23
Feb 06wordpress 2: first bug sorted out
true…
when you change your platform you never know what to expect, but after sorting this little bug I’m so happy to have switched.
when working on MovableType every fix, tweak etc would have taken hours through Perl code (of course cause I don’t know Perl), but in just couple hours I got this one sorted.
yeah… right…
what was the bug? (you might be wondering)
introduction:
I decided to keep my admin panel separated from my blog, and of course this requires some minor tweaking, especially when dealing with CSS that are stored on the main folder.
you end up having just a few files in your blog’s root, and I like that.
well…
my little bug was consisting in a mistaken link creation inside the admin panel.
when going to Manage > Posts > Previous Posts (bottom of the page if you have more than 15 posts), it was linking to the blog’s url, not the admin’s one.
I tracked the bug and I found a workaround which might be just a quick-fix, but it’s working fine.
in
/wp-includes/template-functions-links.php, about line 440 (function get_pagenum_link()), you can find
$qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr );
the get_settings('home') returns the base url for the blog (www.randomtype.com in my case).
I solved the issue checking against the value returned by is_admin()
if you’re in the admin panel, it returns “1″, then I change the parameter from 'home' to 'siteurl'.
(is_admin()) ? $st_url="siteurl" : $st_url="home";
//$qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr );
$qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings($st_url) ) . $qstr );
hope this can help out other people too.
have fun with wordpress 2
Popularity: unranked [?]
