According to the get_edit_post_link() function source this can happen in following conditions:
- there is no such post;
- there is no such post type;
- you don’t have enough permissions to edit the post;
_edit_linkwas changed during post type registration.
The first two are not the case since the ID is available. The fourth is a bad practice: not for general use — core developers recommend you don’t use this when registering your own post type.
In this case, the user doesn’t have enough permissions. According to the OP’s comment under the question, he had been logged out, which is the same sort of thing.
Related Posts:
- Custom Post Type Plugin: Where Do I Put The Template?
- How to Add Custom Taxonomy To Woocommerce Plugin
- Quick edit screen customization
- Mini-Site Strategy
- Prevent trash/delete action on specific post types
- Loading custom page template via plugin
- Why The Init Hook For Custom Post Types
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- Render a different post/template from within the template_include action?
- Custom Taxonomy and tax_query Issue?
- Using posts and postmeta table to store custom Address Book Plugin data
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Custom role capabilities to administrator not taking effect (no plugin)
- Hierarchical or Non-hierarchical Custom Post Type in Real World Example
- How to append element after thumbnail
- How could I create a ‘private comments’ section on a custom post type?
- Custom Post Type | Fatal Error on register_post_type()
- Issue with pre_get_posts on custom post type archive pages
- Admin notice not displaying
- Detect where custom post type is declared
- Metadata for a taxonomy – is there any WordPress way of doing this?
- get_object_taxonomies() returns empty array for custom post type
- Add custom ID to CPT posts only create not update
- Add custom post type as submenu [closed]
- Unable to get Custom Plugin Options data
- What is the best practice for displaying my plugin content in themes?
- Add Custom Post type menu to another menu in specific location
- How to use TinyMCE Editor for one of my custom post meta field?
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Problems wp_insert_post and save_posts filter
- wordpress remove views from action links in a custom post
- Custom post type’s extra fields – how to handle?
- Send a conditional email notification when a custom field value changes in Post Type
- how to set a WP Plugin’s url
- Getting 400 Bad Request on AJAX Call
- detect your custom post type in WordPress
- Option page’s form doesn’t work
- How can I include active content in a custom post type?
- Show current custom taxonomy
- How to insert data into meta box from another plugin?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- ajax response not recieving
- Add post type pages with plugin
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- CPT to installable Plugin
- Most viewed post of custom post type
- filter the_content, custom post type, and wp_query
- Fill custom fields when saving custom post types
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Custom post type page with parameter
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Custom post category name showing empty
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- Get next and prev item from custom WP_Query and Custom Post Type
- Replace Content of Sidebar on Custom Post Type
- How add Filter by Tags and by categories to custom post type in Gutenberg block
- How to upload an image to a custom post type
- Error 404 change permalink term custom term taxonomy
- Show a custom post title in another custom post type in Meta box
- Register custom_post_type from static function
- I have a random letter appearing before my content. Where to start looking for the cause?
- How to select meta key in custom database query
- Restrict Custom Post Type to One Item
- How to seperate posts by categories?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Widget area for individual posts (custom post type)?
- How can I load Template file from wordpress plugin
- Which File Populating CPTs in Slug URL
- Front End users account with lots of user Roles (not Woocommerce)
- Custom post type that lets users create a set of posts?
- How to reset HTML filter input fields on CPT list page?
- Foreach in get_post_types to apply a different filter per post type
- How to develop custom URL redirection
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- Execute code only after user clicks ‘update’ button for CPT being edited
- Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)?
- Display custom post type archive on page.php template
- How to avoid hardcoded text in a custom page template?
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Add category slug as class attribute in a link array
- How to use get_sidebar in plugin folder?
- Custom post types working in functions.php but not in plugin
- Resources to learn OOP for WordPress plugins, custom post types, etc
- How to dynamically register custom post type
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs
- Custom post type template not loading from plugin
- Redirect to All Custom post types
- I am having a problem with fetching product data in the Gutenberg block editor
- Add block templates (html) via plugin for custom post type
- how can i call archive-{post type}.php template from my custom plugins to my theams?
- REST API callback function is not called
- Add taxonomy or category slug to custom post types URL
- Redirection after saving a post
- How to fix post_tags not showing for a CPT in new post for a custom user role?