This filter is documented in wp-admin/includes/media.php $tabs = apply_filters( 'media_upload_tabs', $tabs ); unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] ); $props = array( 'link' => get_option( 'image_default_link_type' ), // DB default is 'file'. 'align' => get_option( 'image_default_align' ), // Empty default. 'size' => get_option( 'image_default_size' ), // Empty default. ); $exts = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() ); $mimes = get_allowed_mime_types(); $ext_mimes = array(); foreach ( $exts as $ext ) { foreach ( $mimes as $ext_preg => $mime_match ) { if ( preg_match( '#' . $ext . '#i', $ext_preg ) ) { $ext_mimes[ $ext ] = $mime_match; break;
$type, $post = 0
Sortie :
@param bool|null $show Whether to show the button, or `null` to decide based @param bool|null $show Whether to show the button, or `null` to decide based @param stdClass[]|null $months An array of objects with `month` and `year` @param bool $infinite Whether the Media Library grid has infinite scrolling. @param array $settings List of media view settings. @param WP_Post $post Post object. @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript. @param WP_Post $post Post object. @param string $type Mime type. @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. @return WP_Post[] Array of media attached to the given post.
// Utilisation de la fonction get_attached_media
$result = get_attached_media($type, $post = 0);
if ($result) {
// Votre logique ici
}
Chargement des actualités...