Stephen Lloyd

Software Engineer

10/29/14If is Mobile?

a.com php page - admin/link.php

if (wp_is_mobile())
  wp_enqueue_script('jquery-touch-punch');

12/6/13Watch the log in real time

tail -f /usr/local/mysql/data/Stephens-MacBook-Pro.log

6/17/13Wordpress Code Snippets plug-in

From Lenny Peters (Graphic Intern): Sweet resource plug in for WP, and I can show you some themes perhaps tomorrow when I get to my machine at home.

http://wordpress.org/plugins/code-snippets/

11/14/11Calling Functions

In the template file, there are sets of things that look like variables.

%% disclaimer %%

They are actually calling functions, so, look for the function called "disclaimer" that is in the same named plug-in folder. If that function has an echo statement, that is what gets output.

For example,
/themes/personality/templates/mortgagerates/template.php
has in it
%% disclaimer %%

AND
/plugins/mortgagerates/PartialController.php
has

public function disclaimer(){
      echo '<p class="disclaimer">For general informational purposes only. Actual rates available to you will depend on many factors including lender, income, credit, location, and property value. Contact a mortgage broker to find out what programs are available to you.</p>';
}

Also,
/themes/fresh/templates/mortgagerates/template.php
/themes/minimal/templates/mortgagerates/template.php

11/14/11

Other Notes

Dump variables
print_r($GLOBALS)
var_dump(get_defined_vars());
var_dump(get_defined_functions());
var_dump(get_defined_constants());

Dump and stop
die(print_r("got to here! "));

Send output to a log table in the database
mx_utils::Log('Blog Id: '.$blog_id, 'stylesheet createFile', true);

and print it
mx_utils::DoPrint('message', $variable)

Debug
After the message, it prints the previous file and function
mx_utils::debug('message')
mx_utils::debug($this->listData->dplFeatured);

works with:
  public static function DebugIsOn(){
    global $pageCache;
    return $pageCache->GetUrlSwitch('debug');
  }
example: ?debug=1


:: targets a function
-> targets a variable.

$windermedia::set_optimal_size()
$windermedia->gallery_sources

 


Stephen Lloyd 10/29/2014