Anyone Please help!
I have a plugin which creates post_type pages in the backend. The plugin is creating the desired pages but the problem is whenever i try to see the page list, it shows “No pages found” message. Screenshot here: http://prnt.sc/azalub
My code for creating the required pages here:
$new_page = array('post_title' => $title,
'post_content' => '['.$shortcode.']',
'post_status' => 'publish',
'post_type' => 'page'
);
$post_id = wp_insert_post( $new_page );
For this purpose, you need to register with plugin activation hook.
See the code example below:
While creating a custom post type, i had set ‘query_var’ to ‘true’ on one of the custom post type in my plugin. Setting it ‘false’ just made everything fine.
if you are using class try pass
array($this, 'method_name')
instead of function name.