A small bug with big influence
-
Do yourself a favor and replace the existing function with that one:
public function _get_page_link( $link, $id ) { global $post, $wp_rewrite, $q_config; $post2 = $post; if ( !$id ) $id = (int) $post->ID; else $post2 = &get_post($id); $draft_or_pending = in_array( $post2->post_status, array( 'draft', 'pending', 'auto-draft' ) ); $link = $wp_rewrite->get_page_permastruct(); if ( !empty($link) && ( isset($post2->post_status) && !$draft_or_pending ) ) { $link = str_replace('%pagename%', $this->get_page_uri($id), $link); $link = trim($link, '/'); // hack $link = home_url("/$link/"); // hack if ($q_config['url_mode'] != 1) $link = user_trailingslashit($link, 'page'); } else { $link = home_url("?page_id=$id"); } return $link; }
Your plugin is then not chaning the $post and a lot of other plugins are working with yours. I only changed the $post to $post2 and many stuff like breadcrumbs, diffrent themes and seo plugins are working again without any problem and also the_title() is returning well what it should and so one ??
https://www.ads-software.com/extend/plugins/qtranslate-slug/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘A small bug with big influence’ is closed to new replies.