WPBP / WordPress-Plugin-Boilerplate-Powered

Wordpress Plugin Boilerplate but Powered with examples and a generator!
https://wpbp.github.io/
GNU General Public License v3.0
789 stars 114 forks source link

fake_page throws error #24

Closed flegfleg closed 9 years ago

flegfleg commented 9 years ago

When browsing to the page created with the fake page class, i get the following error: Undefined property: stdClass::$post_type in /wp-includes/query.php Notice: Undefined offset: -1604600763 in /wp-includes/query.php on line 3708 am i using it wrong?

Mte90 commented 9 years ago

the code that you for generate the page is the same of the boilerplate?

flegfleg commented 9 years ago

yes, same.

/*
 * Load Fake Page class
 */
require_once( plugin_dir_path( __FILE__ ) . 'includes/fake-page.php' );

new Fake_Page(
        array(
    'slug' => 'faker_tester',
    'post_title' => 'Fake Page Title',
    'post content' => 'This is the fake page content'
        )
Mte90 commented 9 years ago

After the edit of the slug you have refresh the permalink? Go on settings->permalink and click on the save button, in this way wordpress load the new permalink. If you change the slug after the flush wordpress don't reconize the slug, while the boilerplate on activation flush the permalink :-)

Mte90 commented 9 years ago

I've updated the class that have some problems