Support » Plugins and Hacks » [Plugin: Page Links To] Got error msg after upgraded to 2.2
7 years, 2 months ago
After I upgraded to 2.2, I got an error message on my web page:
Warning: preg_replace() [function.preg-replace]: Unknown modifier ‘<‘ in
on line 186
Switched back to 2.1, then no errors at all…
I had the same problem and resolved it the same way by downgrading back to 2.1
It works well on two sites hosted on different servers. A few mins I updated the plugin to the latest version 2.2.
Same problem here as described by apmphilon – error message appears on top of front end pages.
v 2.1 apparently works fine with WP 2.9.1
a page I edited showed up blank – till I discovered that a http:// had showed up in the page-links-to field. Hard to send people there…
Same problem here; had to go back to 2.1
I’ve been using 2.1 for a bit now, then I updated to 2.2 and decided to see if this feature to highlight the menu/tab if you are on a wordpress page.
It doesn’t work in 2.1 and it seems the author has tried to fix it in 2.2 and its still a no go. Hopefully they can find whats causing it and get it working.
That highlight feature will be the icing on the cake for this plugin, and just what I need as I am using it to create a menu with a mix of pages, categories and links.
same issue as described above and went back to 2.1
Same, it killed my entire page menu and replaced it with error code.
So I had to roll back to 2.1.
You can replace line 186 with this:
$pages = str_replace(' href="'.$current_page.'"', ' class="active" href="'.$current_page.'"', $pages );
It will fix the error and make the highlighting work. I’m not sure if line 185 is doing what it should, though.
PS: This is just a quick and dirty fix. I’m not a big fan of doing string replacing in HTML code. I’m sure there must be a better way of doing this…
PS2: I’m not responsible if it crashes something else.
you can fix it temporarily by taking lines 185 and 186 and revert them to version 2.1. Didn’ t have time to look for the real error.
$pages = str_replace( ‘ class=”page_item current_page_item”‘, ‘ class=”page_item”‘, $pages );
$pages = str_replace( ‘<li class=”page_item”><a href=”‘ . $current_page . ‘”‘, $pages );
#2.2 $pages = preg_replace( ‘| class=”([^”]+)current_page_item”|’, ‘ class=”$1″‘, $pages ); // Kill default highlighting
#2.2 $pages = preg_replace( ‘<li class=”([^”]+)”><a href=”‘ . $current_page . ‘”‘, $pages );
2.1 doesn’t give me the highlight either which is a shame. Not sure why, tho.
I’m using Atahualpa if it makes any difference.
WordPress Lead Dev
Really sorry about this, everyone. Version 2.3 fixes the bug and restores menu highlighting! I just pushed it out, and it should be available for download in 15-30 minutes.
7 years, 1 month ago
Still having a problem with URI in 2.3. My anchors link to the index like so <a href="?p=185"> but the new 2.3 version made that linking to http://?p=185 so I had to roll back to 2.1.