-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CS fixes, and sorting working again.
- Loading branch information
Showing
8 changed files
with
139 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
<?php | ||
|
||
namespace WordPress\Tabulate; | ||
|
||
class Util { | ||
|
||
/** | ||
* Check whether the plugin is active by checking the active_plugins list. | ||
* | ||
* This is an duplicate of the function defined in wp-adin/includes/plugin.php | ||
* It's redefined here so we can use it in the frontend without including | ||
* all of the plugin.php file. | ||
* | ||
* @param string $plugin Base plugin path from plugins directory. | ||
* @return bool True, if in the active plugins list. False, not in the list. | ||
*/ | ||
public static function is_plugin_active( $plugin ) { | ||
if ( function_exists( 'is_plugin_active' ) ) { | ||
return is_plugin_active( $plugin ); | ||
} | ||
return in_array( $plugin, get_option( 'active_plugins', array() ) ); | ||
} | ||
|
||
} | ||
<?php | ||
/** | ||
* This file contains only the Util class | ||
* | ||
* @package WordPress | ||
* @subpackage Tabulate | ||
*/ | ||
|
||
namespace WordPress\Tabulate; | ||
|
||
/** | ||
* This is a utility class to hold miscellaneous helper methods. | ||
* Not great design, certainly, but then neither is lots of WP core. | ||
*/ | ||
class Util { | ||
|
||
/** | ||
* Check whether the plugin is active by checking the active_plugins list. | ||
* | ||
* This is an duplicate of the function defined in wp-adin/includes/plugin.php | ||
* It's redefined here so we can use it in the frontend without including | ||
* all of the plugin.php file. | ||
* | ||
* @param string $plugin Base plugin path from plugins directory. | ||
* @return bool True, if in the active plugins list. False, not in the list. | ||
*/ | ||
public static function is_plugin_active( $plugin ) { | ||
if ( function_exists( 'is_plugin_active' ) ) { | ||
return is_plugin_active( $plugin ); | ||
} | ||
return in_array( $plugin, get_option( 'active_plugins', array() ) ); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.