This filter is documented in wp-admin/includes/media.php $possible_sizes = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __( 'Thumbnail' ), 'medium' => __( 'Medium' ), 'large' => __( 'Large' ), 'full' => __( 'Full Size' ), ) ); unset( $possible_sizes['full'] ); /* Loop through all potential sizes that may be chosen. Try to do this with some efficiency. First: run the image_downsize filter. If it returns something, we can use its data. If the filter does not return something, then image_downsize() is just an expensive way to check the image metadata, which we do second. foreach ( $possible_sizes as $size => $label ) { This filter is documented in wp-includes/media.php $downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size ); if ( $downsize ) { if ( empty( $downsize[3] ) ) { continue;
$args = array(
Sortie :
@param array $response Array of prepared attachment data. See {@see wp_prepare_attachment_for_js()}.
@param WP_Post $attachment Attachment object.
@param array|false $meta Array of attachment meta data, or false if there is none.
@param array $args {
// Utilisation de la fonction wp_enqueue_media
$result = wp_enqueue_media($args = array();
if ($result) {
// Votre logique ici
}
Chargement des actualités...