conditionally load javascript & CSS for do_action() calls from plugin

And…. the answer was actually correct, if you are using the correct functions. As Milo pointed out, it’s wp_enqueue_script not scripts. add_action(‘wp_footer’, ‘print_my_script’); function print_my_script() { if(did_action(‘my_custom_action’)) { wp_enqueue_script(‘listings’); wp_enqueue_script(‘isotope’); } } Hopefully this helps someone else in need!

get_query_var not works

Your filter: function add_query_vars_filter( $vars ){ $vars[] = “getvar”; return $vars; } add_filter( ‘query_vars’, ‘add_query_vars_filter’ ); Is correct. When WordPress starts assembling the list of query variables, this function will add ‘getvar’ to the list. But then you immediately check if the variable is set before it reaches that point. The query_vars filter hasn’t happened … Read more

Sub Menu content is being duplicated

I was using the same page name for both. You can see in this snippet that I used “BCRM” and I didn’t realize it. add_submenu_page( __FILE__, ‘BCRM Customer Settings’, ‘Customer Settings’, ‘administrator’, ‘**BCRM**’, ‘bcrm_customer_settings_page’); add_submenu_page( __FILE__, ‘BCRM Form Settings’, ‘Form Settings’, ‘administrator’, ‘**BCRM**’, ‘bcrm_form_settings_page’); I changed them to BCRM_customers and BCRM_forms respectively and it is … Read more