Way to display media library in frontend

As far I’ve understood with those I’ve written a simple system for you. Please put the below codes in your functions.php– add_action( ‘wp_enqueue_scripts’, ‘the_dramatist_enqueue_scripts’ ); add_filter( ‘ajax_query_attachments_args’, ‘the_dramatist_filter_media’ ); add_shortcode( ‘the_dramatist_front_upload’, ‘the_dramatist_front_upload’ ); /** * Call wp_enqueue_media() to load up all the scripts we need for media uploader */ function the_dramatist_enqueue_scripts() { wp_enqueue_media(); wp_enqueue_script( ‘some-script’, … Read more

Moving Categories submenu to Media, but still opens Posts menu

To add to what @brasofilo answered 3 years ago, this is what is necessary in the current menu system (WP v4.5.1). add_action( ‘admin_head-edit-tags.php’, ‘modify_menu_highlight_wpse_43839’ ); function modify_menu_highlight_wpse_43839() { if( ‘post_tag’ == $_GET[‘taxonomy’] ) { ?> <script type=”text/javascript”> jQuery(document).ready( function($) { $(“#menu-posts, #menu-posts a”) .removeClass(‘wp-has-current-submenu’) .removeClass(‘wp-menu-open’) .addClass(‘wp-not-current-submenu’); $(“#menu-media, #menu-media > a”) .addClass(‘wp-has-current-submenu’); }); </script> <?php } … Read more

How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page

The current screen doesn’t appear to be set when that filter is run, so you cannot use that. Also, the $post actually refers to the attachment, not the post – so we can’t get the post typ fro that either…. So looking at the source code: http://core.trac.wordpress.org/browser/tags/3.3.2/wp-admin/includes/media.php The filter you are using is called by … Read more

Increase Size Limit of Media Files WordPress 4.1

The limiting factor appears to be in your .htaccess file: php_value post_max_size 1M The post_max_size needs to be at least equal to the upload_max_filesize, so increase that to 100M. The settings in .htaccess should override the settings in php.ini. Edit: If that doesn’t work, and since you have full root privileges, you can modify the … Read more

How to set additional parameter in wp.media?

I’ve been searching for this answer too and found it using this answer. You just need to add a property to the library object: var wpMedia = wp.media.frames.file_frame = wp.media({ ‘library’: { type: ‘image’, custom_var: ‘webhead’ }, ‘multiple’: true }); Then in PHP you can see the custom variable in the ajax_query_attachments_args hook like so: … Read more

How to extend Media Library (WP 4.4)

It’s not a tab but you might be able to get started with an upload button. Check out pre-upload-ui and some actions that follow. Namely pre-plupload-upload-ui and post-upload-ui. This will add a couple buttons to the ‘Upload Files‘ tab and to ‘Media > Add New‘. BUTTONS add_action( ‘pre-plupload-upload-ui’, ‘wpse_20160202_pre_plupload_upload_ui’ ); add_action( ‘post-upload-ui’, ‘wpse_20160202_post_upload_ui’ ); function … Read more

Restrict the number of images to upload per post

I won’t go into the code specifics right now, because I am not sure if you need me to. You essentially need to modify the SWFUpload JavaScript settings array to set the file_upload_limit to 1. Unfortunately I don’t believe SWFUpload allows you to change that settings variable after it has been inited, because it has … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)