Support

Account

Home Forums Feature Requests Ability to Link to Specific Tabs on Options Page Reply To: Ability to Link to Specific Tabs on Options Page

  • I am doing this on some of my sites with the following code. YMMV performance wise having this inline, in an enqueued file, etc depending on the specific implementation:

    
    add_action( "admin_footer", "acf_link_to_tab" );
    function acf_link_to_tab(){ ?>
    	<script>
    	(function($){
    		acf.add_action('ready', function(){
    			if (location.hash.length>1){	
    				var hash = location.hash.substring(1);
    				$('.acf-tab-wrap .acf-tab-button').each(function(i, button){ 
    					if (hash==$(button).text().toLowerCase().replace(' ', '-')){
    						$(button).trigger('click');
    						return false;
    					}
    				});
    			}
    		});
    	})(jQuery);
    	</script><?php	
    }