media_upload_library_form [ WordPress Function ]
media_upload_library_form ( $errors )
| Parameters: |
|
| Defined at: |
|
Benzer Fonksiyonlar: media_upload_library, media_upload_gallery_form, media_upload_type_form, media_upload_form, media_upload_type_url_form
{@internal Missing Short Description}}
Source
<?php
function media_upload_library_form($errors) {
global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$form_class = 'media-upload-form validate';
if ( get_user_setting('uploader') )
$form_class .= ' html-uploader';
$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
if ( $_GET['paged'] < 1 )
$_GET['paged'] = 1;
$start = ( $_GET['paged'] - 1 ) * 10;
if ( $start < 1 )
$start = 0;
add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) );
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
?>
<form id="filter" action="" method="get">
<input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
<input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" />
<p id="media-search" class="search-box">
<label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
<input type="search" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
<?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
</p>
<ul class="subsubsub">
<?php
$type_links = array();
$_num_posts = (array) wp_count_attachments();
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
foreach ( $matches as $_type => $reals )
foreach ( $reals as $real )
if ( isset($num_posts[$_type]) )
$num_posts[$_type] += $_num_posts[$real];
else
$num_posts[$_type] = $_num_posts[$real];
// If available type specified by media button clicked, filter by that type
if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
$_GET['post_mime_type'] = $type;
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- #17023 (add hook for media_upload_library_form()) – WordPress Trac
The "Media Library" tab of the Upload Media dialog includes a date filtering dropdown. The query which populates it returns only month/year combinations in ...
core.trac.wordpress.org - #17600 (Warnings showing in media-upload.php chain ...
... calling wp() /home/rhuancom/public_html/blog/wp-admin/includes/media.php 1916 calling wp_edit_attachments_query() calling media_upload_library_form() ...
core.trac.wordpress.org - PHPXRef 0.7 : WordPress : Detail view of media.php
media_upload_library_form() wp_media_insert_url_form() ...
phpxref.ftwr.co.uk - media_upload_library (WordPress Function) - WPSeek.com
Similar Functions: media_upload_library_form, media_upload_gallery, media_upload_image, media_upload_header, media_upload_form. {@internal Missing ...
wpseek.com