Change default screen option value for media items per page (in media library)
You need upload_per_page: add_filter( ‘get_user_option_edit_upload_per_page’, ‘my_edit_per_page’, 10, 3 );
You need upload_per_page: add_filter( ‘get_user_option_edit_upload_per_page’, ‘my_edit_per_page’, 10, 3 );
You are indeed correct, before the admin update(i imagine the UI redesign, etc), unsetting items from the menus would in effect prevent access to those pages, that’s clearly changed now and requires additional cap checking. This isn’t something i’ve looked into myself(as i’ve just found out this moment), so i can’t speak about methods for … Read more
Modified version of a piece of code found in this tutorial. add_filter(‘media_row_actions’, ‘wpse_30159_qe_download_link’, 10, 2); function wpse_30159_qe_download_link($actions, $post) { /* Almost sure this is not necessary. Just in case… */ global $current_screen; if ( ‘upload’ != $current_screen->id ) return $actions; // if not PDF file, return default $actions if ( ‘application/pdf’ != $post->post_mime_type ) return … Read more
I was able to answer this via help from a great plugin editor. This solution doesn’t reorder the select box but instead forces it to only load the “Uploaded to this Post” media by default. I used some of the JS from this post to get the select box to change. I had some help … Read more
A quick look at the media page with Firebug shows that this CSS statement will allow you to change the size of the picture: .media-frame-content[data-columns=”9″] .attachment { width: 11.11%; } Change the ‘width’ value to something different, with the understanding that the change may affect how the page looks on different size screens. You should … Read more
Yep, it’s curious that adding the extra parameters doesn’t works… I know that Adminimize does that. Looking at its code, that’s what it does: wp_deregister_script( ‘media-upload’ ); wp_enqueue_script( ‘media-upload’, WP_PLUGIN_URL . “https://wordpress.stackexchange.com/” . FB_ADMINIMIZE_BASEFOLDER . ‘/js/tb_window.js’, array( ‘thickbox’ ) ); And this is the tb_window.js file: // send html to the post editor function send_to_editor(h) … Read more
Since you know the location of the image on the disk you can use wp_insert_attachment to insert your big image to the media library. By default this will generate also several smaller versions of the big image that you might not need but this is the easiest way to make all the media related plugins … Read more
640px is the content size set in your functions.php. Here is an example of the content width set in the bundled theme twentyfourteen in twentyfourteen/functions.php#L28 if ( ! isset( $content_width ) ) { $content_width = 474; } In this example, the image size will be 474 px. The content size will be the size used … Read more
I use the Media Library Categories plugin to add categories. It does a wonderful job of adding category functionality, but the code could be improved upon and custom implementation requires some knowledge of PHP, as it only provides you with a shortcode and no documentation. This Question, maybe be able to help you if you … Read more
WordPress has an hook for save meta data an attachment; an small example; like the post_data on save posts. // Construct the attachment array $attachment = array_merge( array( ‘post_mime_type’ => $type, ‘guid’ => $url, ‘post_parent’ => $post_id, ‘post_title’ => $title, ‘post_content’ => $content, ), $post_data ); // Save the data $id = wp_insert_attachment($attachment, $file, $post_id); … Read more