Forums › Forums › Search & Filter Pro › Some issues using plugin backend
- This topic has 18 replies, 3 voices, and was last updated 9 years, 2 months ago by
Anonymous.
-
Trevor(Private) January 25, 2017 at 8:12 am #85175
Hey Christian. It should not go into that file. It should go into your child theme functions.php file (I usually put new scripts at the end).
Putting it in the file you have will be overwritten with the next WP update, and putting it in the main theme functions.php will be overwritten at the next theme update.
It may be that you have to experiment with changing the priority number (11 in the sample code) to higher or lower to see.
Trevor(Private) January 25, 2017 at 8:27 am #85181I think I see the error. There is a hyphen missing in the script name, so try this:
function remove_caldera_from_search_filter($hook) { $search_filter_admin_screens = array("edit-search-filter-widget", "search-filter-widget", "search-filter_page_search-filter-settings", "search-filter_page_search-filter-licence-settings", "search-filter_page_search-filter-system-status" ); $screen = get_current_screen(); if(in_array($screen->id, $search_filter_admin_screens)) {//we are on S&F admin so remove caldera JS to avoid conflict wp_deregister_script("caldera-forms–-shortcode-insert"); } } add_action( 'admin_enqueue_scripts', 'remove_caldera_from_search_filter', 11 );It is this line:
wp_deregister_script("caldera-forms–shortcode-insert");should be this:
wp_deregister_script("caldera-forms–-shortcode-insert");Trevor(Private) January 25, 2017 at 8:50 am #85195Interesting. The github support request you made has the double dash/hyphen, but this page does not:
https://calderaforms.com/doc/remove-caldera-forms-shortcode-button-post-editor/
It also says that you should remove the button as well.
function remove_caldera_from_search_filter() { $search_filter_admin_screens = array("edit-search-filter-widget", "search-filter-widget", "search-filter_page_search-filter-settings", "search-filter_page_search-filter-licence-settings", "search-filter_page_search-filter-system-status" ); $screen = get_current_screen(); if(in_array($screen->id, $search_filter_admin_screens)) {//we are on S&F admin so remove caldera JS to avoid conflict wp_deregister_script("caldera-forms–shortcode-insert"); } } add_action( 'admin_enqueue_scripts', 'remove_caldera_from_search_filter', 15 );Let’s try it without the $hook
-
AuthorPosts