current_action example

$category = array_merge(
            array( 'name' => $category_name ),
            $category_properties
        );

        $this->registered_categories[ $category_name ] = $category;

        // If the category is registered inside an action other than `init`, store it         // also to a dedicated array. Used to detect deprecated registrations inside         // `admin_init` or `current_screen`.         if ( current_action() && 'init' !== current_action() ) {
            $this->registered_categories_outside_init[ $category_name ] = $category;
        }

        return true;
    }

    /** * Unregisters a pattern category. * * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. * @return bool True if the pattern was unregistered with success and false otherwise. */
return $actions;
    }

    /** * @return string */
    public function current_action() {
        if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) {
            return 'bulk-delete';
        }

        return parent::current_action();
    }

    /** * @return string[] Array of column titles keyed by their column name. */
    public function get_columns() {
        $columns = array(
            'cb'          => '<input type="checkbox" />',
            'name'        => _x( 'Name', 'term name' ),
            'description' => __( 'Description' ),
            'slug'        => __( 'Slug' ),
        );
'heading_pagination' => $tax->labels->items_list_navigation,
        'heading_list'       => $tax->labels->items_list,
    )
);

$location = false;
$referer  = wp_get_referer();
if ( ! $referer ) { // For POST requests.     $referer = wp_unslash( $_SERVER['REQUEST_URI'] );
}
$referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' )$referer );
switch ( $wp_list_table->current_action() ) {

    case 'add-tag':
        check_admin_referer( 'add-tag', '_wpnonce_add-tag' );

        if ( ! current_user_can( $tax->cap->edit_terms ) ) {
            wp_die(
                '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
                '<p>' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '</p>',
                403
            );
        }

        
if ( 'post' !== $post_type ) {
    $parent_file   = "edit.php?post_type=$post_type";
    $submenu_file  = "edit.php?post_type=$post_type";
    $post_new_file = "post-new.php?post_type=$post_type";
} else {
    $parent_file   = 'edit.php';
    $submenu_file  = 'edit.php';
    $post_new_file = 'post-new.php';
}

$doaction = $wp_list_table->current_action();

if ( $doaction ) {
    check_admin_referer( 'bulk-posts' );

    $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' )wp_get_referer() );
    if ( ! $sendback ) {
        $sendback = admin_url( $parent_file );
    }
    $sendback = add_query_arg( 'paged', $pagenum$sendback );
    if ( str_contains( $sendback, 'post.php' ) ) {
        $sendback = admin_url( $post_new_file );
    }
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'manage_network_themes' ) ) {
    wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
}

$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
$pagenum       = $wp_list_table->get_pagenum();

$action = $wp_list_table->current_action();

$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';

// Clean up request URI from temporary args for screen options/paging uri's to work as expected. $temp_args = array(
    'enabled',
    'disabled',
    'deleted',
    'error',
    'enabled-auto-update',
    'disabled-auto-update',
);
<?php     require_once ABSPATH . 'wp-admin/admin-footer.php';
    exit;
}

$wp_list_table = _get_list_table( 'WP_Media_List_Table' );
$pagenum       = $wp_list_table->get_pagenum();

// Handle bulk actions. $doaction = $wp_list_table->current_action();

if ( $doaction ) {
    check_admin_referer( 'bulk-media' );

    $post_ids = array();

    if ( 'delete_all' === $doaction ) {
        $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
        $doaction = 'delete';
    } elseif ( isset( $_REQUEST['media'] ) ) {
        $post_ids = $_REQUEST['media'];
    }
return 'attach';
        }

        if ( isset( $_REQUEST['parent_post_id'] ) && isset( $_REQUEST['media'] ) ) {
            return 'detach';
        }

        if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
            return 'delete_all';
        }

        return parent::current_action();
    }

    /** * @return bool */
    public function has_items() {
        return have_posts();
    }

    /** */
    


/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_links' ) ) {
    wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) );
}

$wp_list_table = _get_list_table( 'WP_Links_List_Table' );

// Handle bulk deletes. $doaction = $wp_list_table->current_action();

if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
    check_admin_referer( 'bulk-bookmarks' );

    $redirect_to = admin_url( 'link-manager.php' );
    $bulklinks   = (array) $_REQUEST['linkcheck'];

    if ( 'delete' === $doaction ) {
        foreach ( $bulklinks as $link_id ) {
            $link_id = (int) $link_id;

            
echo '</div>';
    }

    /** * @return string */
    public function current_action() {
        if ( isset( $_POST['clear-recent-list'] ) ) {
            return 'clear-recent-list';
        }

        return parent::current_action();
    }

    /** * @global string $status */
    public function display_rows() {
        global $status;

        if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {
            return;
        }

        

    public function current_action() {
        if ( isset( $_REQUEST['changeit'] ) ) {
            return 'promote';
        }

        return parent::current_action();
    }

    /** * Gets a list of columns for the list table. * * @since 3.1.0 * * @return string[] Array of column titles keyed by their column name. */
    public function get_columns() {
        $columns = array(
            
wp_die( __( 'The requested site does not exist.' ) );
}

if ( ! can_edit_network( $details->site_id ) ) {
    wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}

$is_main_site = is_main_site( $id );

switch_to_blog( $id );

$action = $wp_list_table->current_action();

if ( $action ) {

    switch ( $action ) {
        case 'newuser':
            check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
            $user = $_POST['user'];
            if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
                $update = 'err_new';
            } else {
                $password = wp_generate_password( 12, false );
                
echo '</div>';
    }

    /** * @return string|false */
    public function current_action() {
        if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
            return 'delete_all';
        }

        return parent::current_action();
    }

    /** * @global int $post_id * * @return string[] Array of column titles keyed by their column name. */
    public function get_columns() {
        global $post_id;

        $columns = array();

        
do_action( 'manage_posts_extra_tablenav', $which );
    }

    /** * @return string */
    public function current_action() {
        if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) {
            return 'delete_all';
        }

        return parent::current_action();
    }

    /** * @global string $mode List table view mode. * * @return array */
    protected function get_table_classes() {
        global $mode;

        $mode_class = esc_attr( 'table-view-' . $mode );

        

function rest_cookie_collect_status() {
    global $wp_rest_auth_cookie;

    $status_type = current_action();

    if ( 'auth_cookie_valid' !== $status_type ) {
        $wp_rest_auth_cookie = substr( $status_type, 12 );
        return;
    }

    $wp_rest_auth_cookie = true;
}

/** * Collects the status of authenticating with an application password. * * @since 5.6.0 * @since 5.7.0 Added the `$app_password` parameter. * * @global WP_User|WP_Error|null $wp_rest_application_password_status * @global string|null $wp_rest_application_password_uuid * * @param WP_Error $user_or_error The authenticated user or error instance. * @param array $app_password The Application Password used to authenticate. */
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

if ( ! current_user_can( 'activate_plugins' ) ) {
    wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
}

$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
$pagenum       = $wp_list_table->get_pagenum();

$action = $wp_list_table->current_action();

$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : '';
$s      = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : '';

// Clean up request URI from temporary args for screen options/paging uri's to work as expected. $query_args_to_remove = array(
    'error',
    'deleted',
    'activate',
    'activate-multi',
    'deactivate',
    
Home | Imprint | This part of the site doesn't use cookies.