Version Description
Download this release
Release Info
Developer | machothemes |
Plugin | Strong Testimonials |
Version | 2.36 |
Comparing to | |
See all releases |
Code changes from version 2.35 to 2.36
- admin/about/class-strong-testimonials-about.php +15 -15
- admin/about/how-to.php +32 -32
- admin/about/links.php +9 -5
- admin/about/privacy.php +11 -11
- admin/admin-notices.php +44 -51
- admin/admin.php +21 -26
- admin/class-strong-testimonials-admin-list.php +23 -15
- admin/class-strong-testimonials-admin-scripts.php +65 -113
- admin/class-strong-testimonials-defaults.php +51 -54
- admin/class-strong-testimonials-help.php +118 -169
- admin/class-strong-testimonials-list-table.php +943 -1008
- admin/class-strong-testimonials-page-shortcodes.php +28 -28
- admin/class-strong-testimonials-post-editor.php +87 -100
- admin/class-strong-testimonials-updater.php +73 -56
- admin/class-strong-views-list-table.php +50 -53
- admin/class-walker-strong-category-checklist.php +8 -10
- admin/class-walker-strong-form-category-checklist.php +8 -10
- admin/compat.php +10 -11
- admin/custom-fields-ajax.php +8 -8
- admin/custom-fields.php +179 -177
- admin/form-preview.php +10 -12
- admin/menu/class-strong-testimonials-menu-fields.php +2 -2
- admin/menu/class-strong-testimonials-menu-settings.php +7 -7
- admin/menu/class-strong-testimonials-menu-shortcodes.php +2 -2
- admin/menu/class-strong-testimonials-menu-views.php +2 -2
- admin/menu/class-strong-testimonials-menu.php +22 -22
- admin/partials/fields/field-controls.php +2 -2
- admin/partials/fields/field-header.php +3 -3
- admin/partials/fields/field-label.php +8 -8
- admin/partials/fields/field-name.php +7 -8
- admin/partials/fields/field-text.php +5 -2
- admin/partials/fields/field-type.php +20 -19
- admin/partials/templates/form-preview-template.php +8 -8
- admin/partials/views/group-compat.php +2 -2
- admin/partials/views/group-extra.php +3 -3
- admin/partials/views/group-fields.php +5 -5
- admin/partials/views/group-form.php +3 -3
- admin/partials/views/group-query.php +14 -14
- admin/partials/views/group-slideshow.php +5 -5
- admin/partials/views/group-style.php +14 -14
- admin/partials/views/option-background.php +88 -88
- admin/partials/views/option-boilerplate.php +11 -11
- admin/partials/views/option-category.php +39 -39
- admin/partials/views/option-classes.php +4 -4
- admin/partials/views/option-client-section.php +6 -2
- admin/partials/views/option-color.php +33 -23
- admin/partials/views/option-content.php +90 -90
- admin/partials/views/option-divi.php +16 -15
- admin/partials/views/option-form-ajax.php +4 -3
- admin/partials/views/option-form-category.php +21 -21
- admin/partials/views/option-id.php +5 -5
- admin/partials/views/option-layout.php +65 -64
- admin/partials/views/option-limit.php +20 -18
- admin/partials/views/option-order.php +7 -7
- admin/partials/views/option-pagination.php +149 -129
- admin/partials/views/option-read-more-page.php +24 -23
- admin/partials/views/option-select.php +8 -8
- admin/partials/views/option-slideshow-behavior.php +27 -21
- admin/partials/views/option-slideshow-breakpoints.php +80 -66
- admin/partials/views/option-slideshow-navigation.php +62 -66
- admin/partials/views/option-slideshow-num.php +3 -3
- admin/partials/views/option-slideshow-transition.php +17 -13
- admin/partials/views/option-slideshow-type.php +14 -14
- admin/partials/views/option-template-list.php +14 -14
- admin/partials/views/option-thumbnail.php +23 -28
- admin/partials/views/option-title.php +16 -14
- admin/partials/views/template-input.php +6 -4
- admin/partials/views/template-not-found.php +19 -18
- admin/partials/views/template-options.php +64 -63
- admin/partials/views/view-mode.php +16 -15
- admin/partials/views/view-name.php +8 -7
- admin/partials/views/view-shortcode.php +14 -14
- admin/settings/class-strong-testimonials-settings-compat.php +230 -146
- admin/settings/class-strong-testimonials-settings-form.php +15 -26
- admin/settings/class-strong-testimonials-settings-general.php +10 -11
- admin/settings/class-strong-testimonials-settings-licenses.php +4 -5
- admin/settings/class-strong-testimonials-settings.php +12 -13
- admin/settings/partials/email-from.php +88 -72
- admin/settings/partials/email-to.php +24 -23
- admin/settings/partials/email.php +44 -35
- admin/settings/partials/form.php +258 -235
- admin/settings/partials/general.php +112 -137
- admin/settings/partials/licenses.php +6 -6
- admin/settings/partials/recipient.php +55 -40
- admin/view-list-order.php +5 -4
- admin/views-ajax.php +9 -17
- admin/views-validate.php +35 -34
- admin/views.php +183 -213
- changelog.txt +4 -1
- includes/class-strong-form.php +44 -32
- includes/class-strong-log.php +99 -103
- includes/class-strong-mail.php +42 -45
- includes/class-strong-templates.php +430 -427
- includes/class-strong-testimonials-order.php +10 -14
- includes/class-strong-testimonials-privacy.php +3 -1
- includes/class-strong-testimonials-render.php +9 -4
- includes/class-strong-testimonials-shortcode-average.php +32 -31
- includes/class-strong-testimonials-shortcode-count.php +1 -1
- includes/class-strong-testimonials-shortcode.php +8 -8
- includes/class-strong-view-display.php +382 -378
- includes/class-strong-view-form.php +215 -216
- includes/class-strong-view-slideshow.php +371 -369
- includes/class-strong-view.php +454 -450
- includes/class-walker-strong-category-checklist-front.php +8 -10
- includes/filters.php +0 -98
- includes/functions-activation.php +3 -3
- includes/functions-content.php +14 -17
- includes/functions-image.php +8 -9
- includes/functions-rating.php +36 -32
- includes/functions-template-form.php +182 -199
- includes/functions-template.php +45 -46
- includes/functions-views.php +8 -8
- includes/functions.php +102 -122
- includes/integrations/class-integration-captcha-pro.php +1 -1
- includes/integrations/class-integration-captcha.php +1 -1
- includes/integrations/class-integration-really-simple-captcha.php +9 -9
- includes/l10n-polylang.php +11 -31
- includes/l10n-wpml.php +8 -10
- includes/post-types.php +15 -20
- includes/retro.php +92 -92
- includes/scripts.php +80 -111
- includes/widget2.php +33 -31
- readme.txt +2 -2
- strong-testimonials.php +2 -2
- templates/default-form/form.php +10 -10
- templates/simple-form/form.php +10 -10
- templates/unstyled-form/form.php +10 -10
admin/about/class-strong-testimonials-about.php
CHANGED
@@ -10,8 +10,8 @@ class Strong_Testimonials_About {
|
|
10 |
* Strong_Testimonials_About constructor.
|
11 |
*/
|
12 |
public function __construct() {
|
13 |
-
|
14 |
-
|
15 |
|
16 |
/**
|
17 |
* Add actions and filters.
|
@@ -21,8 +21,8 @@ class Strong_Testimonials_About {
|
|
21 |
}
|
22 |
|
23 |
/**
|
24 |
-
|
25 |
-
|
26 |
* @param $pages
|
27 |
*
|
28 |
* @return mixed
|
@@ -40,8 +40,8 @@ class Strong_Testimonials_About {
|
|
40 |
public function get_submenu() {
|
41 |
return array(
|
42 |
'page_title' => __( 'About' ),
|
43 |
-
|
44 |
-
|
45 |
'menu_slug' => 'about-strong-testimonials',
|
46 |
'function' => array( $this, 'about_page' ),
|
47 |
);
|
@@ -58,26 +58,26 @@ class Strong_Testimonials_About {
|
|
58 |
<div class="wrap about-wrap">
|
59 |
|
60 |
<?php /* translators: %s is the plugin version number */ ?>
|
61 |
-
<h1><?php printf(
|
62 |
|
63 |
<p class="about-text">
|
64 |
-
|
65 |
<?php /* translators: %s is the plugin version number */ ?>
|
66 |
-
|
67 |
|
68 |
-
<div class="wp-badge strong-testimonials"><?php printf(
|
69 |
|
70 |
<h2 class="nav-tab-wrapper wp-clearfix">
|
71 |
|
72 |
-
<a href="<?php echo
|
73 |
|
74 |
-
<a href="<?php echo
|
75 |
|
76 |
</h2>
|
77 |
|
78 |
|
79 |
<?php
|
80 |
-
switch
|
81 |
case 'privacy':
|
82 |
include WPMTST_ADMIN . 'about/privacy.php';
|
83 |
break;
|
@@ -86,8 +86,8 @@ class Strong_Testimonials_About {
|
|
86 |
break;
|
87 |
}
|
88 |
|
89 |
-
include WPMTST_ADMIN
|
90 |
-
include WPMTST_ADMIN
|
91 |
?>
|
92 |
|
93 |
</div>
|
10 |
* Strong_Testimonials_About constructor.
|
11 |
*/
|
12 |
public function __construct() {
|
13 |
+
$this->add_actions();
|
14 |
+
}
|
15 |
|
16 |
/**
|
17 |
* Add actions and filters.
|
21 |
}
|
22 |
|
23 |
/**
|
24 |
+
* Add submenu page.
|
25 |
+
*
|
26 |
* @param $pages
|
27 |
*
|
28 |
* @return mixed
|
40 |
public function get_submenu() {
|
41 |
return array(
|
42 |
'page_title' => __( 'About' ),
|
43 |
+
'menu_title' => __( 'About' ),
|
44 |
+
'capability' => 'strong_testimonials_about',
|
45 |
'menu_slug' => 'about-strong-testimonials',
|
46 |
'function' => array( $this, 'about_page' ),
|
47 |
);
|
58 |
<div class="wrap about-wrap">
|
59 |
|
60 |
<?php /* translators: %s is the plugin version number */ ?>
|
61 |
+
<h1><?php printf( __( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), $major_minor ); ?></h1>
|
62 |
|
63 |
<p class="about-text">
|
64 |
+
<?php _e( 'Thank you for updating to the latest version!' ); ?>
|
65 |
<?php /* translators: %s is the plugin version number */ ?>
|
66 |
+
</p>
|
67 |
|
68 |
+
<div class="wp-badge strong-testimonials"><?php printf( __( 'Version %s' ), $major_minor ); ?></div>
|
69 |
|
70 |
<h2 class="nav-tab-wrapper wp-clearfix">
|
71 |
|
72 |
+
<a href="<?php echo add_query_arg( 'tab', 'how-to', $url ); ?>" class="nav-tab <?php echo $active_tab == 'how-to' ? 'nav-tab-active' : ''; ?>"><?php _e( 'How To', 'strong-testimonials' ); ?></a>
|
73 |
|
74 |
+
<a href="<?php echo add_query_arg( 'tab', 'privacy', $url ); ?>" class="nav-tab <?php echo $active_tab == 'privacy' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Privacy' ); ?></a>
|
75 |
|
76 |
</h2>
|
77 |
|
78 |
|
79 |
<?php
|
80 |
+
switch( $active_tab ) {
|
81 |
case 'privacy':
|
82 |
include WPMTST_ADMIN . 'about/privacy.php';
|
83 |
break;
|
86 |
break;
|
87 |
}
|
88 |
|
89 |
+
include WPMTST_ADMIN. 'about/links.php';
|
90 |
+
include WPMTST_ADMIN. 'about/addons.php';
|
91 |
?>
|
92 |
|
93 |
</div>
|
admin/about/how-to.php
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
<?php
|
2 |
$add_the_view = __( 'Add the view to a page or sidebar using its unique shortcode or the Strong Testimonials widget.', 'strong-testimonials' );
|
3 |
?>
|
4 |
-
<h2><?php
|
5 |
-
<p class="lead-description"><?php
|
6 |
|
7 |
<div class="feature-section two-col">
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
</div>
|
1 |
<?php
|
2 |
$add_the_view = __( 'Add the view to a page or sidebar using its unique shortcode or the Strong Testimonials widget.', 'strong-testimonials' );
|
3 |
?>
|
4 |
+
<h2><?php _e( 'Let\'s Get Started', 'strong-testimonials' ); ?></h2>
|
5 |
+
<p class="lead-description"><?php _e( 'This plugin is different than others you may have tried.', 'strong-testimonials' ); ?></p>
|
6 |
|
7 |
<div class="feature-section two-col">
|
8 |
+
<div class="col">
|
9 |
+
<h3><?php _e('How to Add the Form', 'strong-testimonials' ); ?></h3>
|
10 |
+
<p>1. <?php printf( __( '<a href="%s">Check the custom fields</a>. The default set of fields are designed to suit most situations. Add or remove fields as you see fit.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-fields' ) ); ?>
|
11 |
+
</p>
|
12 |
+
<p>2. <?php printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ); ?>
|
13 |
+
<?php _e( 'Select <strong>Form</strong> mode.', 'strong-testimonials' ); ?>
|
14 |
+
</p>
|
15 |
+
<p>3. <?php echo $add_the_view; ?></p>
|
16 |
+
</div>
|
17 |
|
18 |
+
<div class="col">
|
19 |
+
<h3><?php _e( 'How to Display Your Testimonials', 'strong-testimonials' ); ?></h3>
|
20 |
+
<p>1. <?php printf( __( '<a href="%s">Enter your testimonials</a> if necessary. The plugin will not read existing testimonials from another plugin or theme. It will not import testimonials.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial' ) ); ?></p>
|
21 |
+
<p>2. <?php printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ); ?>
|
22 |
+
<?php _e( 'Select <strong>Display</strong> mode.', 'strong-testimonials' ); ?>
|
23 |
+
</p>
|
24 |
+
<p>3. <?php echo $add_the_view; ?></p>
|
25 |
+
</div>
|
26 |
|
27 |
+
<div class="col">
|
28 |
+
<h3><?php _e( 'How to Add a Slideshow', 'strong-testimonials' ); ?></h3>
|
29 |
+
<p>1. <?php printf( __( '<a href="%s">Enter your testimonials</a> if necessary. The plugin will not read existing testimonials from another plugin or theme. It will not import testimonials.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial' ) ); ?></p>
|
30 |
+
<p>2. <?php printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ); ?>
|
31 |
+
<?php _e( 'Select <strong>Slideshow</strong> mode.', 'strong-testimonials' ); ?>
|
32 |
+
</p>
|
33 |
+
<p>3. <?php echo $add_the_view; ?></p>
|
34 |
+
</div>
|
35 |
|
36 |
+
<div class="col">
|
37 |
+
<h3><?php _e( 'How to Translate', 'strong-testimonials' ); ?></h3>
|
38 |
+
<p><?php _e( 'Strong Testimonials is compatible with WPML, Polylang and WP Globus.', 'strong-testimonials' ); ?></p>
|
39 |
+
<p><?php _e( 'In WPML and Polylang, domains are added to the <strong>String Translation</strong> pages. Those domains encompass the form fields, the form messages, the notification email, and the "Read more" link text in your views. They are updated automatically when any of those settings change.', 'strong-testimonials' ); ?></p>
|
40 |
+
</div>
|
41 |
</div>
|
admin/about/links.php
CHANGED
@@ -1,15 +1,19 @@
|
|
1 |
<hr />
|
2 |
|
3 |
<div class="feature-section three-col">
|
4 |
-
|
5 |
-
|
6 |
<?php
|
7 |
-
$links
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
?>
|
10 |
<ul>
|
11 |
<?php foreach ( $links as $link ) : ?>
|
12 |
-
<li><?php echo
|
13 |
<?php endforeach; ?>
|
14 |
</ul>
|
15 |
</div>
|
1 |
<hr />
|
2 |
|
3 |
<div class="feature-section three-col">
|
4 |
+
<div class="col">
|
5 |
+
<h3><?php _e( 'Support', 'strong-testimonials' ); ?></h3>
|
6 |
<?php
|
7 |
+
$links = array();
|
8 |
+
|
9 |
+
$links[] = sprintf( '<a href="%s" target="_blank">%s</a>',
|
10 |
+
esc_url( 'http://wordpress.org/support/plugin/strong-testimonials' ),
|
11 |
+
__( 'Use the community support forum', 'strong-testimonials' ) );
|
12 |
+
|
13 |
?>
|
14 |
<ul>
|
15 |
<?php foreach ( $links as $link ) : ?>
|
16 |
+
<li><?php echo $link; ?></li>
|
17 |
<?php endforeach; ?>
|
18 |
</ul>
|
19 |
</div>
|
admin/about/privacy.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<h2><?php
|
2 |
-
<p class="lead-description"><?php
|
3 |
<div class="feature-section one-col">
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
</div>
|
1 |
+
<h2><?php _e( 'Privacy and GDPR', 'strong-testimonials' ); ?></h2>
|
2 |
+
<p class="lead-description"><?php _e( 'Compliance is entirely in your control.', 'strong-testimonials' ); ?></p>
|
3 |
<div class="feature-section one-col">
|
4 |
+
<div class="col">
|
5 |
+
<p><?php _e( 'By default, this plugin does not store any user or visitor data, does not send any data to remote servers, act as a service or embed content, does not edit the comments form in any way.', 'strong-testimonials' ); ?></p>
|
6 |
+
<p><?php _e( 'The plugin also prevents displaying email addresses in your testimonials on the front end.', 'strong-testimonials' ); ?></p>
|
7 |
+
<p><strong><?php _e( 'However, this plugin provides features that may involve private data.', 'strong-testimonials' ); ?></strong></p>
|
8 |
+
<p><?php _e( 'If you use the testimonial submission form, the data collected on that form will be stored in your database.', 'strong-testimonials' ); ?></p>
|
9 |
+
<p><?php _e( 'If you enable the administrator notification email upon new testimonial submission, the data collected on your form, at your selection, may be included in that notification email.', 'strong-testimonials' ); ?></p>
|
10 |
+
<p><?php _e( 'If you enable comments on testimonials, the plugin will use your theme\'s single post template and comment form.', 'strong-testimonials' ); ?></p>
|
11 |
+
<p><?php _e( 'If you embed third-party posts such as Twitter, YouTube and FaceBook in your testimonials, you will be agreeing to the Terms of Use of those third-party sites.', 'strong-testimonials' ); ?></p>
|
12 |
+
</div>
|
13 |
</div>
|
admin/admin-notices.php
CHANGED
@@ -33,15 +33,15 @@ function wpmtst_admin_notices() {
|
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
}
|
46 |
add_action( 'admin_notices', 'wpmtst_admin_notices' );
|
47 |
|
@@ -58,66 +58,61 @@ add_action( 'admin_notices', 'wpmtst_admin_notices' );
|
|
58 |
function wpmtst_admin_notice_text( $html = '', $key, $persist = false ) {
|
59 |
|
60 |
switch ( $key ) {
|
61 |
-
case 'defaults-restored':
|
62 |
ob_start();
|
63 |
?>
|
64 |
-
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php
|
65 |
<p>
|
66 |
-
<?php
|
67 |
</p>
|
68 |
</div>
|
69 |
<?php
|
70 |
$html = ob_get_clean();
|
71 |
break;
|
72 |
|
73 |
-
case 'fields-saved':
|
74 |
ob_start();
|
75 |
?>
|
76 |
-
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php
|
77 |
<p>
|
78 |
-
<?php
|
79 |
</p>
|
80 |
</div>
|
81 |
<?php
|
82 |
$html = ob_get_clean();
|
83 |
break;
|
84 |
|
85 |
-
case 'changes-cancelled':
|
86 |
ob_start();
|
87 |
?>
|
88 |
-
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php
|
89 |
<p>
|
90 |
-
<?php
|
91 |
</p>
|
92 |
</div>
|
93 |
<?php
|
94 |
$html = ob_get_clean();
|
95 |
break;
|
96 |
|
97 |
-
case 'captcha-options-changed':
|
98 |
-
$tags
|
99 |
-
'a' => array(
|
100 |
-
'class' => array(),
|
101 |
-
'href' => array(),
|
102 |
-
),
|
103 |
-
);
|
104 |
//$settings_url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings&tab=form#captcha-section' );
|
105 |
$settings_url = admin_url( '?action=captcha-options-changed' );
|
106 |
-
$settings_link = sprintf( wp_kses( __( 'Please check your <a href="%
|
107 |
|
108 |
ob_start();
|
109 |
?>
|
110 |
-
|
111 |
-
|
112 |
-
<?php
|
113 |
-
<?php echo
|
114 |
-
|
115 |
-
|
116 |
<?php
|
117 |
$html = ob_get_clean();
|
118 |
break;
|
119 |
|
120 |
-
default:
|
121 |
// nothing
|
122 |
}
|
123 |
|
@@ -135,7 +130,7 @@ add_filter( 'wpmtst_admin_notice', 'wpmtst_admin_notice_text', 10, 2 );
|
|
135 |
* @param $persist
|
136 |
*/
|
137 |
function wpmtst_add_admin_notice( $key, $persist = false ) {
|
138 |
-
$notices
|
139 |
$notices[ $key ] = array( 'persist' => $persist );
|
140 |
update_option( 'wpmtst_admin_notices', $notices );
|
141 |
}
|
@@ -164,31 +159,29 @@ function wpmtst_delete_admin_notice( $key ) {
|
|
164 |
* @param $value
|
165 |
*/
|
166 |
function wpmtst_auto_dismiss_notices( $option, $old_value, $value ) {
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
}
|
182 |
add_action( 'update_option', 'wpmtst_auto_dismiss_notices', 10, 3 );
|
183 |
|
184 |
|
185 |
function wpmtst_admin_feedback_notice() {
|
186 |
-
|
187 |
$screen = get_current_screen();
|
188 |
if ( $screen->id !== 'edit-wpm-testimonial' ) {
|
189 |
return;
|
190 |
}
|
191 |
-
|
192 |
?>
|
193 |
<div class="notice wpmtst-notice">
|
194 |
<img src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/logo-long.svg" width="400"/>
|
@@ -197,4 +190,4 @@ function wpmtst_admin_feedback_notice() {
|
|
197 |
</div>
|
198 |
<?php
|
199 |
}
|
200 |
-
add_action( 'admin_notices', 'wpmtst_admin_feedback_notice' );
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
+
foreach ( $notices as $key => $notice ) {
|
37 |
+
$message = apply_filters( 'wpmtst_admin_notice', '', $key );
|
38 |
+
if ( $message ) {
|
39 |
+
echo $message;
|
40 |
+
}
|
41 |
+
if ( ! $notice['persist'] ) {
|
42 |
+
wpmtst_delete_admin_notice( $key );
|
43 |
+
}
|
44 |
+
}
|
45 |
}
|
46 |
add_action( 'admin_notices', 'wpmtst_admin_notices' );
|
47 |
|
58 |
function wpmtst_admin_notice_text( $html = '', $key, $persist = false ) {
|
59 |
|
60 |
switch ( $key ) {
|
61 |
+
case 'defaults-restored' :
|
62 |
ob_start();
|
63 |
?>
|
64 |
+
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php esc_attr_e( $key ); ?>">
|
65 |
<p>
|
66 |
+
<?php _e( 'Defaults restored.', 'strong-testimonials' ); ?>
|
67 |
</p>
|
68 |
</div>
|
69 |
<?php
|
70 |
$html = ob_get_clean();
|
71 |
break;
|
72 |
|
73 |
+
case 'fields-saved' :
|
74 |
ob_start();
|
75 |
?>
|
76 |
+
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php esc_attr_e( $key ); ?>">
|
77 |
<p>
|
78 |
+
<?php _e( 'Fields saved.', 'strong-testimonials' ); ?>
|
79 |
</p>
|
80 |
</div>
|
81 |
<?php
|
82 |
$html = ob_get_clean();
|
83 |
break;
|
84 |
|
85 |
+
case 'changes-cancelled' :
|
86 |
ob_start();
|
87 |
?>
|
88 |
+
<div class="wpmtst notice notice-success is-dismissible" data-key="<?php esc_attr_e( $key ); ?>">
|
89 |
<p>
|
90 |
+
<?php _e( 'Changes cancelled.', 'strong-testimonials' ); ?>
|
91 |
</p>
|
92 |
</div>
|
93 |
<?php
|
94 |
$html = ob_get_clean();
|
95 |
break;
|
96 |
|
97 |
+
case 'captcha-options-changed' :
|
98 |
+
$tags = array( 'a' => array( 'class' => array(), 'href' => array() ) );
|
|
|
|
|
|
|
|
|
|
|
99 |
//$settings_url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings&tab=form#captcha-section' );
|
100 |
$settings_url = admin_url( '?action=captcha-options-changed' );
|
101 |
+
$settings_link = sprintf( wp_kses( __( 'Please check your <a href="%s">%s</a>.', 'strong-testimonials' ), $tags ), esc_url( $settings_url ), __( 'settings', 'strong-testimonials' ) );
|
102 |
|
103 |
ob_start();
|
104 |
?>
|
105 |
+
<div class="wpmtst notice notice-warning is-dismissible" data-key="<?php esc_attr_e( $key ); ?>">
|
106 |
+
<p>
|
107 |
+
<?php _e( 'Captcha options have changed in <strong>Strong Testimonials</strong>.', 'strong-testimonials' ); ?>
|
108 |
+
<?php echo $settings_link; ?>
|
109 |
+
</p>
|
110 |
+
</div>
|
111 |
<?php
|
112 |
$html = ob_get_clean();
|
113 |
break;
|
114 |
|
115 |
+
default :
|
116 |
// nothing
|
117 |
}
|
118 |
|
130 |
* @param $persist
|
131 |
*/
|
132 |
function wpmtst_add_admin_notice( $key, $persist = false ) {
|
133 |
+
$notices = get_option( 'wpmtst_admin_notices', array() );
|
134 |
$notices[ $key ] = array( 'persist' => $persist );
|
135 |
update_option( 'wpmtst_admin_notices', $notices );
|
136 |
}
|
159 |
* @param $value
|
160 |
*/
|
161 |
function wpmtst_auto_dismiss_notices( $option, $old_value, $value ) {
|
162 |
+
if ( ! function_exists( 'get_current_screen' ) ) {
|
163 |
+
return;
|
164 |
+
}
|
165 |
+
|
166 |
+
$screen = get_current_screen();
|
167 |
+
if ( $screen && 'options' == $screen->base ) {
|
168 |
+
if ( 'wpmtst_form_options' == $option ) {
|
169 |
+
$notices = get_option( 'wpmtst_admin_notices', array() );
|
170 |
+
if ( isset( $notices['captcha-options-changed'] ) ) {
|
171 |
+
unset( $notices['captcha-options-changed'] );
|
172 |
+
update_option( 'wpmtst_admin_notices', $notices );
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
}
|
177 |
add_action( 'update_option', 'wpmtst_auto_dismiss_notices', 10, 3 );
|
178 |
|
179 |
|
180 |
function wpmtst_admin_feedback_notice() {
|
|
|
181 |
$screen = get_current_screen();
|
182 |
if ( $screen->id !== 'edit-wpm-testimonial' ) {
|
183 |
return;
|
184 |
}
|
|
|
185 |
?>
|
186 |
<div class="notice wpmtst-notice">
|
187 |
<img src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>/img/logo-long.svg" width="400"/>
|
190 |
</div>
|
191 |
<?php
|
192 |
}
|
193 |
+
add_action( 'admin_notices', 'wpmtst_admin_feedback_notice' );
|
admin/admin.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
*/
|
13 |
function wpmtst_version_check() {
|
14 |
global $wp_version;
|
15 |
-
$require_wp_version =
|
16 |
|
17 |
if ( version_compare( $wp_version, $require_wp_version ) == -1 ) {
|
18 |
deactivate_plugins( WPMTST_PLUGIN );
|
@@ -22,7 +22,7 @@ function wpmtst_version_check() {
|
|
22 |
$message .= '<p>' . sprintf( _x( 'This plugin requires <strong>WordPress %s</strong> or higher so it has been deactivated.', 'installation', 'strong-testimonials' ), $require_wp_version ) . '</p>';
|
23 |
$message .= '<p>' . _x( 'Please upgrade WordPress and try again.', 'installation', 'strong-testimonials' ) . '</p>';
|
24 |
$message .= '<p>' . sprintf( _x( 'Back to the WordPress <a href="%s">Plugins page</a>', 'installation', 'strong-testimonials' ), get_admin_url( null, 'plugins.php' ) ) . '</p>';
|
25 |
-
wp_die(
|
26 |
}
|
27 |
}
|
28 |
|
@@ -80,8 +80,8 @@ add_action( 'admin_init', 'wpmtst_admin_init' );
|
|
80 |
*/
|
81 |
function wpmtst_action_captcha_options_changed() {
|
82 |
wpmtst_delete_admin_notice( 'captcha-options-changed' );
|
83 |
-
|
84 |
-
|
85 |
}
|
86 |
|
87 |
add_action( 'admin_action_captcha-options-changed', 'wpmtst_action_captcha_options_changed' );
|
@@ -120,34 +120,29 @@ function wpmtst_is_testimonial_screen() {
|
|
120 |
* @return mixed
|
121 |
*/
|
122 |
function wpmtst_pending_indicator( $menu ) {
|
123 |
-
if ( ! current_user_can( 'edit_posts' ) )
|
124 |
return $menu;
|
125 |
-
}
|
126 |
|
127 |
$options = get_option( 'wpmtst_options' );
|
128 |
-
if ( ! isset( $options['pending_indicator'] ) || ! $options['pending_indicator'] )
|
129 |
return $menu;
|
130 |
-
}
|
131 |
|
132 |
$types = array( 'wpm-testimonial' );
|
133 |
$status = 'pending';
|
134 |
foreach ( $types as $type ) {
|
135 |
$num_posts = wp_count_posts( $type, 'readable' );
|
136 |
$pending_count = 0;
|
137 |
-
if ( ! empty( $num_posts->$status ) )
|
138 |
$pending_count = $num_posts->$status;
|
139 |
-
}
|
140 |
|
141 |
-
if ( $type == 'post' )
|
142 |
$menu_str = 'edit.php';
|
143 |
-
|
144 |
$menu_str = 'edit.php?post_type=' . $type;
|
145 |
-
}
|
146 |
|
147 |
foreach ( $menu as $menu_key => $menu_data ) {
|
148 |
-
if ( $menu_str != $menu_data[2] )
|
149 |
continue;
|
150 |
-
}
|
151 |
$menu[ $menu_key ][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n( $pending_count ) . '</span></span>';
|
152 |
}
|
153 |
}
|
@@ -164,11 +159,12 @@ add_filter( 'add_menu_classes', 'wpmtst_pending_indicator' );
|
|
164 |
* @since 2.18.0
|
165 |
*/
|
166 |
function wpmtst_restore_default_icon( $for ) {
|
167 |
-
if (
|
168 |
-
return;
|
169 |
-
}
|
170 |
?>
|
171 |
-
<input type="button" class="button secondary restore-default"
|
|
|
|
|
|
|
172 |
<?php
|
173 |
}
|
174 |
|
@@ -197,7 +193,7 @@ add_action( 'updated_option', 'wpmtst_updated_option', 10, 3 );
|
|
197 |
* @param $key
|
198 |
*/
|
199 |
function wpmtst_add_config_error( $key ) {
|
200 |
-
$errors
|
201 |
$errors[] = $key;
|
202 |
update_option( 'wpmtst_config_errors', array_unique( $errors ) );
|
203 |
|
@@ -213,7 +209,7 @@ function wpmtst_add_config_error( $key ) {
|
|
213 |
*/
|
214 |
function wpmtst_delete_config_error( $key ) {
|
215 |
$errors = get_option( 'wpmtst_config_errors', array() );
|
216 |
-
$errors = array_diff( $errors, array( $key ) );
|
217 |
update_option( 'wpmtst_config_errors', $errors );
|
218 |
|
219 |
wpmtst_delete_admin_notice( $key );
|
@@ -232,9 +228,7 @@ function wpmtst_delete_config_error( $key ) {
|
|
232 |
function wpmtst_save_view( $view, $action = 'edit' ) {
|
233 |
global $wpdb;
|
234 |
|
235 |
-
if ( ! $view )
|
236 |
-
return false;
|
237 |
-
}
|
238 |
|
239 |
$table_name = $wpdb->prefix . 'strong_views';
|
240 |
$serialized = serialize( $view['data'] );
|
@@ -244,8 +238,9 @@ function wpmtst_save_view( $view, $action = 'edit' ) {
|
|
244 |
$sql = $wpdb->prepare( $sql, $view['name'], $serialized );
|
245 |
$wpdb->query( $sql );
|
246 |
$view['id'] = $wpdb->insert_id;
|
247 |
-
$return
|
248 |
-
}
|
|
|
249 |
$sql = "UPDATE {$table_name} SET name = %s, value = %s WHERE id = %d";
|
250 |
$sql = $wpdb->prepare( $sql, $view['name'], $serialized, intval( $view['id'] ) );
|
251 |
$wpdb->query( $sql );
|
12 |
*/
|
13 |
function wpmtst_version_check() {
|
14 |
global $wp_version;
|
15 |
+
$require_wp_version = "3.7";
|
16 |
|
17 |
if ( version_compare( $wp_version, $require_wp_version ) == -1 ) {
|
18 |
deactivate_plugins( WPMTST_PLUGIN );
|
22 |
$message .= '<p>' . sprintf( _x( 'This plugin requires <strong>WordPress %s</strong> or higher so it has been deactivated.', 'installation', 'strong-testimonials' ), $require_wp_version ) . '</p>';
|
23 |
$message .= '<p>' . _x( 'Please upgrade WordPress and try again.', 'installation', 'strong-testimonials' ) . '</p>';
|
24 |
$message .= '<p>' . sprintf( _x( 'Back to the WordPress <a href="%s">Plugins page</a>', 'installation', 'strong-testimonials' ), get_admin_url( null, 'plugins.php' ) ) . '</p>';
|
25 |
+
wp_die( $message );
|
26 |
}
|
27 |
}
|
28 |
|
80 |
*/
|
81 |
function wpmtst_action_captcha_options_changed() {
|
82 |
wpmtst_delete_admin_notice( 'captcha-options-changed' );
|
83 |
+
wp_redirect( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings&tab=form#captcha-section' ) );
|
84 |
+
exit;
|
85 |
}
|
86 |
|
87 |
add_action( 'admin_action_captcha-options-changed', 'wpmtst_action_captcha_options_changed' );
|
120 |
* @return mixed
|
121 |
*/
|
122 |
function wpmtst_pending_indicator( $menu ) {
|
123 |
+
if ( ! current_user_can( 'edit_posts' ) )
|
124 |
return $menu;
|
|
|
125 |
|
126 |
$options = get_option( 'wpmtst_options' );
|
127 |
+
if ( ! isset( $options['pending_indicator'] ) || ! $options['pending_indicator'] )
|
128 |
return $menu;
|
|
|
129 |
|
130 |
$types = array( 'wpm-testimonial' );
|
131 |
$status = 'pending';
|
132 |
foreach ( $types as $type ) {
|
133 |
$num_posts = wp_count_posts( $type, 'readable' );
|
134 |
$pending_count = 0;
|
135 |
+
if ( ! empty( $num_posts->$status ) )
|
136 |
$pending_count = $num_posts->$status;
|
|
|
137 |
|
138 |
+
if ( $type == 'post' )
|
139 |
$menu_str = 'edit.php';
|
140 |
+
else
|
141 |
$menu_str = 'edit.php?post_type=' . $type;
|
|
|
142 |
|
143 |
foreach ( $menu as $menu_key => $menu_data ) {
|
144 |
+
if ( $menu_str != $menu_data[2] )
|
145 |
continue;
|
|
|
146 |
$menu[ $menu_key ][0] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n( $pending_count ) . '</span></span>';
|
147 |
}
|
148 |
}
|
159 |
* @since 2.18.0
|
160 |
*/
|
161 |
function wpmtst_restore_default_icon( $for ) {
|
162 |
+
if ( !$for ) return;
|
|
|
|
|
163 |
?>
|
164 |
+
<input type="button" class="button secondary restore-default"
|
165 |
+
title="<?php _e( 'restore default', 'strong-testimonials' ); ?>"
|
166 |
+
value=""
|
167 |
+
data-for="<?php echo $for; ?>"/>
|
168 |
<?php
|
169 |
}
|
170 |
|
193 |
* @param $key
|
194 |
*/
|
195 |
function wpmtst_add_config_error( $key ) {
|
196 |
+
$errors = get_option( 'wpmtst_config_errors', array() );
|
197 |
$errors[] = $key;
|
198 |
update_option( 'wpmtst_config_errors', array_unique( $errors ) );
|
199 |
|
209 |
*/
|
210 |
function wpmtst_delete_config_error( $key ) {
|
211 |
$errors = get_option( 'wpmtst_config_errors', array() );
|
212 |
+
$errors = array_diff( $errors, array ( $key ) );
|
213 |
update_option( 'wpmtst_config_errors', $errors );
|
214 |
|
215 |
wpmtst_delete_admin_notice( $key );
|
228 |
function wpmtst_save_view( $view, $action = 'edit' ) {
|
229 |
global $wpdb;
|
230 |
|
231 |
+
if ( ! $view ) return false;
|
|
|
|
|
232 |
|
233 |
$table_name = $wpdb->prefix . 'strong_views';
|
234 |
$serialized = serialize( $view['data'] );
|
238 |
$sql = $wpdb->prepare( $sql, $view['name'], $serialized );
|
239 |
$wpdb->query( $sql );
|
240 |
$view['id'] = $wpdb->insert_id;
|
241 |
+
$return = $view['id'];
|
242 |
+
}
|
243 |
+
else {
|
244 |
$sql = "UPDATE {$table_name} SET name = %s, value = %s WHERE id = %d";
|
245 |
$sql = $wpdb->prepare( $sql, $view['name'], $serialized, intval( $view['id'] ) );
|
246 |
$wpdb->query( $sql );
|
admin/class-strong-testimonials-admin-list.php
CHANGED
@@ -109,7 +109,9 @@ class Strong_Testimonials_Admin_List {
|
|
109 |
} else {
|
110 |
$fields_to_add[ $field['name'] ] = apply_filters( 'wpmtst_l10n', $field['label'], 'strong-testimonials-form-fields', $field['name'] . ' : label' );
|
111 |
}
|
|
|
112 |
}
|
|
|
113 |
}
|
114 |
|
115 |
// 5. add [category], [comments] and [date]
|
@@ -144,40 +146,40 @@ class Strong_Testimonials_Admin_List {
|
|
144 |
|
145 |
switch ( $column ) {
|
146 |
|
147 |
-
case 'post_id':
|
148 |
-
echo
|
149 |
break;
|
150 |
|
151 |
-
case 'post_content':
|
152 |
-
echo
|
153 |
break;
|
154 |
|
155 |
-
case 'post_excerpt':
|
156 |
-
echo
|
157 |
break;
|
158 |
|
159 |
-
case 'strong_thumbnail':
|
160 |
echo get_the_post_thumbnail( $post->ID, array( 75, 75 ) );
|
161 |
break;
|
162 |
|
163 |
-
case 'category':
|
164 |
$categories = get_the_terms( 0, 'wpm-testimonial-category' );
|
165 |
if ( $categories && ! is_wp_error( $categories ) ) {
|
166 |
$list = array();
|
167 |
foreach ( $categories as $cat ) {
|
168 |
$list[] = $cat->name;
|
169 |
}
|
170 |
-
echo
|
171 |
}
|
172 |
break;
|
173 |
|
174 |
-
case 'handle':
|
175 |
if ( current_user_can( 'edit_post', $post->ID ) && ! self::is_column_sorted() && ! self::is_viewing_trash() ) {
|
176 |
echo '<div class="handle"><div class="help"></div><div class="help-in-motion"></div></div>';
|
177 |
}
|
178 |
break;
|
179 |
|
180 |
-
default:
|
181 |
// custom field?
|
182 |
$custom = get_post_custom();
|
183 |
$fields = wpmtst_get_custom_fields();
|
@@ -187,25 +189,31 @@ class Strong_Testimonials_Admin_List {
|
|
187 |
if ( isset( $fields[ $column ] ) ) {
|
188 |
|
189 |
switch ( $fields[ $column ]['input_type'] ) {
|
190 |
-
case 'rating':
|
191 |
wpmtst_star_rating_display( $custom[ $column ][0], 'in-table-list' );
|
192 |
break;
|
193 |
-
case 'checkbox':
|
194 |
echo $custom[ $column ][0] ? 'yes' : 'no';
|
195 |
break;
|
196 |
-
default:
|
197 |
-
echo
|
198 |
}
|
|
|
199 |
}
|
|
|
200 |
} else {
|
201 |
|
202 |
if ( isset( $fields[ $column ] ) ) {
|
203 |
|
204 |
if ( 'checkbox' == $fields[ $column ]['input_type'] ) {
|
205 |
echo 'no';
|
|
|
|
|
206 |
}
|
|
|
207 |
}
|
208 |
}
|
|
|
209 |
}
|
210 |
}
|
211 |
|
109 |
} else {
|
110 |
$fields_to_add[ $field['name'] ] = apply_filters( 'wpmtst_l10n', $field['label'], 'strong-testimonials-form-fields', $field['name'] . ' : label' );
|
111 |
}
|
112 |
+
|
113 |
}
|
114 |
+
|
115 |
}
|
116 |
|
117 |
// 5. add [category], [comments] and [date]
|
146 |
|
147 |
switch ( $column ) {
|
148 |
|
149 |
+
case 'post_id' :
|
150 |
+
echo $post->ID;
|
151 |
break;
|
152 |
|
153 |
+
case 'post_content' :
|
154 |
+
echo substr( $post->post_content, 0, 100 ) . '…';
|
155 |
break;
|
156 |
|
157 |
+
case 'post_excerpt' :
|
158 |
+
echo $post->post_excerpt;
|
159 |
break;
|
160 |
|
161 |
+
case 'strong_thumbnail' :
|
162 |
echo get_the_post_thumbnail( $post->ID, array( 75, 75 ) );
|
163 |
break;
|
164 |
|
165 |
+
case 'category' :
|
166 |
$categories = get_the_terms( 0, 'wpm-testimonial-category' );
|
167 |
if ( $categories && ! is_wp_error( $categories ) ) {
|
168 |
$list = array();
|
169 |
foreach ( $categories as $cat ) {
|
170 |
$list[] = $cat->name;
|
171 |
}
|
172 |
+
echo join( ", ", $list );
|
173 |
}
|
174 |
break;
|
175 |
|
176 |
+
case 'handle' :
|
177 |
if ( current_user_can( 'edit_post', $post->ID ) && ! self::is_column_sorted() && ! self::is_viewing_trash() ) {
|
178 |
echo '<div class="handle"><div class="help"></div><div class="help-in-motion"></div></div>';
|
179 |
}
|
180 |
break;
|
181 |
|
182 |
+
default :
|
183 |
// custom field?
|
184 |
$custom = get_post_custom();
|
185 |
$fields = wpmtst_get_custom_fields();
|
189 |
if ( isset( $fields[ $column ] ) ) {
|
190 |
|
191 |
switch ( $fields[ $column ]['input_type'] ) {
|
192 |
+
case 'rating' :
|
193 |
wpmtst_star_rating_display( $custom[ $column ][0], 'in-table-list' );
|
194 |
break;
|
195 |
+
case 'checkbox' :
|
196 |
echo $custom[ $column ][0] ? 'yes' : 'no';
|
197 |
break;
|
198 |
+
default :
|
199 |
+
echo $custom[ $column ][0];
|
200 |
}
|
201 |
+
|
202 |
}
|
203 |
+
|
204 |
} else {
|
205 |
|
206 |
if ( isset( $fields[ $column ] ) ) {
|
207 |
|
208 |
if ( 'checkbox' == $fields[ $column ]['input_type'] ) {
|
209 |
echo 'no';
|
210 |
+
} else {
|
211 |
+
// display nothing
|
212 |
}
|
213 |
+
|
214 |
}
|
215 |
}
|
216 |
+
|
217 |
}
|
218 |
}
|
219 |
|
admin/class-strong-testimonials-admin-scripts.php
CHANGED
@@ -45,119 +45,91 @@ class Strong_Testimonials_Admin_Scripts {
|
|
45 |
|
46 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
47 |
|
48 |
-
wp_register_style(
|
49 |
-
'wpmtst-font-awesome',
|
50 |
WPMTST_PUBLIC_URL . 'fonts/font-awesome-4.6.3/css/font-awesome.min.css',
|
51 |
array(),
|
52 |
-
'4.6.3'
|
53 |
-
);
|
54 |
|
55 |
-
wp_register_script(
|
56 |
-
'wpmtst-help',
|
57 |
WPMTST_ADMIN_URL . 'js/help.js',
|
58 |
array( 'jquery' ),
|
59 |
$plugin_version,
|
60 |
-
true
|
61 |
-
);
|
62 |
|
63 |
-
wp_register_script(
|
64 |
-
'wpmtst-admin-script',
|
65 |
WPMTST_ADMIN_URL . 'js/admin.js',
|
66 |
array( 'jquery', 'underscore' ),
|
67 |
$plugin_version,
|
68 |
-
true
|
69 |
-
);
|
70 |
|
71 |
-
wp_register_style(
|
72 |
-
'wpmtst-admin-style',
|
73 |
WPMTST_ADMIN_URL . 'css/admin.css',
|
74 |
array( 'wpmtst-font-awesome' ),
|
75 |
-
$plugin_version
|
76 |
-
);
|
77 |
|
78 |
-
wp_register_style(
|
79 |
-
'wpmtst-post-editor',
|
80 |
WPMTST_ADMIN_URL . 'css/post-editor.css',
|
81 |
array( 'wpmtst-font-awesome' ),
|
82 |
-
$plugin_version
|
83 |
-
);
|
84 |
|
85 |
-
wp_register_script(
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
true
|
91 |
-
);
|
92 |
|
93 |
-
wp_register_script(
|
94 |
-
'autosize',
|
95 |
WPMTST_ADMIN_URL . 'js/lib/autosize/autosize.min.js',
|
96 |
array(),
|
97 |
'4.0.1',
|
98 |
-
true
|
99 |
-
);
|
100 |
|
101 |
/**
|
102 |
* Form tab
|
103 |
*/
|
104 |
-
wp_register_style(
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
$plugin_version
|
109 |
-
);
|
110 |
|
111 |
-
wp_register_script(
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
true
|
117 |
-
);
|
118 |
|
119 |
/**
|
120 |
* Compatibility tab
|
121 |
*/
|
122 |
-
wp_register_style(
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
$plugin_version
|
127 |
-
);
|
128 |
|
129 |
-
wp_register_script(
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
true
|
135 |
-
);
|
136 |
|
137 |
/**
|
138 |
* Fields
|
139 |
*/
|
140 |
-
wp_register_style(
|
141 |
-
'wpmtst-admin-fields-style',
|
142 |
WPMTST_ADMIN_URL . 'css/fields.css',
|
143 |
array(),
|
144 |
-
$plugin_version
|
145 |
-
);
|
146 |
|
147 |
-
wp_register_style(
|
148 |
-
'wpmtst-admin-form-preview',
|
149 |
WPMTST_ADMIN_URL . 'css/form-preview.css',
|
150 |
array(),
|
151 |
-
$plugin_version
|
152 |
-
);
|
153 |
|
154 |
-
wp_register_script(
|
155 |
-
'wpmtst-admin-fields-script',
|
156 |
WPMTST_ADMIN_URL . 'js/admin-fields.js',
|
157 |
array( 'jquery', 'jquery-ui-sortable', 'wpmtst-help' ),
|
158 |
$plugin_version,
|
159 |
-
true
|
160 |
-
);
|
161 |
|
162 |
$params = array(
|
163 |
'ajax_nonce' => wp_create_nonce( 'wpmtst-admin' ),
|
@@ -170,45 +142,35 @@ class Strong_Testimonials_Admin_Scripts {
|
|
170 |
/**
|
171 |
* Ratings
|
172 |
*/
|
173 |
-
wp_register_style(
|
174 |
-
'wpmtst-rating-display',
|
175 |
WPMTST_PUBLIC_URL . 'css/rating-display.css',
|
176 |
array( 'wpmtst-font-awesome' ),
|
177 |
-
$plugin_version
|
178 |
-
);
|
179 |
|
180 |
-
wp_register_style(
|
181 |
-
'wpmtst-rating-form',
|
182 |
WPMTST_PUBLIC_URL . 'css/rating-form.css',
|
183 |
array( 'wpmtst-font-awesome' ),
|
184 |
-
$plugin_version
|
185 |
-
);
|
186 |
|
187 |
-
wp_register_script(
|
188 |
-
'wpmtst-rating-script',
|
189 |
WPMTST_ADMIN_URL . 'js/rating-edit.js',
|
190 |
array( 'jquery' ),
|
191 |
$plugin_version,
|
192 |
-
true
|
193 |
-
);
|
194 |
|
195 |
/**
|
196 |
* Views
|
197 |
*/
|
198 |
-
wp_register_style(
|
199 |
-
'wpmtst-admin-views-style',
|
200 |
WPMTST_ADMIN_URL . 'css/views.css',
|
201 |
array(),
|
202 |
-
$plugin_version
|
203 |
-
);
|
204 |
|
205 |
-
wp_register_script(
|
206 |
-
'wpmtst-admin-views-script',
|
207 |
WPMTST_ADMIN_URL . 'js/views.js',
|
208 |
array( 'jquery', 'jquery-ui-sortable', 'wp-color-picker', 'jquery-masonry', 'wpmtst-help' ),
|
209 |
$plugin_version,
|
210 |
-
true
|
211 |
-
);
|
212 |
|
213 |
/**
|
214 |
* Category filter in View editor.
|
@@ -218,33 +180,27 @@ class Strong_Testimonials_Admin_Scripts {
|
|
218 |
*
|
219 |
* @since 2.2.0
|
220 |
*/
|
221 |
-
wp_register_script(
|
222 |
-
'wpmtst-view-category-filter-script',
|
223 |
WPMTST_ADMIN_URL . 'js/view-category-filter.js',
|
224 |
array( 'jquery' ),
|
225 |
$plugin_version,
|
226 |
-
true
|
227 |
-
);
|
228 |
|
229 |
-
wp_register_style(
|
230 |
-
'wpmtst-about-style',
|
231 |
WPMTST_ADMIN_URL . 'css/about.css',
|
232 |
array(),
|
233 |
-
$plugin_version
|
234 |
-
);
|
235 |
|
236 |
/**
|
237 |
* Add-on licenses
|
238 |
*
|
239 |
* @since 2.18
|
240 |
*/
|
241 |
-
wp_register_script(
|
242 |
-
'wpmtst-addons-script',
|
243 |
WPMTST_ADMIN_URL . 'js/addon-licenses.js',
|
244 |
array( 'jquery' ),
|
245 |
$plugin_version,
|
246 |
-
true
|
247 |
-
);
|
248 |
|
249 |
$params = array(
|
250 |
'ajax_nonce' => wp_create_nonce( 'wpmtst-admin' ),
|
@@ -259,13 +215,11 @@ class Strong_Testimonials_Admin_Scripts {
|
|
259 |
*
|
260 |
* @since 2.18
|
261 |
*/
|
262 |
-
wp_register_script(
|
263 |
-
'wpmtst-ays-script',
|
264 |
WPMTST_ADMIN_URL . "js/lib/are-you-sure/jquery.are-you-sure{$min}.js",
|
265 |
array( 'jquery' ),
|
266 |
$plugin_version,
|
267 |
-
true
|
268 |
-
);
|
269 |
}
|
270 |
|
271 |
/**
|
@@ -274,19 +228,17 @@ class Strong_Testimonials_Admin_Scripts {
|
|
274 |
public static function admin_enqueue_scripts() {
|
275 |
$plugin_version = get_option( 'wpmtst_plugin_version' );
|
276 |
|
277 |
-
wp_enqueue_script(
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
true
|
283 |
-
);
|
284 |
|
285 |
wp_localize_script(
|
286 |
'wpmtst-admin-global',
|
287 |
'wpmtst_admin',
|
288 |
array(
|
289 |
-
'nonce'
|
290 |
'templateTagTitle' => __( 'click to insert into message at caret', 'strong-testimonials' ),
|
291 |
)
|
292 |
);
|
45 |
|
46 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
47 |
|
48 |
+
wp_register_style( 'wpmtst-font-awesome',
|
|
|
49 |
WPMTST_PUBLIC_URL . 'fonts/font-awesome-4.6.3/css/font-awesome.min.css',
|
50 |
array(),
|
51 |
+
'4.6.3' );
|
|
|
52 |
|
53 |
+
wp_register_script( 'wpmtst-help',
|
|
|
54 |
WPMTST_ADMIN_URL . 'js/help.js',
|
55 |
array( 'jquery' ),
|
56 |
$plugin_version,
|
57 |
+
true );
|
|
|
58 |
|
59 |
+
wp_register_script( 'wpmtst-admin-script',
|
|
|
60 |
WPMTST_ADMIN_URL . 'js/admin.js',
|
61 |
array( 'jquery', 'underscore' ),
|
62 |
$plugin_version,
|
63 |
+
true );
|
|
|
64 |
|
65 |
+
wp_register_style( 'wpmtst-admin-style',
|
|
|
66 |
WPMTST_ADMIN_URL . 'css/admin.css',
|
67 |
array( 'wpmtst-font-awesome' ),
|
68 |
+
$plugin_version );
|
|
|
69 |
|
70 |
+
wp_register_style( 'wpmtst-post-editor',
|
|
|
71 |
WPMTST_ADMIN_URL . 'css/post-editor.css',
|
72 |
array( 'wpmtst-font-awesome' ),
|
73 |
+
$plugin_version );
|
|
|
74 |
|
75 |
+
wp_register_script( 'wpmtst-custom-spinner',
|
76 |
+
WPMTST_ADMIN_URL . 'js/custom-spinner.js',
|
77 |
+
array( 'jquery' ),
|
78 |
+
$plugin_version,
|
79 |
+
true );
|
|
|
|
|
80 |
|
81 |
+
wp_register_script( 'autosize',
|
|
|
82 |
WPMTST_ADMIN_URL . 'js/lib/autosize/autosize.min.js',
|
83 |
array(),
|
84 |
'4.0.1',
|
85 |
+
true );
|
|
|
86 |
|
87 |
/**
|
88 |
* Form tab
|
89 |
*/
|
90 |
+
wp_register_style( 'wpmtst-admin-form-style',
|
91 |
+
WPMTST_ADMIN_URL . 'css/admin-form.css',
|
92 |
+
array( 'wpmtst-admin-style' ),
|
93 |
+
$plugin_version );
|
|
|
|
|
94 |
|
95 |
+
wp_register_script( 'wpmtst-admin-form-script',
|
96 |
+
WPMTST_ADMIN_URL . 'js/admin-form.js',
|
97 |
+
array( 'wpmtst-admin-script', 'autosize' ),
|
98 |
+
$plugin_version,
|
99 |
+
true );
|
|
|
|
|
100 |
|
101 |
/**
|
102 |
* Compatibility tab
|
103 |
*/
|
104 |
+
wp_register_style( 'wpmtst-admin-compat-style',
|
105 |
+
WPMTST_ADMIN_URL . 'css/admin-compat.css',
|
106 |
+
array(),
|
107 |
+
$plugin_version );
|
|
|
|
|
108 |
|
109 |
+
wp_register_script( 'wpmtst-admin-compat-script',
|
110 |
+
WPMTST_ADMIN_URL . 'js/admin-compat.js',
|
111 |
+
array( 'jquery', 'wpmtst-custom-spinner', 'wpmtst-help' ),
|
112 |
+
$plugin_version,
|
113 |
+
true );
|
|
|
|
|
114 |
|
115 |
/**
|
116 |
* Fields
|
117 |
*/
|
118 |
+
wp_register_style( 'wpmtst-admin-fields-style',
|
|
|
119 |
WPMTST_ADMIN_URL . 'css/fields.css',
|
120 |
array(),
|
121 |
+
$plugin_version );
|
|
|
122 |
|
123 |
+
wp_register_style( 'wpmtst-admin-form-preview',
|
|
|
124 |
WPMTST_ADMIN_URL . 'css/form-preview.css',
|
125 |
array(),
|
126 |
+
$plugin_version );
|
|
|
127 |
|
128 |
+
wp_register_script( 'wpmtst-admin-fields-script',
|
|
|
129 |
WPMTST_ADMIN_URL . 'js/admin-fields.js',
|
130 |
array( 'jquery', 'jquery-ui-sortable', 'wpmtst-help' ),
|
131 |
$plugin_version,
|
132 |
+
true );
|
|
|
133 |
|
134 |
$params = array(
|
135 |
'ajax_nonce' => wp_create_nonce( 'wpmtst-admin' ),
|
142 |
/**
|
143 |
* Ratings
|
144 |
*/
|
145 |
+
wp_register_style( 'wpmtst-rating-display',
|
|
|
146 |
WPMTST_PUBLIC_URL . 'css/rating-display.css',
|
147 |
array( 'wpmtst-font-awesome' ),
|
148 |
+
$plugin_version );
|
|
|
149 |
|
150 |
+
wp_register_style( 'wpmtst-rating-form',
|
|
|
151 |
WPMTST_PUBLIC_URL . 'css/rating-form.css',
|
152 |
array( 'wpmtst-font-awesome' ),
|
153 |
+
$plugin_version );
|
|
|
154 |
|
155 |
+
wp_register_script( 'wpmtst-rating-script',
|
|
|
156 |
WPMTST_ADMIN_URL . 'js/rating-edit.js',
|
157 |
array( 'jquery' ),
|
158 |
$plugin_version,
|
159 |
+
true );
|
|
|
160 |
|
161 |
/**
|
162 |
* Views
|
163 |
*/
|
164 |
+
wp_register_style( 'wpmtst-admin-views-style',
|
|
|
165 |
WPMTST_ADMIN_URL . 'css/views.css',
|
166 |
array(),
|
167 |
+
$plugin_version );
|
|
|
168 |
|
169 |
+
wp_register_script( 'wpmtst-admin-views-script',
|
|
|
170 |
WPMTST_ADMIN_URL . 'js/views.js',
|
171 |
array( 'jquery', 'jquery-ui-sortable', 'wp-color-picker', 'jquery-masonry', 'wpmtst-help' ),
|
172 |
$plugin_version,
|
173 |
+
true );
|
|
|
174 |
|
175 |
/**
|
176 |
* Category filter in View editor.
|
180 |
*
|
181 |
* @since 2.2.0
|
182 |
*/
|
183 |
+
wp_register_script( 'wpmtst-view-category-filter-script',
|
|
|
184 |
WPMTST_ADMIN_URL . 'js/view-category-filter.js',
|
185 |
array( 'jquery' ),
|
186 |
$plugin_version,
|
187 |
+
true );
|
|
|
188 |
|
189 |
+
wp_register_style( 'wpmtst-about-style',
|
|
|
190 |
WPMTST_ADMIN_URL . 'css/about.css',
|
191 |
array(),
|
192 |
+
$plugin_version );
|
|
|
193 |
|
194 |
/**
|
195 |
* Add-on licenses
|
196 |
*
|
197 |
* @since 2.18
|
198 |
*/
|
199 |
+
wp_register_script( 'wpmtst-addons-script',
|
|
|
200 |
WPMTST_ADMIN_URL . 'js/addon-licenses.js',
|
201 |
array( 'jquery' ),
|
202 |
$plugin_version,
|
203 |
+
true );
|
|
|
204 |
|
205 |
$params = array(
|
206 |
'ajax_nonce' => wp_create_nonce( 'wpmtst-admin' ),
|
215 |
*
|
216 |
* @since 2.18
|
217 |
*/
|
218 |
+
wp_register_script( 'wpmtst-ays-script',
|
|
|
219 |
WPMTST_ADMIN_URL . "js/lib/are-you-sure/jquery.are-you-sure{$min}.js",
|
220 |
array( 'jquery' ),
|
221 |
$plugin_version,
|
222 |
+
true );
|
|
|
223 |
}
|
224 |
|
225 |
/**
|
228 |
public static function admin_enqueue_scripts() {
|
229 |
$plugin_version = get_option( 'wpmtst_plugin_version' );
|
230 |
|
231 |
+
wp_enqueue_script( 'wpmtst-admin-global',
|
232 |
+
WPMTST_ADMIN_URL . 'js/admin-global.js',
|
233 |
+
array( 'jquery' ),
|
234 |
+
$plugin_version,
|
235 |
+
true );
|
|
|
|
|
236 |
|
237 |
wp_localize_script(
|
238 |
'wpmtst-admin-global',
|
239 |
'wpmtst_admin',
|
240 |
array(
|
241 |
+
'nonce' => wp_create_nonce( 'wpmtst-admin' ),
|
242 |
'templateTagTitle' => __( 'click to insert into message at caret', 'strong-testimonials' ),
|
243 |
)
|
244 |
);
|
admin/class-strong-testimonials-defaults.php
CHANGED
@@ -54,36 +54,33 @@ class Strong_Testimonials_Defaults {
|
|
54 |
* @return array
|
55 |
*/
|
56 |
public static function get_field_base() {
|
57 |
-
return apply_filters(
|
58 |
-
'
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
'show_shortcode_options' => 0,
|
85 |
-
)
|
86 |
-
);
|
87 |
}
|
88 |
|
89 |
/**
|
@@ -477,7 +474,7 @@ class Strong_Testimonials_Defaults {
|
|
477 |
public static function get_view_options() {
|
478 |
$default_view_options = array(
|
479 |
|
480 |
-
'mode'
|
481 |
'display' => array(
|
482 |
'name' => 'display',
|
483 |
'label' => __( 'Display', 'strong-testimonials' ),
|
@@ -500,33 +497,33 @@ class Strong_Testimonials_Defaults {
|
|
500 |
),
|
501 |
),
|
502 |
|
503 |
-
'order'
|
504 |
'random' => _x( 'random', 'display order', 'strong-testimonials' ),
|
505 |
'menu_order' => _x( 'menu order', 'display order', 'strong-testimonials' ),
|
506 |
'newest' => _x( 'newest first', 'display order', 'strong-testimonials' ),
|
507 |
'oldest' => _x( 'oldest first', 'display order', 'strong-testimonials' ),
|
508 |
),
|
509 |
|
510 |
-
'slideshow_effect'
|
511 |
'none' => _x( 'no transition effect', 'slideshow transition option', 'strong-testimonials' ),
|
512 |
'fade' => _x( 'fade', 'slideshow transition option', 'strong-testimonials' ),
|
513 |
'horizontal' => _x( 'scroll horizontally', 'slideshow transition option', 'strong-testimonials' ),
|
514 |
'vertical' => _x( 'scroll vertically', 'slideshow transition option', 'strong-testimonials' ),
|
515 |
),
|
516 |
|
517 |
-
'slideshow_height'
|
518 |
'dynamic' => _x( 'Adjust height for each slide', 'slideshow option', 'strong-testimonials' ),
|
519 |
'static' => _x( 'Set height to match the tallest slide', 'slideshow option', 'strong-testimonials' ),
|
520 |
),
|
521 |
|
522 |
-
'slideshow_nav_method'
|
523 |
'controls' => array(
|
524 |
'none' => array(
|
525 |
'label' => _x( 'none', 'slideshow controls option', 'strong-testimonials' ),
|
526 |
'args' => array( // base args; style will add more args
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
),
|
531 |
),
|
532 |
'full' => array(
|
@@ -661,11 +658,11 @@ class Strong_Testimonials_Defaults {
|
|
661 |
public static function get_default_view() {
|
662 |
$default_view = array(
|
663 |
'background' => array(
|
664 |
-
'color'
|
665 |
-
'type'
|
666 |
-
'preset'
|
667 |
-
'gradient1'
|
668 |
-
'gradient2'
|
669 |
),
|
670 |
'category' => 'all',
|
671 |
'class' => '',
|
@@ -692,7 +689,7 @@ class Strong_Testimonials_Defaults {
|
|
692 |
'count' => -1,
|
693 |
'divi_builder' => 0,
|
694 |
'excerpt_length' => 55,
|
695 |
-
'font-color'
|
696 |
'color' => '',
|
697 |
'type' => '',
|
698 |
),
|
@@ -733,13 +730,13 @@ class Strong_Testimonials_Defaults {
|
|
733 |
'after_page_number' => '',
|
734 |
),
|
735 |
'slideshow_settings' => array(
|
736 |
-
'type'
|
737 |
-
'show_single'
|
738 |
'max_slides' => 1,
|
739 |
'move_slides' => 1,
|
740 |
'margin' => 1,
|
741 |
),
|
742 |
-
'breakpoints'
|
743 |
'desktop' => array(
|
744 |
'description' => 'Desktop',
|
745 |
'width' => 1200,
|
@@ -822,16 +819,16 @@ class Strong_Testimonials_Defaults {
|
|
822 |
'event' => '',
|
823 |
'script' => '',
|
824 |
),
|
825 |
-
'controller'
|
826 |
'initialize_on' => 'documentReady', // or windowLoad
|
827 |
),
|
828 |
-
'lazyload'
|
829 |
'enabled' => '',
|
830 |
'classes' => array( // may be multiple pairs
|
831 |
array(
|
832 |
'start' => '',
|
833 |
'finish' => '',
|
834 |
-
)
|
835 |
),
|
836 |
),
|
837 |
);
|
@@ -846,7 +843,7 @@ class Strong_Testimonials_Defaults {
|
|
846 |
*/
|
847 |
public static function get_captcha_plugins() {
|
848 |
$plugins = array(
|
849 |
-
'google-captcha'
|
850 |
'name' => 'Google Captcha by BestWebSoft (free)',
|
851 |
'desc' => __( '<strong>Recommended.</strong> The best choice for both Invisible reCAPTCHA and reCAPTCHA V2 ("I\'m not a robot" checkbox).', 'strong-testimonials' ),
|
852 |
'class' => 'Google_Captcha',
|
@@ -857,18 +854,18 @@ class Strong_Testimonials_Defaults {
|
|
857 |
'installed' => false,
|
858 |
'active' => false,
|
859 |
),
|
860 |
-
'captcha-pro'
|
861 |
'name' => 'Captcha Pro by BestWebSoft (premium)',
|
862 |
'desc' => __( 'An excellent plugin for math- and image-based captchas.', 'strong-testimonials' ),
|
863 |
'class' => 'Captcha_Pro',
|
864 |
'file' => 'captcha-pro/captcha_pro.php',
|
865 |
'settings' => 'admin.php?page=captcha_pro.php',
|
866 |
-
'search'
|
867 |
'url' => 'https://bestwebsoft.com/products/wordpress/plugins/captcha/',
|
868 |
'installed' => false,
|
869 |
'active' => false,
|
870 |
),
|
871 |
-
'really-simple-captcha'
|
872 |
'name' => 'Really Simple Captcha by Takayuki Miyoshi (free)',
|
873 |
'class' => 'Really_Simple_Captcha',
|
874 |
'file' => 'really-simple-captcha/really-simple-captcha.php',
|
54 |
* @return array
|
55 |
*/
|
56 |
public static function get_field_base() {
|
57 |
+
return apply_filters( 'wpmtst_field_base', array(
|
58 |
+
'name' => '',
|
59 |
+
'name_mutable' => 1,
|
60 |
+
'label' => '',
|
61 |
+
'show_label' => 1,
|
62 |
+
'input_type' => '',
|
63 |
+
'action_input' => '',
|
64 |
+
'action_output' => '',
|
65 |
+
'text' => '',
|
66 |
+
'show_text_option' => 0,
|
67 |
+
'required' => 0,
|
68 |
+
'show_required_option' => 1,
|
69 |
+
'default_form_value' => '',
|
70 |
+
'default_display_value' => '',
|
71 |
+
'show_default_options' => 1,
|
72 |
+
'error' => __( 'This field is required.', 'strong-testimonials' ),
|
73 |
+
'placeholder' => '',
|
74 |
+
'show_placeholder_option' => 1,
|
75 |
+
'before' => '',
|
76 |
+
'after' => '',
|
77 |
+
'admin_table' => 0,
|
78 |
+
'admin_table_option' => 1,
|
79 |
+
'show_admin_table_option' => 1,
|
80 |
+
'shortcode_on_form' => '',
|
81 |
+
'shortcode_on_display' => '',
|
82 |
+
'show_shortcode_options' => 0,
|
83 |
+
) );
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
/**
|
474 |
public static function get_view_options() {
|
475 |
$default_view_options = array(
|
476 |
|
477 |
+
'mode' => array(
|
478 |
'display' => array(
|
479 |
'name' => 'display',
|
480 |
'label' => __( 'Display', 'strong-testimonials' ),
|
497 |
),
|
498 |
),
|
499 |
|
500 |
+
'order' => array(
|
501 |
'random' => _x( 'random', 'display order', 'strong-testimonials' ),
|
502 |
'menu_order' => _x( 'menu order', 'display order', 'strong-testimonials' ),
|
503 |
'newest' => _x( 'newest first', 'display order', 'strong-testimonials' ),
|
504 |
'oldest' => _x( 'oldest first', 'display order', 'strong-testimonials' ),
|
505 |
),
|
506 |
|
507 |
+
'slideshow_effect' => array(
|
508 |
'none' => _x( 'no transition effect', 'slideshow transition option', 'strong-testimonials' ),
|
509 |
'fade' => _x( 'fade', 'slideshow transition option', 'strong-testimonials' ),
|
510 |
'horizontal' => _x( 'scroll horizontally', 'slideshow transition option', 'strong-testimonials' ),
|
511 |
'vertical' => _x( 'scroll vertically', 'slideshow transition option', 'strong-testimonials' ),
|
512 |
),
|
513 |
|
514 |
+
'slideshow_height' => array(
|
515 |
'dynamic' => _x( 'Adjust height for each slide', 'slideshow option', 'strong-testimonials' ),
|
516 |
'static' => _x( 'Set height to match the tallest slide', 'slideshow option', 'strong-testimonials' ),
|
517 |
),
|
518 |
|
519 |
+
'slideshow_nav_method' => array(
|
520 |
'controls' => array(
|
521 |
'none' => array(
|
522 |
'label' => _x( 'none', 'slideshow controls option', 'strong-testimonials' ),
|
523 |
'args' => array( // base args; style will add more args
|
524 |
+
'controls' => 0,
|
525 |
+
'pager' => 0,
|
526 |
+
'autoControls' => 0,
|
527 |
),
|
528 |
),
|
529 |
'full' => array(
|
658 |
public static function get_default_view() {
|
659 |
$default_view = array(
|
660 |
'background' => array(
|
661 |
+
'color' => '',
|
662 |
+
'type' => '',
|
663 |
+
'preset' => '',
|
664 |
+
'gradient1' => '',
|
665 |
+
'gradient2' => '',
|
666 |
),
|
667 |
'category' => 'all',
|
668 |
'class' => '',
|
689 |
'count' => -1,
|
690 |
'divi_builder' => 0,
|
691 |
'excerpt_length' => 55,
|
692 |
+
'font-color' => array(
|
693 |
'color' => '',
|
694 |
'type' => '',
|
695 |
),
|
730 |
'after_page_number' => '',
|
731 |
),
|
732 |
'slideshow_settings' => array(
|
733 |
+
'type' => 'show_single', // or show_multiple
|
734 |
+
'show_single' => array(
|
735 |
'max_slides' => 1,
|
736 |
'move_slides' => 1,
|
737 |
'margin' => 1,
|
738 |
),
|
739 |
+
'breakpoints' => array(
|
740 |
'desktop' => array(
|
741 |
'description' => 'Desktop',
|
742 |
'width' => 1200,
|
819 |
'event' => '',
|
820 |
'script' => '',
|
821 |
),
|
822 |
+
'controller' => array(
|
823 |
'initialize_on' => 'documentReady', // or windowLoad
|
824 |
),
|
825 |
+
'lazyload' => array(
|
826 |
'enabled' => '',
|
827 |
'classes' => array( // may be multiple pairs
|
828 |
array(
|
829 |
'start' => '',
|
830 |
'finish' => '',
|
831 |
+
)
|
832 |
),
|
833 |
),
|
834 |
);
|
843 |
*/
|
844 |
public static function get_captcha_plugins() {
|
845 |
$plugins = array(
|
846 |
+
'google-captcha' => array(
|
847 |
'name' => 'Google Captcha by BestWebSoft (free)',
|
848 |
'desc' => __( '<strong>Recommended.</strong> The best choice for both Invisible reCAPTCHA and reCAPTCHA V2 ("I\'m not a robot" checkbox).', 'strong-testimonials' ),
|
849 |
'class' => 'Google_Captcha',
|
854 |
'installed' => false,
|
855 |
'active' => false,
|
856 |
),
|
857 |
+
'captcha-pro' => array(
|
858 |
'name' => 'Captcha Pro by BestWebSoft (premium)',
|
859 |
'desc' => __( 'An excellent plugin for math- and image-based captchas.', 'strong-testimonials' ),
|
860 |
'class' => 'Captcha_Pro',
|
861 |
'file' => 'captcha-pro/captcha_pro.php',
|
862 |
'settings' => 'admin.php?page=captcha_pro.php',
|
863 |
+
'search' => '',
|
864 |
'url' => 'https://bestwebsoft.com/products/wordpress/plugins/captcha/',
|
865 |
'installed' => false,
|
866 |
'active' => false,
|
867 |
),
|
868 |
+
'really-simple-captcha' => array(
|
869 |
'name' => 'Really Simple Captcha by Takayuki Miyoshi (free)',
|
870 |
'class' => 'Really_Simple_Captcha',
|
871 |
'file' => 'really-simple-captcha/really-simple-captcha.php',
|
admin/class-strong-testimonials-help.php
CHANGED
@@ -9,10 +9,10 @@ class Strong_Testimonials_Help {
|
|
9 |
|
10 |
public static function init() {
|
11 |
add_action( 'load-wpm-testimonial_page_testimonial-fields', array( __CLASS__, 'fields_editor' ) );
|
12 |
-
add_action( 'load-wpm-testimonial_page_testimonial-views',
|
13 |
add_action( 'load-wpm-testimonial_page_testimonial-views', array( __CLASS__, 'shortcode_attributes' ) );
|
14 |
-
add_action( 'load-wpm-testimonial_page_testimonial-views',
|
15 |
-
add_action( 'load-wpm-testimonial_page_testimonial-views',
|
16 |
|
17 |
add_action( 'load-wpm-testimonial_page_testimonial-settings', array( __CLASS__, 'settings_compat' ) );
|
18 |
}
|
@@ -27,81 +27,40 @@ class Strong_Testimonials_Help {
|
|
27 |
|
28 |
ob_start();
|
29 |
?>
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
<?php
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
)
|
43 |
-
),
|
44 |
-
esc_url( 'https://en.wikipedia.org/wiki/Flash_of_unstyled_content' )
|
45 |
-
);
|
46 |
-
?>
|
47 |
-
|
|
48 |
-
<?php
|
49 |
-
printf(
|
50 |
-
wp_kses(
|
51 |
-
__( '<a href="%s" target="_blank">Demonstrated here</a>', 'strong-testimonials' ),
|
52 |
-
array(
|
53 |
-
'a' => array(
|
54 |
-
'href' => array(),
|
55 |
-
'target' => array(),
|
56 |
-
),
|
57 |
-
)
|
58 |
-
),
|
59 |
-
esc_url( 'https://codepen.io/micikato/full/JroPNm/' )
|
60 |
-
);
|
61 |
-
?>
|
62 |
-
|
|
63 |
-
<?php
|
64 |
-
printf(
|
65 |
-
wp_kses(
|
66 |
-
__( '<a href="%s" target="_blank">An expert\'s observations here</a>', 'strong-testimonials' ),
|
67 |
-
array(
|
68 |
-
'a' => array(
|
69 |
-
'href' => array(),
|
70 |
-
'target' => array(),
|
71 |
-
),
|
72 |
-
)
|
73 |
-
),
|
74 |
-
esc_url( 'https://css-tricks.com/fout-foit-foft/' )
|
75 |
-
);
|
76 |
-
?>
|
77 |
-
</p>
|
78 |
-
<p><?php esc_html_e( 'When this occurs with plugins that use shortcodes, it means the plugin\'s stylesheet was enqueued when the shortcode was rendered so it gets loaded after the content instead of in the normal sequence.', 'strong-testimonials' ); ?></p>
|
79 |
-
<p><?php esc_html_e( 'The prerender option ensures this plugin\'s stylesheets are loaded before the content.', 'strong-testimonials' ); ?></p>
|
80 |
-
<?php
|
81 |
$content = ob_get_clean();
|
82 |
|
83 |
-
get_current_screen()->add_help_tab(
|
84 |
-
array(
|
85 |
'id' => 'wpmtst-help-prerender',
|
86 |
'title' => __( 'Prerender', 'strong-testimonials' ),
|
87 |
'content' => $content,
|
88 |
-
|
89 |
-
);
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
* Custom fields editor.
|
94 |
*/
|
95 |
public static function fields_editor() {
|
96 |
-
|
97 |
-
|
98 |
-
<p><?php
|
99 |
-
<p><?php
|
100 |
-
<p><?php
|
101 |
-
<p><?php
|
102 |
-
<p><?php
|
103 |
-
|
104 |
-
|
105 |
|
106 |
// Links
|
107 |
|
@@ -111,13 +70,11 @@ class Strong_Testimonials_Help {
|
|
111 |
|
112 |
$content .= '<p>' . implode( ' | ', $links ) . '</p>';
|
113 |
|
114 |
-
get_current_screen()->add_help_tab(
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
)
|
120 |
-
);
|
121 |
}
|
122 |
|
123 |
/**
|
@@ -126,28 +83,26 @@ class Strong_Testimonials_Help {
|
|
126 |
public static function views_list() {
|
127 |
ob_start();
|
128 |
?>
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
<?php do_action( 'wpmtst_views_intro_list' ); ?>
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
<?php
|
142 |
$content = ob_get_clean();
|
143 |
|
144 |
-
get_current_screen()->add_help_tab(
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
)
|
150 |
-
);
|
151 |
}
|
152 |
|
153 |
/**
|
@@ -160,31 +115,29 @@ class Strong_Testimonials_Help {
|
|
160 |
|
161 |
ob_start();
|
162 |
?>
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
<?php
|
179 |
$content = ob_get_clean();
|
180 |
|
181 |
-
get_current_screen()->add_help_tab(
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
)
|
187 |
-
);
|
188 |
}
|
189 |
|
190 |
/**
|
@@ -197,54 +150,52 @@ class Strong_Testimonials_Help {
|
|
197 |
|
198 |
ob_start();
|
199 |
?>
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
<?php
|
239 |
$content = ob_get_clean();
|
240 |
|
241 |
-
get_current_screen()->add_help_tab(
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
)
|
247 |
-
);
|
248 |
}
|
249 |
|
250 |
/**
|
@@ -257,19 +208,17 @@ class Strong_Testimonials_Help {
|
|
257 |
|
258 |
ob_start();
|
259 |
?>
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
<?php
|
264 |
$content = ob_get_clean();
|
265 |
|
266 |
-
get_current_screen()->add_help_tab(
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
)
|
272 |
-
);
|
273 |
}
|
274 |
|
275 |
}
|
9 |
|
10 |
public static function init() {
|
11 |
add_action( 'load-wpm-testimonial_page_testimonial-fields', array( __CLASS__, 'fields_editor' ) );
|
12 |
+
add_action( 'load-wpm-testimonial_page_testimonial-views', array( __CLASS__, 'views_list' ) );
|
13 |
add_action( 'load-wpm-testimonial_page_testimonial-views', array( __CLASS__, 'shortcode_attributes' ) );
|
14 |
+
add_action( 'load-wpm-testimonial_page_testimonial-views', array( __CLASS__, 'view_editor_pagination' ) );
|
15 |
+
add_action( 'load-wpm-testimonial_page_testimonial-views', array( __CLASS__, 'view_editor_stretch' ) );
|
16 |
|
17 |
add_action( 'load-wpm-testimonial_page_testimonial-settings', array( __CLASS__, 'settings_compat' ) );
|
18 |
}
|
27 |
|
28 |
ob_start();
|
29 |
?>
|
30 |
+
<p><?php _e( 'Normally, a web page will load its stylesheets (font, color, size, etc.) before the content. When the content is displayed, the style is ready and the page appears as it was designed.', 'strong-testimonials' ); ?></p>
|
31 |
+
<p><?php _e( 'When a browser displays the content before all the stylesheets have been loaded, a flash of unstyled content can occur.', 'strong-testimonials' ); ?></p>
|
32 |
+
<p>
|
33 |
+
<?php printf( wp_kses( __( '<a href="%s" target="_blank">Explained further here</a>', 'strong-testimonials' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://en.wikipedia.org/wiki/Flash_of_unstyled_content' ) ); ?>
|
34 |
+
|
|
35 |
+
<?php printf( wp_kses( __( '<a href="%s" target="_blank">Demonstrated here</a>', 'strong-testimonials' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://codepen.io/micikato/full/JroPNm/' ) ); ?>
|
36 |
+
|
|
37 |
+
<?php printf( wp_kses( __( '<a href="%s" target="_blank">An expert\'s observations here</a>', 'strong-testimonials' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://css-tricks.com/fout-foit-foft/' ) ); ?>
|
38 |
+
</p>
|
39 |
+
<p><?php _e( 'When this occurs with plugins that use shortcodes, it means the plugin\'s stylesheet was enqueued when the shortcode was rendered so it gets loaded after the content instead of in the normal sequence.', 'strong-testimonials' ); ?></p>
|
40 |
+
<p><?php _e( 'The prerender option ensures this plugin\'s stylesheets are loaded before the content.', 'strong-testimonials' ); ?></p>
|
41 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
$content = ob_get_clean();
|
43 |
|
44 |
+
get_current_screen()->add_help_tab( array(
|
|
|
45 |
'id' => 'wpmtst-help-prerender',
|
46 |
'title' => __( 'Prerender', 'strong-testimonials' ),
|
47 |
'content' => $content,
|
48 |
+
) );
|
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
* Custom fields editor.
|
53 |
*/
|
54 |
public static function fields_editor() {
|
55 |
+
ob_start();
|
56 |
+
?>
|
57 |
+
<p><?php _e( 'These fields let you customize your testimonials to gather the information you need.', 'strong-testimonials' ); ?></p>
|
58 |
+
<p><?php _e( 'This editor serves two purposes: (1) to modify the form as it appears on your site, and (2) to modify the custom fields added to each testimonial.', 'strong-testimonials' ); ?></p>
|
59 |
+
<p><?php _e( 'The default fields are designed to fit most situations. You can quickly add or remove fields and change several display properties.', 'strong-testimonials' ); ?></p>
|
60 |
+
<p><?php _e( 'Fields will appear in this order on the form.', 'strong-testimonials' ); ?> <?php printf( __( 'Reorder by grabbing the %s icon.', 'strong-testimonials' ), '<span class="dashicons dashicons-menu"></span>' ); ?></p>
|
61 |
+
<p><?php _e( 'To display this form, create a view and select Form mode.', 'strong-testimonials' ); ?></p>
|
62 |
+
<?php
|
63 |
+
$content = ob_get_clean();
|
64 |
|
65 |
// Links
|
66 |
|
70 |
|
71 |
$content .= '<p>' . implode( ' | ', $links ) . '</p>';
|
72 |
|
73 |
+
get_current_screen()->add_help_tab( array(
|
74 |
+
'id' => 'wpmtst-help',
|
75 |
+
'title' => __( 'Form Fields', 'strong-testimonials' ),
|
76 |
+
'content' => $content,
|
77 |
+
) );
|
|
|
|
|
78 |
}
|
79 |
|
80 |
/**
|
83 |
public static function views_list() {
|
84 |
ob_start();
|
85 |
?>
|
86 |
+
<div>
|
87 |
+
<p><?php _e( 'A view is simply a group of settings with an easy-to-use editor.', 'strong-testimonials' ); ?>
|
88 |
+
<p><?php _e( 'You can create an <strong>unlimited</strong> number of views.', 'strong-testimonials' ); ?></p>
|
89 |
+
<p><?php _e( 'For example:', 'strong-testimonials' ); ?></p>
|
90 |
+
<ul class="standard">
|
91 |
+
<li><?php _e( 'Create a view to display your testimonials in a list, grid, or slideshow.', 'strong-testimonials' ); ?></li>
|
92 |
+
<li><?php _e( 'Create a view to show a testimonial submission form', 'strong-testimonials' ); ?></li>
|
93 |
+
<li><?php _e( 'Create a view to append your custom fields to the individual testimonial using your theme single post template.', 'strong-testimonials' ); ?></li>
|
94 |
<?php do_action( 'wpmtst_views_intro_list' ); ?>
|
95 |
+
</ul>
|
96 |
+
<p><?php _e( 'Add a view to a page with its unique shortcode or add it to a sidebar with the Strong Testimonials widget.', 'strong-testimonials' ); ?></p>
|
97 |
+
</div>
|
98 |
<?php
|
99 |
$content = ob_get_clean();
|
100 |
|
101 |
+
get_current_screen()->add_help_tab( array(
|
102 |
+
'id' => 'wpmtst-help-views',
|
103 |
+
'title' => __( 'About Views', 'strong-testimonials' ),
|
104 |
+
'content' => $content,
|
105 |
+
) );
|
|
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
115 |
|
116 |
ob_start();
|
117 |
?>
|
118 |
+
<div>
|
119 |
+
<p><?php _e( 'Optional shortcode attributes will override the view settings. Use this to create reusable view <strong>patterns</strong>.', 'strong-testimonials' ); ?>
|
120 |
+
<p><?php _e( 'Overridable settings: <code>post_ids</code>, <code>category</code>, <code>order</code>, <code>count</code>.', 'strong-testimonials' ); ?>
|
121 |
+
<p><?php _e( 'For example, imagine you have five services, a sales page for each service, and a testimonial category for each service. To display the testimonials on each service page, you can create five duplicate views, one for each category.', 'strong-testimonials' ); ?>
|
122 |
+
<p><?php _e( 'Or you can configure one view as a pattern and add it to each service page with the <code>category</code> attribute.', 'strong-testimonials' ); ?>
|
123 |
+
<p>
|
124 |
+
<?php _e( '<code>[testimonial_view id="1" category="service-1"]</code>', 'strong-testimonials' ); ?>,
|
125 |
+
<?php _e( '<code>[testimonial_view id="1" category="service-2"]</code>', 'strong-testimonials' ); ?>, etc.
|
126 |
+
</p>
|
127 |
+
<p>
|
128 |
+
<?php _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ); ?>
|
129 |
+
<?php _e( '<code>[testimonial_view id="1" category="service-3" order="random" count="5"]</code>', 'strong-testimonials' ); ?>
|
130 |
+
</p>
|
131 |
+
<p><?php _e( 'Using <code>post_ids</code> is the most specific method and it will override category and count (whether settings or attributes).', 'strong-testimonials' ); ?></p>
|
132 |
+
</div>
|
133 |
<?php
|
134 |
$content = ob_get_clean();
|
135 |
|
136 |
+
get_current_screen()->add_help_tab( array(
|
137 |
+
'id' => 'wpmtst-help-shortcode',
|
138 |
+
'title' => __( 'Shortcode Attributes', 'strong-testimonials' ),
|
139 |
+
'content' => $content,
|
140 |
+
) );
|
|
|
|
|
141 |
}
|
142 |
|
143 |
/**
|
150 |
|
151 |
ob_start();
|
152 |
?>
|
153 |
+
<p><?php _e( 'Some of the features and drawbacks for each method.', 'strong-testimonials' ); ?></p>
|
154 |
+
|
155 |
+
<table class="wpmtst-help-tab" cellpadding="0" cellspacing="0">
|
156 |
+
<thead>
|
157 |
+
<tr>
|
158 |
+
<th></th>
|
159 |
+
<th><?php _e( 'Simple', 'strong-testimonials' ); ?></th>
|
160 |
+
<th><?php _e( 'Standard', 'strong-testimonials' ); ?></th>
|
161 |
+
</tr>
|
162 |
+
</thead>
|
163 |
+
<tbody>
|
164 |
+
<tr>
|
165 |
+
<td><?php _e( 'best use', 'strong-testimonials' ); ?></td>
|
166 |
+
<td><?php _e( 'ten pages or less', 'strong-testimonials' ); ?></td>
|
167 |
+
<td><?php _e( 'more than ten pages', 'strong-testimonials' ); ?></td>
|
168 |
+
</tr>
|
169 |
+
<tr>
|
170 |
+
<td><?php _e( 'URLs', 'strong-testimonials' ); ?></td>
|
171 |
+
<td><?php _e( 'does not change the URL', 'strong-testimonials' ); ?></td>
|
172 |
+
<td><?php _e( 'uses paged URLs just like standard WordPress posts', 'strong-testimonials' ); ?></td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td><?php _e( 'the Back button', 'strong-testimonials' ); ?></td>
|
176 |
+
<td><?php _e( 'It does not remember which page of testimonials you are on. If you click away – for example, on a "Read more" link – then click back, you will return to page one.', 'strong-testimonials' ); ?></td>
|
177 |
+
<td><?php _e( 'You will return the last page you were on so this works well with "Read more" links.', 'strong-testimonials' ); ?></td>
|
178 |
+
</tr>
|
179 |
+
<tr>
|
180 |
+
<td><?php _e( 'works with random order option', 'strong-testimonials' ); ?></td>
|
181 |
+
<td><?php _e( 'yes' ); ?></td>
|
182 |
+
<td><?php _e( 'no' ); ?></td>
|
183 |
+
</tr>
|
184 |
+
<tr>
|
185 |
+
<td><?php _e( 'works in a widget', 'strong-testimonials' ); ?></td>
|
186 |
+
<td><?php _e( 'yes' ); ?></td>
|
187 |
+
<td><?php _e( 'no' ); ?></td>
|
188 |
+
</tr>
|
189 |
+
</tbody>
|
190 |
+
</table>
|
191 |
<?php
|
192 |
$content = ob_get_clean();
|
193 |
|
194 |
+
get_current_screen()->add_help_tab( array(
|
195 |
+
'id' => 'wpmtst-help-pagination',
|
196 |
+
'title' => __( 'Pagination', 'strong-testimonials' ),
|
197 |
+
'content' => $content,
|
198 |
+
) );
|
|
|
|
|
199 |
}
|
200 |
|
201 |
/**
|
208 |
|
209 |
ob_start();
|
210 |
?>
|
211 |
+
<p><?php _e( 'This will set the height of the <b>slideshow container</b> to match the tallest slide in order to keep elements below it from bouncing up and down during slide transitions. With testimonials of uneven length, the result is whitespace underneath the shorter testimonials.', 'strong-testimonials' ); ?></p>
|
212 |
+
<p><?php _e( 'Select the <b>Stretch</b> option to stretch the borders and background vertically to compensate.', 'strong-testimonials' ); ?></p>
|
213 |
+
<p><?php _e( 'Use the excerpt or abbreviated content if you want to minimize the whitespace.', 'strong-testimonials' ); ?></p>
|
214 |
<?php
|
215 |
$content = ob_get_clean();
|
216 |
|
217 |
+
get_current_screen()->add_help_tab( array(
|
218 |
+
'id' => 'wpmtst-help-stretch',
|
219 |
+
'title' => __( 'Stretch', 'strong-testimonials' ),
|
220 |
+
'content' => $content,
|
221 |
+
) );
|
|
|
|
|
222 |
}
|
223 |
|
224 |
}
|
admin/class-strong-testimonials-list-table.php
CHANGED
@@ -10,629 +10,585 @@
|
|
10 |
* @access private
|
11 |
*/
|
12 |
|
13 |
-
if ( !
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
* the default $args.
|
112 |
-
*
|
113 |
-
* @since 3.1.0
|
114 |
-
* @access public
|
115 |
-
*
|
116 |
-
* @param array|string $args {
|
117 |
-
* Array or string of arguments.
|
118 |
-
*
|
119 |
-
* @type string $plural Plural value used for labels and the objects being listed.
|
120 |
-
* This affects things such as CSS class-names and nonces used
|
121 |
-
* in the list table, e.g. 'posts'. Default empty.
|
122 |
-
* @type string $singular Singular label for an object being listed, e.g. 'post'.
|
123 |
-
* Default empty
|
124 |
-
* @type bool $ajax Whether the list table supports AJAX. This includes loading
|
125 |
-
* and sorting data, for example. If true, the class will call
|
126 |
-
* the {@see _js_vars()} method in the footer to provide variables
|
127 |
-
* to any scripts handling AJAX events. Default false.
|
128 |
-
* @type string $screen String containing the hook name used to determine the current
|
129 |
-
* screen. If left null, the current screen will be automatically set.
|
130 |
-
* Default null.
|
131 |
-
* }
|
132 |
-
*/
|
133 |
-
public function __construct( $args = array() ) {
|
134 |
-
$args = wp_parse_args(
|
135 |
-
$args,
|
136 |
-
array(
|
137 |
-
'plural' => '',
|
138 |
-
'singular' => '',
|
139 |
-
'ajax' => false,
|
140 |
-
'screen' => null,
|
141 |
-
)
|
142 |
);
|
143 |
-
|
144 |
-
$this->screen = convert_to_screen( $args['screen'] );
|
145 |
-
|
146 |
-
add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
|
147 |
-
|
148 |
-
if ( ! $args['plural'] ) {
|
149 |
-
$args['plural'] = $this->screen->base;
|
150 |
-
}
|
151 |
-
|
152 |
-
$args['plural'] = sanitize_key( $args['plural'] );
|
153 |
-
$args['singular'] = sanitize_key( $args['singular'] );
|
154 |
-
|
155 |
-
$this->_args = $args;
|
156 |
-
|
157 |
-
if ( $args['ajax'] ) {
|
158 |
-
// wp_enqueue_script( 'list-table' );
|
159 |
-
add_action( 'admin_footer', array( $this, '_js_vars' ) );
|
160 |
-
}
|
161 |
-
|
162 |
-
if ( empty( $this->modes ) ) {
|
163 |
-
$this->modes = array(
|
164 |
-
'list' => __( 'List View' ),
|
165 |
-
'excerpt' => __( 'Excerpt View' ),
|
166 |
-
);
|
167 |
-
}
|
168 |
}
|
|
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
}
|
183 |
}
|
|
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
}
|
|
|
200 |
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
}
|
214 |
}
|
|
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
}
|
228 |
}
|
|
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
}
|
244 |
-
return false;
|
245 |
}
|
|
|
|
|
246 |
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
-
|
287 |
-
|
288 |
-
}
|
289 |
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
*/
|
309 |
-
public function get_pagination_arg( $key ) {
|
310 |
-
if ( 'page' == $key ) {
|
311 |
-
return $this->get_pagenum();
|
312 |
-
}
|
313 |
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
|
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
/**
|
332 |
-
*
|
333 |
*
|
334 |
-
*
|
335 |
-
*
|
336 |
-
*/
|
337 |
-
public function no_items() {
|
338 |
-
esc_html_e( 'No items found.' );
|
339 |
-
}
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Display the search box.
|
343 |
*
|
344 |
-
* @since 3.
|
345 |
-
* @access public
|
346 |
*
|
347 |
-
* @param
|
348 |
-
* @param string $input_id The search input id
|
349 |
*/
|
350 |
-
|
351 |
-
if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
|
352 |
-
return;
|
353 |
-
}
|
354 |
|
355 |
-
|
|
|
356 |
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
if ( ! empty( $_REQUEST['order'] ) ) {
|
361 |
-
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '">';
|
362 |
-
}
|
363 |
-
if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
|
364 |
-
echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '">';
|
365 |
-
}
|
366 |
-
if ( ! empty( $_REQUEST['detached'] ) ) {
|
367 |
-
echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '">';
|
368 |
-
|