PHP 8.4 and related post function
-
How I can solve this?
[10-Dec-2024 00:41:12 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function jetpackme_exclude_related_post(), 1 passed in wp-includes/class-wp-hook.php on line 324 and exactly 2 expected in /wp-content/themes/generatepress_/functions.php:238
function jetpackme_exclude_related_post( $exclude_post_ids, $post_id ) {
// $post_id is the post we are currently getting related posts for$exclude_post_ids[] = 1037; // Exclude post_id 1037. $exclude_post_ids[] = 1038;// Also exclude post_id 1038. return $exclude_post_ids;}
add_filter( ‘jetpack_relatedposts_filter_exclude_post_ids’, ‘jetpackme_exclude_related_post’, 20, 2 );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘PHP 8.4 and related post function’ is closed to new replies.