public function beforeFilter()
 {
     add_action('woocommerce_before_checkout_form', array($this, 'show_notification_if_cart_exceeded'));
     add_filter('woocommerce_payment_complete_order_status', array($this, 'payment_complete_order_status'));
     add_filter('woocommerce_available_payment_gateways', array($this, 'remove_bank_transfer_if_customer'));
     add_action('woocommerce_thankyou_bacs', array($this, 'complete_order_if_admin'));
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     add_filter('gform_pre_render_5', array($this, 'form_render'), 12);
     add_filter('gform_pre_validation_5', array($this, 'form_render'));
     add_filter('gform_pre_submission_filter_5', array($this, 'form_render'));
     add_filter('gform_admin_pre_render_5', array($this, 'form_render'));
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     add_action('after_post_archive_title', array($this, 'after_post_archive_title'));
     add_action('archive_detail_post_display_meta', array($this, 'archive_detail_post_display_meta'));
     add_action('archive_loop_post_display_meta', array($this, 'archive_loop_post_display_meta'));
     add_filter('the_content', array($this, 'ext_link_to_new_tab'));
     add_filter('the_excerpt', array($this, 'ext_link_to_new_tab'));
     parent::beforeFilter();
 }
 public static function get_scripts()
 {
     if (is_user_logged_in()) {
         self::$scripts = array_merge(self::$scripts, ['parties/mustache.min.js', 'parties/gsap.min.js', 'parties/jquery.selectric.min.js', 'parties/jquery.qtip.min.js', ['file' => 'app.min.js', 'localize' => ['name' => 'myAjax', 'data' => ['ajax_url' => admin_url('admin-ajax.php'), 'current_user_id' => get_current_user_id(), 'themeDir' => THEME_DIR]]]]);
     } else {
         self::$scripts = array_merge(self::$scripts, [['file' => 'login.min.js', 'localize' => ['name' => 'myAjax', 'data' => ['ajax_url' => admin_url('admin-ajax.php'), 'current_user_id' => get_current_user_id(), 'themeDir' => THEME_DIR]]]]);
     }
     return parent::get_scripts();
 }
 public static function get_scripts()
 {
     $exploded_string = explode('@', get_field('google_map', 'option'));
     $further_exploded_string = explode(',', $exploded_string[1]);
     $latitude = $further_exploded_string[0];
     $longitude = $further_exploded_string[1];
     self::$scripts[] = ['file' => 'map.js', 'localize' => ['name' => 'map', 'data' => ['lon' => $longitude, 'lat' => $latitude, 'icon' => THEME_DIR . '/img/pin.png']]];
     return parent::get_scripts();
 }
 public function beforeFilter()
 {
     remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
     remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
     add_action('woocommerce_before_main_content', array($this, 'display_product_block'));
     remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end');
     add_filter('woocommerce_product_description_heading', '__return_false');
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     wpkit()->ajax('user_login', array($this, 'user_login'));
     wpkit()->ajax('validate_user_email', array($this, 'validate_user_email'));
     wpkit()->ajax('user_accept_notifications', array($this, 'user_accept_notifications'), false);
     wpkit()->ajax('user_action_event', array($this, 'user_action_event'), false);
     wpkit()->ajax('user_get_unactioned_events', array($this, 'user_get_unactioned_events'), false);
     wpkit()->ajax('user_like_post', array($this, 'user_like_post'), false);
     wpkit()->ajax('user_unlike_post', array($this, 'user_unlike_post'), false);
     add_filter('show_admin_bar', array($this, 'show_admin_bar'));
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     add_action('acf/save_post', array($this, 'invite_users'), 10, 2);
     add_action('after_event_archive_title', array($this, 'archive_detail_event_display_meta'));
     add_action('archive_loop_event_display_meta', array($this, 'archive_loop_event_display_meta'));
     add_action('gform_pre_render_5', array($this, 'populate_user_events_field'));
     add_action('gform_after_submission_7', array($this, 'user_accept_event'), 1);
     add_action('gform_after_submission_12', array($this, 'user_decline_event'), 1);
     add_action('gform_after_submission_5', array($this, 'user_feedback_event'), 1);
     add_action('gform_field_value_first_event', array($this, 'first_event_id'), 1);
     add_action('gform_replace_merge_tags', array($this, 'replace_event_info'), 10, 7);
     add_action('gform_custom_merge_tags', array($this, 'custom_event_merge_tags'), 10, 4);
     add_action('index_args_event', array($this, 'index_args'));
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
     remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20);
     remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar');
     add_action('woocommerce_before_main_content', array($this, 'display_featured_products'), 20);
     add_filter('woocommerce_show_page_title', '__return_false');
     remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20);
     remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30);
     remove_action('woocommerce_after_shop_loop', 'woocommerce_pagination');
     remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
     remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end');
     remove_action('woocommerce_before_shop_loop', 'wc_print_notices');
     remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end');
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     add_filter('gform_form_settings', array($this, 'form_terms_settings'), 10, 2);
     add_filter('gform_pre_form_settings_save', array($this, 'save_form_terms_settings'));
     add_filter('gform_username', array($this, 'clean_username'), 10, 4);
     add_filter('gform_field_content', array($this, 'upload_field_setting_button_text'), 10, 3);
     add_action('gform_pre_render', array($this, 'display_terms_popup'));
     add_filter('gform_file_upload_markup', array($this, 'upload_field_upload_markup'), 10, 4);
     add_filter('gform_ajax_spinner_url', array($this, 'replace_gforms_spinner'));
     add_filter('gform_submit_button', array($this, 'form_submit_button'), 10, 2);
     add_filter('gform_field_css_class', array($this, 'nesting_custom_class'), 10, 3);
     add_filter('gform_field_content', array($this, 'nesting_display_field'), 20, 5);
     add_filter('gform_get_form_filter', array($this, 'custom_markup'), 20, 2);
     add_filter('gform_init_scripts_footer', '__return_true');
     add_filter('gform_validation_message', array($this, 'change_message'), 10, 2);
     parent::beforeFilter();
 }
 public static function get_scripts()
 {
     if ($postcode = get_user_meta(get_current_user_id(), 'billing_postcode', true)) {
         $long_lang = json_decode(file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyDRgQenEbBj0BF-QBdCfVDOPnWGClYX5W8&v=3&address=' . urlencode($postcode)));
         if ($long_lang && count($long_lang->results) > 0) {
             $longitude = $long_lang->results[0]->geometry->location->lng;
             $latitude = $long_lang->results[0]->geometry->location->lat;
         }
     } else {
         $exploded_string = explode('@', get_field('google_map', 'option'));
         $further_exploded_string = explode(',', $exploded_string[1]);
         $latitude = $further_exploded_string[0];
         $longitude = $further_exploded_string[1];
     }
     self::$scripts[] = ['file' => 'map.js', 'localize' => ['name' => 'map', 'data' => ['lon' => $longitude, 'lat' => $latitude, 'icon' => THEME_DIR . '/img/pin.png']]];
     return parent::get_scripts();
 }
 public function beforeFilter()
 {
     add_filter('acf/update_value/name=welcome_message', array($this, 'set_welcome_id'), 10, 3);
     add_action('admin_menu', array($this, 'change_post_menu_label'));
     add_filter('wpmu_signup_user_notification_subject', array($this, 'signup_user_notification_subject'), 10, 5);
     add_filter('wpmu_signup_user_notification_email', array($this, 'signup_user_notification_email'), 10, 5);
     global $wp_post_types;
     $labels =& $wp_post_types['post']->labels;
     $labels->name = 'News';
     $labels->singular_name = 'News';
     $labels->add_new = 'Add News';
     $labels->add_new_item = 'Add News';
     $labels->edit_item = 'Edit News';
     $labels->new_item = 'News';
     $labels->view_item = 'View News';
     $labels->search_items = 'Search News';
     $labels->not_found = 'No News found';
     $labels->not_found_in_trash = 'No News found in Trash';
     parent::beforeFilter();
 }
 public function beforeFilter()
 {
     // maybe you'd like to set authentication
     auth(array('form' => array('page' => 'login', 'allow' => array('login', 'reset'), 'force' => true)));
     // some generic filters and actions across the whole site
     add_filter('style_loader_src', array($this, 'remove_cssjs_ver'), 10, 2);
     add_filter('script_loader_src', array($this, 'remove_cssjs_ver'), 10, 2);
     add_filter('the_content', array($this, 'fix_shortcodes'));
     add_filter('the_excerpt', array($this, 'adjust_excerpt'));
     add_filter('wp_title', array($this, 'theme_name_wp_title'), 10, 2);
     remove_action('wp_head', 'print_emoji_detection_script', 7);
     remove_action('admin_print_scripts', 'print_emoji_detection_script');
     remove_action('wp_print_styles', 'print_emoji_styles');
     remove_action('admin_print_styles', 'print_emoji_styles');
     remove_filter('the_content_feed', 'wp_staticize_emoji');
     remove_filter('comment_text_rss', 'wp_staticize_emoji');
     remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
     add_filter('tiny_mce_plugins', array($this, 'disable_emojis_tinymce'));
     add_filter('wp_calculate_image_srcset', '__return_false');
     add_filter('script_loader_tag', array($this, 'clean_script_tag'));
     parent::beforeFilter();
 }
 public function getScripts()
 {
     wp_enqueue_script('jquery');
     $this->scripts[] = ['file' => 'app.min.js', 'localize' => ['name' => 'myAjax', 'data' => ['ajaxurl' => admin_url('admin-ajax.php')]]];
     return parent::getScripts();
 }
 /**
  * Initialization hook method.
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
 }
 public function getScripts()
 {
     $this->scripts['map']['localize'] = ['name' => 'locations', 'data' => get_congregations()];
     return parent::getScripts();
 }
 /**
  * get_scripts static method.
  *
  * @return Array
  */
 public static function get_scripts()
 {
     return parent::get_scripts();
 }
 public function beforeFilter()
 {
     add_action('login_form_lostpassword', array($this, 'redirect_to_custom_lostpassword'));
     parent::beforeFilter();
 }