firecastdan
Forum Replies Created
-
//relative links – rather than absolute for posts/page links
function fcml_internal_link_to_relative( $url, $post, $leavename ) {
//echo “<br />before url:” . $url;//if ( $post->post_type == ‘post’ || $post->post_type == ‘page’ ) {
$url = wp_make_link_relative($url);
//}
//echo “<br />after url:” . $url;return $url;
}
add_filter( ‘post_link’, ‘fcml_internal_link_to_relative’, 10, 3 );
add_filter( ‘page_link’, ‘fcml_internal_link_to_relative’, 10, 3 );NOTE: post_link causes the error – page_link is fine
ISSUE STILL EXISTS (have identified where in the theme code it occurs and thus the cause)
REGULAR POSTS EDIT ERROR – CAUSED BY YOAST PLUGIN WHEN USING CUSTOM THEME
WordPress error – The editor has encountered an unexpected error.
Occurs when editing regular POSTS in the admin area (Custom Post Types unaffected)Disabling Yoast plugin removes the error. Only happens on custom theme not the default WordPress ones.
Error is located in the functions.php file.
It is caused by the function that converts absolute links to reltive ones – The ‘post_link’ filter that uses the wp_make_link_relative() function
Specifically the line that changes the URL variable – $url = wp_make_link_relative($url)When it occurs regarding plugin versions:
Updating WordPress version on an older site is fine. Then when Yoast is updated to version 17.1 the post error starts happeningTHIS IS A YOAST ISSUE
If any plugins or custom code hook ‘post_link’ after WordPress SEO it can generate a fatal error.
Discussion here of issue – Wrong parameter in get_permalink
when you call get_permalink($post); – $post is not a WP_Post or and ID but your Stdclass.
If any plugins or custom code hook ‘post_link’ after WordPress SEO it can generate a fatal error.
https://github.com/Yoast/wordpress-seo/issues/16308ROFL. You basically said to her – “you have to pay for our plugin that doesn’t work for us to try and fix this error with our plugin that we may not be able to fix anyway or we aren’t going to bother to look into it any further”!! and you wonder why you got no reply!
For what its worth I have the exact same problem and its yoast causing it. its been weeks now and still not fixed. I would happily chuck yoast in the bin but my client likes it for some reason – although not enough to get the paid version like in the past
how do i set this back to unresolved?
anyway my issue is that regular posts cant be edited with yoast on – you get the unexpected error messsage – The editor has encountered an unexpected error.
custom posts are fine though.
turn yoast off and the error goes away
same happens to me. And if I disable Yoast it goes away. So I don’t think it is resolved?