• Resolved john brown

    (@alihan1988)


    Hello,

    My testing code is:

    $my_post = array(
        'post_title'    => 'My post',
        'post_content'  => 'This is my post.',
        'post_status'   => 'draft',
        'post_author'   => 1,
        'post_category' => array( 1 )
    );
     
    $post_id = wp_insert_post( $my_post, true );
    var_dump( $post_id );

    But I getting an error when “Autoflush Enabled” on SG Optimizer( AKA. Automatic Cache Purge )

    But, when I disabled Autoflush feature on SG Optimizer options panel, wp_insert_post works well.

    Error:
    Fatal error: Uncaught Error: Call to a member function get_extra_permastruct() on null in /home/customer/www/username in /home/customer/www/example.com/public_html/wp-includes/taxonomy.php on line 4324

    Thanks for this great plugin.

    • This topic was modified 4 years, 3 months ago by john brown.
Viewing 1 replies (of 1 total)
  • Plugin Author Stanimir Stoyanov

    (@sstoqnov)

    SiteGround Representative

    Hey @alihan1988

    Which hook do you use to add the page?

    This error usually happens when you are adding the page before wp_loaded was called.

    Please change the hook which you are using and the error should be fixed.

    Regards,
    Stanimir

Viewing 1 replies (of 1 total)
  • The topic ‘Error with Autoflush Enabled’ is closed to new replies.