-
When programmatically deleting a post with
wp_delete_post( $post_id, true )
, I get the following error in debug.log
WordPress database error Unknown column '0' in 'field list' for query UPDATEwp_rank_math_internal_meta
SETinternal_link_count
= '0',external_link_count
= '0',0
= '' WHEREobject_id
= 4 made by include('/shared/httpd/wp/htdocs/web/app/plugins/wp-graphql-rank-math/vendor/codeception/codeception/codecept'), require('/shared/httpd/wp/htdocs/web/app/plugins/wp-graphql-rank-math/vendor/codeception/codeception/app.php'), {closure}, Codeception\Application->run, Symfony\Component\Console\Application->run, Symfony\Component\Console\Application->doRun, Symfony\Component\Console\Application->doRunCommand, Symfony\Component\Console\Command\Command->run, Codeception\Command\Run->execute, Codeception\Codecept->run, Codeception\Codecept->runSuite, Codeception\SuiteManager->run, Codeception\PHPUnit\Runner->doEnhancedRun, PHPUnit\Framework\TestSuite->run, PHPUnit\Framework\TestCase->run, PHPUnit\Framework\TestResult->run, PHPUnit\Framework\TestCase->runBare, ContentNodeSeoQueryTest->tearDown, wp_delete_post, do_action('delete_post'), WP_Hook->do_action, WP_Hook->apply_filters, RankMath\Links\Links->delete_post, RankMath\Links\Storage->update_link_counts, RankMath\Links\Storage->save_meta_dataI did some sleuthing in
includes\modules\links\class-storage.php::save_meta_data()
, and for some reason, the$meta_data
getting passed into the method is:Array ( [internal_link_count] => 0 [external_link_count] => 0 [0] => )
That 0 key, I believe is supposed to be
incoming_link_count
, but I’m not sure why its getting lost.Any ideas?
Running PHP 8.0.19 + WordPress 6.0.2 + Rank Math 1.0.98.2
The ticket ‘Wordpress database error when deleting post programmatically’ is closed to new replies.