Created
November 5, 2014 03:48
-
-
Save norcross/311a8e31e450e0eb4a14 to your computer and use it in GitHub Desktop.
remove the month drop down from post types
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( 'months_dropdown_results', 'rkv_remove_month_filters' ), 10, 2 ); | |
/** | |
* remove the month drop down filter by | |
* spoofing WP and saying that none exist | |
* for specific post types | |
* | |
* @param array $months the original count | |
* @param string $post_type the post type | |
* @return array an empty array or the original array | |
*/ | |
function rkv_remove_month_filters( $months, $post_type ) { | |
return in_array( $post_type, array( 'page' ) ) ? array() : $months; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment