Last active
November 15, 2024 14:01
-
-
Save thekendog/28fd8a2be900878eedfe4876bc68cea9 to your computer and use it in GitHub Desktop.
Remove unviewable post types from Blocksy customizer
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
/** | |
* Remove unviewable post types from customizer | |
*/ | |
add_filter( | |
'blocksy:custom_post_types:supported_list', | |
function ( $post_types ) { | |
foreach ( $post_types as $key => $post_type ) { | |
if ( ! is_post_type_viewable( $post_type ) ) { | |
unset( $post_types[ $key ] ); | |
} | |
} | |
return $post_types; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment