Last active
September 1, 2015 15:26
Blog: Describing PHPStorm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Determines whether we are in debug mode or not based on WP_DEBUG & SCRIPT_DEBUG | |
* | |
* @return bool Whether we are in debug mode. | |
*/ | |
function wps_is_debug() { | |
return ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wps_get_plugin_info( $plugin ) { | |
static $plugins = array(); | |
if ( isset( $plugins[ $plugin ] ) ) { | |
return $plugins[ $plugin ]; | |
} | |
if ( !function_exists( 'plugins_api' ) ) { | |
require_once( ABSPATH . '/wp-admin/includes/plugin-install.php' ); | |
} | |
$info = plugins_api( 'plugin_information', array( 'slug' => $plugin ) ); | |
$plugins[ $plugin ] = $info; | |
return $info; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wps_get_plugin_info( $plugin ) { | |
static $plugins = array(); | |
if ( $plugin != 'myplugin' ) { | |
return false; | |
} | |
if ( isset( $plugins[ $plugin ] ) ) { | |
return $plugins[ $plugin ]; | |
} | |
if ( ! function_exists( 'plugins_api' ) ) { | |
require_once( ABSPATH . '/wp-admin/includes/plugin-install.php' ); | |
} | |
$info = plugins_api( 'plugin_information', array( 'slug' => $plugin ) ); | |
$plugins[ $plugin ] = $info; | |
return $info; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wps_get_plugin_info($plugin) { | |
static $plugins=array(); | |
if ($plugin!='myplugin') | |
return false; | |
if (isset($plugins[$plugin])) | |
return $plugins[$plugin]; | |
if ( !function_exists( 'plugins_api' ) ) | |
require_once(ABSPATH.'/wp-admin/includes/plugin-install.php'); | |
$info=plugins_api('plugin_information',array('slug'=>$plugin)); | |
$plugins[$plugin]=$info; | |
return $info; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @return bool | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param $plugin | |
* | |
* @return object | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment