WordPress.org

Make WordPress Core

Ticket #18935: my-sites.diff

File my-sites.diff, 1004 bytes (added by trepmal, 7 years ago)

Display error in the admin chrome

  • wp-admin/my-sites.php

     
    1919
    2020$blogs = get_blogs_of_user( $current_user->ID );
    2121
    22 if ( empty( $blogs ) )
    23         wp_die( __( 'You must be a member of at least one site to use this page.' ) );
    24 
    2522$updated = false;
    2623if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) {
    2724        check_admin_referer( 'update-my-sites' );
     
    5552<div class="wrap">
    5653<?php screen_icon(); ?>
    5754<h2><?php echo esc_html( $title ); ?></h2>
     55<?php
     56if ( empty( $blogs ) ) :
     57        echo '<p>';
     58        _e( 'You must be a member of at least one site to use this page.' );
     59        echo '</p>';
     60else :
     61?>
    5862<form id="myblogs" action="" method="post">
    5963        <?php
    6064        choose_primary_blog();
     
    104108        <?php wp_nonce_field( 'update-my-sites' ); ?>
    105109        <?php submit_button(); ?>
    106110        </form>
     111<?php endif; ?>
    107112        </div>
    108113<?php
    109114include( './admin-footer.php' );