Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wp_rewrite returning null in plugin settings page

I just wanted to add this as a SOLVED question because it took me a while to figure it out and there was no documentation on this.

Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-includes/post.php on line 3555

Trying to wp_update_post() via plugin settings page and was getting this notice.

The solution was to add this line before calling the wp function: $wp_rewrite = new wp_rewrite;

like image 517
Nick B. Avatar asked Dec 14 '25 19:12

Nick B.


1 Answers

The solution was to add this line before calling the WP function: $wp_rewrite = new wp_rewrite;

like image 53
Nick B. Avatar answered Dec 19 '25 06:12

Nick B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!