_admin_search_query example

$input_id = $input_id . '-search-input';

        if ( ! empty( $_REQUEST['orderby'] ) ) {
            echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
        }
        if ( ! empty( $_REQUEST['order'] ) ) {
            echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
        }
        ?> <p class="search-box"> <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> <input type="search" id="<?php echo esc_attr( $input_id ); ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search installed plugins...' ); ?>" /> <?php submit_button( $text, 'hide-if-js', '', false, array( 'id' => 'search-submit' ) ); ?> </p> <?php     }

    /** * @global string $status * * @return string[] Array of column titles keyed by their column name. */
    public function get_columns() {
        
?> </div> <div class="search-form"> <p class="search-box"> <label class="screen-reader-text" for="media-search-input"> <?php                     /* translators: Hidden accessibility text. */
                    esc_html_e( 'Search Media' );
                    ?> </label> <input type="search" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"> <input id="search-submit" type="submit" class="button" value="<?php esc_attr_e( 'Search Media' ); ?>"> </p> </div> </div> <?php     }

    /** * @return string[] Array of column titles keyed by their column name. */
    public function get_columns() {
        
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
        }
        if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
            echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
        }
        if ( ! empty( $_REQUEST['detached'] ) ) {
            echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
        }
        ?> <p class="search-box"> <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> </p> <?php     }

    /** * Generates views links. * * @since 6.1.0 * * @param array $link_data { * An array of link data. * * @type string $url The link URL. * @type string $label The link label. * @type bool $current Optional. Whether this is the currently selected view. * } * @return string[] An array of link markup. Keys match the `$link_data` input array. */
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
        '<p>' . __( '<a href="https://wordpress.org/documentation/article/media-library-screen/">Documentation on Media Library</a>' ) . '</p>' .
        '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
    );

    // Used in the HTML title tag.     $title       = __( 'Media Library' );
    $parent_file = 'upload.php';

    require_once ABSPATH . 'wp-admin/admin-header.php';
    ?> <div class="wrap" id="wp-media-grid" data-search="<?php _admin_search_query(); ?>"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php         if ( current_user_can( 'upload_files' ) ) {
            ?> <a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html_x( 'Add New', 'file' ); ?></a> <?php         }
        ?> <hr class="wp-header-end">
Home | Imprint | This part of the site doesn't use cookies.