PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 2.33
Strong Testimonials v2.33
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / admin / views-ajax.php
strong-testimonials / admin Last commit date
about 7 years ago css 7 years ago img 8 years ago js 7 years ago menu 8 years ago partials 7 years ago scss 7 years ago settings 7 years ago admin-notices.php 8 years ago admin.php 7 years ago class-strong-testimonials-admin-category-list.php 8 years ago class-strong-testimonials-admin-list.php 7 years ago class-strong-testimonials-admin-scripts.php 8 years ago class-strong-testimonials-defaults.php 7 years ago class-strong-testimonials-help.php 8 years ago class-strong-testimonials-list-table.php 7 years ago class-strong-testimonials-page-shortcodes.php 7 years ago class-strong-testimonials-post-editor.php 7 years ago class-strong-testimonials-updater.php 7 years ago class-strong-views-list-table.php 8 years ago class-walker-strong-category-checklist.php 7 years ago class-walker-strong-form-category-checklist.php 7 years ago compat.php 8 years ago custom-fields-ajax.php 8 years ago custom-fields.php 7 years ago form-preview.php 8 years ago view-list-order.php 8 years ago views-ajax.php 7 years ago views-validate.php 7 years ago views.php 7 years ago
views-ajax.php
120 lines
1 <?php
2 /**
3 * Views Ajax Functions
4 */
5
6
7 /**
8 * Check for forced options.
9 *
10 * @since 1.25.0
11 */
12 function wpmtst_force_check() {
13 $atts = array( 'template' => $_REQUEST['template'] );
14 $force = WPMST()->templates->get_template_config( $atts, 'force', false );
15 if ( $force ) {
16 wp_send_json_success( (array) $force );
17 }
18 wp_send_json_error();
19 }
20 add_action( 'wp_ajax_wpmtst_force_check', 'wpmtst_force_check' );
21
22
23 /**
24 * [Add New Field] Ajax receiver
25 *
26 * @since 1.21.0
27 */
28 function wpmtst_view_add_field_function() {
29 $new_key = (int) $_REQUEST['key'];
30 $empty_field = array( 'field' => '', 'type' => 'text', 'class' => '' );
31 wpmtst_view_field_inputs( $new_key, $empty_field, true );
32 wp_die();
33 }
34 add_action( 'wp_ajax_wpmtst_view_add_field', 'wpmtst_view_add_field_function' );
35
36
37 /**
38 * [Field Type: Link] Ajax receiver
39 *
40 * @since 1.21.0
41 */
42 function wpmtst_view_add_field_link_function() {
43 $key = (int) $_REQUEST['key'];
44 $field_name = $_REQUEST['fieldName'];
45 $type = $_REQUEST['fieldType'];
46 $empty_field = array( 'url' => '', 'link_text' => '', 'new_tab' => true );
47 wpmtst_view_field_link( $key, $field_name, $type, $empty_field );
48 wp_die();
49 }
50 add_action( 'wp_ajax_wpmtst_view_add_field_link', 'wpmtst_view_add_field_link_function' );
51
52
53 /**
54 * [Field name change] Ajax receiver
55 *
56 * @since 1.24.0
57 */
58 function wpmtst_view_get_label_function() {
59 $field = array( 'field' => $_REQUEST['name'] );
60 $label = wpmtst_get_field_label( $field );
61 echo $label;
62 wp_die();
63 }
64 add_action( 'wp_ajax_wpmtst_view_get_label', 'wpmtst_view_get_label_function' );
65
66
67 /**
68 * [Field Type: Date] Ajax receiver
69 *
70 * @since 1.21.0
71 */
72 function wpmtst_view_add_field_date_function() {
73 $key = (int) $_REQUEST['key'];
74 $empty_field = array( 'format' => '' );
75 wpmtst_view_field_date( $key, $empty_field );
76 wp_die();
77 }
78 add_action( 'wp_ajax_wpmtst_view_add_field_date', 'wpmtst_view_add_field_date_function' );
79
80
81 /**
82 * Fetch the view mode description.
83 *
84 * @since 2.22.0
85 */
86 function wpmtst_view_get_mode_description() {
87 $mode = $_REQUEST['mode'];
88 $options = get_option( 'wpmtst_view_options' );
89 if ( isset( $options['mode'][ $mode ]['description'] ) ) {
90 echo $options['mode'][ $mode ]['description'];
91 }
92 wp_die();
93 }
94 add_action( 'wp_ajax_wpmtst_view_get_mode_description', 'wpmtst_view_get_mode_description' );
95
96
97 /**
98 * Get background color presets in View editor.
99 */
100 function wpmtst_get_background_preset_colors() {
101 $preset = wpmtst_get_background_presets( $_REQUEST['key'] );
102 echo json_encode( $preset );
103 wp_die();
104 }
105 add_action( 'wp_ajax_wpmtst_get_background_preset_colors', 'wpmtst_get_background_preset_colors' );
106
107
108 /**
109 * [Restore Default Breakpoints] Ajax receiver.
110 *
111 * @since 2.32.2
112 */
113 function wpmtst_restore_default_breakpoints_function() {
114 $options = Strong_Testimonials_Defaults::get_default_view();
115 $breakpoints = $options['slideshow_settings']['breakpoints'];
116 echo json_encode( $breakpoints );
117 wp_die();
118 }
119 add_action( 'wp_ajax_wpmtst_restore_default_breakpoints', 'wpmtst_restore_default_breakpoints_function' );
120