Hot answers tagged

2

When you create an attachment, do the following: If attachments parent ID is for a post with an excluded post type, do nothing If it isn't in the list of excluded post types, assign it a tag in a hidden custom taxonomy e.g. function create_hidden_taxonomy() { register_taxonomy( 'hidden_taxonomy', 'attachment', array( ...


2

Media items are just like posts with post_type = attachment and post_status = inherit. when we are on upload.php page, we have two views: List View Grid View Grid view is populated via JavaScript and list view is extending normal WP_List_Table. Since it (List view) is using normal post query we can use pre_get_posts to alter the query to hide required ...


2

WordPress has some standard images thumbnail,medium,medium_large,large for which image sizes you can set it under Settings --> Media except medium_large size whose default height set to 768px ( medium_large is available from WP4.4). So when you set 0 to in the media settings it won't generate thumbnail,medium size,large size images and it didn't as far ...


2

That area of all admin screens is where admin notices are displayed, so you could generate an admin notice. Here's a suitable function and hook: function wpse_233031_admin_notice() { ?> <div class="notice notice-info"> <p>Your message here!</p> </div> <?php } function wpse_233031_hook_admin_notice() { ...


1

I found the problem :) Actually this is my friend's website. I don't have any idea how he changed the upload dir but I noticed that there is no define( 'UPLOADS', ''.'uploads' ); in his wp-config.php file. I added it and it's now working perfectly. I hope this helps other people who will facing this problem.



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