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 | |
// don't use the php tags when copying this in your own theme's functions.php | |
function add_new_query_vars($public_query_vars) { | |
$public_query_vars[] = 'posts_fields'; | |
$public_query_vars[] = 'posts_join'; | |
$public_query_vars[] = 'posts_where'; | |
$public_query_vars[] = 'posts_orderby'; | |
return $public_query_vars; | |
} |
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 back end wp-admin menu items to the front end toolbar 'site-name' node. | |
* Menu items are added based on the current users capabilities. | |
*/ | |
class KM_WP_Admin_Bar_Front_End_Menu { | |
/** | |
* Prefix for toolbars ids |
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 | |
/** | |
* Gets date ranges for the BETWEEN operator in a WordPress meta query. | |
* WordPress minimum requirements don't let you | |
* use php DateTime or (some) relative formats for strtotime() which were introduced in php 5.3. | |
* | |
* @param string|array $args Arguments. | |
* @return array Array with two dates. | |
*/ | |
function get_between_clause_dates( $args ) { |
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 | |
/** | |
* Checks if post status is new | |
*/ | |
add_action( 'transition_post_status', 'post_unpublished', 10, 3 ); | |
function post_unpublished( $new_status, $old_status, $post ) { | |
if ( $old_status == 'new' ) { | |
// do stuff for new post | |
} |
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 | |
/** | |
* Reversed Pagination for WordPress - proof of concept | |
* | |
* WARNING! Not suitable for use on a live website! | |
* | |
* Proof of concept for reversed pagination as discussed here | |
* http://nerd.vasilis.nl/problem-paginated-archive-pages-blogs/ | |
* and here (Dutch) | |
* http://wasstra.at/035/ |
OlderNewer