[wp-trac] [WordPress Trac] #16572: Admin URL's break when site is installed as a subdirectory
WordPress Trac
wp-trac at lists.automattic.com
Tue Feb 15 21:08:19 UTC 2011
#16572: Admin URL's break when site is installed as a subdirectory
----------------------------+-----------------------------
Reporter: jcorradino | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 3.0.5
Severity: major | Keywords:
----------------------------+-----------------------------
For instance, the pagination on the posts page links to /wp-admin/ rather
than /sub-directory/wp-admin/
The problem lays in the following code on edit.php (lines 312-319)
{{{
$page_links = paginate_links( array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
'prev_text' => __('«'),
'next_text' => __('»'),
'total' => $num_pages,
'current' => $pagenum
));
}}}
I changed it to the following, and it seems to work.
{{{
$page_links = paginate_links( array(
'base' => get_option('home').add_query_arg( 'paged', '%#%' ),
'format' => '',
'prev_text' => __('«'),
'next_text' => __('»'),
'total' => $num_pages,
'current' => $pagenum
));
}}}
If there is an easier way to go about fixing this, then please let me
know. Pagination is not the only place where I am seeing this bug, if you
also look at /wp-admin/includes/media.php, line 82 contains the following
{{{
$link = "<a href='" . esc_url($href) . "'$class>$text</a>";
}}}
which also dumps you in /wp-admin/ instead of /sub-directory/wp-admin/
I propose the same change as above. In total, there are 4 templates that
I have determined to be affected by this bug under wp-admin (may be
missing some): comment.php, edit.php, media.php, and /includes/media.php.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16572>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list