PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / square / controllers / FrmSquareLiteHooksController.php

FrmSquareLiteHooksController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at square/controllers/FrmSquareLiteHooksController.php

54 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 class FrmSquareLiteHooksController {
7
8 /**
9 * @return void
10 */
11 public static function load_hooks() {
12 add_action( 'frm_enqueue_form_scripts', 'FrmSquareLiteActionsController::maybe_load_scripts' );
13 add_filter( 'frm_validate_credit_card_field_entry', 'FrmSquareLiteActionsController::remove_cc_validation', 20, 3 );
14
15 add_filter( 'frm_payment_gateways', 'FrmSquareLiteAppController::add_gateway' );
16
17 add_action( 'init', 'FrmSquareLiteConnectHelper::check_for_redirects' );
18
19 // Use 20 so this happens after the Stripe add-on.
20 add_filter( 'frm_pro_show_card_callback', 'FrmSquareLiteActionsController::maybe_show_card', 20, 2 );
21 }
22
23 /**
24 * @return void
25 */
26 public static function load_admin_hooks() {
27 add_filter( 'frm_add_settings_section', 'FrmSquareLiteSettingsController::add_settings_section' );
28 add_action( 'frm_update_settings', 'FrmSquareLiteSettingsController::process_form' );
29 add_action( 'frm_action_settings_before_action_name', 'FrmSquareLiteAppController::maybe_show_address_type_warning' );
30
31 if ( defined( 'DOING_AJAX' ) ) {
32 self::load_ajax_hooks();
33 }
34 }
35
36 /**
37 * @return void
38 */
39 private static function load_ajax_hooks() {
40 add_action( 'wp_ajax_frm_square_oauth', 'FrmSquareLiteAppController::handle_oauth' );
41 add_action( 'wp_ajax_frm_square_disconnect', 'FrmSquareLiteAppController::handle_disconnect' );
42
43 add_action( 'wp_ajax_frm_verify_buyer', 'FrmSquareLiteAppController::verify_buyer' );
44 add_action( 'wp_ajax_nopriv_frm_verify_buyer', 'FrmSquareLiteAppController::verify_buyer' );
45
46 $frm_square_events_controller = new FrmSquareLiteEventsController();
47 add_action( 'wp_ajax_nopriv_frm_square_process_events', array( &$frm_square_events_controller, 'process_events' ) );
48 add_action( 'wp_ajax_frm_square_process_events', array( &$frm_square_events_controller, 'process_events' ) );
49
50 // Verify Square Lite sites.
51 add_action( 'wp_ajax_nopriv_frm_square_lite_verify', 'FrmSquareLiteConnectHelper::verify' );
52 }
53 }
54