Tag Info

Hot answers tagged

2

You can adjust the attachment query in the media library popup, through the ajax_query_attachments_args filter. Here are two PHP 5.4+ examples: Example #1: Show only attachments that where uploaded during the last 24 hours: /** * Media Library popup * - Only display attachments uploaded during the last 24 hours: */ add_filter( ...


1

Add the filter "ajax_query_attachments_args" in this way and URLs variables are sent to the class WP_Query the default is to send array(7) { ["orderby"]=> string(4) "date" ["order"]=> string(4) "DESC" ["posts_per_page"]=> string(2) "40" ["paged"]=> string(1) "1" ["post_type"]=> string(10) ...


1

Here are two filter examples: add_action( 'pre-upload-ui', function() { ?><h4><?php _e( 'Please Remember This And That! (pre-upload-ui)' );?></h4><?php }); add_action( 'post-upload-ui', function() { ?><h4><?php _e( 'Please Remember This And That! (post-upload-ui)' );?></h4><?php }); You might ...


1

You're close - couple of things: $field is an array representation of the field, so you need to use $field['name'] which is the name of the field. get_field will format the value unless you set the third argument to false - we want the ID, not the post object/URL (or whatever setting you configured for your field return value) Your code won't delete the ...


1

We can add the Featured option as a fake mime-type with: add_filter( 'media_view_settings', function( $settings ) { $settings['mimeTypes']['wpsefeaturedimage'] = 'Featured'; return $settings; }); It will show up like this: Then we can use the posts_where filter and check for our fake mime type: /** * Filter for featured images in the media ...



Only top voted, non community-wiki answers of a minimum length are eligible