How can I run shortcode after click with ajax

You should try to replace the following jQuery part: action: ‘process_shortcode_on_tab_click’ with this one: action: ‘process_shortcode_on_tab_click_action’ to match your wp_ajax_process_shortcode_on_tab_click_action and wp_ajax_nopriv_process_shortcode_on_tab_click_action actions. Check for example the Codex on how to name the custom wp_ajax_$youraction hook.

custom tabs in media uploader

found it. in the automattic SVN for media.php i found the media_upload_header() function, and the only thing left to do is to echo it in the last function: function media_upload_ell_gmap_form() { echo media_upload_header(); ?> <h2>HTML Form</h2> <?php } that’s it.

Remove tabs from media uploader for a CPT

You can use the media_upload_tabs filter check for your post type and unset any tab you don’t want ex: function remove_media_library_tab($tabs) { if (isset($_REQUEST[‘post_id’])) { $post_type = get_post_type($_REQUEST[‘post_id’]); if (‘premium’ == $post_type) unset($tabs[‘library’]); unset($tabs[‘type_url’]); } return $tabs; } add_filter(‘media_upload_tabs’, ‘remove_media_library_tab’);

Switch to the library tab in the media uploader

After struggling around for days through the poorly documented media modal source code and using code from the gist (thanks, Fabien), I came up with a solution: JS: wp.media.controller.Custom = wp.media.controller.State.extend({ initialize: function(){ this.props = new Backbone.Model({ custom_data: ” }); this.props.on( ‘change:custom_data’, this.refresh, this ); }, refresh: function() { this.frame.toolbar.get().refresh(); }, // called when the … Read more

How do I change tab size in Vim?

Expanding on zoul’s answer: If you want to setup Vim to use specific settings when editing a particular filetype, you’ll want to use autocommands: This will make it so that tabs are displayed as 4 spaces. Setting expandtab will cause Vim to actually insert spaces (the number of them being controlled by tabstop) when you press tab; you … Read more

Open link in new tab or window [duplicate]

You should add the target=”_blank” and rel=”noopener noreferrer” in the anchor tag. For example: Adding rel=”noopener noreferrer” is not mandatory, but it’s a recommended security measure. More information can be found in the links below. Source: MDN | HTML element <a> | attribute target About rel=noopener Opens External Anchors Using rel=”noopener”