network_admin_url example


function self_admin_url( $path = '', $scheme = 'admin' ) {
    if ( is_network_admin() ) {
        $url = network_admin_url( $path$scheme );
    } elseif ( is_user_admin() ) {
        $url = user_admin_url( $path$scheme );
    } else {
        $url = admin_url( $path$scheme );
    }

    /** * Filters the admin URL for the current site or network depending on context. * * @since 4.9.0 * * @param string $url The complete URL including scheme and path. * @param string $path Path relative to the URL. Blank string if no path is specified. * @param string $scheme The scheme to use. */
return false;
    }

    if ( 'upgrade.php' === $pagenow ) {
        return;
    }

    if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
        echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
            /* translators: %s: URL to Upgrade Network screen. */
            __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
            esc_url( network_admin_url( 'upgrade.php' ) )
        ) . '</div>';
    }
}

/** * Avoids a collision between a site slug and a permalink slug. * * In a subdirectory installation this will make sure that a site and a post do not use the * same subdirectory by checking for a site with the same name as a new post. * * @since 3.0.0 * * @param array $data An array of post data. * @param array $postarr An array of posts. Not currently used. * @return array The new array of post data after checking for collisions. */
case 'user':
            _e( 'The network currently allows user registrations.' );
            break;
        default:
            _e( 'The network currently allows both site and user registrations.' );
            break;
    }

    echo ' ';

    /* translators: %s: URL to Network Settings screen. */
    printf( __( 'To change or disable registration go to your <a href="%s">Options page</a>.' )esc_url( network_admin_url( 'settings.php' ) ) );
    echo '</div>';
}

$newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null;

$current_user = wp_get_current_user();
if ( 'none' === $active_signup ) {
    _e( 'Registration has been disabled.' );
} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) {
    $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) );
    /* translators: %s: Login URL. */
    
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
    ?> <div id="message" class="notice notice-error is-dismissible"> <?php         foreach ( $add_user_errors->get_error_messages() as $error ) {
            echo "<p>$error</p>";
        }
        ?> </div> <?php } ?> <form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate"> <p><?php echo wp_required_field_message(); ?></p> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="username"><?php _e( 'Username' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" required="required" /></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="email" class="regular-text" name="user[email]" id="email" required="required" /></td> </tr> <tr class="form-field"> <td colspan="2" class="td-full">

    protected function get_views() {
        global $role;

        $total_users  = get_user_count();
        $super_admins = get_super_admins();
        $total_admins = count( $super_admins );

        $role_links        = array();
        $role_links['all'] = array(
            'url'     => network_admin_url( 'users.php' ),
            'label'   => sprintf(
                /* translators: Number of users. */
                _nx(
                    'All <span class="count">(%s)</span>',
                    'All <span class="count">(%s)</span>',
                    $total_users,
                    'users'
                ),
                number_format_i18n( $total_users )
            ),
            'current' => 'super' !== $role,
        );
// Include an unmodified $wp_version.     require ABSPATH . WPINC . '/version.php';

    $is_development_version = preg_match( '/alpha|beta|RC/', $wp_version );

    if ( $is_development_version ) {
        return sprintf(
            /* translators: 1: WordPress version number, 2: URL to WordPress Updates screen. */
            __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ),
            get_bloginfo( 'version', 'display' ),
            network_admin_url( 'update-core.php' )
        );
    }

    switch ( $cur->response ) {
        case 'upgrade':
            return sprintf(
                '<strong><a href="%s">%s</a></strong>',
                network_admin_url( 'update-core.php' ),
                /* translators: %s: WordPress version. */
                sprintf( __( 'Get Version %s' )$cur->current )
            );

        
/** * Filters whether to redirect the request to the Network Admin. * * @since 3.2.0 * * @param bool $redirect_network_admin_request Whether the request should be redirected. */
$redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );

if ( $redirect_network_admin_request ) {
    wp_redirect( network_admin_url() );
    exit;
}

unset( $redirect_network_admin_request );
// Can only reference the About screen if their update was successful.                 list( $about_version ) = explode( '-', $core_update->current, 2 );
                /* translators: %s: WordPress version. */
                $body .= sprintf( __( 'For more on version %s, see the About WordPress screen:' )$about_version );
                $body .= "\n" . admin_url( 'about.php' );

                if ( $newer_version_available ) {
                    /* translators: %s: WordPress latest version. */
                    $body .= "\n\n" . sprintf( __( 'WordPress %s is also now available.' )$next_user_core_update->current ) . ' ';
                    $body .= __( 'Updating is easy and only takes a few moments:' );
                    $body .= "\n" . network_admin_url( 'update-core.php' );
                }

                break;

            case 'fail':
            case 'manual':
                $body .= sprintf(
                    /* translators: 1: Home URL, 2: WordPress version. */
                    __( 'Please update your site at %1$s to WordPress %2$s.' ),
                    home_url(),
                    $next_user_core_update->current
                );
