What table is the media’s sort order stored?
This is the menu_order. You can sort by multiple values too. // Example ‘orderby’ => ‘title menu_order’
This is the menu_order. You can sort by multiple values too. // Example ‘orderby’ => ‘title menu_order’
What you’re asking for is functionally equivalent to scaling images to fit within a bounding square of each size, so could be achieved with this: add_image_size(‘big_xxl’, 4500, 4500); add_image_size(‘big_xl’, 3300, 3300); add_image_size(‘big’, 2100, 2100); add_image_size(‘medium’, 1250, 1250); Consider a landscape image that is 5000×500. These rules will generate images scaled to 4500, 3300, 2100 and … Read more
As mentioned in my comment(s), below the code as it imho should be.(tested and working) /** * Add new role: Writer * This role allows to: Add/Edit/Delete Posts and Uploads * * Read more: {@link https://codex.wordpress.org/Roles_and_Capabilities} * * Works with @version WP4.8.1 and below */ add_role( ‘writer’, ‘Writer’, array( ‘delete_posts’ => true, ‘delete_published_posts’ => true, … Read more
upload_tmp_dir is an optional setting in php.ini. Php will attempt to use the system default temp directory. So it should just work. If something happens to the permissions on your temp directory, regardless of wether you set it in php.ini or use the system default (usually /tmp on unix like systems), then media uploads will … Read more
Please see if Custom Upload Dir (WordPress Plugin) does the job for you. With that plugin you can configure the upload path based on numerous settings.
you can create a column of post_thumbnail like so: // ADDING THUMBNAIL TO EDIT SCREEN if ( !function_exists(‘fb_AddThumbColumn’) && function_exists(‘add_theme_support’) ) { // for post and page add_theme_support(‘post-thumbnails’, array( ‘post’, ‘page’ ) ); function fb_AddThumbColumn($cols) { $cols[‘thumbnail’] = __(‘Thumbnail’); return $cols; } function fb_AddThumbValue($column_name, $post_id) { $width = (int) 100; $height = (int) 100; if … Read more
You have to convert attachment variable to JSON object using toJSON() . Then you can its property. use attachment = frame.state().get(‘selection’).first().toJSON(); instead of attachment = frame.state().get(‘selection’).first();
There’re several filters that you can utilize: Custom column content If you got a custom column that you added with the “-filter, then you can use the manage_{$post->post_type}_posts_custom_column filter to alter the content. If you only want to target non-hierarchial post types then there’s as well the manage_posts_custom_column and for hierarchical ones, there’s manage_pages_custom_column. All … Read more
I would suggest using WP CLI for that. It’s the (in)official WordPress command line tool, like Drush for Drupal or the Symfony2 Console Component. Use the media command to handle your (future) attachments: wp media import <file> [–option=value*] * Take a look at the docs or the CLI help tool to see what options you … Read more
Uncheck this box: Setting/Media [ ] Organize my uploads into month- and year-based folders