is_allowed example

'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
        '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
        403
    );
}

if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) {
    if ( 'activate' === $_GET['action'] ) {
        check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] );
        $theme = wp_get_theme( $_GET['stylesheet'] );

        if ( ! $theme->exists() || ! $theme->is_allowed() ) {
            wp_die(
                '<h1>' . __( 'Something went wrong.' ) . '</h1>' .
                '<p>' . __( 'The requested theme does not exist.' ) . '</p>',
                403
            );
        }

        switch_theme( $theme->get_stylesheet() );
        wp_redirect( admin_url( 'themes.php?activated=true' ) );
        exit;
    } elseif ( 'resume' === $_GET['action'] ) {
        
array(
            'TB_iframe' => 'true',
            'width'     => 1024,
            'height'    => 800,
        ),
        $current->response[ $theme_key ]['url']
    );

    /** @var WP_MS_Themes_List_Table $wp_list_table */
    $wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );

    $active = $theme->is_allowed( 'network' ) ? ' active' : '';

    $requires_wp  = isset( $response['requires'] ) ? $response['requires'] : null;
    $requires_php = isset( $response['requires_php'] ) ? $response['requires_php'] : null;

    $compatible_wp  = is_wp_version_compatible( $requires_wp );
    $compatible_php = is_php_version_compatible( $requires_php );

    printf(
        '<tr class="plugin-update-tr%s" id="%s" data-slug="%s">' .
        '<td colspan="%s" class="plugin-update colspanchange">' .
        '<div class="update-message notice inline notice-warning notice-alt"><p>',
        

            if ( ! current_user_can( 'switch_themes' ) ) {
                $this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
            }

            // If the theme has errors while loading, bail.             if ( $this->theme()->errors() ) {
                $this->wp_die( -1, $this->theme()->errors()->get_error_message() );
            }

            // If the theme isn't allowed per multisite settings, bail.             if ( ! $this->theme()->is_allowed() ) {
                $this->wp_die( -1, __( 'The requested theme does not exist.' ) );
            }
        }

        // Make sure changeset UUID is established immediately after the theme is loaded.         add_action( 'after_setup_theme', array( $this, 'establish_loaded_changeset' ), 5 );

        /* * Import theme starter content for fresh installations when landing in the customizer. * Import starter content at after_setup_theme:100 so that any * add_theme_support( 'starter-content' ) calls will have been made. */
$themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
            $allowed_where   = 'site';
        } else {
            $themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
            $allowed_where   = 'network';
        }

        $current      = get_site_transient( 'update_themes' );
        $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current;

        foreach ( (array) $themes['all'] as $key => $theme ) {
            if ( $this->is_site_themes && $theme->is_allowed( 'network' ) ) {
                unset( $themes['all'][ $key ] );
                continue;
            }

            if ( $maybe_update && isset( $current->response[ $key ] ) ) {
                $themes['all'][ $key ]->update = true;
                $themes['upgrade'][ $key ]     = $themes['all'][ $key ];
            }

            $filter                    = $theme->is_allowed( $allowed_where$this->site_id ) ? 'enabled' : 'disabled';
            $themes[ $filter ][ $key ] = $themes['all'][ $key ];

            
Home | Imprint | This part of the site doesn't use cookies.