How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?

I’m new to WordPress so please be patient! I’ve created a template in html5/ccs3 and am in the process of trying to make a wordpress template out of it. In my navigation menu (in html) I have a social menu that opens 3 different modals: <social-icons> <div class=”navbar-collapse collapse”> <div class=”btn-group nav navbar-nav navbar-right” role=”group”> … Read more

Add control in image detail panel

I am trying to add a checkbox control in the image details popup (when editing image in a post). I have added the following code in my template function.php but I can’t manage to display the checkbox in the popup. What am I missing? function bluesolutions_customize_register($wp_customize) { $wp_customize->add_section(‘bluesolutions_use_lighbox_section’, array( ‘title’ => __(‘Lightbox’, ‘mytheme’), ‘description’ => … Read more

Refresh wp.media after ajax call

I’m building a plugin where I add a tab to the media manager and can add stuff from another source. I add the tab with this, which generates a iframe: add_filter(‘media_upload_tabs’, ‘add_myUpload_tab’); function add_myUpload_tab($tabs) { $tabs[‘myTab’] = “My tab”; Return $tabs; } add_action(‘media_upload_myTab’, ‘add_myUpload_save_page’); function add_myUpload_save_page() { wp_iframe( ‘myTab_save_frame’ ); } function myTab_save_frame() { echo … Read more

Disable media library tab for non admins in uploader screen

I am developing a plugin in which i am required to allow front end users to upload media, which I am able to do. But I don’t want to let them sneak into media library which comes as tab with uploader screen. I tried the following function remove_medialibrary_tab($tabs) { if ( !current_user_can( ‘administrator’ ) ) … Read more

Modifying the media-template.php file, the right way?

The shortcode accepts the columns=”0″ as an attribute so that it doesn’t insert any breaks in the HTML between gallery items, however this option is not available in Gallery Settings interface (“Add Media” pop-up when editing pages/posts). I’ve located the code in wp-includes\media-template.php line 396 to 406; <label class=”setting”> <span><?php _e(‘Columns’); ?></span> <select class=”columns” name=”columns” … Read more

Filter media library items by size

I want to prevent users from being able to set a Featured Image from the media library if its width is less than 100px. Originally I thought to use the ajax_query_attachments_args filter, but it filters a WP_Query() object which effectively cannot be used for this purpose because the meta_query‘s meta_key—which is _wp_attachment_metadata—contains serialized data. This … Read more