X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fef8173b8c3bad08f495551e43cfdeac1cae6021..b3ddbea8a296025a672b3c3ddca158dc51ed8080:/wp-includes/link-template.php
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 33f0a7dd..70f75956 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -847,6 +847,8 @@ function get_post_type_archive_link( $post_type ) {
$struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
if ( $post_type_obj->rewrite['with_front'] )
$struct = $wp_rewrite->front . $struct;
+ else
+ $struct = $wp_rewrite->root . $struct;
$link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
} else {
$link = home_url( '?post_type=' . $post_type );
@@ -1577,7 +1579,7 @@ function next_posts( $max_page = 0, $echo = true ) {
* @param int $max_page Optional. Max pages.
* @return string|null
*/
-function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
+function get_next_posts_link( $label = null, $max_page = 0 ) {
global $paged, $wp_query;
if ( !$max_page )
@@ -1588,6 +1590,9 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
$nextpage = intval($paged) + 1;
+ if ( null === $label )
+ $label = __( 'Next Page »' );
+
if ( !is_single() && ( $nextpage <= $max_page ) ) {
$attr = apply_filters( 'next_posts_link_attributes', '' );
return '" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . '';
@@ -1603,7 +1608,7 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
* @param string $label Content for link text.
* @param int $max_page Optional. Max pages.
*/
-function next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
+function next_posts_link( $label = null, $max_page = 0 ) {
echo get_next_posts_link( $label, $max_page );
}
@@ -1653,9 +1658,12 @@ function previous_posts( $echo = true ) {
* @param string $label Optional. Previous page link text.
* @return string|null
*/
-function get_previous_posts_link( $label = '« Previous Page' ) {
+function get_previous_posts_link( $label = null ) {
global $paged;
+ if ( null === $label )
+ $label = __( '« Previous Page' );
+
if ( !is_single() && $paged > 1 ) {
$attr = apply_filters( 'previous_posts_link_attributes', '' );
return '". preg_replace( '/&([^#])(?![a-z]{1,8};)/', '&$1', $label ) .'';
@@ -1670,7 +1678,7 @@ function get_previous_posts_link( $label = '« Previous Page' ) {
*
* @param string $label Optional. Previous page link text.
*/
-function previous_posts_link( $label = '« Previous Page' ) {
+function previous_posts_link( $label = null ) {
echo get_previous_posts_link( $label );
}
@@ -2294,13 +2302,13 @@ function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) {
$user_id = (int) $user_id;
$blogs = get_blogs_of_user( $user_id );
- if ( empty($blogs) ) {
+ if ( ! is_super_admin() && empty($blogs) ) {
$url = user_admin_url( $path, $scheme );
} elseif ( ! is_multisite() ) {
$url = admin_url( $path, $scheme );
} else {
$current_blog = get_current_blog_id();
- if ( $current_blog && in_array($current_blog, array_keys($blogs)) ) {
+ if ( $current_blog && ( is_super_admin( $user_id ) || in_array( $current_blog, array_keys( $blogs ) ) ) ) {
$url = admin_url( $path, $scheme );
} else {
$active = get_active_blog_for_user( $user_id );
@@ -2411,7 +2419,7 @@ function wp_shortlink_wp_head() {
if ( empty( $shortlink ) )
return;
- echo "\n";
+ echo "\n";
}
/**