Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_edit_attachments_query [ WordPress Function ]

wp_edit_attachments_query ( $q = false )
Parameters:
  • (unknown_type) $q
Returns:
  • (unknown)
Defined at:



{@internal Missing Short Description}}

Source


<?php
function wp_edit_attachments_query$q false ) {
    if ( 
false === $q )
        
$q $_GET;

    
$q['m']   = isset( $q['m'] ) ? (int) $q['m'] : 0;
    
$q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
    
$q['post_type'] = 'attachment';
    
$post_type get_post_type_object'attachment' );
    
$states 'inherit';
    if ( 
current_user_can$post_type->cap->read_private_posts ) )
        
$states .= ',private';

    
$q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' $states;
    
$media_per_page = (int) get_user_option'upload_per_page' );
    if ( empty( 
$media_per_page ) || $media_per_page )
        
$media_per_page 20;
    
$q['posts_per_page'] = apply_filters'upload_per_page'$media_per_page );

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

    if ( isset(
$q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
        unset(
$q['post_mime_type']);

    if ( isset(
$q['detached']) )
        
add_filter('posts_where''_edit_attachments_query_helper');

    
wp$q );

    if ( isset(
$q['detached']) )
        
remove_filter('posts_where''_edit_attachments_query_helper');

    return array(
$post_mime_types$avail_post_mime_types);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics