Fatal error when creating new posts V1.0.116
-
A fatal PHP error is occurring when attempting to add new posts with instant indexing enabled on the new version.
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function RankMath\Instant_Indexing\Instant_Indexing::before_save_post(), 3 passed in /wp-includes/class-wp-hook.php on line 307 and exactly 4 expected in /wp-content/plugins/seo-by-rank-math/includes/modules/instant-indexing/class-instant-indexing.php:262
This is due to the update argument not being passed. Changing the following code:
public function before_save_post( $data, $postarr, $unsanitized_postarr, $update ) { if ( ! $update ) { return $data; }
to
public function before_save_post( $data, $postarr, $unsanitized_postarr, $update=false ) { if ( ! $update ) { return $data; }
Should stop that error from happening.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Fatal error when creating new posts V1.0.116’ is closed to new replies.