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_link
was 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?
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- 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?
- handling csv data with a custom post type
- Custom Post Type | Fatal Error on register_post_type()
- Issue with pre_get_posts on custom post type archive pages
- Detect where custom post type is declared
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Insert Multiple Post with Same Publish Button
- get_object_taxonomies() returns empty array for custom post type
- custom post type not showing in menu
- 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
- custom comments form for custom post type
- Problems wp_insert_post and save_posts filter
- Custom fields for custom post type
- wordpress remove views from action links in a custom post
- When should I create custom post types?
- Custom post type’s extra fields – how to handle?
- Send a conditional email notification when a custom field value changes in Post Type
- Getting 400 Bad Request on AJAX Call
- Main query not querying any posts in custom taxonomy template
- What’s an efficient way to change the post status of many posts at once?
- Show current custom taxonomy
- How to insert data into meta box from another plugin?
- How exclude or skip post type with get_next_post_link
- 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
- Add post type pages with plugin
- Create a select metabox that the user can pupolate?
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Most viewed post of custom post type
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Mandatory field in Custom post
- Custom post type page with parameter
- Custom post type category link redirecting to 404 page
- Translate website without duplicate custom post
- How to store the third party script with HTML code in the wordpress custom input field?
- How to show the post which checkbox is not selected
- Replace Content of Sidebar on Custom Post Type
- How to upload an image to a custom post type
- How to stop the custom post type URL from the google search?
- Changing CPT permalink
- I have a random letter appearing before my content. Where to start looking for the cause?
- Apply a custom Template to a Custom Post Type from within a plugin
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Error when moving custom post type to bin
- Admin metabox with custom post type dropdown option not update choosed input after saving
- Correct way to register custom post type from external php file?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Add an array as post content dynamically
- Which File Populating CPTs in Slug URL
- Front End users account with lots of user Roles (not Woocommerce)
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- php output of generated custom metabox
- Not Able to List CPT Based on Taxonomy Term
- How to reset HTML filter input fields on CPT list page?
- Can’t save custom post type fields
- Foreach in get_post_types to apply a different filter per post type
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- Simple renaming my custom post type set with a plugin doesn’t work?
- Display custom post type archive on page.php template
- get_post_types doesn’t work in plugin
- Show Templates in Custom Post Type Editor
- Associate custom categories to different user IDs
- Shortcode error
- Render custom taxonomy query as single template
- How to avoid hardcoded text in a custom page template?
- How to use get_sidebar in plugin folder?
- Get term_id for each instance of custom taxonomy
- How to internationalize the sub menu name “categories” in Custom post type?
- Resources to learn OOP for WordPress plugins, custom post types, etc
- Creating a Custom Post Type as a Plugin? Why?
- How to create an upload page (front side)
- WordPress Roles
- How to dynamically register custom post type
- How to change post cpt with submit button?
- How to separate posts by categories?
- Custom Post Type featured option
- How to filter custom post data with AJAX?
- Make term slugs of custom taxonomy available in WP REST API for custom post type?