Created
February 22, 2017 17:37
-
-
Save brandondove/537464049cd25626fe636bea44ed3d17 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Allows you to modify any part of the custom post type registration | |
* | |
* see: https://codex.wordpress.org/Function_Reference/register_post_type | |
*/ | |
function example_ads_setup( $args = array() ) { | |
// Change the permalink structure for the custom post type | |
$args['rewrite'] = array( | |
'slug' => 'go', // http://example.com/go/single-ad-slug | |
); | |
// Expose ads in the REST API | |
$args['show_in_rest'] = true; | |
return $args; | |
} | |
add_filter( 'ads_setup', 'example_ads_setup' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment