Created
January 18, 2020 14:36
-
-
Save pavlo-bondarchuk/cc6b31247decaab61f460efac3d1ecf9 to your computer and use it in GitHub Desktop.
Modify a Custom Post Type after it’s been registered
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 grd_client_filter_products_cpt( $args, $post_type ) { | |
| // If not courses CPT, bail. | |
| if ( 'courses' !== $post_type ) { | |
| return $args; | |
| } | |
| // Add additional courses CPT options. | |
| $args = array( | |
| 'has_archive' => false, | |
| ); | |
| // Merge args together. | |
| return array_merge( $args ); | |
| } | |
| add_filter( 'register_post_type_args', 'grd_client_filter_products_cpt', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment