thut9g
Last Updated: February 25, 2016
·
1.479K
· olivopablo

Add ChromePhp to Wordpress

ChromePhp is very useful php class to debug code, get variable value, or see json variable in readable format than just using 'echo' or 'print_r()'.

The result will be outputted on Chrome Console(inspect element).

Installation on Wordpress :

  1. Install chromephp extension from Link.
  2. Download ChromePhp.php Link, and then put this file on /wp-content/plugins/).
  3. Add this code right after <?php tags on ChromePhp.php.

/*
Plugin Name: ChromePhp
Plugin URI: https://github.com/ccampbell/chromephp
Description: Server Side Chrome PHP debugger class
Author: Craig Campbell <iamcraigcampbell@gmail.com>
Version: 1
Author URI: https://github.com/ccampbell
*/
  1. Activate plugin.
  2. Use it i.e. ChromePhp::log($post->ID)

1 Response
Add your response

17729

Yes, this is quite awesome! Thank you!

over 1 year ago ·