How to remove UI access to Custom Post Type using direct links?

Yes. Use capabilities! When registering a post type, take a look at the capability_type and capabilities. You can define a custom capability map for the standard edit_post, delete_post, etc. for your post type. The thing you remember is, if you customize the capabilities, YOU DON’T HAVE THESE CAPABILITIES EITHER! This means you’ll have to get … Read more

Modify loop to include all post statuses not just ‘published’

Okay, I think to start you need to change line 470 of the file includes/admin/class-learndash-admin-binary-selector.php from: ‘post_status’ => array(‘publish’), to ‘post_status’ => array(‘any’), If this doesn’t work on its own, there may be other places you need to change this as well – do a global file search on ‘post_status’ and look for places where … Read more

Using get_the_excerpt in edit-post

I think (and assuming) you use (without code, it’s hard to know, how you proceed) add_meta_boxes() to do your job. Then your code is logically standing in custom functions. Your function to render the metabox, don’t get the $post global, if you didn’t define it, the function need to know from which post it must … Read more

Conditions for admin get_current_screen action parent_file edit.php?post_type=page

You can use get_current_screen() to get details about the current screen. We want to hook on or after load-edit.php because get_current_screen() is defined just prior to this hook. By hooking into load-edit.php, we guarantee that this code will only fire on the edit.php page. Then we check the current screen to see if the post … Read more

how can i add extra parameter to edit post link?

The get_edit_post_link filter lets you modify that value. This is applied any time get_edit_post_link function is called, which admin uses, as well as themes on the front end. function wpd_edit_post_link_filter( $link, $post_ID, $context ){ if( ‘room’ == get_post_type( $post_ID ) ){ $link = $link . ‘&fubar=baz’; } return $link; } add_filter( ‘get_edit_post_link’, ‘wpd_edit_post_link_filter’, 10, 3 … Read more