if ( $this->search_terms || $this->features ) {
            _e( 'No items found.' );
            return;
        }

        $blog_id = get_current_blog_id();
        if ( is_multisite() ) {
            if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
                printf(
                    /* translators: 1: URL to Themes tab on Edit Site screen, 2: URL to Add Themes screen. */
                    __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ),
                    network_admin_url( 'site-themes.php?id=' . $blog_id ),
                    network_admin_url( 'theme-install.php' )
                );

                return;
            } elseif ( current_user_can( 'manage_network_themes' ) ) {
                printf(
                    /* translators: %s: URL to Themes tab on Edit Site screen. */
                    __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%s">enable</a> more themes.' ),
                    network_admin_url( 'site-themes.php?id=' . $blog_id )
                );

                
wp_die( $id->get_error_message() );
    }
}

if ( isset( $_GET['update'] ) ) {
    $messages = array();
    if ( 'added' === $_GET['update'] ) {
        $messages[] = sprintf(
            /* translators: 1: Dashboard URL, 2: Network admin edit URL. */
            __( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
            esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
            network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
        );
    }
}

// Used in the HTML title tag. $title       = __( 'Add New Site' );
$parent_file = 'sites.php';

wp_enqueue_script( 'user-suggest' );

require_once ABSPATH . 'wp-admin/admin-header.php';

                $title       = __( 'Users' );
                $parent_file = 'users.php';

                require_once ABSPATH . 'wp-admin/admin-header.php';

                echo '<div class="wrap">';
                confirm_delete_users( $_POST['allusers'] );
                echo '</div>';

                require_once ABSPATH . 'wp-admin/admin-footer.php';
            } else {
                wp_redirect( network_admin_url( 'users.php' ) );
            }
            exit;

        case 'allusers':
            if ( ! current_user_can( 'manage_network_users' ) ) {
                wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
            }

            if ( isset( $_POST['action'] ) && isset( $_POST['allusers'] ) ) {
                check_admin_referer( 'bulk-users-network' );

                
// Handle network admin email change requests. if ( ! empty( $_GET['network_admin_hash'] ) ) {
    $new_admin_details = get_site_option( 'network_admin_hash' );
    $redirect          = 'settings.php?updated=false';
    if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash']$_GET['network_admin_hash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
        update_site_option( 'admin_email', $new_admin_details['newemail'] );
        delete_site_option( 'network_admin_hash' );
        delete_site_option( 'new_admin_email' );
        $redirect = 'settings.php?updated=true';
    }
    wp_redirect( network_admin_url( $redirect ) );
    exit;
} elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' === $_GET['dismiss'] ) {
    check_admin_referer( 'dismiss_new_network_admin_email' );
    delete_site_option( 'network_admin_hash' );
    delete_site_option( 'new_admin_email' );
    wp_redirect( network_admin_url( 'settings.php?updated=true' ) );
    exit;
}

add_action( 'admin_head', 'network_settings_add_js' );



/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
wp_enqueue_script( 'updates' );
add_thickbox();

if ( is_multisite() && ! is_network_admin() ) {
    wp_redirect( network_admin_url( 'update-core.php' ) );
    exit;
}

if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) {
    wp_die( __( 'Sorry, you are not allowed to update this site.' ) );
}

/** * Lists available core updates. * * @since 2.7.0 * * @global string $wp_local_package Locale code of the package. * @global wpdb $wpdb WordPress database abstraction object. * * @param object $update */
<?php /** * Multisite upgrade administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */

require_once __DIR__ . '/admin.php';

wp_redirect( network_admin_url( 'upgrade.php' ) );
exit;
/** This action is documented in wp-admin/network/site-themes.php */
                    $redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to$doaction$blogs$id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
                    wp_safe_redirect( $redirect_to );
                    exit;
                }
            } else {
                // Process query defined by WP_MS_Site_List_Table::extra_table_nav().                 $location = remove_query_arg(
                    array( '_wp_http_referer', '_wpnonce' ),
                    add_query_arg( $_POSTnetwork_admin_url( 'sites.php' ) )
                );

                wp_redirect( $location );
                exit;
            }

            break;

        case 'archiveblog':
        case 'unarchiveblog':
            update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );
            
Home | Imprint | This part of the site doesn't use cookies.