wp_nonce_url example

$can_restore = current_user_can( 'edit_post', $post->ID );
    $current_id  = false;

    foreach ( $revisions as $revision ) {
        $modified     = strtotime( $revision->post_modified );
        $modified_gmt = strtotime( $revision->post_modified_gmt . ' +0000' );
        if ( $can_restore ) {
            $restore_link = str_replace(
                '&',
                '&',
                wp_nonce_url(
                    add_query_arg(
                        array(
                            'revision' => $revision->ID,
                            'action'   => 'restore',
                        ),
                        admin_url( 'revision.php' )
                    ),
                    "restore-post_{$revision->ID}"
                )
            );
        }

        
global $wp_filesystem;

    if ( empty( $plugins ) ) {
        return false;
    }

    $checked = array();
    foreach ( $plugins as $plugin ) {
        $checked[] = 'checked[]=' . $plugin;
    }

    $url = wp_nonce_url( 'plugins.php?action=delete-selected&verify-delete=1&' . implode( '&', $checked ), 'bulk-plugins' );

    ob_start();
    $credentials = request_filesystem_credentials( $url );
    $data        = ob_get_clean();

    if ( false === $credentials ) {
        if ( ! empty( $data ) ) {
            require_once ABSPATH . 'wp-admin/admin-header.php';
            echo $data;
            require_once ABSPATH . 'wp-admin/admin-footer.php';
            exit;
        }
$remove_data_markup .= '</span>';

            $row_actions['remove-data'] = $remove_data_markup;
        }

        if ( 'request-completed' !== $status ) {
            $complete_request_markup  = '<span>';
            $complete_request_markup .= sprintf(
                '<a href="%s" class="complete-request" aria-label="%s">%s</a>',
                esc_url(
                    wp_nonce_url(
                        add_query_arg(
                            array(
                                'action'     => 'complete',
                                'request_id' => array( $request_id ),
                            ),
                            admin_url( 'erase-personal-data.php' )
                        ),
                        'bulk-privacy_requests'
                    )
                ),
                esc_attr(
                    
?> <div class="updated inline"> <p> <?php         printf(
            /* translators: %s: New admin email. */
            __( 'There is a pending change of the admin email to %s.' ),
            '<code>' . esc_html( $new_admin_email ) . '</code>'
        );
        printf(
            ' <a href="%1$s">%2$s</a>',
            esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
            __( 'Cancel' )
        );
    ?> </p> </div> <?php endif; ?> </td> </tr> <?php if ( ! is_multisite() ) { ?> <tr> <th scope="row">

    $bytes      = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    $size       = size_format( $bytes );
    $upload_dir = wp_upload_dir();
    if ( ! empty( $upload_dir['error'] ) ) :
        ?> <div class="error"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p> <p><strong><?php echo $upload_dir['error']; ?></strong></p></div> <?php     else :
        ?> <form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>"> <p> <?php         printf(
            '<label for="upload">%s</label> (%s)',
            __( 'Choose a file from your computer:' ),
            /* translators: %s: Maximum allowed file size. */
            sprintf( __( 'Maximum size: %s' )$size )
        );
        ?> <input type="file" id="upload" name="import" size="25" /> <input type="hidden" name="action" value="save" /> <input type="hidden" name="max_file_size" value="
foreach ( $themes as $theme ) :
            ?> <div class="available-theme"> <?php
            $template   = $theme->get_template();
            $stylesheet = $theme->get_stylesheet();
            $title      = $theme->display( 'Name' );
            $version    = $theme->display( 'Version' );
            $author     = $theme->display( 'Author' );

            $activate_link = wp_nonce_url( 'themes.php?action=activate&amp;template=' . urlencode( $template ) . '&amp;stylesheet=' . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );

            $actions             = array();
            $actions['activate'] = sprintf(
                '<a href="%s" class="activatelink" title="%s">%s</a>',
                $activate_link,
                /* translators: %s: Theme name. */
                esc_attr( sprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' )$title ) ),
                __( 'Activate' )
            );

            if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
                
$is_plugin_installed = false;

        if ( isset( $data['install'] ) ) {
            $plugin_slug = $data['install'];

            if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {
                // Looks like an importer is installed, but not active.                 $plugins = get_plugins( '/' . $plugin_slug );
                if ( ! empty( $plugins ) ) {
                    $keys        = array_keys( $plugins );
                    $plugin_file = $plugin_slug . '/' . $keys[0];
                    $url         = wp_nonce_url(
                        add_query_arg(
                            array(
                                'action' => 'activate',
                                'plugin' => $plugin_file,
                                'from'   => 'import',
                            ),
                            admin_url( 'plugins.php' )
                        ),
                        'activate-plugin_' . $plugin_file
                    );
                    $action      = sprintf(
                        
<?php echo $item_id; ?>"> <input id="menu-item-checkbox-<?php echo $item_id; ?>" type="checkbox" class="menu-item-checkbox" data-menu-item-id="<?php echo $item_id; ?>" disabled="disabled" /> <span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span> </label> <span class="item-controls"> <span class="item-type"><?php echo esc_html( $menu_item->type_label ); ?></span> <span class="item-order hide-if-js"> <?php                             printf(
                                '<a href="%s" class="item-move-up" aria-label="%s">&#8593;</a>',
                                wp_nonce_url(
                                    add_query_arg(
                                        array(
                                            'action'    => 'move-up-menu-item',
                                            'menu-item' => $item_id,
                                        ),
                                        remove_query_arg( $removed_argsadmin_url( 'nav-menus.php' ) )
                                    ),
                                    'move-menu_item'
                                ),
                                esc_attr__( 'Move up' )
                            );
                            


        if ( $spammed > 0 ) {
            $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;

            $messages[] = sprintf(
                /* translators: %s: Number of comments. */
                _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ),
                $spammed
            ) . sprintf(
                ' <a href="%1$s">%2$s</a><br />',
                esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ),
                __( 'Undo' )
            );
        }

        if ( $unspammed > 0 ) {
            $messages[] = sprintf(
                /* translators: %s: Number of comments. */
                _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ),
                $unspammed
            );
        }

        
<?php
        if ( $updater->is_vcs_checkout( ABSPATH ) ) {
            _e( 'This site appears to be under version control. Automatic updates are disabled.' );
        } elseif ( $upgrade_major ) {
            _e( 'This site is automatically kept up to date with each new version of WordPress.' );

            if ( $can_set_update_option ) {
                echo '<br />';
                printf(
                    '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-disable">%s</a>',
                    wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ),
                    __( 'Switch to automatic updates for maintenance and security releases only.' )
                );
            }
        } elseif ( $upgrade_minor ) {
            _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' );

            if ( $can_set_update_option ) {
                echo '<br />';
                printf(
                    '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-enable">%s</a>',
                    wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ),
                    
<?php if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : ?> <div class="updated inline"> <p> <?php                                     printf(
                                        /* translators: %s: New email. */
                                        __( 'There is a pending change of your email to %s.' ),
                                        '<code>' . esc_html( $new_email['newemail'] ) . '</code>'
                                    );
                                    printf(
                                        ' <a href="%1$s">%2$s</a>',
                                        esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
                                        __( 'Cancel' )
                                    );
                                    ?> </p> </div> <?php endif; ?> </td> </tr> <tr class="user-url-wrap"> <th><label for="url"><?php _e( 'Website' ); ?></label></th> <td><input type="url" name="url" id="url" value="

    $update_plugins = get_site_transient( 'update_plugins' );
    if ( isset( $update_plugins->response ) ) {
        foreach ( (array) $update_plugins->response as $file => $plugin ) {
            if ( $plugin->slug === $api->slug ) {
                $status      = 'update_available';
                $update_file = $file;
                $version     = $plugin->new_version;
                if ( current_user_can( 'update_plugins' ) ) {
                    $url = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $update_file ), 'upgrade-plugin_' . $update_file );
                }
                break;
            }
        }
    }

    if ( 'install' === $status ) {
        if ( is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) {
            $installed_plugin = get_plugins( '/' . $api->slug );
            if ( empty( $installed_plugin ) ) {
                if ( current_user_can( 'install_plugins' ) ) {
                    
if ( isset( $bulk_messages[ $post_type ][ $message ] ) ) {
        $messages[] = sprintf( $bulk_messages[ $post_type ][ $message ]number_format_i18n( $count ) );
    } elseif ( isset( $bulk_messages['post'][ $message ] ) ) {
        $messages[] = sprintf( $bulk_messages['post'][ $message ]number_format_i18n( $count ) );
    }

    if ( 'trashed' === $message && isset( $_REQUEST['ids'] ) ) {
        $ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );

        $messages[] = sprintf(
            '<a href="%1$s">%2$s</a>',
            esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ),
            __( 'Undo' )
        );
    }

    if ( 'untrashed' === $message && isset( $_REQUEST['ids'] ) ) {
        $ids = explode( ',', $_REQUEST['ids'] );

        if ( 1 === count( $ids ) && current_user_can( 'edit_post', $ids[0] ) ) {
            $messages[] = sprintf(
                '<a href="%1$s">%2$s</a>',
                esc_url( get_edit_post_link( $ids[0] ) ),
                
esc_url( get_edit_post_link( $post->ID ) ),
                /* translators: %s: Attachment title. */
                esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' )$att_title ) ),
                __( 'Edit' )
            );
        }

        if ( current_user_can( 'delete_post', $post->ID ) ) {
            if ( $this->is_trash ) {
                $actions['untrash'] = sprintf(
                    '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
                    esc_url( wp_nonce_url( "post.php?action=untrash&amp;post=$post->ID", 'untrash-post_' . $post->ID ) ),
                    /* translators: %s: Attachment title. */
                    esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' )$att_title ) ),
                    __( 'Restore' )
                );
            } elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
                $actions['trash'] = sprintf(
                    '<a href="%s" class="submitdelete aria-button-if-js" aria-label="%s">%s</a>',
                    esc_url( wp_nonce_url( "post.php?action=trash&amp;post=$post->ID", 'trash-post_' . $post->ID ) ),
                    /* translators: %s: Attachment title. */
                    esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' )$att_title ) ),
                    _x( 'Trash', 'verb' )
                );
        $user         = $item;
        $super_admins = get_super_admins();

        $actions = array();

        if ( current_user_can( 'edit_user', $user->ID ) ) {
            $edit_link       = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) )get_edit_user_link( $user->ID ) ) );
            $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
        }

        if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins, true ) ) {
            $actions['delete'] = '<a href="' . esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) )wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
        }

        /** * Filters the action links displayed under each user in the Network Admin Users list table. * * @since 3.2.0 * * @param string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete'. * @param WP_User $user WP_User object. */
        $actions = apply_filters( 'ms_user_row_actions', $actions$user );

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