Add Post type menu to another menu

You only need to add the page slug to “show_in_menu”, making the answer to your example: ‘show_in_menu’ => ‘mytestpage’, For a more complete example: Admin/Settings page of: /wp-admin/admin.php?page=mytestpage register_post_type(‘mycpt’, array(‘label’ => ‘My Custom Post Type’, ‘capability_type’ => ‘post’, ‘show_ui’ => true, ‘show_in_menu’ => ‘mytestpage’));

How Do I Programmatically Better Organize Custom Post Type Menus?

On the function to register a new custom post type can you set this CPT as Submenu to a exist menu item. Use the param show_in_menu A example: register_post_type( ‘issue’, apply_filters( ‘wpit_register_issue_post_type’, array( ‘labels’ => $issue_labels, ‘rewrite’ => $issue_rewrite, ‘supports’ => $issue_supports, ‘taxonomies’ => $issue_taxonomies, ‘menu_position’ => 5, ‘public’ => TRUE, ‘show_ui’ => TRUE, ‘show_in_menu’ … Read more

Admin Post Update Redirection to Posts Screen

Use the redirect_post_location filter and admin_url() function. add_filter( ‘redirect_post_location’, ‘wpse_124132_redirect_post_location’ ); /** * Redirect to the edit.php on post save or publish. */ function wpse_124132_redirect_post_location( $location ) { if ( isset( $_POST[‘save’] ) || isset( $_POST[‘publish’] ) ) return admin_url( “edit.php” ); return $location; } To redirect to a different url, add everything after the … Read more

Add metabox with media uploader in a custom post type [duplicate]

I am working on something similar. This is for a podcast upload meta-box. Returns the url to the file. Here is what I have so far: //Add Metabox add_action(‘add_meta_boxes’, ‘add_upload_file_metaboxes’); function add_upload_file_metaboxes() { add_meta_box(‘swp_file_upload’, ‘File Upload’, ‘swp_file_upload’, ‘podcasts’, ‘normal’, ‘default’); } function swp_file_upload() { global $post; // Noncename needed to verify where the data originated … Read more

How to add custom template in plugin?

This plugin looks for page_contact.php from active theme’s folder and uses plugin’s templates/page_contact.php as a fallback. <?php /** * Plugin Name: Test Plugin */ add_filter( ‘template_include’, ‘contact_page_template’, 99 ); function contact_page_template( $template ) { $file_name=”page_contact.php”; if ( is_page( ‘contact’ ) ) { if ( locate_template( $file_name ) ) { $template = locate_template( $file_name ); } … Read more

How can I fix those issues generated by the Themecheck plugin

Registering custom posts is a plugin territory. It means that you need to remove them from the theme’s functionality and register them via a plugin (usually recommended when installing the theme using TGM Plugin Activation or something else). Here are the recommendations of the Theme Review Team. Themes must not incorporate the following, Plugin-territory functionality. … Read more