'post_type' => ['page']
must be 'post_type' => 'page'
. Just look at the example here: http://codex.wordpress.org/Function_Reference/wp_insert_post#Example
Related Posts:
- wp_insert_post breaks rewrite rules
- Making update notification functionality for my themes
- how to create a conditional content_width for a wordpress theme?
- Best practice for including plugins as part of a theme?
- Modular theme settings
- How to disable 3.1 “Admin Bar” via script for the admin user?
- Where do I find the functions triggered within a hook?
- How to determine the current widget’s parent container (sidebar widget id)
- Setting up partial Right-to-Left admin interface
- Is it possible to display the admin bar while in the Theme Customizer?
- How to Change CSS Variable value in Theme Customizer Live Preview
- Pagination & get_pages?
- Custom nav menu is created with default pages, but not hooked to theme’s custom menu location
- How to pass code from header.php to footer.php
- Move my theme style.css into a folder
- Easy WordPress theme creation tutorial? [closed]
- How do I add a post to a menu
- Demo Import changes terms ids
- how to change WordPress menu markup/classes
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Is it a good idea to make whole theme widgetized?
- Where is definied the theme location for the main menu in a WordPress template?
- How to get the URI to a theme without the domain. Example: /wp-content/themes/my-theme
- How to handle custom form submission?
- menu behavior is not as expected
- My custom theme does not load the translations
- Disable front-page.php template
- Gutenberg – editor-font-sizes in functions not working
- Same ACF on two different pages
- A mystery 300px image size
- Custom Field returning Numerical Value for Image rather than URL
- which is the best way to customize nav-menu-template.php?
- wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?
- Inheritance of parent theme plugin files in a child theme
- Default string not appearing want to translate
- How to make a local cache of mshots images
- Why is the Page Template dropdown menu using the wrong file name?
- Display a list of certain categories by ID
- Using a page as home, how do I prevent nav from setting both home and page links active?
- 2 localizations inside a WordPress theme
- Implementing FancyBox
- Child theme enqueue scripts using new functions
- Should I change text-domain of TGM library inside theme?
- Custom theme updater – random string in new theme name
- Show woocommerce categories on my theme menu styling
- Child Theme’s style.css not loading in mobile browser
- How to Find the Page the Front Page is Using?
- My jQuery is enqueued properly. So why isn’t it working?
- Database Tables in WordPress Theme
- 3 Level Deep Navigation Menu Not Showing All Levels
- Broken theme, template is missing
- WordPress page/blog incorporated into static website
- wp_enqueue_script not working?
- Random white space before doctype
- Premium theme licensing of php called through AJAX
- is_single() works in plugin, not in theme?
- Do I need to create a child theme for JointsWP
- why mytheme/single-product.php works but not mytheme/woocommerce/single-product.php
- Issue on Accessing To Ajax Enqeued File to Pass to URL for Ajax Call
- pass wordpress template directory into ajax url call
- theme-independent CSS/JS files
- What is the need for the static front page [closed]
- Do translation functions like __e() have to take strings in English in themes?
- Custom jquery not code not working in wordpress
- License of the used Bootstrap Theme is not GPL compatible
- How add built-in textarea in theme development?
- Customize Option Framework
- How to include posts with a theme
- Under theme folder, what’s sequence of action for index.php, page.php, single.php?
- Register a custom post type as public = false, but have content appear in search engines?
- Pagination don’t work with active filters
- Theme author.php transfer
- restrain filter on get_the_excerpt to queried item in stead of current post
- Theme has disappeared
- How to display only author’s name for the current post?
- How can I include custom Gutenberg Blocks in a theme?
- WordPress displaying two different headers, one at top and one below footer
- two col layout bootstrap 4 with one fixed col and fade in effect on image
- Styling the website via the customizer – do the changes stay after theme update?
- Alt header logo and link for specific pages
- annoying “Confirm Form Resubmission” message
- image sizes – finding and removing
- Make page accessible from another URL
- Any way to permanently translate themes?
- How to submit a guest post with rich text editor?
- show posts in different styling
- Infinite scroll loads new posts several times
- How to reduce repetitive code
- How to save checkbox choice in wordpress
- How to disable edit link button bottom of the page for all users except Administrator
- How to filter content by language with WPGlobus
- Enqueue script/style with multiple GET parameters
- Is it possible to create more than one design in a WordPress theme? [closed]
- Image Size wrong during upload
- How can I add a single image from a gallery into the page header?
- How to create full header but keep content narrow
- How to send async emails in wordpress?
- ways to create customized theme (hard coded – no pagebuilder)
- Can’t select my block by clicking on it on apiVersion – but using blockProps
- Webpack does not create or update index.asset.php file in build folder