This file contains hidden or 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 custom post types count action to WP Dashboard (At a Glance) | |
*/ | |
function add_cpt_glance_items( $items ) { | |
$args = array( | |
'public' => true, // Showing public post types only | |
'_builtin' => false // Except the build-in wp post types (page, post, attachments) | |
); |
This file contains hidden or 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 postname_redirect() { | |
// If this is not a 404 page, do nothing. | |
if ( ! is_404() ) { | |
return FALSE; | |
} | |
// If the current permalink structure is '/%postname%/'. | |
// Don't do anything, even if we find a 404. | |
global $wp_rewrite; |