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
<?php | |
function compare_versions( | |
$version, $compareVersion, $lookup = array('greater' => 1, 'equal' => 0, 'less' => -1) | |
) | |
{ | |
$version = explode('.', $version); | |
$compareVersion = explode('.', $compareVersion); | |
$count = max(count($version), count($compareVersion)); |
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
<?php | |
function select_12_hour() | |
{ | |
$return = ''; | |
for ($i = 0; $i < 24; $i++) | |
{ | |
$period = ($i < 12) ? 'a.m.' : 'p.m.'; |
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
<?php | |
/* | |
* Simple Honeypot | |
* | |
* Takes request and stores the users IP, user-agent, and request into separate files. Useful | |
* for logging requests to locations that no one should be poking around. | |
* | |
* To do: | |
* - Add user-agent blocking |
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
<?php | |
// Enable styles dropdown | |
add_filter('mce_buttons_2', function ($buttons) { | |
array_unshift($buttons, 'styleselect'); | |
return $buttons; | |
}); | |
// Register editor "Styles" drop down classes | |
add_filter('tiny_mce_before_init', function($styles) { |
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
span.margin-class-applied, | |
#tinymce.wp-editor span.margin-class-applied | |
{ | |
display: inline-block; | |
} | |
.margin-bottom-none, | |
#tinymce.wp-editor .margin-bottom-none | |
{ | |
margin-bottom: 0; |
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
<?php | |
remove_filter('the_title', 'capital_P_dangit', 11); | |
remove_filter('the_content', 'capital_P_dangit', 11); | |
remove_filter('comment_text', 'capital_P_dangit', 31); |
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
<?php | |
/** | |
* Is Login Page | |
* | |
* Detects if the current request is from the login page. | |
* | |
* Credit: http://stackoverflow.com/questions/5266945/wordpress-how-detect-if-current-page-is-the-login-page#5892694 | |
*/ | |
function isLoginPage() |
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
<?php | |
// Where to save | |
$store = ''; | |
// Files to download | |
$files = array( | |
'file', | |
); |
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
<?php | |
// Application bootstrap | |
// Start buffering output. We'll do some work on it later. | |
ob_start(); | |
// Bootstrap Wordpress | |
// PHP 5.2 is still in use, so we cannot use __DIR__ | |
require dirname(__FILE__).'/wordpress.php'; |
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
<?php | |
// functions.php | |
add_filter('admin_body_class', function($classes) { | |
global $wpdb, $post; | |
if (is_admin()) | |
{ |
OlderNewer