Admin URL's break when site is installed as a subdirectory
|Reported by:||jcorradino||Owned by:|
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.
Change History (5)
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed