Skip to content

Instantly share code, notes, and snippets.

@brandondove
Created February 22, 2017 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandondove/537464049cd25626fe636bea44ed3d17 to your computer and use it in GitHub Desktop.
Save brandondove/537464049cd25626fe636bea44ed3d17 to your computer and use it in GitHub Desktop.
<?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