Error param on get_permalink()
-
Hey team,
In this file https://plugins.trac.wordpress.org/browser/wordpress-seo/trunk/inc/sitemaps/class-post-type-sitemap-provider.php#L615 when you call get_permalink($post);
$post is not a WP_Post or and ID but your Stdclass.
In the function get_permalink() the final return has a filter :
/**
* Filters the permalink for a post.
*
* Only applies to posts with post_type of ‘post’.
*
* @since 1.5.0
*
* @param string $permalink The post’s permalink.
* @param WP_Post $post The post in question.
* @param bool $leavename Whether to keep the post name.
*/
apply_filters( ‘post_link’, $permalink, $post, $leavename );If any plugins or custom code hook ‘post_link’ after WordPress SEO it can generate a fatal error.
Could you modify your code to put an ID or an WP_Post instance ?
Best,
- The topic ‘Error param on get_permalink()’ is closed to new replies.