self_admin_url example



    $user = get_userdata( $user_id );

    if ( ! $user ) {
        return '';
    }

    if ( get_current_user_id() == $user->ID ) {
        $link = get_edit_profile_url( $user->ID );
    } else {
        $link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
    }

    /** * Filters the user edit link. * * @since 3.5.0 * * @param string $link The edit link. * @param int $user_id User ID. */
    return apply_filters( 'get_edit_user_link', $link$user->ID );
}
<?php                                 printf(
                                    /* translators: %s: Theme name. */
                                    __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
                                    '{{{ data.theme.name }}}'
                                );
                                if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
                                    printf(
                                        /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
                                        ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
                                        self_admin_url( 'update-core.php' ),
                                        esc_url( wp_get_update_php_url() )
                                    );
                                    wp_update_php_annotation( '</p><p><em>', '</em>' );
                                } elseif ( current_user_can( 'update_core' ) ) {
                                    printf(
                                        /* translators: %s: URL to WordPress Updates screen. */
                                        ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
                                        self_admin_url( 'update-core.php' )
                                    );
                                } elseif ( current_user_can( 'update_php' ) ) {
                                    printf(
                                        
'themeSearchResults'   => __( '%d themes found' ),
                /* translators: %d: Number of themes being displayed, which cannot currently consider singular vs. plural forms. */
                'announceThemeCount'   => __( 'Displaying %d themes' ),
                /* translators: %s: Theme name. */
                'announceThemeDetails' => __( 'Showing details for theme: %s' ),
            ),
        );

        // Temporarily disable installation in Customizer. See #42184.         $filesystem_method = get_filesystem_method();
        ob_start();
        $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
        ob_end_clean();
        if ( 'direct' !== $filesystem_method && ! $filesystem_credentials_are_stored ) {
            $settings['theme']['_filesystemCredentialsNeeded'] = true;
        }

        // Prepare Customize Section objects to pass to JavaScript.         foreach ( $this->sections() as $id => $section ) {
            if ( $section->check_capabilities() ) {
                $settings['sections'][ $id ] = $section->json();
            }
        }

        
wp_enqueue_script( 'updates' );

if ( $action ) {

    switch ( $action ) {
        case 'activate':
            if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
                wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );
            }

            if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
                wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s) );
                exit;
            }

            check_admin_referer( 'activate-plugin_' . $plugin );

            $result = activate_plugin( $pluginself_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) )is_network_admin() );
            if ( is_wp_error( $result ) ) {
                if ( 'unexpected_output' === $result->get_error_code() ) {
                    $redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s);
                    wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin )$redirect ) );
                    exit;
                }
