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
function adjust_caption() { | |
var captions = document.getElementsByClassName('wp-caption'); | |
for (var i = 0; i < captions.length; i++) { | |
// set wrap to auto | |
captions[i].style.width = 'auto'; | |
// will set the width of the p to the same as the image. comment out if you don't want/need | |
captions[i].getElementsByTagName('p')[0].style.width = captions[i].getElementsByTagName('img')[0].width + 'px'; | |
} | |
} |
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 | |
// fancy PHP 5.3+ style | |
add_action( 'template_redirect', function() { | |
if ( ! is_user_logged_in() ) { | |
wp_redirect( wp_login_url() ); | |
exit; | |
} | |
} ); |
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 | |
// add filter to allow for new weekly schedule | |
add_filter( 'cron_schedules', 'rkv_weekly_cron' ); | |
function rkv_weekly_cron( $schedules ) { | |
// Adds once weekly to the existing schedules. | |
$schedules['weekly'] = array( | |
'interval' => 604800, | |
'display' => __( 'Once Weekly' ) | |
); |
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 get_api_key($key) { | |
global $API_Key_Manager; | |
return $API_Ket_Manager->get_key($key); | |
} |
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 | |
class super_kewl { | |
// can be public or no visibility declaration (which defaults to public) | |
public function matt($param = false) { | |
echo $param ? esc_attr($param) : 'Hello!'; | |
} | |
} | |
// will output Hello |
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 | |
/* | |
Name: Box Name | |
Author: Author Name | |
Description: A good description of this box | |
Version: Box version | |
Class: box_class_with_underscore | |
*/ | |
class box_class_with_underscore extends thesis_box { |
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 | |
// find out if they're logged in and send them to the login form if not | |
add_action('template_redirect', 'deny_phonies'); | |
function deny_phonies() { | |
if (!is_user_logged_in() && $GLOBALS['pagenow'] !== 'wp-login.php') { | |
wp_redirect(get_site_url($GLOBALS['blog_id'], 'wp-login.php')); | |
exit; | |
} | |
} |
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 | |
// add css using the thesis_css filter | |
class your_skin_class extends thesis_skin { | |
function construct() { | |
add_filter('thesis_css', array($this, 'add_css')); | |
} | |
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 | |
class example_skin_class extends thesis_skin { | |
// list of box classes you want to add to the queue | |
// do not give these strings for keys or everything will blow up | |
public $boxes_class_list = array( | |
'box_class_one', | |
'box_class_two', | |
'box_class_three', | |
'box_class_four', |
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 | |
echo "get_current_user: " . (function_exists('get_current_user') ? get_current_user() : 'get_current_user() does not exist'); | |
echo "<br>"; | |
echo "getmyuid: " . (function_exists('getmyuid') ? getmyuid() : 'getmyuid() does not exist'); | |
echo "<br>"; | |
echo "fileowner(seed.php): " . (function_exists('fileowner') ? fileowner(dirname(__FILE__) . '/seed.php') : 'fileowner() does not exist'); | |
echo "<br>"; | |
echo "fileowner(". basename(__FILE__) ."): " . (function_exists('fileowner') ? fileowner(__FILE__) : 'fileowner() does not exist'); | |
echo "<br>"; |