wp_edit_attachments_query_vars example

'removable_query_args',
        function() {
            return array( 'error' );
        },
        10,
        0
    );

    $q = $_GET;
    // Let JS handle this.     unset( $q['s'] );
    $vars   = wp_edit_attachments_query_vars( $q );
    $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(
            
/** * Executes a query for attachments. An array of WP_Query arguments * can be passed in, which will override the arguments set by this function. * * @since 2.5.0 * * @param array|false $q Optional. Array of query variables to use to build the query. * Defaults to the `$_GET` superglobal. * @return array */
function wp_edit_attachments_query( $q = false ) {
    wp( wp_edit_attachments_query_vars( $q ) );

    $post_mime_types       = get_post_mime_types();
    $avail_post_mime_types = get_available_post_mime_types( 'attachment' );

    return array( $post_mime_types$avail_post_mime_types );
}

/** * Returns the list of classes to be used by a meta box. * * @since 2.5.0 * * @param string $box_id Meta box ID (used in the 'id' attribute for the meta box). * @param string $screen_id The screen on which the meta box is shown. * @return string Space-separated string of class names. */
Home | Imprint | This part of the site doesn't use cookies.