'abbr'    => array( 'title' => array() ),
        'acronym' => array( 'title' => array() ),
        'code'    => array(),
        'em'      => array(),
        'strong'  => array(),
    );

    $plugin_name = wp_kses( $plugin_data['Name']$plugins_allowedtags );
    $plugin_slug = isset( $response->slug ) ? $response->slug : $response->id;

    if ( isset( $response->slug ) ) {
        $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&section=changelog' );
    } elseif ( isset( $response->url ) ) {
        $details_url = $response->url;
    } else {
        $details_url = $plugin_data['PluginURI'];
    }

    $details_url = add_query_arg(
        array(
            'TB_iframe' => 'true',
            'width'     => 600,
            'height'    => 800,
        ),

    protected function is_filesystem_available() {
        $filesystem_method = get_filesystem_method();

        if ( 'direct' === $filesystem_method ) {
            return true;
        }

        ob_start();
        $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
        ob_end_clean();

        if ( $filesystem_credentials_are_stored ) {
            return true;
        }

        return new WP_Error( 'fs_unavailable', __( 'The filesystem is currently unavailable for managing plugins.' ), array( 'status' => 500 ) );
    }

    /** * Retrieves the plugin's schema, conforming to JSON Schema. * * @since 5.5.0 * * @return array Item schema data. */


            if ( empty( $action ) ) {
                if ( is_main_site() ) {
                    $url    = wp_nonce_url(
                        add_query_arg(
                            array(
                                'action' => 'install-plugin',
                                'plugin' => $plugin_slug,
                                'from'   => 'import',
                            ),
                            self_admin_url( 'update.php' )
                        ),
                        'install-plugin_' . $plugin_slug
                    );
                    $action = sprintf(
                        '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>',
                        esc_url( $url ),
                        esc_attr( $plugin_slug ),
                        esc_attr( $data[0] ),
                        /* translators: %s: Importer name. */
                        esc_attr( sprintf( _x( 'Install %s now', 'plugin' )$data[0] ) ),
                        __( 'Install Now' )
                    );
echo '</div>';
    }

    /** */
    public function bulk_footer() {
        $this->decrement_update_count( 'translation' );

        $update_actions = array(
            'updates_page' => sprintf(
                '<a href="%s" target="_parent">%s</a>',
                self_admin_url( 'update-core.php' ),
                __( 'Go to WordPress Updates page' )
            ),
        );

        /** * Filters the list of action links available following a translations update. * * @since 3.7.0 * * @param string[] $update_actions Array of translations update links. */
        

    echo '</ul>';

    // Don't show the maintenance mode notice when we are only showing a single re-install option.     if ( $updates && ( count( $updates ) > 1 || 'latest' !== $updates[0]->response ) ) {
        echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.' ) . '</p>';
    } elseif ( ! $updates ) {
        list( $normalized_version ) = explode( '-', $wp_version );
        echo '<p>' . sprintf(
            /* translators: 1: URL to About screen, 2: WordPress version. */
            __( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ),
            esc_url( self_admin_url( 'about.php' ) ),
            $normalized_version
        ) . '</p>';
    }

    dismissed_updates();
}

/** * Display WordPress auto-updates settings. * * @since 5.6.0 */


            // Used in the HTML title tag.             $title       = __( 'Update Themes' );
            $parent_file = 'themes.php';

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

            echo '<div class="wrap">';
            echo '<h1>' . esc_html( $title ) . '</h1>';

            $url = self_admin_url( 'update.php?action=update-selected-themes&amp;themes=' . urlencode( implode( ',', $themes ) ) );
            $url = wp_nonce_url( $url, 'bulk-update-themes' );

            echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
            echo '</div>';
            require_once ABSPATH . 'wp-admin/admin-footer.php';
            exit;
        case 'delete-selected':
            if ( ! current_user_can( 'delete_themes' ) ) {
                wp_die( __( 'Sorry, you are not allowed to delete themes for this site.' ) );
            }

            
$ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );
    foreach ( $vars as $key => $value ) {
        if ( ! $value || in_array( $key$ignore, true ) ) {
            unset( $vars[ $key ] );
        }
    }

    wp_localize_script(
        'media-grid',
        '_wpMediaGridSettings',
        array(
            'adminUrl'  => parse_url( self_admin_url(), PHP_URL_PATH ),
            'queryVars' => (object) $vars,
        )
    );

    get_current_screen()->add_help_tab(
        array(
            'id'      => 'overview',
            'title'   => __( 'Overview' ),
            'content' =>
                '<p>' . __( 'All the files you&#8217;ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '</p>' .
                '<p>' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '</p>' .
                
if ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) {
    $new_email = get_user_meta( $current_user->ID, '_new_email', true );
    if ( $new_email && hash_equals( $new_email['hash']$_GET['newuseremail'] ) ) {
        $user             = new stdClass();
        $user->ID         = $current_user->ID;
        $user->user_email = esc_html( trim( $new_email['newemail'] ) );
        if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) {
            $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );
        }
        wp_update_user( $user );
        delete_user_meta( $current_user->ID, '_new_email' );
        wp_redirect( add_query_arg( array( 'updated' => 'true' )self_admin_url( 'profile.php' ) ) );
        die();
    } else {
        wp_redirect( add_query_arg( array( 'error' => 'new-email' )self_admin_url( 'profile.php' ) ) );
    }
} elseif ( IS_PROFILE_PAGE && ! empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
    check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
    delete_user_meta( $current_user->ID, '_new_email' );
    wp_redirect( add_query_arg( array( 'updated' => 'true' )self_admin_url( 'profile.php' ) ) );
    die();
}

$this->decrement_update_count( 'plugin' );

        $update_actions = array(
            'activate_plugin' => sprintf(
                '<a href="%s" target="_parent">%s</a>',
                wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . urlencode( $this->plugin ), 'activate-plugin_' . $this->plugin ),
                __( 'Activate Plugin' )
            ),
            'plugins_page'    => sprintf(
                '<a href="%s" target="_parent">%s</a>',
                self_admin_url( 'plugins.php' ),
                __( 'Go to Plugins page' )
            ),
        );

        if ( $this->plugin_active || ! $this->result || is_wp_error( $this->result ) || ! current_user_can( 'activate_plugin', $this->plugin ) ) {
            unset( $update_actions['activate_plugin'] );
        }

        /** * Filters the list of action links available following a single plugin update. * * @since 2.7.0 * * @param string[] $update_actions Array of plugin action links. * @param string $plugin Path to the plugin file relative to the plugins directory. */
<?php }

/** * Displays a form to upload themes from zip files. * * @since 2.8.0 */
function install_themes_upload() {
    ?> <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install or update it by uploading it here.' ); ?></p> <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo esc_url( self_admin_url( 'update.php?action=upload-theme' ) ); ?>"> <?php wp_nonce_field( 'theme-upload' ); ?> <label class="screen-reader-text" for="themezip"> <?php         /* translators: Hidden accessibility text. */
        _e( 'Theme zip file' );
        ?> </label> <input type="file" id="themezip" name="themezip" accept=".zip" /> <?php submit_button( __( 'Install Now' ), '', 'install-theme-submit', false ); ?> </form> <?php }


/** * Prints the filesystem credentials modal when needed. * * @since 4.2.0 */
function wp_print_request_filesystem_credentials_modal() {
    $filesystem_method = get_filesystem_method();

    ob_start();
    $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
    ob_end_clean();

    $request_filesystem_credentials = ( 'direct' !== $filesystem_method && ! $filesystem_credentials_are_stored );
    if ( ! $request_filesystem_credentials ) {
        return;
    }
    ?> <div id="request-filesystem-credentials-dialog" class="notification-dialog-wrap request-filesystem-credentials-dialog"> <div class="notification-dialog-background"></div> <div class="notification-dialog" role="dialog" aria-labelledby="request-filesystem-credentials-title" tabindex="0"> <div class="request-filesystem-credentials-dialog-content">
Home | Imprint | This part of the site doesn't use cookies.