Change link for “add new” buttons on custom post type

in most of the case WordPress ui uses admin_url() function to retrieve administrative urls. so you can use admin_url filter to modify that. Example: add_filter( ‘admin_url’, ‘wpse_271288_change_add_new_link_for_post_type’, 10, 2 ); function wpse_271288_change_add_new_link_for_post_type( $url, $path ){ if( $path === ‘post-new.php?post_type=your_custom_post_type’ ) { $url = get_permalink(/*your post ID here*/); // or any other url } return $url; … Read more

Display metaboxes if checkbox ir marked

Why don’t you use only one metabox and then use jQuery to manage what options to show: // add metabox function adding_custom_meta_boxes( $post_type, $post ) { add_meta_box( ‘my-meta-box’, __( ‘My Meta Box’ ), ‘render_my_meta_box’, ‘post’, ‘normal’, ‘default’ ); } add_action( ‘add_meta_boxes’, ‘adding_custom_meta_boxes’, 10, 2 ); // render metabox function render_my_meta_box( $post ) { wp_nonce_field( ‘my_metas_nonce’, … Read more

duplicate comment section functionality and call it something else for custom post types

You can still use the core comment functionality for the custom post type, then filter the edit-comments.php admin screen and create a new admin page with the required comments table. Step 1. Removing the comments from the edit-comments.php admin screen can be done by using the comments_clauses filter: <?php // Remove comments for specific post … Read more