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
- Adding a new custom post type using the editor causes 502 bad gateway error
- Get posts for custom post type with WP_Query
- Custom Post Type Data in Sidebar widgets?
- Why would WordPress use ‘attachment’ in a custom post type’s query string?
- Unregister post type from child theme
- Custom Post Type With Different Views
- How to get term link that crosses different custom post types?
- Custom post type Admin Page
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Set post title from two meta fields
- Where to put archive-{post-type}.php
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- WordPress custom post type category pagination 404 Error
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Custom Taxonomy order by Custom Field
- Custom post types – non-visible title and how it affects URL
- Limit search form to 4 custom post types only
- “More” span making trouble
- How to rename image at uploading on specific plugin or post-type in WordPress
- Loop on front-page.php
- How to create a json API for my custom post type
- Display custom post type in hierarchical order with get_terms
- the_title filter returning wrong post type
- Am unable to reset a query properly
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- A simple script to allow sorting of custom posts in admin?
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- URL rewrite add author as base
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Custom Post Type slug same as page name
- manage_edit-{post_type}_sortable_columns sorts, but wrong!
- Is there any way to add a “custom field” to the CPT archive page?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Paginate_links in custom post type template
- Sort posts in loop by the WooCommerce Membership of the author
- return only the first two terms of custom post
- Dynamic CPT / Taxonomy
- Custom posts of one type have disappeared from admin. Still appear on site [closed]
- How to approach a site where it has sub-businesses, each with its own pages (“articles”, “staff”)? Don’t want to use WP multisite
- Getting a GET error in console – 404 not found for wp-json
- Page inside custom post type (url rewrite?)
- assign different templates to custom post type with homepage loop
- Custom Post Type: Search Results – Template for no results
- Get custom term meta problem on single post type
- Pagination for search results of custom post type [duplicate]
- Validate Custom Post Type fields
- Custom Taxonomy Filter Issues
- Event Archive by Month
- how to organize my categories or should I do custom post types for some?
- Archive page of taxonomy returns a 404 error
- Multiple categories assigned to a single product breaking the breadcrumb
- redirect after submiting post for review
- Is there a way to display a custom post type menu item as “users” submenu?
- Sql Update CPT from publish to draft and particular custom field
- wp_set_post_terms not updating with WP Cron Event
- Rewrite url for custom post type with specific url
- Custom post type meta fields missing on save_post_type
- Help Adding filter to Add Media button for custom post type
- How to display user-defined / custom post in wordpress?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Post search not looking at post title since 4.4.2 upgrade
- Can I override the permalink/slug on creation
- Heirarchical URLs with CPT and custom taxonomy
- How to change permalinks to taxonomy and post type’s posts
- Custom Catagory not found
- How to display custom post type ordered by a custom field date
- Custom post type single page fine for admin, 404 from front
- Custom post type slug localization