The issue is in using the $post
variable for arguments. After changing this to something like $new_post
I no longer get the notices.
There must be some conflict with the global $post
that WordPress uses.
I took this from the Codex, but looking back at the page, I realize that $post
was just referring the argument name and the actual example in the codex does not use $post
for the args array.
Related Posts:
- Undefined property: stdClass::$labels in general-template.php post_type_archive_title()
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- How to customize post edit notices
- How to throw error to user when saving post
- Custom Post Type with Input fields to seperate table on database.
- wordpress plugin error handling
- How can I fix those issues generated by the Themecheck plugin
- Get all posts from custom post type and insert in select input as metabox
- The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- wp is not defined error using wp.media to create a custom image uploader
- Change message given when deleting post from custom post type
- Check Title Unique Or Not and If not error message and dont save
- Custom Post Type, Saving Multiple Checkboxes
- Notice: Undefined index: error and understanding wordpress
- Illegal offset type in get_post_type_object()?
- Trouble with CPT Child 404
- CPT Validation to not show “Post updated.”
- Sizing textarea field in custom metabox
- Save and user submitted data from a form and display them in the wp backend
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Query not work for current taxonomy
- Custom Post Type and Breadcrumbs Conflict
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Display custom-post type based on the Title matching the current selected value
- Custom Post Type Causes Error: Warning: call_user_func_array()
- I have a random letter appearing before my content. Where to start looking for the cause?
- How to add dynamic fields on wordpress custom post type page in admin section
- “A post type mismatch has been detected” Error when updating custom post
- Error [Column ‘post_title’ cannot be null] when title is disabled for Custom post type
- Custom Post Type slug has the same Redirection entry
- get_posts() return NULL using a custom plugin and add_submenu_page() with Post Type
- fehler beim laden des blocks: ungültige(r) parameter: attributes – Gutenberg
- Adding a new custom post type using the editor causes 502 bad gateway error
- custom post type tags
- Show custom posts with a specific “custom TAXONOMY slug” on startpage
- Query Custom Post Type by Tag
- Show posts of parent in edit.php
- How to retreive terms associated with a custom post type?
- Loops running into each other
- Permalinks Works for Custompost type but not with pages Why?
- Custom Post Type Base URL
- white page after php code insert for custom post type [closed]
- Custom Taxonomy in Permalink from post type
- Creating entries with image attachements within posts and managing them in a list
- What is the most efficient way to manage changes my product comparison tables?
- How to add taxonomy in menus?
- Return Custom Post Type Categories
- Display by tag from different post types
- Associating post id with its post type
- Invalid Taxonomy in template
- Types plugin isn’t compatible with my custom post type
- How can I modify this blog loop to display custom post type posts?
- How to Create a Frontend Html-list Editable in the Backend?
- Custom Post Type to Upload Images
- Permalink for regular posts “/blog/”
- Fourth page of custom post type archive page does not exist
- WordPress and Unity high scores table
- Allow authors to create article image
- Gallery not displaying images when clicking on them
- Previous and Next posts
- Create action running on trashed_post hook to modify post_meta value
- Archive custom template from search
- Tags and Taxonomy links not working for Custom Post Types
- Custom role can’t create permalink
- Geolocate Custom Post Type on Save
- Radom post image/link based on custom taxonomy
- Pagination broke after updateto WordPress 3.4 [duplicate]
- Custom post types permalinks not working
- Post AND page parameter for WP function
- How do I ensure custom post type information is displayed in correct order?
- Tag-post relationship problem
- Changing checkbox array from single to multiple select
- Author.php not displaying post type posts
- Rewrite rules for using the same base slug for multiple content types
- Creating additional page with own URL for each custom post
- changed custom post type now $image_attributes[0]; broken
- exclude posts from a custom category
- Searching for a single custom post type, buddypress
- One random post from multiple custom post types
- Remove Permanent URL for custom post types
- Problem with Custom Post Types, Taxonomy, permalink, Archive
- empty dashboard for custom role
- Checking for published posts in a certain post type
- Allowing logged in users to create custom posts
- Category names on CPT archive pages [closed]
- Custom Post Type and single-posttype template
- Random meta field from specific custom post type
- Custom post type as a category, for another custom post type
- How to relate one custom post type to another custom post type
- Add text to metabox input text field from Thickbox
- Permalink for Custom Post Types
- Get all custom_post_type posts + blog posts from one category in a single query
- How to turn custom-post archive into an overview page, listing the metadata of the posts?
- Loop to pull content from parent element in custom post type [duplicate]
- Hide custom post type and use its slug in new plugin menu
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- Post types disappeared
- Dynamically change Custom Post Type Template OR Change Permalink?
- Page template anomaly