Categories
Sydney

Disable Permalinks for Registered Custom Post Types of Sydney Toolbox

Add this PHP code to child theme’s functions or use a functionality plugin like Code Snippets:

function sydney_child_modify_cpt( $args, $post_type ) {

  $custom_args = array();
  $custom_args['public']              = false;
  $custom_args['has_archive']         = false;
  $custom_args['publicaly_queryable'] = false;
  $custom_args['query_var']           = false;

  switch ($post_type) {
    case 'services':        // Services
    case 'employees':       // Employees
    case 'testimonials':    // Testimonials
    case 'clients':         // Clients
    case 'projects':        // Projects
      $args = array_merge( $args, $custom_args );
      break;
  }

  return $args;

}
add_filter( 'register_post_type_args', 'sydney_child_modify_cpt', 10, 2 );