Support

Account

Forum Replies Created

  • A little late here, but an easy JS solution I created is this:

    
    jQuery(function(){
    	function parseHash(){var hash=window.location.hash.substring(1),params={};if(hash.length<5){return params;}var vars=hash.split('&');for(var i=0;i<vars.length;i++){if(!vars[i]){continue;}var pair=vars[i].split('=');if(pair.length<2){continue;}params[pair[0]]=pair[1];}return params;},
    	var hashData=parseHash();
    	if(hashData&&hashData.acf_tab){jQuery('a.acf-tab-button[data-key="'+hashData.acf_tab+'"]').trigger('click');jQuery('form#post').attr('action','#&acf_tab='+hashData.acf_tab);}
    	jQuery('a.acf-tab-button').on('click',function(event){window.location.hash='&acf_tab='+jQuery(this).data('key');jQuery('form#post').attr('action','#&acf_tab='+jQuery(this).data('key'));});
    });
    

    Just add that anywhere in the admin area of your site through an action/filter. Here’s an example of that for your functions.php file:

    
    add_action( 'admin_enqueue_scripts', array(__CLASS__,function(){
    	wp_enqueue_script( 'psAdminCustom', get_template_directory_uri() . '/admin/custom.js', array(), '2.0.0', false );
    } ) );
    
Viewing 1 post (of 1 total)