Version Description
Download this release
Release Info
Developer | giucu91 |
Plugin | Strong Testimonials |
Version | 2.50.1 |
Comparing to | |
See all releases |
Code changes from version 2.50.0 to 2.50.1
- admin/class-strong-testimonials-admin-scripts.php +21 -10
- admin/class-strong-testimonials-defaults.php +11 -8
- admin/class-strong-testimonials-updater.php +0 -7
- admin/class-strong-testimonials-upsell.php +80 -78
- admin/class-strong-views-list-table.php +71 -32
- admin/custom-fields.php +3 -3
- admin/js/admin-fields.js +1 -1
- admin/js/admin-order.js +2 -1
- admin/menu/class-strong-testimonials-menu-fields.php +1 -1
- admin/settings/class-strong-testimonials-form.php +99 -0
- admin/settings/class-strong-testimonials-settings-form.php +4 -4
- admin/settings/class-strong-testimonials-settings-general.php +6 -6
- admin/settings/partials/general.php +1 -1
- admin/views.php +28 -18
- changelog.txt +7 -0
- includes/class-strong-form.php +32 -1
- includes/filters.php +8 -1
- readme.txt +1 -1
- strong-testimonials.php +3 -2
admin/class-strong-testimonials-admin-scripts.php
CHANGED
@@ -276,14 +276,29 @@ class Strong_Testimonials_Admin_Scripts {
|
|
276 |
* Fields
|
277 |
*/
|
278 |
public static function admin_fields() {
|
279 |
-
|
280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
|
282 |
-
|
283 |
-
|
|
|
|
|
|
|
|
|
284 |
|
285 |
-
|
286 |
-
|
|
|
287 |
}
|
288 |
|
289 |
/**
|
@@ -293,10 +308,6 @@ class Strong_Testimonials_Admin_Scripts {
|
|
293 |
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
|
294 |
|
295 |
switch ( $tab ) {
|
296 |
-
case 'form':
|
297 |
-
wp_enqueue_style( 'wpmtst-admin-form-style' );
|
298 |
-
wp_enqueue_script( 'wpmtst-admin-form-script' );
|
299 |
-
break;
|
300 |
case 'compat':
|
301 |
wp_enqueue_style( 'wpmtst-admin-compat-style' );
|
302 |
wp_enqueue_script( 'wpmtst-admin-compat-script' );
|
276 |
* Fields
|
277 |
*/
|
278 |
public static function admin_fields() {
|
279 |
+
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
|
280 |
+
wp_enqueue_style( 'wpmtst-admin-style' );
|
281 |
+
wp_enqueue_script( 'wpmtst-admin-script' );
|
282 |
+
|
283 |
+
switch ( $tab ) {
|
284 |
+
case 'form':
|
285 |
+
wp_enqueue_style( 'wpmtst-admin-form-style' );
|
286 |
+
wp_enqueue_script( 'wpmtst-admin-form-script' );
|
287 |
+
break;
|
288 |
+
case 'fields':
|
289 |
+
wp_enqueue_style( 'wpmtst-admin-fields-style' );
|
290 |
+
wp_enqueue_script( 'wpmtst-admin-fields-script' );
|
291 |
|
292 |
+
wp_enqueue_style( 'wpmtst-admin-form-preview' );
|
293 |
+
wp_enqueue_style( 'wpmtst-rating-form' );
|
294 |
+
break;
|
295 |
+
default:
|
296 |
+
wp_enqueue_style( 'wpmtst-admin-fields-style' );
|
297 |
+
wp_enqueue_script( 'wpmtst-admin-fields-script' );
|
298 |
|
299 |
+
wp_enqueue_style( 'wpmtst-admin-form-preview' );
|
300 |
+
wp_enqueue_style( 'wpmtst-rating-form' );
|
301 |
+
}
|
302 |
}
|
303 |
|
304 |
/**
|
308 |
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : '';
|
309 |
|
310 |
switch ( $tab ) {
|
|
|
|
|
|
|
|
|
311 |
case 'compat':
|
312 |
wp_enqueue_style( 'wpmtst-admin-compat-style' );
|
313 |
wp_enqueue_script( 'wpmtst-admin-compat-script' );
|
admin/class-strong-testimonials-defaults.php
CHANGED
@@ -31,9 +31,9 @@ class Strong_Testimonials_Defaults {
|
|
31 |
$default_options = array(
|
32 |
'embed_width' => '',
|
33 |
'nofollow' => true,
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
'pending_indicator' => true,
|
38 |
'remove_whitespace' => true,
|
39 |
//@todo : delete commented line. For the moment let it be
|
@@ -44,9 +44,9 @@ class Strong_Testimonials_Defaults {
|
|
44 |
'scrolltop' => true,
|
45 |
'scrolltop_offset' => 80,
|
46 |
'lazyload' => false,
|
47 |
-
|
48 |
'touch_enabled' => true,
|
49 |
-
|
50 |
);
|
51 |
|
52 |
return $default_options;
|
@@ -86,8 +86,8 @@ class Strong_Testimonials_Defaults {
|
|
86 |
'shortcode_on_form' => '',
|
87 |
'shortcode_on_display' => '',
|
88 |
'show_shortcode_options' => 0,
|
89 |
-
|
90 |
-
|
91 |
) );
|
92 |
}
|
93 |
|
@@ -475,6 +475,9 @@ class Strong_Testimonials_Defaults {
|
|
475 |
'success_redirect_url' => '',
|
476 |
'members_only' => false,
|
477 |
'members_only_message' => __( 'You need to be logged in to access this form.', 'strong-testimonials' ),
|
|
|
|
|
|
|
478 |
);
|
479 |
|
480 |
return apply_filters( 'wpmtst_default_form_options', $default_form_options );
|
@@ -851,7 +854,7 @@ class Strong_Testimonials_Defaults {
|
|
851 |
)
|
852 |
),
|
853 |
),
|
854 |
-
|
855 |
);
|
856 |
|
857 |
return $options;
|
31 |
$default_options = array(
|
32 |
'embed_width' => '',
|
33 |
'nofollow' => true,
|
34 |
+
'noopener' => false,
|
35 |
+
'noreferrer' => false,
|
36 |
+
'disable_rewrite' => false,
|
37 |
'pending_indicator' => true,
|
38 |
'remove_whitespace' => true,
|
39 |
//@todo : delete commented line. For the moment let it be
|
44 |
'scrolltop' => true,
|
45 |
'scrolltop_offset' => 80,
|
46 |
'lazyload' => false,
|
47 |
+
'no_lazyload_plugin' => true,
|
48 |
'touch_enabled' => true,
|
49 |
+
'disable_upsells' => false
|
50 |
);
|
51 |
|
52 |
return $default_options;
|
86 |
'shortcode_on_form' => '',
|
87 |
'shortcode_on_display' => '',
|
88 |
'show_shortcode_options' => 0,
|
89 |
+
'show_length_option' => 0,
|
90 |
+
'max_length' => ''
|
91 |
) );
|
92 |
}
|
93 |
|
475 |
'success_redirect_url' => '',
|
476 |
'members_only' => false,
|
477 |
'members_only_message' => __( 'You need to be logged in to access this form.', 'strong-testimonials' ),
|
478 |
+
'mailchimp' => false,
|
479 |
+
'mailchimp_message' => __( 'Subscribe to our newsletter.', 'strong-testimonials' ),
|
480 |
+
'mailchimp_list' => ''
|
481 |
);
|
482 |
|
483 |
return apply_filters( 'wpmtst_default_form_options', $default_form_options );
|
854 |
)
|
855 |
),
|
856 |
),
|
857 |
+
'random_js' => false
|
858 |
);
|
859 |
|
860 |
return $options;
|
admin/class-strong-testimonials-updater.php
CHANGED
@@ -561,13 +561,6 @@ class Strong_Testimonials_Updater {
|
|
561 |
}
|
562 |
}
|
563 |
|
564 |
-
if ( ! isset( $history['2.29_captcha_options_changed'] ) ) {
|
565 |
-
self::update_history_log( '2.29_captcha_options_changed' );
|
566 |
-
if ( $notice ) {
|
567 |
-
wpmtst_add_admin_notice( 'captcha-options-changed', true );
|
568 |
-
}
|
569 |
-
}
|
570 |
-
|
571 |
return $form_options;
|
572 |
}
|
573 |
|
561 |
}
|
562 |
}
|
563 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
return $form_options;
|
565 |
}
|
566 |
|
admin/class-strong-testimonials-upsell.php
CHANGED
@@ -11,87 +11,89 @@ class Strong_Testimonials_Upsell {
|
|
11 |
public function __construct() {
|
12 |
$this->set_store_upgrade_url();
|
13 |
$options = get_option( 'wpmtst_options' );
|
14 |
-
if ( isset( $options['upsells'] ) && $options['upsells'] == false) {
|
15 |
-
|
16 |
-
add_action( 'wpmtst_admin_after_settings_form', array( $this, 'general_upsell' ) );
|
17 |
-
|
18 |
-
if ( ! defined( 'WPMTST_ROLE_MANAGEMENT_VERSION' ) ) {
|
19 |
-
add_action( 'wpmtst_settings_tabs', array( $this, 'register_role_manager' ), 4, 2 );
|
20 |
-
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_rm_settings_page' ) );
|
21 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_role_upsell' ), 20 );
|
22 |
-
}
|
23 |
-
|
24 |
-
if ( ! defined( 'WPMTST_COUNTRY_SELECTOR_VERSION' ) ) {
|
25 |
-
add_action( 'wpmtst_after_form_type_selection', array( $this, 'output_country_selector_upsell' ) );
|
26 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_country_selector_upsell' ), 95 );
|
27 |
-
}
|
28 |
-
|
29 |
-
if ( ! defined( 'WPMTST_CUSTOM_FIELDS_VERSION' ) ) {
|
30 |
-
add_action( 'wpmtst_after_form_type_selection', array( $this, 'output_custom_fields_upsell' ) );
|
31 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_custom_fields_upsell' ), 90 );
|
32 |
-
}
|
33 |
-
|
34 |
-
if ( ! defined( 'WPMTST_MULTIPLE_FORMS_VERSION' ) ) {
|
35 |
-
add_action( 'wpmtst_before_fields_settings', array( $this, 'output_multiple_form_upsell' ) );
|
36 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_multiple_form_upsell' ), 30 );
|
37 |
-
}
|
38 |
-
|
39 |
-
if ( ! defined( 'WPMTST_REVIEW_MARKUP_VERSION' ) ) {
|
40 |
-
add_action( 'wpmtst_view_editor_after_groups', array( $this, 'output_review_markup_upsell' ) );
|
41 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_review_markup_upsell' ), 15 );
|
42 |
-
add_action( 'wpmtst_settings_tabs', array( $this, 'register_review_markup' ), 4, 2 );
|
43 |
-
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_review_markup_settings_page' ) );
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( ! defined( 'WPMTST_ADVANCED_VIEWS_VERSION' ) ) {
|
47 |
-
add_action( 'wpmtst_view_editor_after_group_select', array( $this, 'output_advanced_views_upsell' ) );
|
48 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_advanced_views_upsell' ), 35 );
|
49 |
-
}
|
50 |
-
|
51 |
-
if ( ! defined( 'WPMTST_CAPTCHA_VERSION' ) ) {
|
52 |
-
add_action( 'wpmtst_fields_before_fields_editor_preview', array( $this, 'output_captcha_editor_upsell' ) );
|
53 |
-
add_action( 'wpmtst_after_form_settings', array( $this, 'output_captcha_form_settings_upsell' ) );
|
54 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_captcha_upsell' ), 40 );
|
55 |
-
}
|
56 |
-
|
57 |
-
if ( ! defined( 'WPMTST_PRO_TEMPLATES_VERSION' ) ) {
|
58 |
-
add_action( 'wpmtst_views_after_template_list', array( $this, 'output_pro_templates_upsell' ) );
|
59 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_pro_templates_upsell' ), 20 );
|
60 |
-
}
|
61 |
-
|
62 |
-
if ( ! defined( 'WPMTST_EMAILS_VERSION' ) ) {
|
63 |
-
add_action( 'wpmtst_after_mail_notification_settings', array( $this, 'output_enhanced_emails_upsell' ) );
|
64 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_enhanced_emails_upsell' ), 45 );
|
65 |
-
}
|
66 |
-
|
67 |
-
if ( ! defined( 'WPMTST_INFINITE_SCROLL_VERSION' ) ) {
|
68 |
-
add_action( 'wpmtst_view_editor_pagination_row_end', array( $this, 'output_infinite_scroll_upsell' ) );
|
69 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_infinite_scroll_upsell' ), 50 );
|
70 |
-
}
|
71 |
-
|
72 |
-
if ( ! defined( 'WPMTST_FILTERS_VERSION' ) ) {
|
73 |
-
add_action( 'wpmtst_after_style_view_section', array( $this, 'output_filters_upsell' ) );
|
74 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_filters_upsell' ), 15 );
|
75 |
-
}
|
76 |
-
|
77 |
-
if ( ! defined( 'WPMTST_PRO_VERSION' ) ) {
|
78 |
-
add_action( 'wpmtst_settings_tabs', array( $this, 'register_st_pro_tab' ), 4, 2 );
|
79 |
-
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_st_pro_page' ) );
|
80 |
-
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_pro_upsell' ), 10 );
|
81 |
-
}
|
82 |
-
|
83 |
-
if ( ! defined( 'WPMTST_ASSIGNMENT_VERSION' ) ) {
|
84 |
-
add_action( 'wpmtst_settings_tabs', array( $this, 'register_assigment_tab' ), 4, 2 );
|
85 |
-
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_assigment_settings_page' ) );
|
86 |
-
}
|
87 |
-
|
88 |
-
if ( ! defined( 'WPMTST_PROPERTIES_VERSION' ) ) {
|
89 |
-
add_action( 'wpmtst_settings_tabs', array( $this, 'register_properties_tab' ), 4, 2 );
|
90 |
-
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_properties_page' ) );
|
91 |
-
}
|
92 |
|
|
|
|
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
96 |
}
|
97 |
|
11 |
public function __construct() {
|
12 |
$this->set_store_upgrade_url();
|
13 |
$options = get_option( 'wpmtst_options' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
if ( isset( $options['disable_upsells'] ) && $options['disable_upsells'] ) {
|
16 |
+
return;
|
17 |
}
|
18 |
|
19 |
+
add_action( 'wpmtst_admin_after_settings_form', array( $this, 'general_upsell' ) );
|
20 |
+
|
21 |
+
if ( ! defined( 'WPMTST_ROLE_MANAGEMENT_VERSION' ) ) {
|
22 |
+
add_action( 'wpmtst_settings_tabs', array( $this, 'register_role_manager' ), 4, 2 );
|
23 |
+
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_rm_settings_page' ) );
|
24 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_role_upsell' ), 20 );
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( ! defined( 'WPMTST_COUNTRY_SELECTOR_VERSION' ) ) {
|
28 |
+
add_action( 'wpmtst_after_form_type_selection', array( $this, 'output_country_selector_upsell' ) );
|
29 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_country_selector_upsell' ), 95 );
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( ! defined( 'WPMTST_CUSTOM_FIELDS_VERSION' ) ) {
|
33 |
+
add_action( 'wpmtst_after_form_type_selection', array( $this, 'output_custom_fields_upsell' ) );
|
34 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_custom_fields_upsell' ), 90 );
|
35 |
+
}
|
36 |
+
|
37 |
+
if ( ! defined( 'WPMTST_MULTIPLE_FORMS_VERSION' ) ) {
|
38 |
+
add_action( 'wpmtst_before_fields_settings', array( $this, 'output_multiple_form_upsell' ) );
|
39 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_multiple_form_upsell' ), 30 );
|
40 |
+
}
|
41 |
+
|
42 |
+
if ( ! defined( 'WPMTST_REVIEW_MARKUP_VERSION' ) ) {
|
43 |
+
add_action( 'wpmtst_view_editor_after_groups', array( $this, 'output_review_markup_upsell' ) );
|
44 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_review_markup_upsell' ), 15 );
|
45 |
+
add_action( 'wpmtst_settings_tabs', array( $this, 'register_review_markup' ), 4, 2 );
|
46 |
+
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_review_markup_settings_page' ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( ! defined( 'WPMTST_ADVANCED_VIEWS_VERSION' ) ) {
|
50 |
+
add_action( 'wpmtst_view_editor_after_group_select', array( $this, 'output_advanced_views_upsell' ) );
|
51 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_advanced_views_upsell' ), 35 );
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( ! defined( 'WPMTST_CAPTCHA_VERSION' ) ) {
|
55 |
+
add_action( 'wpmtst_fields_before_fields_editor_preview', array( $this, 'output_captcha_editor_upsell' ) );
|
56 |
+
add_action( 'wpmtst_after_form_settings', array( $this, 'output_captcha_form_settings_upsell' ) );
|
57 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_captcha_upsell' ), 40 );
|
58 |
+
}
|
59 |
+
|
60 |
+
if ( ! defined( 'WPMTST_PRO_TEMPLATES_VERSION' ) ) {
|
61 |
+
add_action( 'wpmtst_views_after_template_list', array( $this, 'output_pro_templates_upsell' ) );
|
62 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_pro_templates_upsell' ), 20 );
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( ! defined( 'WPMTST_EMAILS_VERSION' ) ) {
|
66 |
+
add_action( 'wpmtst_after_mail_notification_settings', array( $this, 'output_enhanced_emails_upsell' ) );
|
67 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_enhanced_emails_upsell' ), 45 );
|
68 |
+
}
|
69 |
+
|
70 |
+
if ( ! defined( 'WPMTST_INFINITE_SCROLL_VERSION' ) ) {
|
71 |
+
add_action( 'wpmtst_view_editor_pagination_row_end', array( $this, 'output_infinite_scroll_upsell' ) );
|
72 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_infinite_scroll_upsell' ), 50 );
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! defined( 'WPMTST_FILTERS_VERSION' ) ) {
|
76 |
+
add_action( 'wpmtst_after_style_view_section', array( $this, 'output_filters_upsell' ) );
|
77 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_filters_upsell' ), 15 );
|
78 |
+
}
|
79 |
+
|
80 |
+
if ( ! defined( 'WPMTST_PRO_VERSION' ) ) {
|
81 |
+
add_action( 'wpmtst_settings_tabs', array( $this, 'register_st_pro_tab' ), 4, 2 );
|
82 |
+
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_st_pro_page' ) );
|
83 |
+
add_filter( 'wpmtst_general_upsell_items', array( $this, 'add_pro_upsell' ), 10 );
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( ! defined( 'WPMTST_ASSIGNMENT_VERSION' ) ) {
|
87 |
+
add_action( 'wpmtst_settings_tabs', array( $this, 'register_assigment_tab' ), 4, 2 );
|
88 |
+
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_assigment_settings_page' ) );
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( ! defined( 'WPMTST_PROPERTIES_VERSION' ) ) {
|
92 |
+
add_action( 'wpmtst_settings_tabs', array( $this, 'register_properties_tab' ), 4, 2 );
|
93 |
+
add_filter( 'wpmtst_settings_callbacks', array( $this, 'register_properties_page' ) );
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
|
98 |
}
|
99 |
|
admin/class-strong-views-list-table.php
CHANGED
@@ -34,8 +34,43 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
|
|
34 |
}
|
35 |
$data = $this->move_sticky( $data );
|
36 |
$data = apply_filters('wpmtst_list_views', $data);
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$this->items = $data;
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
/**
|
41 |
* Move sticky views to the top
|
@@ -193,39 +228,43 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
|
|
193 |
* @access public
|
194 |
*/
|
195 |
public function display() {
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
//$this->display_tablenav( 'top' );
|
200 |
-
|
201 |
-
?>
|
202 |
-
<div class="wp-list-table-wrap">
|
203 |
-
<div class="overlay" style="display: none;"></div>
|
204 |
-
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
205 |
-
<thead>
|
206 |
-
<tr>
|
207 |
-
<?php $this->print_column_headers(); ?>
|
208 |
-
</tr>
|
209 |
-
</thead>
|
210 |
-
|
211 |
-
<tbody id="the-list"<?php
|
212 |
-
if ( $singular ) {
|
213 |
-
echo " data-wp-lists='list:$singular'";
|
214 |
-
} ?>>
|
215 |
-
<?php $this->display_rows_or_placeholder(); ?>
|
216 |
-
</tbody>
|
217 |
-
|
218 |
-
<tfoot>
|
219 |
-
<tr>
|
220 |
-
<?php $this->print_column_headers( false ); ?>
|
221 |
-
</tr>
|
222 |
-
</tfoot>
|
223 |
-
|
224 |
-
</table>
|
225 |
-
<?php
|
226 |
-
//$this->display_tablenav( 'bottom' );
|
227 |
?>
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
<?php
|
230 |
}
|
231 |
|
34 |
}
|
35 |
$data = $this->move_sticky( $data );
|
36 |
$data = apply_filters('wpmtst_list_views', $data);
|
37 |
+
if (isset($_GET['mode']) && !empty($_GET['mode']) && $_GET['mode'] !== 'all') {
|
38 |
+
$data = $this->filter_data( $_GET['mode'], $data );
|
39 |
+
}
|
40 |
+
if (isset($_GET['s']) && !empty($_GET['s'])) {
|
41 |
+
$data = $this->search_data( $_GET['s'], $data );
|
42 |
+
}
|
43 |
$this->items = $data;
|
44 |
}
|
45 |
+
|
46 |
+
public function prepare_filters( $data = array() ) {
|
47 |
+
$links = array();
|
48 |
+
foreach ($data as $item) {
|
49 |
+
$value = unserialize($item['value']);
|
50 |
+
$links[$value['mode']][] = $item;
|
51 |
+
}
|
52 |
+
return $links;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function filter_data( $mode, $data = array() ) {
|
56 |
+
$items = array();
|
57 |
+
foreach ($data as $item) {
|
58 |
+
if ($mode == $item['data']['mode']) {
|
59 |
+
$items[] = $item;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
return $items;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function search_data( $search, $data = array() ) {
|
66 |
+
$items = array();
|
67 |
+
foreach ($data as $item) {
|
68 |
+
if (strtolower($search) == strtolower($item['name'])) {
|
69 |
+
$items[] = $item;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
return $items;
|
73 |
+
}
|
74 |
|
75 |
/**
|
76 |
* Move sticky views to the top
|
228 |
* @access public
|
229 |
*/
|
230 |
public function display() {
|
231 |
+
$singular = $this->_args['singular'];
|
232 |
+
// Disabling the table nav options to regain some real estate.
|
233 |
+
//$this->display_tablenav( 'top' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
?>
|
235 |
+
<form id="posts-filter" method="get">
|
236 |
+
<p class="search-box">
|
237 |
+
<label class="screen-reader-text" for="post-search-input"><?php esc_html_e( 'Search', 'strong-testimonials' ); ?></label>
|
238 |
+
<input type="search" id="post-search-input" name="s" value="<?php echo (isset($_GET['s']) && !empty($_GET['s']) ? $_GET['s'] : '') ?>">
|
239 |
+
<input type="submit" id="search-submit" class="button" value="<?php esc_html_e( 'Search', 'strong-testimonials' ); ?>">
|
240 |
+
<input type="hidden" name="post_type" class="post_type_page" value="wpm-testimonial">
|
241 |
+
<input type="hidden" name="page" value="testimonial-views">
|
242 |
+
</p>
|
243 |
+
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
244 |
+
<thead>
|
245 |
+
<tr>
|
246 |
+
<?php $this->print_column_headers(); ?>
|
247 |
+
</tr>
|
248 |
+
</thead>
|
249 |
+
|
250 |
+
<tbody id="the-list"<?php
|
251 |
+
if ( $singular ) {
|
252 |
+
echo " data-wp-lists='list:$singular'";
|
253 |
+
} ?>>
|
254 |
+
<?php $this->display_rows_or_placeholder(); ?>
|
255 |
+
</tbody>
|
256 |
+
|
257 |
+
<tfoot>
|
258 |
+
<tr>
|
259 |
+
<?php $this->print_column_headers( false ); ?>
|
260 |
+
</tr>
|
261 |
+
</tfoot>
|
262 |
+
|
263 |
+
</table>
|
264 |
+
<?php
|
265 |
+
//$this->display_tablenav( 'bottom' );
|
266 |
+
?>
|
267 |
+
</form>
|
268 |
<?php
|
269 |
}
|
270 |
|
admin/custom-fields.php
CHANGED
@@ -20,6 +20,8 @@ add_action( 'wpmtst_form_admin', 'wpmtst_form_admin2' );
|
|
20 |
*/
|
21 |
function wpmtst_update_custom_fields() {
|
22 |
$goback = wp_get_referer();
|
|
|
|
|
23 |
if ( ! isset( $_POST['wpmtst_form_submitted'] ) ) {
|
24 |
wp_redirect( $goback );
|
25 |
exit;
|
@@ -156,12 +158,10 @@ function wpmtst_settings_custom_fields( $form_id = 1 ) {
|
|
156 |
}
|
157 |
|
158 |
$forms = get_option( 'wpmtst_custom_forms' );
|
159 |
-
$fields = $forms[$form_id]['fields'];
|
160 |
?>
|
161 |
|
162 |
<div class="wrap wpmtst">
|
163 |
-
<h1 class="wp-heading-inline"><?php esc_html_e( 'Forms', 'strong-testimonials' ); ?></h1>
|
164 |
-
<hr class="wp-header-end">
|
165 |
<?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
|
166 |
|
167 |
<div id="left-col">
|
20 |
*/
|
21 |
function wpmtst_update_custom_fields() {
|
22 |
$goback = wp_get_referer();
|
23 |
+
$goback = apply_filters('wpmtst_form_goback', $goback);
|
24 |
+
|
25 |
if ( ! isset( $_POST['wpmtst_form_submitted'] ) ) {
|
26 |
wp_redirect( $goback );
|
27 |
exit;
|
158 |
}
|
159 |
|
160 |
$forms = get_option( 'wpmtst_custom_forms' );
|
161 |
+
$fields = apply_filters( 'wpmtst_form_fields', $forms[$form_id]['fields']);
|
162 |
?>
|
163 |
|
164 |
<div class="wrap wpmtst">
|
|
|
|
|
165 |
<?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
|
166 |
|
167 |
<div id="left-col">
|
admin/js/admin-fields.js
CHANGED
@@ -490,7 +490,7 @@ function sanitizeName(label) {
|
|
490 |
$("#fields-editor-preview")
|
491 |
.children().first()
|
492 |
.after(newDiv)
|
493 |
-
.fadeOut(
|
494 |
newDiv.show();
|
495 |
$(this).remove();
|
496 |
});
|
490 |
$("#fields-editor-preview")
|
491 |
.children().first()
|
492 |
.after(newDiv)
|
493 |
+
.fadeOut(0, function () {
|
494 |
newDiv.show();
|
495 |
$(this).remove();
|
496 |
});
|
admin/js/admin-order.js
CHANGED
@@ -81,7 +81,8 @@ jQuery(document).ready(function ($) {
|
|
81 |
ui.item.find(".column-handle").addClass("refresh");
|
82 |
$.post(ajaxurl, {
|
83 |
action: 'st-update-menu-order',
|
84 |
-
|
|
|
85 |
},
|
86 |
function (data) {
|
87 |
// update menu order shown
|
81 |
ui.item.find(".column-handle").addClass("refresh");
|
82 |
$.post(ajaxurl, {
|
83 |
action: 'st-update-menu-order',
|
84 |
+
posts: $('#the-list').sortable('serialize'),
|
85 |
+
order: wpmtstOrderHelper
|
86 |
},
|
87 |
function (data) {
|
88 |
// update menu order shown
|
admin/menu/class-strong-testimonials-menu-fields.php
CHANGED
@@ -46,7 +46,7 @@ class Strong_Testimonials_Menu_Fields {
|
|
46 |
'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Form', 'strong-testimonials' ) ),
|
47 |
'capability' => 'strong_testimonials_fields',
|
48 |
'menu_slug' => 'testimonial-fields',
|
49 |
-
'function' => '
|
50 |
);
|
51 |
}
|
52 |
|
46 |
'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Form', 'strong-testimonials' ) ),
|
47 |
'capability' => 'strong_testimonials_fields',
|
48 |
'menu_slug' => 'testimonial-fields',
|
49 |
+
'function' => array( 'Strong_Testimonials_Forms', 'settings_page' ),
|
50 |
);
|
51 |
}
|
52 |
|
admin/settings/class-strong-testimonials-form.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Strong_Testimonials_Settings
|
4 |
+
*/
|
5 |
+
class Strong_Testimonials_Forms {
|
6 |
+
|
7 |
+
const DEFAULT_TAB = 'fields';
|
8 |
+
|
9 |
+
public static $callbacks;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Strong_Testimonials_Settings constructor.
|
13 |
+
*/
|
14 |
+
public function __construct() {}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Initialize.
|
18 |
+
*/
|
19 |
+
public static function init() {
|
20 |
+
self::add_actions();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Add actions and filters.
|
25 |
+
*/
|
26 |
+
public static function add_actions() {
|
27 |
+
add_action( 'admin_init', array( __CLASS__, 'register_settings' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Register settings
|
32 |
+
*/
|
33 |
+
public static function register_settings() {
|
34 |
+
self::$callbacks = apply_filters( 'wpmtst_form_callbacks', array() );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Settings page
|
39 |
+
*/
|
40 |
+
public static function settings_page() {
|
41 |
+
if ( ! current_user_can( 'strong_testimonials_options' ) ) {
|
42 |
+
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'strong-testimonials' ) );
|
43 |
+
}
|
44 |
+
$tab = self::get_tab();
|
45 |
+
$url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-fields' );
|
46 |
+
?>
|
47 |
+
<div class="wrap wpmtst">
|
48 |
+
|
49 |
+
<h1><?php echo wp_kses_post( apply_filters( 'wpmtst_cpt_singular_name', esc_html__( 'Forms', 'strong-testimonials' ) ) ); ?></h1>
|
50 |
+
|
51 |
+
<?php do_action( 'wpmtst_testimonials_settings' ); ?>
|
52 |
+
|
53 |
+
<?php if ( isset( $_GET['settings-updated'] ) ) : ?>
|
54 |
+
<div id="message" class="updated notice is-dismissible">
|
55 |
+
<p><?php esc_html_e( 'Settings saved.', 'strong-testimonials' ); ?></p>
|
56 |
+
</div>
|
57 |
+
<?php endif; ?>
|
58 |
+
|
59 |
+
<h2 class="nav-tab-wrapper">
|
60 |
+
<?php do_action( 'wpmtst_form_tabs', $tab, $url ); ?>
|
61 |
+
</h2>
|
62 |
+
<?php if ($tab != 'fields'): ?>
|
63 |
+
<div class="wpmts-settings-columns">
|
64 |
+
<form id="<?php echo esc_attr( $tab ); ?>-form" method="post" action="options.php" enctype="multipart/form-data">
|
65 |
+
<?php
|
66 |
+
if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
|
67 |
+
call_user_func( self::$callbacks[ $tab ] );
|
68 |
+
} else {
|
69 |
+
call_user_func( self::$callbacks[ self::DEFAULT_TAB ] );
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( has_action( 'wpmtst_settings_submit_row' ) ) {
|
73 |
+
echo '<p class="submit-buttons">';
|
74 |
+
do_action( 'wpmtst_settings_submit_row' );
|
75 |
+
echo '</p>';
|
76 |
+
}
|
77 |
+
?>
|
78 |
+
</form>
|
79 |
+
<?php do_action( 'wpmtst_admin_after_settings_form' ) ?>
|
80 |
+
</div>
|
81 |
+
<?php else:
|
82 |
+
if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
|
83 |
+
call_user_func( self::$callbacks[ $tab ] );
|
84 |
+
} else {
|
85 |
+
call_user_func( self::$callbacks[ self::DEFAULT_TAB ] );
|
86 |
+
}
|
87 |
+
endif; ?>
|
88 |
+
|
89 |
+
</div><!-- .wrap -->
|
90 |
+
<?php
|
91 |
+
}
|
92 |
+
|
93 |
+
private static function get_tab() {
|
94 |
+
return ( isset( $_GET['tab'] ) && $_GET['tab'] ) ? $_GET['tab'] : self::DEFAULT_TAB;
|
95 |
+
}
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
Strong_Testimonials_Forms::init();
|
admin/settings/class-strong-testimonials-settings-form.php
CHANGED
@@ -26,9 +26,9 @@ class Strong_Testimonials_Settings_Form {
|
|
26 |
* Add actions and filters.
|
27 |
*/
|
28 |
public static function add_actions() {
|
29 |
-
|
30 |
-
add_action( '
|
31 |
-
add_filter( '
|
32 |
|
33 |
add_action( 'wp_ajax_wpmtst_restore_default_messages', array( __CLASS__, 'restore_default_messages_function' ) );
|
34 |
add_action( 'wp_ajax_wpmtst_restore_default_message', array( __CLASS__, 'restore_default_message_function' ) );
|
@@ -46,7 +46,7 @@ class Strong_Testimonials_Settings_Form {
|
|
46 |
printf( '<a href="%s" class="nav-tab %s">%s</a>',
|
47 |
esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
|
48 |
esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
|
49 |
-
__( '
|
50 |
);
|
51 |
}
|
52 |
|
26 |
* Add actions and filters.
|
27 |
*/
|
28 |
public static function add_actions() {
|
29 |
+
add_action( 'wpmtst_register_settings', array( __CLASS__, 'register_settings' ) );
|
30 |
+
add_action( 'wpmtst_form_tabs', array( __CLASS__, 'register_tab' ), 2, 2 );
|
31 |
+
add_filter( 'wpmtst_form_callbacks', array( __CLASS__, 'register_settings_page' ) );
|
32 |
|
33 |
add_action( 'wp_ajax_wpmtst_restore_default_messages', array( __CLASS__, 'restore_default_messages_function' ) );
|
34 |
add_action( 'wp_ajax_wpmtst_restore_default_message', array( __CLASS__, 'restore_default_message_function' ) );
|
46 |
printf( '<a href="%s" class="nav-tab %s">%s</a>',
|
47 |
esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
|
48 |
esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
|
49 |
+
__( 'Settings', 'strong-testimonials' )
|
50 |
);
|
51 |
}
|
52 |
|
admin/settings/class-strong-testimonials-settings-general.php
CHANGED
@@ -82,9 +82,9 @@ class Strong_Testimonials_Settings_General {
|
|
82 |
public static function sanitize_options( $input ) {
|
83 |
$input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
|
84 |
$input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
$input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
|
89 |
$input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
|
90 |
/* @todo : delete commented line. For the moment let it be */
|
@@ -95,11 +95,11 @@ class Strong_Testimonials_Settings_General {
|
|
95 |
$input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
|
96 |
$input['single_testimonial_slug'] = sanitize_text_field( $input['single_testimonial_slug'] );
|
97 |
$input['lazyload'] = wpmtst_sanitize_checkbox( $input, 'lazyload' );
|
98 |
-
|
99 |
$input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
|
100 |
-
|
101 |
|
102 |
-
|
103 |
}
|
104 |
|
105 |
}
|
82 |
public static function sanitize_options( $input ) {
|
83 |
$input['embed_width'] = $input['embed_width'] ? (int) sanitize_text_field( $input['embed_width'] ) : '';
|
84 |
$input['nofollow'] = wpmtst_sanitize_checkbox( $input, 'nofollow' );
|
85 |
+
$input['noopener'] = wpmtst_sanitize_checkbox( $input, 'noopener' );
|
86 |
+
$input['noreferrer'] = wpmtst_sanitize_checkbox( $input, 'noreferrer' );
|
87 |
+
$input['disable_rewrite'] = wpmtst_sanitize_checkbox( $input, 'disable_rewrite' );
|
88 |
$input['pending_indicator'] = wpmtst_sanitize_checkbox( $input, 'pending_indicator' );
|
89 |
$input['remove_whitespace'] = wpmtst_sanitize_checkbox( $input, 'remove_whitespace' );
|
90 |
/* @todo : delete commented line. For the moment let it be */
|
95 |
$input['support_custom_fields'] = wpmtst_sanitize_checkbox( $input, 'support_custom_fields' );
|
96 |
$input['single_testimonial_slug'] = sanitize_text_field( $input['single_testimonial_slug'] );
|
97 |
$input['lazyload'] = wpmtst_sanitize_checkbox( $input, 'lazyload' );
|
98 |
+
$input['no_lazyload_plugin'] = wpmtst_sanitize_checkbox( $input, 'no_lazyload_plugin' );
|
99 |
$input['touch_enabled'] = wpmtst_sanitize_checkbox( $input, 'touch_enabled' );
|
100 |
+
$input['disable_upsells'] = wpmtst_sanitize_checkbox( $input, 'upsells' );
|
101 |
|
102 |
+
return apply_filters( 'wpmtst_sanitize_general_options', $input );
|
103 |
}
|
104 |
|
105 |
}
|
admin/settings/partials/general.php
CHANGED
@@ -272,7 +272,7 @@ $options = get_option( 'wpmtst_options' );
|
|
272 |
<td>
|
273 |
<fieldset>
|
274 |
<label>
|
275 |
-
<input type="checkbox" name="wpmtst_options[
|
276 |
<?php printf( __( 'Disable all upsells.', 'strong-testimonials' ) ); ?>
|
277 |
<?php _e( 'Off by default.', 'strong-testimonials' ); ?>
|
278 |
</label>
|
272 |
<td>
|
273 |
<fieldset>
|
274 |
<label>
|
275 |
+
<input type="checkbox" name="wpmtst_options[disable_upsells]" <?php checked( $options['disable_upsells'] ); ?>>
|
276 |
<?php printf( __( 'Disable all upsells.', 'strong-testimonials' ) ); ?>
|
277 |
<?php _e( 'Off by default.', 'strong-testimonials' ); ?>
|
278 |
</label>
|
admin/views.php
CHANGED
@@ -24,7 +24,7 @@ function wpmtst_views_admin() {
|
|
24 |
);
|
25 |
|
26 |
?>
|
27 |
-
<div class="wrap
|
28 |
|
29 |
<?php
|
30 |
if ( isset( $_REQUEST['result'] ) ) {
|
@@ -63,33 +63,43 @@ function wpmtst_views_admin() {
|
|
63 |
|
64 |
} else {
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
?>
|
70 |
-
<h1>
|
71 |
<?php esc_html_e( 'Views', 'strong-testimonials' ); ?>
|
72 |
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views&action=add' ) ); ?>" class="add-new-h2"><?php esc_html_e( 'Add New', 'strong-testimonials' ); ?></a>
|
73 |
<a href="#tab-panel-wpmtst-help-views" class="add-new-h2 open-help-tab"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
|
74 |
</h1>
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
<?php
|
77 |
-
// Fetch views after heading and before intro in case we need to display any database errors.
|
78 |
-
$views = wpmtst_get_views();
|
79 |
-
|
80 |
// Add button to clear sort value.
|
81 |
if ( isset( $_GET['orderby'] ) ) {
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
$views_table->prepare_list( wpmtst_unserialize_views( $views ) );
|
93 |
$views_table->display();
|
94 |
|
95 |
}
|
24 |
);
|
25 |
|
26 |
?>
|
27 |
+
<div class="wrap">
|
28 |
|
29 |
<?php
|
30 |
if ( isset( $_REQUEST['result'] ) ) {
|
63 |
|
64 |
} else {
|
65 |
|
66 |
+
/**
|
67 |
+
* View list
|
68 |
+
*/
|
69 |
+
|
70 |
+
// Fetch views after heading and before intro in case we need to display any database errors.
|
71 |
+
$views = wpmtst_get_views();
|
72 |
+
$views_table = new Strong_Views_List_Table();
|
73 |
+
|
74 |
+
// Get links for filtering
|
75 |
+
$filters = $views_table->prepare_filters(wpmtst_unserialize_views( $views ));
|
76 |
?>
|
77 |
+
<h1 class="wp-heading-inline">
|
78 |
<?php esc_html_e( 'Views', 'strong-testimonials' ); ?>
|
79 |
<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views&action=add' ) ); ?>" class="add-new-h2"><?php esc_html_e( 'Add New', 'strong-testimonials' ); ?></a>
|
80 |
<a href="#tab-panel-wpmtst-help-views" class="add-new-h2 open-help-tab"><?php esc_html_e( 'Help', 'strong-testimonials' ); ?></a>
|
81 |
</h1>
|
82 |
+
<hr class="wp-header-end">
|
83 |
+
<h2 class="screen-reader-text"><?php esc_html_e( 'Filter view list', 'strong-testimonials' ); ?></h2>
|
84 |
+
<ul class="subsubsub">
|
85 |
+
<li class="all"><a <?php echo (!isset($_GET['mode']) || $_GET['mode'] == 'all' ? 'class="current"' : '') ?> href="<?php echo add_query_arg( array('post_type' => 'wpm-testimonial', 'page' => 'testimonial-views', 'mode' => 'all' ), admin_url('edit.php') ) ?>"><?php esc_html_e( 'All', 'strong-testimonials' ); ?><?php printf( __( ' <span class="count">(%s)</span>', 'strong-testimonials' ), count($views) ); ?></a> |</li>
|
86 |
+
<?php foreach ($filters as $mode => $items): ?>
|
87 |
+
<li class="<?php echo $mode ?>"><a <?php echo (isset($_GET['mode']) && $_GET['mode'] == $mode ? 'class="current"' : '') ?> href="<?php echo add_query_arg( array('post_type' => 'wpm-testimonial', 'page' => 'testimonial-views', 'mode' => $mode ), admin_url('edit.php') ) ?>"><?php echo ucfirst($mode) ?><?php printf( __( ' <span class="count">(%s)</span>', 'strong-testimonials' ), count($items) ); ?></a> |</li>
|
88 |
+
<?php endforeach; ?>
|
89 |
+
</ul>
|
90 |
<?php
|
|
|
|
|
|
|
91 |
// Add button to clear sort value.
|
92 |
if ( isset( $_GET['orderby'] ) ) {
|
93 |
+
?>
|
94 |
+
<form action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post" style="margin-bottom: 4px;">
|
95 |
+
<input type="hidden" name="action" value="clear-view-sort">
|
96 |
+
<input type="submit" value="clear sort" class="button">
|
97 |
+
</form>
|
98 |
+
<?php
|
99 |
}
|
100 |
|
101 |
+
// Display the table
|
102 |
+
$views_table->prepare_list(wpmtst_unserialize_views( $views ) );
|
|
|
103 |
$views_table->display();
|
104 |
|
105 |
}
|
changelog.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 2.50.0 =
|
2 |
* Fixed read more bug
|
3 |
* Added integration with the new addons
|
1 |
+
= 2.50.1 =
|
2 |
+
* Small fixes
|
3 |
+
* Changed the layout of the views page.
|
4 |
+
* Moved form tab from general settings to Form.
|
5 |
+
* Fixed drag and drop issue for testimonials.
|
6 |
+
* Added old testimonial-heading CSS classes back.
|
7 |
+
|
8 |
= 2.50.0 =
|
9 |
* Fixed read more bug
|
10 |
* Added integration with the new addons
|
includes/class-strong-form.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
* Class Strong_Testimonials_Form
|
4 |
*/
|
5 |
class Strong_Testimonials_Form {
|
|
|
|
|
6 |
|
7 |
public $form_options;
|
8 |
|
@@ -23,10 +25,39 @@ class Strong_Testimonials_Form {
|
|
23 |
*/
|
24 |
public function add_actions() {
|
25 |
add_action( 'init', array( $this, 'process_form' ), 20 );
|
26 |
-
|
|
|
|
|
27 |
add_action( 'wp_ajax_wpmtst_form2', array( $this, 'process_form_ajax' ) );
|
28 |
add_action( 'wp_ajax_nopriv_wpmtst_form2', array( $this, 'process_form_ajax' ) );
|
29 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
/**
|
32 |
* Process a form.
|
3 |
* Class Strong_Testimonials_Form
|
4 |
*/
|
5 |
class Strong_Testimonials_Form {
|
6 |
+
|
7 |
+
const TAB_NAME = 'fields';
|
8 |
|
9 |
public $form_options;
|
10 |
|
25 |
*/
|
26 |
public function add_actions() {
|
27 |
add_action( 'init', array( $this, 'process_form' ), 20 );
|
28 |
+
//add_action( 'wpmtst_register_form_settings', array( $this, 'register_settings' ) );
|
29 |
+
add_action( 'wpmtst_form_tabs', array( $this, 'register_tab' ), 1, 2 );
|
30 |
+
add_filter( 'wpmtst_form_callbacks', array( $this, 'register_fields_page' ) );
|
31 |
add_action( 'wp_ajax_wpmtst_form2', array( $this, 'process_form_ajax' ) );
|
32 |
add_action( 'wp_ajax_nopriv_wpmtst_form2', array( $this, 'process_form_ajax' ) );
|
33 |
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Register fields tab.
|
37 |
+
*
|
38 |
+
* @param $active_tab
|
39 |
+
* @param $url
|
40 |
+
*/
|
41 |
+
public function register_tab( $active_tab, $url ) {
|
42 |
+
printf( '<a href="%s" class="nav-tab %s">%s</a>',
|
43 |
+
esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
|
44 |
+
esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
|
45 |
+
__( 'Fields', 'strong-testimonials' )
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Register fields page.
|
51 |
+
*
|
52 |
+
* @param $pages
|
53 |
+
*
|
54 |
+
* @return mixed
|
55 |
+
*/
|
56 |
+
public function register_fields_page( $pages ) {
|
57 |
+
$pages[ self::TAB_NAME ] = 'wpmtst_form_admin';
|
58 |
+
|
59 |
+
return $pages;
|
60 |
+
}
|
61 |
|
62 |
/**
|
63 |
* Process a form.
|
includes/filters.php
CHANGED
@@ -31,13 +31,20 @@ add_filter( 'strong_view_form_html', 'wpmtst_remove_whitespace' );
|
|
31 |
* @since 2.33.0 Moved to `init` action.
|
32 |
*/
|
33 |
function wpmtst_content_filters() {
|
|
|
34 |
add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 );
|
35 |
add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
|
36 |
add_filter( 'wpmtst_the_content', 'wptexturize' );
|
37 |
add_filter( 'wpmtst_the_content', 'wpautop' );
|
38 |
add_filter( 'wpmtst_the_content', 'shortcode_unautop' );
|
39 |
add_filter( 'wpmtst_the_content', 'prepend_attachment' );
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
add_filter( 'wpmtst_the_content', 'do_shortcode', 11 );
|
42 |
add_filter( 'wpmtst_the_content', 'convert_smilies', 20 );
|
43 |
|
31 |
* @since 2.33.0 Moved to `init` action.
|
32 |
*/
|
33 |
function wpmtst_content_filters() {
|
34 |
+
|
35 |
add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 );
|
36 |
add_filter( 'wpmtst_the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
|
37 |
add_filter( 'wpmtst_the_content', 'wptexturize' );
|
38 |
add_filter( 'wpmtst_the_content', 'wpautop' );
|
39 |
add_filter( 'wpmtst_the_content', 'shortcode_unautop' );
|
40 |
add_filter( 'wpmtst_the_content', 'prepend_attachment' );
|
41 |
+
|
42 |
+
if (version_compare(get_bloginfo('version'),'5.5', '>=')) {
|
43 |
+
add_filter( 'wpmtst_the_content', 'wp_filter_content_tags' );
|
44 |
+
} else {
|
45 |
+
add_filter( 'wpmtst_the_content', 'wp_make_content_images_responsive' );
|
46 |
+
}
|
47 |
+
|
48 |
add_filter( 'wpmtst_the_content', 'do_shortcode', 11 );
|
49 |
add_filter( 'wpmtst_the_content', 'convert_smilies', 20 );
|
50 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: testimonials, testimonial slider, testimonial form, star ratings
|
|
4 |
Requires at least: 4.6
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 5.4
|
7 |
-
Stable tag: 2.50.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
4 |
Requires at least: 4.6
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 2.50.1
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
strong-testimonials.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Collect and display your testimonials or reviews.
|
6 |
* Author: MachoThemes
|
7 |
* Author URI: https://www.machothemes.com/
|
8 |
-
* Version: 2.50.
|
9 |
* Text Domain: strong-testimonials
|
10 |
* Domain Path: /languages
|
11 |
* Requires: 4.6 or higher
|
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
-
define( 'WPMTST_VERSION', '2.50.
|
48 |
define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
|
49 |
define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
|
50 |
defined( 'WPMTST_STORE_URL' ) || define( 'WPMTST_STORE_URL', 'https://strongtestimonials.com' );
|
@@ -270,6 +270,7 @@ final class Strong_Testimonials {
|
|
270 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-general.php';
|
271 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-form.php';
|
272 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-compat.php';
|
|
|
273 |
|
274 |
require_once WPMTST_ADMIN . 'class-strong-testimonials-addons.php';
|
275 |
require_once WPMTST_ADMIN . 'class-strong-testimonials-defaults.php';
|
5 |
* Description: Collect and display your testimonials or reviews.
|
6 |
* Author: MachoThemes
|
7 |
* Author URI: https://www.machothemes.com/
|
8 |
+
* Version: 2.50.1
|
9 |
* Text Domain: strong-testimonials
|
10 |
* Domain Path: /languages
|
11 |
* Requires: 4.6 or higher
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
+
define( 'WPMTST_VERSION', '2.50.1' );
|
48 |
define( 'WPMTST_PLUGIN', plugin_basename( __FILE__ ) ); // strong-testimonials/strong-testimonials.php
|
49 |
define( 'WPMTST', dirname( WPMTST_PLUGIN ) ); // strong-testimonials
|
50 |
defined( 'WPMTST_STORE_URL' ) || define( 'WPMTST_STORE_URL', 'https://strongtestimonials.com' );
|
270 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-general.php';
|
271 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-form.php';
|
272 |
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-settings-compat.php';
|
273 |
+
require_once WPMTST_ADMIN . 'settings/class-strong-testimonials-form.php';
|
274 |
|
275 |
require_once WPMTST_ADMIN . 'class-strong-testimonials-addons.php';
|
276 |
require_once WPMTST_ADMIN . 'class-strong-testimonials-defaults.php';
|