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( 'genesis_register_sidebar_defaults', 'wps_register_sidebar_defaults' ); | |
/** | |
* Modify the Genesis sidebar defaults | |
* | |
* @param array $defaults Genesis defaults. | |
* @return array Modified Genesis defaults. | |
*/ | |
function wps_register_sidebar_defaults( $defaults ) { |
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_action( 'wp_enqueue_scripts', 'wps_enqueue_lt_ie9' ); | |
/** | |
* Conditionally Enqueue Script for IE browsers less than IE 9 | |
* | |
* @link http://php.net/manual/en/function.version-compare.php | |
* @uses wp_check_browser_version() | |
*/ | |
function wps_enqueue_lt_ie9() { | |
global $is_IE; |
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
<!--[if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> |
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_action( 'wp_head', 'wps_add_ie_html5_shim' ); | |
/** | |
* Add IE conditional html5 shim to header | |
*/ | |
function wps_add_ie_html5_shim() { | |
global $is_IE; | |
if ( $is_IE ) { | |
echo '<!--[if lt IE 9]>'; | |
echo '<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>'; |
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 | |
/** | |
* Bail out if running an autosave, ajax or a cron | |
* or user does not have proper capabilities | |
* | |
* @return bool|int True if should bail, post ID if lacking cap | |
*/ | |
function wps_bail( $post_id = '', $cap = 'edit_post' ) { | |
/** Bail out if running an autosave */ |
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_action( 'save_post', 'wps_inpost_layout_check', 1 ); | |
/** | |
* Checks the version of Genesis and executes accordingly. | |
* | |
* Executes for Genesis versions less than 1.9.x. | |
* | |
* @category Genesis | |
* @package Admin |
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 | |
/** | |
* WordPress WP_User_Query Comprehensive Reference | |
* Compiled by wpsmith - wpsmith.net | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_User_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/user.php | |
*/ | |
$args = 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
<?php | |
// Caveat: This creates 2 queries and any use of this code should also use site transients | |
// prepare arguments | |
$args = array( | |
'meta_key' => 'last_name', | |
); | |
// Create the WP_User_Query object |
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 | |
// prepare arguments | |
$args = array( | |
'meta_key' => 'last_name', | |
'query_id' => 'wps_last_name', | |
); | |
// Create the WP_User_Query object | |
$author_query = new WP_User_Query( $args ); |