Strong Testimonials - Version 2.36

Version Description

Download this release

Release Info

Developer machothemes
Plugin Icon 128x128 Strong Testimonials
Version 2.36
Comparing to
See all releases

Code changes from version 2.35 to 2.36

Files changed (127) hide show
  1. admin/about/class-strong-testimonials-about.php +15 -15
  2. admin/about/how-to.php +32 -32
  3. admin/about/links.php +9 -5
  4. admin/about/privacy.php +11 -11
  5. admin/admin-notices.php +44 -51
  6. admin/admin.php +21 -26
  7. admin/class-strong-testimonials-admin-list.php +23 -15
  8. admin/class-strong-testimonials-admin-scripts.php +65 -113
  9. admin/class-strong-testimonials-defaults.php +51 -54
  10. admin/class-strong-testimonials-help.php +118 -169
  11. admin/class-strong-testimonials-list-table.php +943 -1008
  12. admin/class-strong-testimonials-page-shortcodes.php +28 -28
  13. admin/class-strong-testimonials-post-editor.php +87 -100
  14. admin/class-strong-testimonials-updater.php +73 -56
  15. admin/class-strong-views-list-table.php +50 -53
  16. admin/class-walker-strong-category-checklist.php +8 -10
  17. admin/class-walker-strong-form-category-checklist.php +8 -10
  18. admin/compat.php +10 -11
  19. admin/custom-fields-ajax.php +8 -8
  20. admin/custom-fields.php +179 -177
  21. admin/form-preview.php +10 -12
  22. admin/menu/class-strong-testimonials-menu-fields.php +2 -2
  23. admin/menu/class-strong-testimonials-menu-settings.php +7 -7
  24. admin/menu/class-strong-testimonials-menu-shortcodes.php +2 -2
  25. admin/menu/class-strong-testimonials-menu-views.php +2 -2
  26. admin/menu/class-strong-testimonials-menu.php +22 -22
  27. admin/partials/fields/field-controls.php +2 -2
  28. admin/partials/fields/field-header.php +3 -3
  29. admin/partials/fields/field-label.php +8 -8
  30. admin/partials/fields/field-name.php +7 -8
  31. admin/partials/fields/field-text.php +5 -2
  32. admin/partials/fields/field-type.php +20 -19
  33. admin/partials/templates/form-preview-template.php +8 -8
  34. admin/partials/views/group-compat.php +2 -2
  35. admin/partials/views/group-extra.php +3 -3
  36. admin/partials/views/group-fields.php +5 -5
  37. admin/partials/views/group-form.php +3 -3
  38. admin/partials/views/group-query.php +14 -14
  39. admin/partials/views/group-slideshow.php +5 -5
  40. admin/partials/views/group-style.php +14 -14
  41. admin/partials/views/option-background.php +88 -88
  42. admin/partials/views/option-boilerplate.php +11 -11
  43. admin/partials/views/option-category.php +39 -39
  44. admin/partials/views/option-classes.php +4 -4
  45. admin/partials/views/option-client-section.php +6 -2
  46. admin/partials/views/option-color.php +33 -23
  47. admin/partials/views/option-content.php +90 -90
  48. admin/partials/views/option-divi.php +16 -15
  49. admin/partials/views/option-form-ajax.php +4 -3
  50. admin/partials/views/option-form-category.php +21 -21
  51. admin/partials/views/option-id.php +5 -5
  52. admin/partials/views/option-layout.php +65 -64
  53. admin/partials/views/option-limit.php +20 -18
  54. admin/partials/views/option-order.php +7 -7
  55. admin/partials/views/option-pagination.php +149 -129
  56. admin/partials/views/option-read-more-page.php +24 -23
  57. admin/partials/views/option-select.php +8 -8
  58. admin/partials/views/option-slideshow-behavior.php +27 -21
  59. admin/partials/views/option-slideshow-breakpoints.php +80 -66
  60. admin/partials/views/option-slideshow-navigation.php +62 -66
  61. admin/partials/views/option-slideshow-num.php +3 -3
  62. admin/partials/views/option-slideshow-transition.php +17 -13
  63. admin/partials/views/option-slideshow-type.php +14 -14
  64. admin/partials/views/option-template-list.php +14 -14
  65. admin/partials/views/option-thumbnail.php +23 -28
  66. admin/partials/views/option-title.php +16 -14
  67. admin/partials/views/template-input.php +6 -4
  68. admin/partials/views/template-not-found.php +19 -18
  69. admin/partials/views/template-options.php +64 -63
  70. admin/partials/views/view-mode.php +16 -15
  71. admin/partials/views/view-name.php +8 -7
  72. admin/partials/views/view-shortcode.php +14 -14
  73. admin/settings/class-strong-testimonials-settings-compat.php +230 -146
  74. admin/settings/class-strong-testimonials-settings-form.php +15 -26
  75. admin/settings/class-strong-testimonials-settings-general.php +10 -11
  76. admin/settings/class-strong-testimonials-settings-licenses.php +4 -5
  77. admin/settings/class-strong-testimonials-settings.php +12 -13
  78. admin/settings/partials/email-from.php +88 -72
  79. admin/settings/partials/email-to.php +24 -23
  80. admin/settings/partials/email.php +44 -35
  81. admin/settings/partials/form.php +258 -235
  82. admin/settings/partials/general.php +112 -137
  83. admin/settings/partials/licenses.php +6 -6
  84. admin/settings/partials/recipient.php +55 -40
  85. admin/view-list-order.php +5 -4
  86. admin/views-ajax.php +9 -17
  87. admin/views-validate.php +35 -34
  88. admin/views.php +183 -213
  89. changelog.txt +4 -1
  90. includes/class-strong-form.php +44 -32
  91. includes/class-strong-log.php +99 -103
  92. includes/class-strong-mail.php +42 -45
  93. includes/class-strong-templates.php +430 -427
  94. includes/class-strong-testimonials-order.php +10 -14
  95. includes/class-strong-testimonials-privacy.php +3 -1
  96. includes/class-strong-testimonials-render.php +9 -4
  97. includes/class-strong-testimonials-shortcode-average.php +32 -31
  98. includes/class-strong-testimonials-shortcode-count.php +1 -1
  99. includes/class-strong-testimonials-shortcode.php +8 -8
  100. includes/class-strong-view-display.php +382 -378
  101. includes/class-strong-view-form.php +215 -216
  102. includes/class-strong-view-slideshow.php +371 -369
  103. includes/class-strong-view.php +454 -450
  104. includes/class-walker-strong-category-checklist-front.php +8 -10
  105. includes/filters.php +0 -98
  106. includes/functions-activation.php +3 -3
  107. includes/functions-content.php +14 -17
  108. includes/functions-image.php +8 -9
  109. includes/functions-rating.php +36 -32
  110. includes/functions-template-form.php +182 -199
  111. includes/functions-template.php +45 -46
  112. includes/functions-views.php +8 -8
  113. includes/functions.php +102 -122
  114. includes/integrations/class-integration-captcha-pro.php +1 -1
  115. includes/integrations/class-integration-captcha.php +1 -1
  116. includes/integrations/class-integration-really-simple-captcha.php +9 -9
  117. includes/l10n-polylang.php +11 -31
  118. includes/l10n-wpml.php +8 -10
  119. includes/post-types.php +15 -20
  120. includes/retro.php +92 -92
  121. includes/scripts.php +80 -111
  122. includes/widget2.php +33 -31
  123. readme.txt +2 -2
  124. strong-testimonials.php +2 -2
  125. templates/default-form/form.php +10 -10
  126. templates/simple-form/form.php +10 -10
  127. 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
- $this->add_actions();
14
- }
15
 
16
  /**
17
  * Add actions and filters.
@@ -21,8 +21,8 @@ class Strong_Testimonials_About {
21
  }
22
 
23
  /**
24
- * Add submenu page.
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
- 'menu_title' => __( 'About' ),
44
- 'capability' => 'strong_testimonials_about',
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( esc_html__( 'Welcome to Strong Testimonials %s', 'strong-testimonials' ), esc_html( $major_minor ) ); ?></h1>
62
 
63
  <p class="about-text">
64
- <?php esc_html_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( esc_html__( 'Version %s' ), esc_html( $major_minor ) ); ?></div>
69
 
70
  <h2 class="nav-tab-wrapper wp-clearfix">
71
 
72
- <a href="<?php echo esc_url( add_query_arg( 'tab', 'how-to', $url ) ); ?>" class="nav-tab <?php echo $active_tab == 'how-to' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'How To', 'strong-testimonials' ); ?></a>
73
 
74
- <a href="<?php echo esc_url( add_query_arg( 'tab', 'privacy', $url ) ); ?>" class="nav-tab <?php echo $active_tab == 'privacy' ? 'nav-tab-active' : ''; ?>"><?php esc_html_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,8 +86,8 @@ class Strong_Testimonials_About {
86
  break;
87
  }
88
 
89
- include WPMTST_ADMIN . 'about/links.php';
90
- include WPMTST_ADMIN . 'about/addons.php';
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 esc_html_e( 'Let\'s Get Started', 'strong-testimonials' ); ?></h2>
5
- <p class="lead-description"><?php esc_html_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 esc_html_e( 'How to Add the Form', 'strong-testimonials' ); ?></h3>
10
- <p>1. <?php wp_kses_post( 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' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-fields' ) ) ) ); ?>
11
- </p>
12
- <p>2. <?php wp_kses_post( printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ) ) ); ?>
13
- <?php wp_kses_post( _e( 'Select <strong>Form</strong> mode.', 'strong-testimonials' ) ); ?>
14
- </p>
15
- <p>3. <?php echo esc_html( $add_the_view ); ?></p>
16
- </div>
17
 
18
- <div class="col">
19
- <h3><?php esc_html_e( 'How to Display Your Testimonials', 'strong-testimonials' ); ?></h3>
20
- <p>1. <?php wp_kses_post( 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' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial' ) ) ) ); ?></p>
21
- <p>2. <?php wp_kses_post( printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ) ) ); ?>
22
- <?php wp_kses_post( _e( 'Select <strong>Display</strong> mode.', 'strong-testimonials' ) ); ?>
23
- </p>
24
- <p>3. <?php echo esc_html( $add_the_view ); ?></p>
25
- </div>
26
 
27
- <div class="col">
28
- <h3><?php esc_html_e( 'How to Add a Slideshow', 'strong-testimonials' ); ?></h3>
29
- <p>1. <?php wp_kses_post( 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' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial' ) ) ) ); ?></p>
30
- <p>2. <?php wp_kses_post( printf( __( 'Create a <a href="%s">view</a>.', 'strong-testimonials' ), esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ) ) ); ?>
31
- <?php wp_kses_post( _e( 'Select <strong>Slideshow</strong> mode.', 'strong-testimonials' ) ); ?>
32
- </p>
33
- <p>3. <?php echo esc_html( $add_the_view ); ?></p>
34
- </div>
35
 
36
- <div class="col">
37
- <h3><?php esc_html_e( 'How to Translate', 'strong-testimonials' ); ?></h3>
38
- <p><?php esc_html_e( 'Strong Testimonials is compatible with WPML, Polylang and WP Globus.', 'strong-testimonials' ); ?></p>
39
- <p><?php wp_kses_post( _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>
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
- <div class="col">
5
- <h3><?php esc_html_e( 'Support', 'strong-testimonials' ); ?></h3>
6
  <?php
7
- $links = array();
8
- $links[] = sprintf( '<a href="%s" target="_blank">%s</a>', esc_url( 'http://wordpress.org/support/plugin/strong-testimonials' ), __( 'Use the community support forum', 'strong-testimonials' ) );
 
 
 
 
9
  ?>
10
  <ul>
11
  <?php foreach ( $links as $link ) : ?>
12
- <li><?php echo wp_kses_post( $link ); ?></li>
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 esc_html_e( 'Privacy and GDPR', 'strong-testimonials' ); ?></h2>
2
- <p class="lead-description"><?php esc_html_e( 'Compliance is entirely in your control.', 'strong-testimonials' ); ?></p>
3
  <div class="feature-section one-col">
4
- <div class="col">
5
- <p><?php esc_html_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 esc_html_e( 'The plugin also prevents displaying email addresses in your testimonials on the front end.', 'strong-testimonials' ); ?></p>
7
- <p><strong><?php esc_html_e( 'However, this plugin provides features that may involve private data.', 'strong-testimonials' ); ?></strong></p>
8
- <p><?php esc_html_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 esc_html_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 esc_html_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 esc_html_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>
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
- foreach ( $notices as $key => $notice ) {
37
- $message = apply_filters( 'wpmtst_admin_notice', '', $key );
38
- if ( $message ) {
39
- echo wp_kses_post( $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,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 echo esc_attr( $key ); ?>">
65
  <p>
66
- <?php esc_html_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 echo esc_attr( $key ); ?>">
77
  <p>
78
- <?php esc_html_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 echo esc_attr( $key ); ?>">
89
  <p>
90
- <?php esc_html_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(
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="%1$s">%2$s</a>.', 'strong-testimonials' ), $tags ), esc_url( $settings_url ), __( 'settings', 'strong-testimonials' ) );
107
 
108
  ob_start();
109
  ?>
110
- <div class="wpmtst notice notice-warning is-dismissible" data-key="<?php echo esc_attr( $key ); ?>">
111
- <p>
112
- <?php echo wp_kses_post( _e( 'Captcha options have changed in <strong>Strong Testimonials</strong>.', 'strong-testimonials' ) ); ?>
113
- <?php echo wp_kses_post( $settings_link ); ?>
114
- </p>
115
- </div>
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 = get_option( 'wpmtst_admin_notices', array() );
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
- if ( ! function_exists( 'get_current_screen' ) ) {
168
- return;
169
- }
170
-
171
- $screen = get_current_screen();
172
- if ( $screen && 'options' == $screen->base ) {
173
- if ( 'wpmtst_form_options' == $option ) {
174
- $notices = get_option( 'wpmtst_admin_notices', array() );
175
- if ( isset( $notices['captcha-options-changed'] ) ) {
176
- unset( $notices['captcha-options-changed'] );
177
- update_option( 'wpmtst_admin_notices', $notices );
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 = '3.7';
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( wp_kses_post( $message ) );
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
- 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,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
- } else {
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 ( ! $for ) {
168
- return;
169
- }
170
  ?>
171
- <input type="button" class="button secondary restore-default" title="<?php esc_attr_e( 'restore default', 'strong-testimonials' ); ?>" value="&#xf171" data-for="<?php echo esc_attr( $for ); ?>"/>
 
 
 
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 = get_option( 'wpmtst_config_errors', array() );
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 = $view['id'];
248
- } else {
 
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="&#xf171"
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 wp_kses_post( $post->ID );
149
  break;
150
 
151
- case 'post_content':
152
- echo wp_kses_post( substr( $post->post_content, 0, 100 ) ) . '&hellip;';
153
  break;
154
 
155
- case 'post_excerpt':
156
- echo wp_kses_post( $post->post_excerpt );
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 wp_kses_post( join( ', ', $list ) );
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 wp_kses_post( $custom[ $column ][0] );
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 ) . '&hellip;';
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
- 'wpmtst-custom-spinner',
87
- WPMTST_ADMIN_URL . 'js/custom-spinner.js',
88
- array( 'jquery' ),
89
- $plugin_version,
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
- 'wpmtst-admin-form-style',
106
- WPMTST_ADMIN_URL . 'css/admin-form.css',
107
- array( 'wpmtst-admin-style' ),
108
- $plugin_version
109
- );
110
 
111
- wp_register_script(
112
- 'wpmtst-admin-form-script',
113
- WPMTST_ADMIN_URL . 'js/admin-form.js',
114
- array( 'wpmtst-admin-script', 'autosize' ),
115
- $plugin_version,
116
- true
117
- );
118
 
119
  /**
120
  * Compatibility tab
121
  */
122
- wp_register_style(
123
- 'wpmtst-admin-compat-style',
124
- WPMTST_ADMIN_URL . 'css/admin-compat.css',
125
- array(),
126
- $plugin_version
127
- );
128
 
129
- wp_register_script(
130
- 'wpmtst-admin-compat-script',
131
- WPMTST_ADMIN_URL . 'js/admin-compat.js',
132
- array( 'jquery', 'wpmtst-custom-spinner', 'wpmtst-help' ),
133
- $plugin_version,
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
- 'wpmtst-admin-global',
279
- WPMTST_ADMIN_URL . 'js/admin-global.js',
280
- array( 'jquery' ),
281
- $plugin_version,
282
- true
283
- );
284
 
285
  wp_localize_script(
286
  'wpmtst-admin-global',
287
  'wpmtst_admin',
288
  array(
289
- 'nonce' => wp_create_nonce( 'wpmtst-admin' ),
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
- 'wpmtst_field_base',
59
- array(
60
- 'name' => '',
61
- 'name_mutable' => 1,
62
- 'label' => '',
63
- 'show_label' => 1,
64
- 'input_type' => '',
65
- 'action_input' => '',
66
- 'action_output' => '',
67
- 'text' => '',
68
- 'show_text_option' => 0,
69
- 'required' => 0,
70
- 'show_required_option' => 1,
71
- 'default_form_value' => '',
72
- 'default_display_value' => '',
73
- 'show_default_options' => 1,
74
- 'error' => __( 'This field is required.', 'strong-testimonials' ),
75
- 'placeholder' => '',
76
- 'show_placeholder_option' => 1,
77
- 'before' => '',
78
- 'after' => '',
79
- 'admin_table' => 0,
80
- 'admin_table_option' => 1,
81
- 'show_admin_table_option' => 1,
82
- 'shortcode_on_form' => '',
83
- 'shortcode_on_display' => '',
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' => array(
481
  'display' => array(
482
  'name' => 'display',
483
  'label' => __( 'Display', 'strong-testimonials' ),
@@ -500,33 +497,33 @@ class Strong_Testimonials_Defaults {
500
  ),
501
  ),
502
 
503
- 'order' => array(
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' => array(
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' => array(
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' => array(
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
- 'controls' => 0,
528
- 'pager' => 0,
529
- 'autoControls' => 0,
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' => array(
696
  'color' => '',
697
  'type' => '',
698
  ),
@@ -733,13 +730,13 @@ class Strong_Testimonials_Defaults {
733
  'after_page_number' => '',
734
  ),
735
  'slideshow_settings' => array(
736
- 'type' => 'show_single', // or show_multiple
737
- 'show_single' => array(
738
  'max_slides' => 1,
739
  'move_slides' => 1,
740
  'margin' => 1,
741
  ),
742
- 'breakpoints' => array(
743
  'desktop' => array(
744
  'description' => 'Desktop',
745
  'width' => 1200,
@@ -822,16 +819,16 @@ class Strong_Testimonials_Defaults {
822
  'event' => '',
823
  'script' => '',
824
  ),
825
- 'controller' => array(
826
  'initialize_on' => 'documentReady', // or windowLoad
827
  ),
828
- 'lazyload' => array(
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' => array(
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' => array(
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' => array(
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', 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,81 +27,40 @@ class Strong_Testimonials_Help {
27
 
28
  ob_start();
29
  ?>
30
- <p><?php esc_html_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 esc_html_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
34
- printf(
35
- wp_kses(
36
- __( '<a href="%s" target="_blank">Explained further here</a>', 'strong-testimonials' ),
37
- array(
38
- 'a' => array(
39
- 'href' => array(),
40
- 'target' => array(),
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
- ob_start();
97
- ?>
98
- <p><?php esc_html_e( 'These fields let you customize your testimonials to gather the information you need.', 'strong-testimonials' ); ?></p>
99
- <p><?php esc_html_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>
100
- <p><?php esc_html_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>
101
- <p><?php esc_html_e( 'Fields will appear in this order on the form.', 'strong-testimonials' ); ?> <?php printf( esc_html__( 'Reorder by grabbing the %s icon.', 'strong-testimonials' ), '<span class="dashicons dashicons-menu"></span>' ); ?></p>
102
- <p><?php esc_html_e( 'To display this form, create a view and select Form mode.', 'strong-testimonials' ); ?></p>
103
- <?php
104
- $content = ob_get_clean();
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
- array(
116
- 'id' => 'wpmtst-help',
117
- 'title' => __( 'Form Fields', 'strong-testimonials' ),
118
- 'content' => $content,
119
- )
120
- );
121
  }
122
 
123
  /**
@@ -126,28 +83,26 @@ class Strong_Testimonials_Help {
126
  public static function views_list() {
127
  ob_start();
128
  ?>
129
- <div>
130
- <p><?php esc_html_e( 'A view is simply a group of settings with an easy-to-use editor.', 'strong-testimonials' ); ?>
131
- <p><?php esc_html_e( 'You can create an unlimited number of views.', 'strong-testimonials' ); ?></p>
132
- <p><?php esc_html_e( 'For example:', 'strong-testimonials' ); ?></p>
133
- <ul class="standard">
134
- <li><?php esc_html_e( 'Create a view to display your testimonials in a list, grid, or slideshow.', 'strong-testimonials' ); ?></li>
135
- <li><?php esc_html_e( 'Create a view to show a testimonial submission form', 'strong-testimonials' ); ?></li>
136
- <li><?php esc_html_e( 'Create a view to append your custom fields to the individual testimonial using your theme single post template.', 'strong-testimonials' ); ?></li>
137
  <?php do_action( 'wpmtst_views_intro_list' ); ?>
138
- </ul>
139
- <p><?php esc_html_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>
140
- </div>
141
  <?php
142
  $content = ob_get_clean();
143
 
144
- get_current_screen()->add_help_tab(
145
- array(
146
- 'id' => 'wpmtst-help-views',
147
- 'title' => __( 'About Views', 'strong-testimonials' ),
148
- 'content' => $content,
149
- )
150
- );
151
  }
152
 
153
  /**
@@ -160,31 +115,29 @@ class Strong_Testimonials_Help {
160
 
161
  ob_start();
162
  ?>
163
- <div>
164
- <p><?php echo wp_kses_post( _e( 'Optional shortcode attributes will override the view settings. Use this to create reusable view <strong>patterns</strong>.', 'strong-testimonials' ) ); ?>
165
- <p><?php echo wp_kses_post( _e( 'Overridable settings: <code>post_ids</code>, <code>category</code>, <code>order</code>, <code>count</code>.', 'strong-testimonials' ) ); ?>
166
- <p><?php echo wp_kses_post( _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' ) ); ?>
167
- <p><?php echo wp_kses_post( _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' ) ); ?>
168
- <p>
169
- <?php echo wp_kses_post( _e( '<code>[testimonial_view id="1" category="service-1"]</code>', 'strong-testimonials' ) ); ?>,
170
- <?php echo wp_kses_post( _e( '<code>[testimonial_view id="1" category="service-2"]</code>', 'strong-testimonials' ) ); ?>, etc.
171
- </p>
172
- <p>
173
- <?php echo wp_kses_post( _e( 'Attributes may be used in combination. For example:', 'strong-testimonials' ) ); ?>
174
- <?php echo wp_kses_post( _e( '<code>[testimonial_view id="1" category="service-3" order="random" count="5"]</code>', 'strong-testimonials' ) ); ?>
175
- </p>
176
- <p><?php echo wp_kses_post( _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>
177
- </div>
178
  <?php
179
  $content = ob_get_clean();
180
 
181
- get_current_screen()->add_help_tab(
182
- array(
183
- 'id' => 'wpmtst-help-shortcode',
184
- 'title' => __( 'Shortcode Attributes', 'strong-testimonials' ),
185
- 'content' => $content,
186
- )
187
- );
188
  }
189
 
190
  /**
@@ -197,54 +150,52 @@ class Strong_Testimonials_Help {
197
 
198
  ob_start();
199
  ?>
200
- <p><?php esc_html_e( 'Some of the features and drawbacks for each method.', 'strong-testimonials' ); ?></p>
201
-
202
- <table class="wpmtst-help-tab" cellpadding="0" cellspacing="0">
203
- <thead>
204
- <tr>
205
- <th></th>
206
- <th><?php esc_html_e( 'Simple', 'strong-testimonials' ); ?></th>
207
- <th><?php esc_html_e( 'Standard', 'strong-testimonials' ); ?></th>
208
- </tr>
209
- </thead>
210
- <tbody>
211
- <tr>
212
- <td><?php esc_html_e( 'best use', 'strong-testimonials' ); ?></td>
213
- <td><?php esc_html_e( 'ten pages or less', 'strong-testimonials' ); ?></td>
214
- <td><?php esc_html_e( 'more than ten pages', 'strong-testimonials' ); ?></td>
215
- </tr>
216
- <tr>
217
- <td><?php esc_html_e( 'URLs', 'strong-testimonials' ); ?></td>
218
- <td><?php esc_html_e( 'does not change the URL', 'strong-testimonials' ); ?></td>
219
- <td><?php esc_html_e( 'uses paged URLs just like standard WordPress posts', 'strong-testimonials' ); ?></td>
220
- </tr>
221
- <tr>
222
- <td><?php esc_html_e( 'the Back button', 'strong-testimonials' ); ?></td>
223
- <td><?php esc_html_e( 'It does not remember which page of testimonials you are on. If you click away &ndash; for example, on a "Read more" link &ndash; then click back, you will return to page one.', 'strong-testimonials' ); ?></td>
224
- <td><?php esc_html_e( 'You will return the last page you were on so this works well with "Read more" links.', 'strong-testimonials' ); ?></td>
225
- </tr>
226
- <tr>
227
- <td><?php esc_html_e( 'works with random order option', 'strong-testimonials' ); ?></td>
228
- <td><?php esc_html_e( 'yes' ); ?></td>
229
- <td><?php esc_html_e( 'no' ); ?></td>
230
- </tr>
231
- <tr>
232
- <td><?php esc_html_e( 'works in a widget', 'strong-testimonials' ); ?></td>
233
- <td><?php esc_html_e( 'yes' ); ?></td>
234
- <td><?php esc_html_e( 'no' ); ?></td>
235
- </tr>
236
- </tbody>
237
- </table>
238
  <?php
239
  $content = ob_get_clean();
240
 
241
- get_current_screen()->add_help_tab(
242
- array(
243
- 'id' => 'wpmtst-help-pagination',
244
- 'title' => __( 'Pagination', 'strong-testimonials' ),
245
- 'content' => $content,
246
- )
247
- );
248
  }
249
 
250
  /**
@@ -257,19 +208,17 @@ class Strong_Testimonials_Help {
257
 
258
  ob_start();
259
  ?>
260
- <p><?php esc_html_e( 'This will set the height of the slideshow container 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>
261
- <p><?php esc_html_e( 'Select the Stretch option to stretch the borders and background vertically to compensate.', 'strong-testimonials' ); ?></p>
262
- <p><?php esc_html_e( 'Use the excerpt or abbreviated content if you want to minimize the whitespace.', 'strong-testimonials' ); ?></p>
263
  <?php
264
  $content = ob_get_clean();
265
 
266
- get_current_screen()->add_help_tab(
267
- array(
268
- 'id' => 'wpmtst-help-stretch',
269
- 'title' => __( 'Stretch', 'strong-testimonials' ),
270
- 'content' => $content,
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 &ndash; for example, on a "Read more" link &ndash; 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 ( ! class_exists( 'Strong_Testimonials_List_Table' ) ) :
14
-
15
- class Strong_Testimonials_List_Table {
16
-
17
- /**
18
- * The current list of items
19
- *
20
- * @since 3.1.0
21
- * @var array
22
- * @access public
23
- */
24
- public $items;
25
-
26
- /**
27
- * Various information about the current table
28
- *
29
- * @since 3.1.0
30
- * @var array
31
- * @access protected
32
- */
33
- protected $_args;
34
-
35
- /**
36
- * Various information needed for displaying the pagination
37
- *
38
- * @since 3.1.0
39
- * @var array
40
- */
41
- protected $_pagination_args = array();
42
-
43
- /**
44
- * The current screen
45
- *
46
- * @since 3.1.0
47
- * @var object
48
- * @access protected
49
- */
50
- protected $screen;
51
-
52
- /**
53
- * Cached bulk actions
54
- *
55
- * @since 3.1.0
56
- * @var array
57
- * @access private
58
- */
59
- private $_actions;
60
-
61
- /**
62
- * Cached pagination output
63
- *
64
- * @since 3.1.0
65
- * @var string
66
- * @access private
67
- */
68
- private $_pagination;
69
-
70
- /**
71
- * The view switcher modes.
72
- *
73
- * @since 4.1.0
74
- * @var array
75
- * @access protected
76
- */
77
- protected $modes = array();
78
-
79
- /**
80
- * Stores the value returned by ->get_column_info()
81
- *
82
- * @var array
83
- */
84
- protected $_column_headers;
85
-
86
- protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
87
-
88
- protected $compat_methods = array(
89
- 'set_pagination_args',
90
- 'get_views',
91
- 'get_bulk_actions',
92
- 'bulk_actions',
93
- 'row_actions',
94
- 'months_dropdown',
95
- 'view_switcher',
96
- 'comments_bubble',
97
- 'get_items_per_page',
98
- 'pagination',
99
- 'get_sortable_columns',
100
- 'get_column_info',
101
- 'get_table_classes',
102
- 'display_tablenav',
103
- 'extra_tablenav',
104
- 'single_row_columns',
105
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- /**
108
- * Constructor.
109
- *
110
- * The child class should call this constructor from its own constructor to override
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
- * Make private properties readable for backwards compatibility.
172
- *
173
- * @since 4.0.0
174
- * @access public
175
- *
176
- * @param string $name Property to get.
177
- * @return mixed Property.
178
- */
179
- public function __get( $name ) {
180
- if ( in_array( $name, $this->compat_fields ) ) {
181
- return $this->$name;
182
- }
183
  }
 
184
 
185
- /**
186
- * Make private properties settable for backwards compatibility.
187
- *
188
- * @since 4.0.0
189
- * @access public
190
- *
191
- * @param string $name Property to check if set.
192
- * @param mixed $value Property value.
193
- * @return mixed Newly-set property.
194
- */
195
- public function __set( $name, $value ) {
196
- if ( in_array( $name, $this->compat_fields ) ) {
197
- return $this->$name = $value;
198
- }
199
  }
 
200
 
201
- /**
202
- * Make private properties checkable for backwards compatibility.
203
- *
204
- * @since 4.0.0
205
- * @access public
206
- *
207
- * @param string $name Property to check if set.
208
- * @return bool Whether the property is set.
209
- */
210
- public function __isset( $name ) {
211
- if ( in_array( $name, $this->compat_fields ) ) {
212
- return isset( $this->$name );
213
- }
214
  }
 
215
 
216
- /**
217
- * Make private properties un-settable for backwards compatibility.
218
- *
219
- * @since 4.0.0
220
- * @access public
221
- *
222
- * @param string $name Property to unset.
223
- */
224
- public function __unset( $name ) {
225
- if ( in_array( $name, $this->compat_fields ) ) {
226
- unset( $this->$name );
227
- }
228
  }
 
229
 
230
- /**
231
- * Make private/protected methods readable for backwards compatibility.
232
- *
233
- * @since 4.0.0
234
- * @access public
235
- *
236
- * @param callable $name Method to call.
237
- * @param array $arguments Arguments to pass when calling.
238
- * @return mixed|bool Return value of the callback, false otherwise.
239
- */
240
- public function __call( $name, $arguments ) {
241
- if ( in_array( $name, $this->compat_methods ) ) {
242
- return call_user_func_array( array( $this, $name ), $arguments );
243
- }
244
- return false;
245
  }
 
 
246
 
247
- /**
248
- * Checks the current user's permissions
249
- *
250
- * @since 3.1.0
251
- * @access public
252
- * @abstract
253
- */
254
- public function ajax_user_can() {
255
- die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
256
- }
257
 
258
- /**
259
- * Prepares the list of items for displaying.
260
- * @uses WP_List_Table::set_pagination_args()
261
- *
262
- * @since 3.1.0
263
- * @access public
264
- * @abstract
265
- */
266
- public function prepare_items() {
267
- die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
268
- }
269
 
270
- /**
271
- * An internal method that sets all the necessary pagination arguments
272
- *
273
- * @param array $args An associative array with information about the pagination
274
- * @access protected
275
- */
276
- protected function set_pagination_args( $args ) {
277
- $args = wp_parse_args(
278
- $args,
279
- array(
280
- 'total_items' => 0,
281
- 'total_pages' => 0,
282
- 'per_page' => 0,
283
- )
284
- );
 
 
 
 
 
 
285
 
286
- if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
287
- $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
288
- }
289
 
290
- // Redirect if page number is invalid and headers are not already sent.
291
- if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
292
- wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
293
- exit;
294
- }
 
 
 
 
 
 
 
 
 
 
 
 
295
 
296
- $this->_pagination_args = $args;
297
- }
 
 
 
 
 
 
 
 
 
298
 
299
- /**
300
- * Access the pagination args.
301
- *
302
- * @since 3.1.0
303
- * @access public
304
- *
305
- * @param string $key Pagination argument to retrieve. Common values include 'total_items',
306
- * 'total_pages', 'per_page', or 'infinite_scroll'.
307
- * @return int Number of items that correspond to the given pagination argument.
308
- */
309
- public function get_pagination_arg( $key ) {
310
- if ( 'page' == $key ) {
311
- return $this->get_pagenum();
312
- }
313
 
314
- if ( isset( $this->_pagination_args[ $key ] ) ) {
315
- return $this->_pagination_args[ $key ];
316
- }
317
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
- /**
320
- * Whether the table has items to display or not
321
- *
322
- * @since 3.1.0
323
- * @access public
324
- *
325
- * @return bool
326
- */
327
- public function has_items() {
328
- return ! empty( $this->items );
329
- }
 
330
 
 
 
 
 
 
 
 
 
331
  /**
332
- * Message to be displayed when there are no items
333
  *
334
- * @since 3.1.0
335
- * @access public
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.1.0
345
- * @access public
346
  *
347
- * @param string $text The search button text
348
- * @param string $input_id The search input id
349
  */
350
- public function search_box( $text, $input_id ) {
351
- if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
352
- return;
353
- }
354
 
355
- $input_id = $input_id . '-search-input';
 
356
 
357
- if ( ! empty( $_REQUEST['orderby'] ) ) {
358
- echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '">';
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
- }
369
- ?>
370
- <p class="search-box">
371
- <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $text ); ?>:</label>
372
- <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>">
373
- <?php submit_button( $text, 'button', '', false, array( 'id' => 'search-submit' ) ); ?>
374
- </p>
375
- <?php
376
  }
 
 
 
377
 
378
- /**
379
- * Get an associative array ( id => link ) with the list
380
- * of views available on this table.
381
- *
382
- * @since 3.1.0
383
- * @access protected
384
- *
385
- * @return array
386
- */
387
- protected function get_views() {
388
- return array();
389
- }
390
 
391
- /**
392
- * Display the list of views available on this table.
393
- *
394
- * @since 3.1.0
395
- * @access public
396
- */
397
- public function views() {
398
- $views = $this->get_views();
 
 
 
 
399
  /**
400
- * Filter the list of available list table views.
401
  *
402
  * The dynamic portion of the hook name, `$this->screen->id`, refers
403
  * to the ID of the current screen, usually a string.
404
  *
 
 
405
  * @since 3.5.0
406
  *
407
- * @param array $views An array of available list table views.
408
  */
409
- $views = apply_filters( "views_{$this->screen->id}", $views );
410
-
411
- if ( empty( $views ) ) {
412
- return;
413
- }
414
-
415
- echo "<ul class='subsubsub'>\n";
416
- foreach ( $views as $class => $view ) {
417
- $views[ $class ] = "\t<li class='$class'>$view";
418
- }
419
- echo implode( " |</li>\n", wp_kses_post( $views ) ) . "</li>\n";
420
- echo '</ul>';
421
  }
422
 
423
- /**
424
- * Get an associative array ( option_name => option_title ) with the list
425
- * of bulk actions available on this table.
426
- *
427
- * @since 3.1.0
428
- * @access protected
429
- *
430
- * @return array
431
- */
432
- protected function get_bulk_actions() {
433
- return array();
434
- }
435
 
436
- /**
437
- * Display the bulk actions dropdown.
438
- *
439
- * @since 3.1.0
440
- * @access protected
441
- *
442
- * @param string $which The location of the bulk actions: 'top' or 'bottom'.
443
- * This is designated as optional for backwards-compatibility.
444
- */
445
- protected function bulk_actions( $which = '' ) {
446
- if ( is_null( $this->_actions ) ) {
447
- $no_new_actions = $this->_actions = $this->get_bulk_actions();
448
- /**
449
- * Filter the list table Bulk Actions drop-down.
450
- *
451
- * The dynamic portion of the hook name, `$this->screen->id`, refers
452
- * to the ID of the current screen, usually a string.
453
- *
454
- * This filter can currently only be used to remove bulk actions.
455
- *
456
- * @since 3.5.0
457
- *
458
- * @param array $actions An array of the available bulk actions.
459
- */
460
- $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
461
- $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
462
- $two = '';
463
- } else {
464
- $two = '2';
465
- }
466
-
467
- if ( empty( $this->_actions ) ) {
468
- return;
469
- }
470
-
471
- echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_html__( 'Select bulk action' ) . '</label>';
472
- echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
473
- echo "<option value='-1' selected='selected'>" . esc_html__( 'Bulk Actions' ) . "</option>\n";
474
-
475
- foreach ( $this->_actions as $name => $title ) {
476
- $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
477
-
478
- echo "\t<option value='$name'$class>$title</option>\n";
479
- }
480
 
481
- echo "</select>\n";
 
482
 
483
- submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
484
- echo "\n";
485
  }
486
 
487
- /**
488
- * Get the current action selected from the bulk actions dropdown.
489
- *
490
- * @since 3.1.0
491
- * @access public
492
- *
493
- * @return string|bool The action name or False if no action was selected
494
- */
495
- public function current_action() {
496
- if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
497
- return false;
498
- }
499
-
500
- if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
501
- return $_REQUEST['action'];
502
- }
503
 
504
- if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
505
- return $_REQUEST['action2'];
506
- }
507
 
 
 
 
 
 
 
 
 
 
 
508
  return false;
509
- }
510
 
511
- /**
512
- * Generate row actions div
513
- *
514
- * @since 3.1.0
515
- * @access protected
516
- *
517
- * @param array $actions The list of actions
518
- * @param bool $always_visible Whether the actions should be always visible
519
- * @return string
520
- */
521
- protected function row_actions( $actions, $always_visible = false ) {
522
- $action_count = count( $actions );
523
- $i = 0;
524
 
525
- if ( ! $action_count ) {
526
- return '';
527
- }
528
 
529
- $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
530
- foreach ( $actions as $action => $link ) {
531
- ++$i;
532
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
533
- $out .= "<span class='$action'>$link$sep</span>";
534
- }
535
- $out .= '</div>';
536
 
537
- return $out;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
538
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
 
540
  /**
541
- * Display a monthly dropdown for filtering items
542
  *
543
- * @since 3.1.0
544
- * @access protected
545
  *
546
- * @param string $post_type
 
547
  */
548
- protected function months_dropdown( $post_type ) {
549
- global $wpdb, $wp_locale;
550
-
551
- /**
552
- * Filter whether to remove the 'Months' drop-down from the post list table.
553
- *
554
- * @since 4.2.0
555
- *
556
- * @param bool $disable Whether to disable the drop-down. Default false.
557
- * @param string $post_type The post type.
558
- */
559
- if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
560
- return;
561
- }
562
 
563
- $months = $wpdb->get_results(
564
- $wpdb->prepare(
565
- "
566
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
567
  FROM $wpdb->posts
568
  WHERE post_type = %s
569
  ORDER BY post_date DESC
570
- ",
571
- $post_type
572
- )
573
- );
574
 
575
- /**
576
- * Filter the 'Months' drop-down results.
577
- *
578
- * @since 3.7.0
579
- *
580
- * @param object $months The months drop-down query results.
581
- * @param string $post_type The post type.
582
- */
583
- $months = apply_filters( 'months_dropdown_results', $months, $post_type );
584
 
585
- $month_count = count( $months );
586
 
587
- if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
588
- return;
589
- }
590
 
591
- $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
592
- ?>
593
  <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
594
  <select name="m" id="filter-by-date">
595
  <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
596
- <?php
597
- foreach ( $months as $arc_row ) {
598
- if ( 0 == $arc_row->year ) {
599
- continue;
600
- }
601
-
602
- $month = zeroise( $arc_row->month, 2 );
603
- $year = $arc_row->year;
604
-
605
- printf(
606
- "<option %s value='%s'>%s</option>\n",
607
- selected( $m, $year . $month, false ),
608
- esc_attr( $arc_row->year . $month ),
609
- /* translators: 1: month name, 2: 4-digit year */
610
- sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
611
- );
612
- }
613
- ?>
614
- </select>
615
- <?php
616
  }
 
 
 
 
617
 
618
- /**
619
- * Display a view switcher
620
- *
621
- * @since 3.1.0
622
- * @access protected
623
- *
624
- * @param string $current_mode
625
- */
626
- protected function view_switcher( $current_mode ) {
627
- ?>
628
  <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>">
629
  <div class="view-switch">
630
- <?php
631
  foreach ( $this->modes as $mode => $title ) {
632
  $classes = array( 'view-' . $mode );
633
- if ( $current_mode == $mode ) {
634
  $classes[] = 'current';
635
- }
636
  printf(
637
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
638
  esc_url( add_query_arg( 'mode', $mode ) ),
@@ -640,573 +596,552 @@ if ( ! class_exists( 'Strong_Testimonials_List_Table' ) ) :
640
  $title
641
  );
642
  }
643
- ?>
644
  </div>
645
- <?php
646
- }
647
-
648
- /**
649
- * Display a comment count bubble
650
- *
651
- * @since 3.1.0
652
- * @access protected
653
- *
654
- * @param int $post_id The post ID.
655
- * @param int $pending_comments Number of pending comments.
656
- */
657
- protected function comments_bubble( $post_id, $pending_comments ) {
658
- $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
659
 
660
- if ( $pending_comments ) {
661
- echo '<strong>';
662
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663
 
664
- echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . '</span></a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
 
666
- if ( $pending_comments ) {
667
- echo '</strong>';
668
- }
669
- }
 
 
 
 
 
 
 
 
 
 
670
 
671
  /**
672
- * Get the current page number
673
- *
674
- * @since 3.1.0
675
- * @access public
676
  *
677
- * @return int
678
- */
679
- public function get_pagenum() {
680
- $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
681
-
682
- if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
683
- $pagenum = $this->_pagination_args['total_pages'];
684
- }
685
-
686
- return max( 1, $pagenum );
687
- }
688
-
689
- /**
690
- * Get number of items to display on a single page
691
  *
692
- * @since 3.1.0
693
- * @access protected
694
  *
695
- * @param string $option
696
- * @param int $default
697
- * @return int
698
  */
699
- protected function get_items_per_page( $option, $default = 20 ) {
700
- $per_page = (int) get_user_option( $option );
701
- if ( empty( $per_page ) || $per_page < 1 ) {
702
- $per_page = $default;
703
- }
704
 
705
- /**
706
- * Filter the number of items to be displayed on each page of the list table.
707
- *
708
- * The dynamic hook name, $option, refers to the `per_page` option depending
709
- * on the type of list table in use. Possible values include: 'edit_comments_per_page',
710
- * 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
711
- * 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
712
- * 'edit_{$post_type}_per_page', etc.
713
- *
714
- * @since 2.9.0
715
- *
716
- * @param int $per_page Number of items to be displayed. Default 20.
717
- */
718
- return (int) apply_filters( $option, $per_page );
719
  }
720
 
721
- /**
722
- * Display the pagination.
723
- *
724
- * @since 3.1.0
725
- * @access protected
726
- *
727
- * @param string $which
728
- */
729
- protected function pagination( $which ) {
730
- if ( empty( $this->_pagination_args ) ) {
731
- return;
732
- }
733
-
734
- $total_items = $this->_pagination_args['total_items'];
735
- $total_pages = $this->_pagination_args['total_pages'];
736
- $infinite_scroll = false;
737
- if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
738
- $infinite_scroll = $this->_pagination_args['infinite_scroll'];
739
- }
740
-
741
- $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
742
 
743
- $current = $this->get_pagenum();
744
 
745
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
746
 
747
- $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
748
 
749
- $page_links = array();
750
 
751
- $disable_first = $disable_last = '';
752
- if ( $current == 1 ) {
753
- $disable_first = ' disabled';
754
- }
755
- if ( $current == $total_pages ) {
756
- $disable_last = ' disabled';
757
- }
758
- $page_links[] = sprintf(
759
- "<a class='%s' title='%s' href='%s'>%s</a>",
760
- 'first-page' . $disable_first,
761
- esc_attr__( 'Go to the first page' ),
762
- esc_url( remove_query_arg( 'paged', $current_url ) ),
763
- '&laquo;'
764
- );
765
 
766
- $page_links[] = sprintf(
767
- "<a class='%s' title='%s' href='%s'>%s</a>",
768
- 'prev-page' . $disable_first,
769
- esc_attr__( 'Go to the previous page' ),
770
- esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
771
- '&lsaquo;'
772
- );
 
 
 
 
 
 
773
 
774
- if ( 'bottom' == $which ) {
775
- $html_current_page = $current;
776
- } else {
777
- $html_current_page = sprintf(
778
- "%s<input class='current-page' id='current-page-selector' title='%s' type='text' name='paged' value='%s' size='%d'>",
779
- '<label for="current-page-selector" class="screen-reader-text">' . __( 'Select Page' ) . '</label>',
780
- esc_attr__( 'Current page' ),
781
- $current,
782
- strlen( $total_pages )
783
- );
784
- }
785
- $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
786
- $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
787
-
788
- $page_links[] = sprintf(
789
- "<a class='%s' title='%s' href='%s'>%s</a>",
790
- 'next-page' . $disable_last,
791
- esc_attr__( 'Go to the next page' ),
792
- esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
793
- '&rsaquo;'
794
- );
795
 
796
- $page_links[] = sprintf(
797
- "<a class='%s' title='%s' href='%s'>%s</a>",
798
- 'last-page' . $disable_last,
799
- esc_attr__( 'Go to the last page' ),
800
- esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
801
- '&raquo;'
 
 
802
  );
803
-
804
- $pagination_links_class = 'pagination-links';
805
- if ( ! empty( $infinite_scroll ) ) {
806
- $pagination_links_class = ' hide-if-js';
807
- }
808
- $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
809
-
810
- if ( $total_pages ) {
811
- $page_class = $total_pages < 2 ? ' one-page' : '';
812
- } else {
813
- $page_class = ' no-pages';
814
- }
815
- $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
816
-
817
- echo $this->_pagination;
818
  }
 
 
 
 
 
 
 
 
 
819
 
820
- /**
821
- * Get a list of columns. The format is:
822
- * 'internal-name' => 'Title'
823
- *
824
- * @since 3.1.0
825
- * @access public
826
- * @abstract
827
- *
828
- * @return array
829
- */
830
- public function get_columns() {
831
- die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
832
- }
833
 
834
- /**
835
- * Get a list of sortable columns. The format is:
836
- * 'internal-name' => 'orderby'
837
- * or
838
- * 'internal-name' => array( 'orderby', true )
839
- *
840
- * The second format will make the initial sorting order be descending
841
- *
842
- * @since 3.1.0
843
- * @access protected
844
- *
845
- * @return array
846
- */
847
- protected function get_sortable_columns() {
848
- return array();
849
  }
 
850
 
851
- /**
852
- * Get a list of all, hidden and sortable columns, with filter applied
853
- *
854
- * @since 3.1.0
855
- * @access protected
856
- *
857
- * @return array
858
- */
859
- protected function get_column_info() {
860
- if ( isset( $this->_column_headers ) ) {
861
- return $this->_column_headers;
862
- }
863
-
864
- $columns = get_column_headers( $this->screen );
865
- $hidden = get_hidden_columns( $this->screen );
866
-
867
- $sortable_columns = $this->get_sortable_columns();
868
- /**
869
- * Filter the list table sortable columns for a specific screen.
870
- *
871
- * The dynamic portion of the hook name, `$this->screen->id`, refers
872
- * to the ID of the current screen, usually a string.
873
- *
874
- * @since 3.5.0
875
- *
876
- * @param array $sortable_columns An array of sortable columns.
877
- */
878
- $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
879
-
880
- $sortable = array();
881
- foreach ( $_sortable as $id => $data ) {
882
- if ( empty( $data ) ) {
883
- continue;
884
- }
885
 
886
- $data = (array) $data;
887
- if ( ! isset( $data[1] ) ) {
888
- $data[1] = false;
889
- }
890
 
891
- $sortable[ $id ] = $data;
892
- }
 
 
 
 
 
 
 
 
 
 
 
893
 
894
- $this->_column_headers = array( $columns, $hidden, $sortable );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
895
 
 
 
 
 
 
 
 
 
 
 
896
  return $this->_column_headers;
897
- }
898
 
899
- /**
900
- * Return number of visible columns
901
- *
902
- * @since 3.1.0
903
- * @access public
904
- *
905
- * @return int
906
- */
907
- public function get_column_count() {
908
- list ( $columns, $hidden ) = $this->get_column_info();
909
- $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
910
- return count( $columns ) - count( $hidden );
911
- }
912
 
 
913
  /**
914
- * Print column headers, accounting for hidden and sortable columns.
 
 
 
915
  *
916
- * @since 3.1.0
917
- * @access public
918
  *
919
- * @param bool $with_id Whether to set the id attribute or not
920
  */
921
- public function print_column_headers( $with_id = true ) {
922
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
923
 
924
- $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
925
- $current_url = remove_query_arg( 'paged', $current_url );
 
 
926
 
927
- if ( isset( $_GET['orderby'] ) ) {
928
- $current_orderby = $_GET['orderby'];
929
- } else {
930
- $current_orderby = '';
931
- }
932
 
933
- if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
934
- $current_order = 'desc';
935
- } else {
936
- $current_order = 'asc';
937
- }
938
 
939
- if ( ! empty( $columns['cb'] ) ) {
940
- static $cb_counter = 1;
941
- $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
942
- . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox">';
943
- $cb_counter++;
944
- }
945
 
946
- foreach ( $columns as $column_key => $column_display_name ) {
947
- $class = array( 'manage-column', "column-$column_key" );
948
 
949
- $style = '';
950
- if ( in_array( $column_key, $hidden ) ) {
951
- $style = 'display:none;';
952
- }
 
 
 
 
 
 
 
 
 
953
 
954
- $style = ' style="' . $style . '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
 
956
- if ( 'cb' == $column_key ) {
957
- $class[] = 'check-column';
958
- } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
959
- $class[] = 'num';
960
- }
961
 
962
- if ( isset( $sortable[ $column_key ] ) ) {
963
- list( $orderby, $desc_first ) = $sortable[ $column_key ];
 
964
 
965
- if ( $current_orderby == $orderby ) {
966
- $order = 'asc' == $current_order ? 'desc' : 'asc';
967
- $class[] = 'sorted';
968
- $class[] = $current_order;
969
- } else {
970
- $order = $desc_first ? 'desc' : 'asc';
971
- $class[] = 'sortable';
972
- $class[] = $desc_first ? 'asc' : 'desc';
973
- }
974
 
975
- $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
976
- }
 
 
977
 
978
- $id = $with_id ? "id='$column_key'" : '';
 
979
 
980
- if ( ! empty( $class ) ) {
981
- $class = "class='" . join( ' ', $class ) . "'";
 
 
 
 
 
 
982
  }
983
 
984
- echo "<th scope='col' $id $class $style>$column_display_name</th>";
985
  }
 
 
 
 
 
 
 
986
  }
 
987
 
988
- /**
989
- * Display the table
990
- *
991
- * @since 3.1.0
992
- * @access public
993
- */
994
- public function display() {
995
- $singular = $this->_args['singular'];
996
 
997
- $this->display_tablenav( 'top' );
998
 
999
- ?>
1000
  <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
1001
  <thead>
1002
  <tr>
1003
- <?php $this->print_column_headers(); ?>
1004
  </tr>
1005
  </thead>
1006
 
1007
- <tbody id="the-list"
1008
- <?php
1009
- if ( $singular ) {
1010
- echo " data-wp-lists='list:$singular'";
1011
- }
1012
- ?>
1013
- >
1014
- <?php $this->display_rows_or_placeholder(); ?>
1015
  </tbody>
1016
 
1017
  <tfoot>
1018
  <tr>
1019
- <?php $this->print_column_headers( false ); ?>
1020
  </tr>
1021
  </tfoot>
1022
 
1023
  </table>
1024
- <?php
1025
- $this->display_tablenav( 'bottom' );
1026
- }
1027
 
1028
- /**
1029
- * Get a list of CSS classes for the list table table tag.
1030
- *
1031
- * @since 3.1.0
1032
- * @access protected
1033
- *
1034
- * @return array List of CSS classes for the table tag.
1035
- */
1036
- protected function get_table_classes() {
1037
- return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
1038
- }
1039
 
1040
- /**
1041
- * Generate the table navigation above or below the table
1042
- *
1043
- * @since 3.1.0
1044
- * @access protected
1045
- * @param string $which
1046
- */
1047
- protected function display_tablenav( $which ) {
1048
- if ( 'top' == $which ) {
1049
- wp_nonce_field( 'bulk-' . $this->_args['plural'] );
1050
- }
1051
- ?>
1052
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
1053
 
1054
  <div class="alignleft actions bulkactions">
1055
  <?php $this->bulk_actions( $which ); ?>
1056
  </div>
1057
- <?php
1058
- $this->extra_tablenav( $which );
1059
- $this->pagination( $which );
1060
- ?>
1061
 
1062
  <br class="clear">
1063
  </div>
1064
- <?php
1065
- }
1066
-
1067
- /**
1068
- * Extra controls to be displayed between bulk actions and pagination
1069
- *
1070
- * @since 3.1.0
1071
- * @access protected
1072
- *
1073
- * @param string $which
1074
- */
1075
- protected function extra_tablenav( $which ) {}
1076
 
1077
- /**
1078
- * Generate the tbody element for the list table.
1079
- *
1080
- * @since 3.1.0
1081
- * @access public
1082
- */
1083
- public function display_rows_or_placeholder() {
1084
- if ( $this->has_items() ) {
1085
- $this->display_rows();
1086
- } else {
1087
- echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1088
- $this->no_items();
1089
- echo '</td></tr>';
1090
- }
 
 
 
 
 
 
 
 
 
1091
  }
 
1092
 
1093
- /**
1094
- * Generate the table rows
1095
- *
1096
- * @since 3.1.0
1097
- * @access public
1098
- */
1099
- public function display_rows() {
1100
- foreach ( $this->items as $item ) {
1101
- $this->single_row( $item );
1102
- }
1103
- }
1104
 
1105
- /**
1106
- * Generates content for a single row of the table
1107
- *
1108
- * @since 3.1.0
1109
- * @access public
1110
- *
1111
- * @param object $item The current item
1112
- */
1113
- public function single_row( $item ) {
1114
- echo '<tr>';
1115
- $this->single_row_columns( $item );
1116
- echo '</tr>';
1117
- }
1118
 
1119
- protected function column_default( $item, $column_name ) {}
1120
 
1121
- protected function column_cb( $item ) {}
1122
 
1123
- /**
1124
- * Generates the columns for a single row of the table
1125
- *
1126
- * @since 3.1.0
1127
- * @access protected
1128
- *
1129
- * @param object $item The current item
1130
- */
1131
- protected function single_row_columns( $item ) {
1132
- list( $columns, $hidden ) = $this->get_column_info();
1133
 
1134
- foreach ( $columns as $column_name => $column_display_name ) {
1135
- $class = "class='$column_name column-$column_name'";
1136
 
1137
- $style = '';
1138
- if ( in_array( $column_name, $hidden ) ) {
1139
- $style = ' style="display:none;"';
1140
- }
1141
 
1142
- $attributes = "$class$style";
1143
 
1144
- if ( 'cb' == $column_name ) {
1145
- echo '<th scope="row" class="check-column">';
1146
- echo $this->column_cb( $item );
1147
- echo '</th>';
1148
- } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1149
- echo "<td $attributes>";
1150
- echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1151
- echo '</td>';
1152
- } else {
1153
- echo "<td $attributes>";
1154
- echo $this->column_default( $item, $column_name );
1155
- echo '</td>';
1156
- }
 
1157
  }
1158
  }
 
1159
 
1160
- /**
1161
- * Handle an incoming ajax request (called from admin-ajax.php)
1162
- *
1163
- * @since 3.1.0
1164
- * @access public
1165
- */
1166
- public function ajax_response() {
1167
- $this->prepare_items();
1168
-
1169
- ob_start();
1170
- if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1171
- $this->display_rows();
1172
- } else {
1173
- $this->display_rows_or_placeholder();
1174
- }
1175
 
1176
- $rows = ob_get_clean();
1177
 
1178
- $response = array( 'rows' => $rows );
1179
 
1180
- if ( isset( $this->_pagination_args['total_items'] ) ) {
1181
- $response['total_items_i18n'] = sprintf(
1182
- _n( '1 item', '%s items', $this->_pagination_args['total_items'] ),
1183
- number_format_i18n( $this->_pagination_args['total_items'] )
1184
- );
1185
- }
1186
- if ( isset( $this->_pagination_args['total_pages'] ) ) {
1187
- $response['total_pages'] = $this->_pagination_args['total_pages'];
1188
- $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
1189
- }
1190
-
1191
- die( wp_json_encode( $response ) );
1192
  }
1193
 
1194
- /**
1195
- * Send required variables to JavaScript land
1196
- *
1197
- * @access public
1198
- */
1199
- public function _js_vars() {
1200
- $args = array(
1201
- 'class' => get_class( $this ),
1202
- 'screen' => array(
1203
- 'id' => $this->screen->id,
1204
- 'base' => $this->screen->base,
1205
- ),
1206
- );
1207
 
1208
- printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1209
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1210
  }
 
1211
 
1212
  endif;
10
  * @access private
11
  */
12
 
13
+ if ( !class_exists( 'Strong_Testimonials_List_Table' ) ) :
14
+
15
+ class Strong_Testimonials_List_Table {
16
+
17
+ /**
18
+ * The current list of items
19
+ *
20
+ * @since 3.1.0
21
+ * @var array
22
+ * @access public
23
+ */
24
+ public $items;
25
+
26
+ /**
27
+ * Various information about the current table
28
+ *
29
+ * @since 3.1.0
30
+ * @var array
31
+ * @access protected
32
+ */
33
+ protected $_args;
34
+
35
+ /**
36
+ * Various information needed for displaying the pagination
37
+ *
38
+ * @since 3.1.0
39
+ * @var array
40
+ */
41
+ protected $_pagination_args = array();
42
+
43
+ /**
44
+ * The current screen
45
+ *
46
+ * @since 3.1.0
47
+ * @var object
48
+ * @access protected
49
+ */
50
+ protected $screen;
51
+
52
+ /**
53
+ * Cached bulk actions
54
+ *
55
+ * @since 3.1.0
56
+ * @var array
57
+ * @access private
58
+ */
59
+ private $_actions;
60
+
61
+ /**
62
+ * Cached pagination output
63
+ *
64
+ * @since 3.1.0
65
+ * @var string
66
+ * @access private
67
+ */
68
+ private $_pagination;
69
+
70
+ /**
71
+ * The view switcher modes.
72
+ *
73
+ * @since 4.1.0
74
+ * @var array
75
+ * @access protected
76
+ */
77
+ protected $modes = array();
78
+
79
+ /**
80
+ * Stores the value returned by ->get_column_info()
81
+ *
82
+ * @var array
83
+ */
84
+ protected $_column_headers;
85
+
86
+ protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
87
+
88
+ protected $compat_methods = array( 'set_pagination_args', 'get_views', 'get_bulk_actions', 'bulk_actions',
89
+ 'row_actions', 'months_dropdown', 'view_switcher', 'comments_bubble', 'get_items_per_page', 'pagination',
90
+ 'get_sortable_columns', 'get_column_info', 'get_table_classes', 'display_tablenav', 'extra_tablenav',
91
+ 'single_row_columns' );
92
+
93
+ /**
94
+ * Constructor.
95
+ *
96
+ * The child class should call this constructor from its own constructor to override
97
+ * the default $args.
98
+ *
99
+ * @since 3.1.0
100
+ * @access public
101
+ *
102
+ * @param array|string $args {
103
+ * Array or string of arguments.
104
+ *
105
+ * @type string $plural Plural value used for labels and the objects being listed.
106
+ * This affects things such as CSS class-names and nonces used
107
+ * in the list table, e.g. 'posts'. Default empty.
108
+ * @type string $singular Singular label for an object being listed, e.g. 'post'.
109
+ * Default empty
110
+ * @type bool $ajax Whether the list table supports AJAX. This includes loading
111
+ * and sorting data, for example. If true, the class will call
112
+ * the {@see _js_vars()} method in the footer to provide variables
113
+ * to any scripts handling AJAX events. Default false.
114
+ * @type string $screen String containing the hook name used to determine the current
115
+ * screen. If left null, the current screen will be automatically set.
116
+ * Default null.
117
+ * }
118
+ */
119
+ public function __construct( $args = array() ) {
120
+ $args = wp_parse_args( $args, array(
121
+ 'plural' => '',
122
+ 'singular' => '',
123
+ 'ajax' => false,
124
+ 'screen' => null,
125
+ ) );
126
+
127
+ $this->screen = convert_to_screen( $args['screen'] );
128
+
129
+ add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
130
+
131
+ if ( !$args['plural'] )
132
+ $args['plural'] = $this->screen->base;
133
+
134
+ $args['plural'] = sanitize_key( $args['plural'] );
135
+ $args['singular'] = sanitize_key( $args['singular'] );
136
+
137
+ $this->_args = $args;
138
+
139
+ if ( $args['ajax'] ) {
140
+ // wp_enqueue_script( 'list-table' );
141
+ add_action( 'admin_footer', array( $this, '_js_vars' ) );
142
+ }
143
 
144
+ if ( empty( $this->modes ) ) {
145
+ $this->modes = array(
146
+ 'list' => __( 'List View' ),
147
+ 'excerpt' => __( 'Excerpt View' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
150
+ }
151
 
152
+ /**
153
+ * Make private properties readable for backwards compatibility.
154
+ *
155
+ * @since 4.0.0
156
+ * @access public
157
+ *
158
+ * @param string $name Property to get.
159
+ * @return mixed Property.
160
+ */
161
+ public function __get( $name ) {
162
+ if ( in_array( $name, $this->compat_fields ) ) {
163
+ return $this->$name;
 
164
  }
165
+ }
166
 
167
+ /**
168
+ * Make private properties settable for backwards compatibility.
169
+ *
170
+ * @since 4.0.0
171
+ * @access public
172
+ *
173
+ * @param string $name Property to check if set.
174
+ * @param mixed $value Property value.
175
+ * @return mixed Newly-set property.
176
+ */
177
+ public function __set( $name, $value ) {
178
+ if ( in_array( $name, $this->compat_fields ) ) {
179
+ return $this->$name = $value;
 
180
  }
181
+ }
182
 
183
+ /**
184
+ * Make private properties checkable for backwards compatibility.
185
+ *
186
+ * @since 4.0.0
187
+ * @access public
188
+ *
189
+ * @param string $name Property to check if set.
190
+ * @return bool Whether the property is set.
191
+ */
192
+ public function __isset( $name ) {
193
+ if ( in_array( $name, $this->compat_fields ) ) {
194
+ return isset( $this->$name );
 
195
  }
196
+ }
197
 
198
+ /**
199
+ * Make private properties un-settable for backwards compatibility.
200
+ *
201
+ * @since 4.0.0
202
+ * @access public
203
+ *
204
+ * @param string $name Property to unset.
205
+ */
206
+ public function __unset( $name ) {
207
+ if ( in_array( $name, $this->compat_fields ) ) {
208
+ unset( $this->$name );
 
209
  }
210
+ }
211
 
212
+ /**
213
+ * Make private/protected methods readable for backwards compatibility.
214
+ *
215
+ * @since 4.0.0
216
+ * @access public
217
+ *
218
+ * @param callable $name Method to call.
219
+ * @param array $arguments Arguments to pass when calling.
220
+ * @return mixed|bool Return value of the callback, false otherwise.
221
+ */
222
+ public function __call( $name, $arguments ) {
223
+ if ( in_array( $name, $this->compat_methods ) ) {
224
+ return call_user_func_array( array( $this, $name ), $arguments );
 
 
225
  }
226
+ return false;
227
+ }
228
 
229
+ /**
230
+ * Checks the current user's permissions
231
+ *
232
+ * @since 3.1.0
233
+ * @access public
234
+ * @abstract
235
+ */
236
+ public function ajax_user_can() {
237
+ die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
238
+ }
239
 
240
+ /**
241
+ * Prepares the list of items for displaying.
242
+ * @uses WP_List_Table::set_pagination_args()
243
+ *
244
+ * @since 3.1.0
245
+ * @access public
246
+ * @abstract
247
+ */
248
+ public function prepare_items() {
249
+ die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
250
+ }
251
 
252
+ /**
253
+ * An internal method that sets all the necessary pagination arguments
254
+ *
255
+ * @param array $args An associative array with information about the pagination
256
+ * @access protected
257
+ */
258
+ protected function set_pagination_args( $args ) {
259
+ $args = wp_parse_args( $args, array(
260
+ 'total_items' => 0,
261
+ 'total_pages' => 0,
262
+ 'per_page' => 0,
263
+ ) );
264
+
265
+ if ( !$args['total_pages'] && $args['per_page'] > 0 )
266
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
267
+
268
+ // Redirect if page number is invalid and headers are not already sent.
269
+ if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
270
+ wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
271
+ exit;
272
+ }
273
 
274
+ $this->_pagination_args = $args;
275
+ }
 
276
 
277
+ /**
278
+ * Access the pagination args.
279
+ *
280
+ * @since 3.1.0
281
+ * @access public
282
+ *
283
+ * @param string $key Pagination argument to retrieve. Common values include 'total_items',
284
+ * 'total_pages', 'per_page', or 'infinite_scroll'.
285
+ * @return int Number of items that correspond to the given pagination argument.
286
+ */
287
+ public function get_pagination_arg( $key ) {
288
+ if ( 'page' == $key )
289
+ return $this->get_pagenum();
290
+
291
+ if ( isset( $this->_pagination_args[$key] ) )
292
+ return $this->_pagination_args[$key];
293
+ }
294
 
295
+ /**
296
+ * Whether the table has items to display or not
297
+ *
298
+ * @since 3.1.0
299
+ * @access public
300
+ *
301
+ * @return bool
302
+ */
303
+ public function has_items() {
304
+ return !empty( $this->items );
305
+ }
306
 
307
+ /**
308
+ * Message to be displayed when there are no items
309
+ *
310
+ * @since 3.1.0
311
+ * @access public
312
+ */
313
+ public function no_items() {
314
+ _e( 'No items found.' );
315
+ }
 
 
 
 
 
316
 
317
+ /**
318
+ * Display the search box.
319
+ *
320
+ * @since 3.1.0
321
+ * @access public
322
+ *
323
+ * @param string $text The search button text
324
+ * @param string $input_id The search input id
325
+ */
326
+ public function search_box( $text, $input_id ) {
327
+ if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
328
+ return;
329
+
330
+ $input_id = $input_id . '-search-input';
331
+
332
+ if ( ! empty( $_REQUEST['orderby'] ) )
333
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '">';
334
+ if ( ! empty( $_REQUEST['order'] ) )
335
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '">';
336
+ if ( ! empty( $_REQUEST['post_mime_type'] ) )
337
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '">';
338
+ if ( ! empty( $_REQUEST['detached'] ) )
339
+ echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '">';
340
+ ?>
341
+ <p class="search-box">
342
+ <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
343
+ <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>">
344
+ <?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
345
+ </p>
346
+ <?php
347
+ }
348
 
349
+ /**
350
+ * Get an associative array ( id => link ) with the list
351
+ * of views available on this table.
352
+ *
353
+ * @since 3.1.0
354
+ * @access protected
355
+ *
356
+ * @return array
357
+ */
358
+ protected function get_views() {
359
+ return array();
360
+ }
361
 
362
+ /**
363
+ * Display the list of views available on this table.
364
+ *
365
+ * @since 3.1.0
366
+ * @access public
367
+ */
368
+ public function views() {
369
+ $views = $this->get_views();
370
  /**
371
+ * Filter the list of available list table views.
372
  *
373
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
374
+ * to the ID of the current screen, usually a string.
 
 
 
 
 
 
 
375
  *
376
+ * @since 3.5.0
 
377
  *
378
+ * @param array $views An array of available list table views.
 
379
  */
380
+ $views = apply_filters( "views_{$this->screen->id}", $views );
 
 
 
381
 
382
+ if ( empty( $views ) )
383
+ return;
384
 
385
+ echo "<ul class='subsubsub'>\n";
386
+ foreach ( $views as $class => $view ) {
387
+ $views[ $class ] = "\t<li class='$class'>$view";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  }
389
+ echo implode( " |</li>\n", $views ) . "</li>\n";
390
+ echo "</ul>";
391
+ }
392
 
393
+ /**
394
+ * Get an associative array ( option_name => option_title ) with the list
395
+ * of bulk actions available on this table.
396
+ *
397
+ * @since 3.1.0
398
+ * @access protected
399
+ *
400
+ * @return array
401
+ */
402
+ protected function get_bulk_actions() {
403
+ return array();
404
+ }
405
 
406
+ /**
407
+ * Display the bulk actions dropdown.
408
+ *
409
+ * @since 3.1.0
410
+ * @access protected
411
+ *
412
+ * @param string $which The location of the bulk actions: 'top' or 'bottom'.
413
+ * This is designated as optional for backwards-compatibility.
414
+ */
415
+ protected function bulk_actions( $which = '' ) {
416
+ if ( is_null( $this->_actions ) ) {
417
+ $no_new_actions = $this->_actions = $this->get_bulk_actions();
418
  /**
419
+ * Filter the list table Bulk Actions drop-down.
420
  *
421
  * The dynamic portion of the hook name, `$this->screen->id`, refers
422
  * to the ID of the current screen, usually a string.
423
  *
424
+ * This filter can currently only be used to remove bulk actions.
425
+ *
426
  * @since 3.5.0
427
  *
428
+ * @param array $actions An array of the available bulk actions.
429
  */
430
+ $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
431
+ $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
432
+ $two = '';
433
+ } else {
434
+ $two = '2';
 
 
 
 
 
 
 
435
  }
436
 
437
+ if ( empty( $this->_actions ) )
438
+ return;
 
 
 
 
 
 
 
 
 
 
439
 
440
+ echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . __( 'Select bulk action' ) . "</label>";
441
+ echo "<select name='action$two' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
442
+ echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
443
 
444
+ foreach ( $this->_actions as $name => $title ) {
445
+ $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
446
 
447
+ echo "\t<option value='$name'$class>$title</option>\n";
 
448
  }
449
 
450
+ echo "</select>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
 
452
+ submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
453
+ echo "\n";
454
+ }
455
 
456
+ /**
457
+ * Get the current action selected from the bulk actions dropdown.
458
+ *
459
+ * @since 3.1.0
460
+ * @access public
461
+ *
462
+ * @return string|bool The action name or False if no action was selected
463
+ */
464
+ public function current_action() {
465
+ if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
466
  return false;
 
467
 
468
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
469
+ return $_REQUEST['action'];
 
 
 
 
 
 
 
 
 
 
 
470
 
471
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
472
+ return $_REQUEST['action2'];
 
473
 
474
+ return false;
475
+ }
 
 
 
 
 
476
 
477
+ /**
478
+ * Generate row actions div
479
+ *
480
+ * @since 3.1.0
481
+ * @access protected
482
+ *
483
+ * @param array $actions The list of actions
484
+ * @param bool $always_visible Whether the actions should be always visible
485
+ * @return string
486
+ */
487
+ protected function row_actions( $actions, $always_visible = false ) {
488
+ $action_count = count( $actions );
489
+ $i = 0;
490
+
491
+ if ( !$action_count )
492
+ return '';
493
+
494
+ $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
495
+ foreach ( $actions as $action => $link ) {
496
+ ++$i;
497
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
498
+ $out .= "<span class='$action'>$link$sep</span>";
499
  }
500
+ $out .= '</div>';
501
+
502
+ return $out;
503
+ }
504
+
505
+ /**
506
+ * Display a monthly dropdown for filtering items
507
+ *
508
+ * @since 3.1.0
509
+ * @access protected
510
+ *
511
+ * @param string $post_type
512
+ */
513
+ protected function months_dropdown( $post_type ) {
514
+ global $wpdb, $wp_locale;
515
 
516
  /**
517
+ * Filter whether to remove the 'Months' drop-down from the post list table.
518
  *
519
+ * @since 4.2.0
 
520
  *
521
+ * @param bool $disable Whether to disable the drop-down. Default false.
522
+ * @param string $post_type The post type.
523
  */
524
+ if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
525
+ return;
526
+ }
 
 
 
 
 
 
 
 
 
 
 
527
 
528
+ $months = $wpdb->get_results( $wpdb->prepare( "
 
 
529
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
530
  FROM $wpdb->posts
531
  WHERE post_type = %s
532
  ORDER BY post_date DESC
533
+ ", $post_type ) );
 
 
 
534
 
535
+ /**
536
+ * Filter the 'Months' drop-down results.
537
+ *
538
+ * @since 3.7.0
539
+ *
540
+ * @param object $months The months drop-down query results.
541
+ * @param string $post_type The post type.
542
+ */
543
+ $months = apply_filters( 'months_dropdown_results', $months, $post_type );
544
 
545
+ $month_count = count( $months );
546
 
547
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
548
+ return;
 
549
 
550
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
551
+ ?>
552
  <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
553
  <select name="m" id="filter-by-date">
554
  <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
555
+ <?php
556
+ foreach ( $months as $arc_row ) {
557
+ if ( 0 == $arc_row->year )
558
+ continue;
559
+
560
+ $month = zeroise( $arc_row->month, 2 );
561
+ $year = $arc_row->year;
562
+
563
+ printf( "<option %s value='%s'>%s</option>\n",
564
+ selected( $m, $year . $month, false ),
565
+ esc_attr( $arc_row->year . $month ),
566
+ /* translators: 1: month name, 2: 4-digit year */
567
+ sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
568
+ );
 
 
 
 
 
 
569
  }
570
+ ?>
571
+ </select>
572
+ <?php
573
+ }
574
 
575
+ /**
576
+ * Display a view switcher
577
+ *
578
+ * @since 3.1.0
579
+ * @access protected
580
+ *
581
+ * @param string $current_mode
582
+ */
583
+ protected function view_switcher( $current_mode ) {
584
+ ?>
585
  <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>">
586
  <div class="view-switch">
587
+ <?php
588
  foreach ( $this->modes as $mode => $title ) {
589
  $classes = array( 'view-' . $mode );
590
+ if ( $current_mode == $mode )
591
  $classes[] = 'current';
 
592
  printf(
593
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
594
  esc_url( add_query_arg( 'mode', $mode ) ),
596
  $title
597
  );
598
  }
599
+ ?>
600
  </div>
601
+ <?php
602
+ }
 
 
 
 
 
 
 
 
 
 
 
 
603
 
604
+ /**
605
+ * Display a comment count bubble
606
+ *
607
+ * @since 3.1.0
608
+ * @access protected
609
+ *
610
+ * @param int $post_id The post ID.
611
+ * @param int $pending_comments Number of pending comments.
612
+ */
613
+ protected function comments_bubble( $post_id, $pending_comments ) {
614
+ $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
615
+
616
+ if ( $pending_comments )
617
+ echo '<strong>';
618
+
619
+ echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
620
+
621
+ if ( $pending_comments )
622
+ echo '</strong>';
623
+ }
624
 
625
+ /**
626
+ * Get the current page number
627
+ *
628
+ * @since 3.1.0
629
+ * @access public
630
+ *
631
+ * @return int
632
+ */
633
+ public function get_pagenum() {
634
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
635
+
636
+ if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
637
+ $pagenum = $this->_pagination_args['total_pages'];
638
+
639
+ return max( 1, $pagenum );
640
+ }
641
 
642
+ /**
643
+ * Get number of items to display on a single page
644
+ *
645
+ * @since 3.1.0
646
+ * @access protected
647
+ *
648
+ * @param string $option
649
+ * @param int $default
650
+ * @return int
651
+ */
652
+ protected function get_items_per_page( $option, $default = 20 ) {
653
+ $per_page = (int) get_user_option( $option );
654
+ if ( empty( $per_page ) || $per_page < 1 )
655
+ $per_page = $default;
656
 
657
  /**
658
+ * Filter the number of items to be displayed on each page of the list table.
 
 
 
659
  *
660
+ * The dynamic hook name, $option, refers to the `per_page` option depending
661
+ * on the type of list table in use. Possible values include: 'edit_comments_per_page',
662
+ * 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
663
+ * 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
664
+ * 'edit_{$post_type}_per_page', etc.
 
 
 
 
 
 
 
 
 
665
  *
666
+ * @since 2.9.0
 
667
  *
668
+ * @param int $per_page Number of items to be displayed. Default 20.
 
 
669
  */
670
+ return (int) apply_filters( $option, $per_page );
671
+ }
 
 
 
672
 
673
+ /**
674
+ * Display the pagination.
675
+ *
676
+ * @since 3.1.0
677
+ * @access protected
678
+ *
679
+ * @param string $which
680
+ */
681
+ protected function pagination( $which ) {
682
+ if ( empty( $this->_pagination_args ) ) {
683
+ return;
 
 
 
684
  }
685
 
686
+ $total_items = $this->_pagination_args['total_items'];
687
+ $total_pages = $this->_pagination_args['total_pages'];
688
+ $infinite_scroll = false;
689
+ if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
690
+ $infinite_scroll = $this->_pagination_args['infinite_scroll'];
691
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
 
693
+ $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
694
 
695
+ $current = $this->get_pagenum();
696
 
697
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
698
 
699
+ $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
700
 
701
+ $page_links = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
702
 
703
+ $disable_first = $disable_last = '';
704
+ if ( $current == 1 ) {
705
+ $disable_first = ' disabled';
706
+ }
707
+ if ( $current == $total_pages ) {
708
+ $disable_last = ' disabled';
709
+ }
710
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
711
+ 'first-page' . $disable_first,
712
+ esc_attr__( 'Go to the first page' ),
713
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
714
+ '&laquo;'
715
+ );
716
 
717
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
718
+ 'prev-page' . $disable_first,
719
+ esc_attr__( 'Go to the previous page' ),
720
+ esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
721
+ '&lsaquo;'
722
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
 
724
+ if ( 'bottom' == $which ) {
725
+ $html_current_page = $current;
726
+ } else {
727
+ $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' title='%s' type='text' name='paged' value='%s' size='%d'>",
728
+ '<label for="current-page-selector" class="screen-reader-text">' . __( 'Select Page' ) . '</label>',
729
+ esc_attr__( 'Current page' ),
730
+ $current,
731
+ strlen( $total_pages )
732
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  }
734
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
735
+ $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
736
+
737
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
738
+ 'next-page' . $disable_last,
739
+ esc_attr__( 'Go to the next page' ),
740
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
741
+ '&rsaquo;'
742
+ );
743
 
744
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
745
+ 'last-page' . $disable_last,
746
+ esc_attr__( 'Go to the last page' ),
747
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
748
+ '&raquo;'
749
+ );
 
 
 
 
 
 
 
750
 
751
+ $pagination_links_class = 'pagination-links';
752
+ if ( ! empty( $infinite_scroll ) ) {
753
+ $pagination_links_class = ' hide-if-js';
 
 
 
 
 
 
 
 
 
 
 
 
754
  }
755
+ $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
756
 
757
+ if ( $total_pages ) {
758
+ $page_class = $total_pages < 2 ? ' one-page' : '';
759
+ } else {
760
+ $page_class = ' no-pages';
761
+ }
762
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
 
764
+ echo $this->_pagination;
765
+ }
 
 
766
 
767
+ /**
768
+ * Get a list of columns. The format is:
769
+ * 'internal-name' => 'Title'
770
+ *
771
+ * @since 3.1.0
772
+ * @access public
773
+ * @abstract
774
+ *
775
+ * @return array
776
+ */
777
+ public function get_columns() {
778
+ die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
779
+ }
780
 
781
+ /**
782
+ * Get a list of sortable columns. The format is:
783
+ * 'internal-name' => 'orderby'
784
+ * or
785
+ * 'internal-name' => array( 'orderby', true )
786
+ *
787
+ * The second format will make the initial sorting order be descending
788
+ *
789
+ * @since 3.1.0
790
+ * @access protected
791
+ *
792
+ * @return array
793
+ */
794
+ protected function get_sortable_columns() {
795
+ return array();
796
+ }
797
 
798
+ /**
799
+ * Get a list of all, hidden and sortable columns, with filter applied
800
+ *
801
+ * @since 3.1.0
802
+ * @access protected
803
+ *
804
+ * @return array
805
+ */
806
+ protected function get_column_info() {
807
+ if ( isset( $this->_column_headers ) )
808
  return $this->_column_headers;
 
809
 
810
+ $columns = get_column_headers( $this->screen );
811
+ $hidden = get_hidden_columns( $this->screen );
 
 
 
 
 
 
 
 
 
 
 
812
 
813
+ $sortable_columns = $this->get_sortable_columns();
814
  /**
815
+ * Filter the list table sortable columns for a specific screen.
816
+ *
817
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
818
+ * to the ID of the current screen, usually a string.
819
  *
820
+ * @since 3.5.0
 
821
  *
822
+ * @param array $sortable_columns An array of sortable columns.
823
  */
824
+ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
 
825
 
826
+ $sortable = array();
827
+ foreach ( $_sortable as $id => $data ) {
828
+ if ( empty( $data ) )
829
+ continue;
830
 
831
+ $data = (array) $data;
832
+ if ( !isset( $data[1] ) )
833
+ $data[1] = false;
 
 
834
 
835
+ $sortable[$id] = $data;
836
+ }
 
 
 
837
 
838
+ $this->_column_headers = array( $columns, $hidden, $sortable );
 
 
 
 
 
839
 
840
+ return $this->_column_headers;
841
+ }
842
 
843
+ /**
844
+ * Return number of visible columns
845
+ *
846
+ * @since 3.1.0
847
+ * @access public
848
+ *
849
+ * @return int
850
+ */
851
+ public function get_column_count() {
852
+ list ( $columns, $hidden ) = $this->get_column_info();
853
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
854
+ return count( $columns ) - count( $hidden );
855
+ }
856
 
857
+ /**
858
+ * Print column headers, accounting for hidden and sortable columns.
859
+ *
860
+ * @since 3.1.0
861
+ * @access public
862
+ *
863
+ * @param bool $with_id Whether to set the id attribute or not
864
+ */
865
+ public function print_column_headers( $with_id = true ) {
866
+ list( $columns, $hidden, $sortable ) = $this->get_column_info();
867
+
868
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
869
+ $current_url = remove_query_arg( 'paged', $current_url );
870
+
871
+ if ( isset( $_GET['orderby'] ) )
872
+ $current_orderby = $_GET['orderby'];
873
+ else
874
+ $current_orderby = '';
875
+
876
+ if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
877
+ $current_order = 'desc';
878
+ else
879
+ $current_order = 'asc';
880
+
881
+ if ( ! empty( $columns['cb'] ) ) {
882
+ static $cb_counter = 1;
883
+ $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
884
+ . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox">';
885
+ $cb_counter++;
886
+ }
887
 
888
+ foreach ( $columns as $column_key => $column_display_name ) {
889
+ $class = array( 'manage-column', "column-$column_key" );
 
 
 
890
 
891
+ $style = '';
892
+ if ( in_array( $column_key, $hidden ) )
893
+ $style = 'display:none;';
894
 
895
+ $style = ' style="' . $style . '"';
 
 
 
 
 
 
 
 
896
 
897
+ if ( 'cb' == $column_key )
898
+ $class[] = 'check-column';
899
+ elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
900
+ $class[] = 'num';
901
 
902
+ if ( isset( $sortable[$column_key] ) ) {
903
+ list( $orderby, $desc_first ) = $sortable[$column_key];
904
 
905
+ if ( $current_orderby == $orderby ) {
906
+ $order = 'asc' == $current_order ? 'desc' : 'asc';
907
+ $class[] = 'sorted';
908
+ $class[] = $current_order;
909
+ } else {
910
+ $order = $desc_first ? 'desc' : 'asc';
911
+ $class[] = 'sortable';
912
+ $class[] = $desc_first ? 'asc' : 'desc';
913
  }
914
 
915
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
916
  }
917
+
918
+ $id = $with_id ? "id='$column_key'" : '';
919
+
920
+ if ( !empty( $class ) )
921
+ $class = "class='" . join( ' ', $class ) . "'";
922
+
923
+ echo "<th scope='col' $id $class $style>$column_display_name</th>";
924
  }
925
+ }
926
 
927
+ /**
928
+ * Display the table
929
+ *
930
+ * @since 3.1.0
931
+ * @access public
932
+ */
933
+ public function display() {
934
+ $singular = $this->_args['singular'];
935
 
936
+ $this->display_tablenav( 'top' );
937
 
938
+ ?>
939
  <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
940
  <thead>
941
  <tr>
942
+ <?php $this->print_column_headers(); ?>
943
  </tr>
944
  </thead>
945
 
946
+ <tbody id="the-list"<?php
947
+ if ( $singular ) {
948
+ echo " data-wp-lists='list:$singular'";
949
+ } ?>>
950
+ <?php $this->display_rows_or_placeholder(); ?>
 
 
 
951
  </tbody>
952
 
953
  <tfoot>
954
  <tr>
955
+ <?php $this->print_column_headers( false ); ?>
956
  </tr>
957
  </tfoot>
958
 
959
  </table>
960
+ <?php
961
+ $this->display_tablenav( 'bottom' );
962
+ }
963
 
964
+ /**
965
+ * Get a list of CSS classes for the list table table tag.
966
+ *
967
+ * @since 3.1.0
968
+ * @access protected
969
+ *
970
+ * @return array List of CSS classes for the table tag.
971
+ */
972
+ protected function get_table_classes() {
973
+ return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
974
+ }
975
 
976
+ /**
977
+ * Generate the table navigation above or below the table
978
+ *
979
+ * @since 3.1.0
980
+ * @access protected
981
+ * @param string $which
982
+ */
983
+ protected function display_tablenav( $which ) {
984
+ if ( 'top' == $which )
985
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
986
+ ?>
 
987
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
988
 
989
  <div class="alignleft actions bulkactions">
990
  <?php $this->bulk_actions( $which ); ?>
991
  </div>
992
+ <?php
993
+ $this->extra_tablenav( $which );
994
+ $this->pagination( $which );
995
+ ?>
996
 
997
  <br class="clear">
998
  </div>
999
+ <?php
1000
+ }
 
 
 
 
 
 
 
 
 
 
1001
 
1002
+ /**
1003
+ * Extra controls to be displayed between bulk actions and pagination
1004
+ *
1005
+ * @since 3.1.0
1006
+ * @access protected
1007
+ *
1008
+ * @param string $which
1009
+ */
1010
+ protected function extra_tablenav( $which ) {}
1011
+
1012
+ /**
1013
+ * Generate the tbody element for the list table.
1014
+ *
1015
+ * @since 3.1.0
1016
+ * @access public
1017
+ */
1018
+ public function display_rows_or_placeholder() {
1019
+ if ( $this->has_items() ) {
1020
+ $this->display_rows();
1021
+ } else {
1022
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
1023
+ $this->no_items();
1024
+ echo '</td></tr>';
1025
  }
1026
+ }
1027
 
1028
+ /**
1029
+ * Generate the table rows
1030
+ *
1031
+ * @since 3.1.0
1032
+ * @access public
1033
+ */
1034
+ public function display_rows() {
1035
+ foreach ( $this->items as $item )
1036
+ $this->single_row( $item );
1037
+ }
 
1038
 
1039
+ /**
1040
+ * Generates content for a single row of the table
1041
+ *
1042
+ * @since 3.1.0
1043
+ * @access public
1044
+ *
1045
+ * @param object $item The current item
1046
+ */
1047
+ public function single_row( $item ) {
1048
+ echo '<tr>';
1049
+ $this->single_row_columns( $item );
1050
+ echo '</tr>';
1051
+ }
1052
 
1053
+ protected function column_default( $item, $column_name ) {}
1054
 
1055
+ protected function column_cb( $item ) {}
1056
 
1057
+ /**
1058
+ * Generates the columns for a single row of the table
1059
+ *
1060
+ * @since 3.1.0
1061
+ * @access protected
1062
+ *
1063
+ * @param object $item The current item
1064
+ */
1065
+ protected function single_row_columns( $item ) {
1066
+ list( $columns, $hidden ) = $this->get_column_info();
1067
 
1068
+ foreach ( $columns as $column_name => $column_display_name ) {
1069
+ $class = "class='$column_name column-$column_name'";
1070
 
1071
+ $style = '';
1072
+ if ( in_array( $column_name, $hidden ) )
1073
+ $style = ' style="display:none;"';
 
1074
 
1075
+ $attributes = "$class$style";
1076
 
1077
+ if ( 'cb' == $column_name ) {
1078
+ echo '<th scope="row" class="check-column">';
1079
+ echo $this->column_cb( $item );
1080
+ echo '</th>';
1081
+ }
1082
+ elseif ( method_exists( $this, 'column_' . $column_name ) ) {
1083
+ echo "<td $attributes>";
1084
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
1085
+ echo "</td>";
1086
+ }
1087
+ else {
1088
+ echo "<td $attributes>";
1089
+ echo $this->column_default( $item, $column_name );
1090
+ echo "</td>";
1091
  }
1092
  }
1093
+ }
1094
 
1095
+ /**
1096
+ * Handle an incoming ajax request (called from admin-ajax.php)
1097
+ *
1098
+ * @since 3.1.0
1099
+ * @access public
1100
+ */
1101
+ public function ajax_response() {
1102
+ $this->prepare_items();
1103
+
1104
+ ob_start();
1105
+ if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1106
+ $this->display_rows();
1107
+ } else {
1108
+ $this->display_rows_or_placeholder();
1109
+ }
1110
 
1111
+ $rows = ob_get_clean();
1112
 
1113
+ $response = array( 'rows' => $rows );
1114
 
1115
+ if ( isset( $this->_pagination_args['total_items'] ) ) {
1116
+ $response['total_items_i18n'] = sprintf(
1117
+ _n( '1 item', '%s items', $this->_pagination_args['total_items'] ),
1118
+ number_format_i18n( $this->_pagination_args['total_items'] )
1119
+ );
1120
+ }
1121
+ if ( isset( $this->_pagination_args['total_pages'] ) ) {
1122
+ $response['total_pages'] = $this->_pagination_args['total_pages'];
1123
+ $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
 
 
 
1124
  }
1125
 
1126
+ die( wp_json_encode( $response ) );
1127
+ }
 
 
 
 
 
 
 
 
 
 
 
1128
 
1129
+ /**
1130
+ * Send required variables to JavaScript land
1131
+ *
1132
+ * @access public
1133
+ */
1134
+ public function _js_vars() {
1135
+ $args = array(
1136
+ 'class' => get_class( $this ),
1137
+ 'screen' => array(
1138
+ 'id' => $this->screen->id,
1139
+ 'base' => $this->screen->base,
1140
+ )
1141
+ );
1142
+
1143
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1144
  }
1145
+ }
1146
 
1147
  endif;
admin/class-strong-testimonials-page-shortcodes.php CHANGED
@@ -29,57 +29,57 @@ class Strong_Testimonials_Page_Shortcodes {
29
  ?>
30
  <div class="wrap wpmtst shortcodes has-stars">
31
 
32
- <h1><?php esc_html_e( 'Shortcodes', 'strong-testimonials' ); ?></h1>
33
 
34
- <h2><?php esc_html_e( 'Testimonial Views', 'strong-testimonials' ); ?></h2>
35
 
36
  <p>
37
- <?php echo wp_kses_post( _e( 'Each view has a unique shortcode like <code>&#91;testimonial_view id="1"&#93;</code>.', 'strong-testimonials' ) ); ?>
38
- <?php printf( '<a href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ), esc_html__( 'Go to views', 'strong-testimonials' ) ); ?>
39
  </p>
40
 
41
- <h2><?php esc_html_e( 'Testimonial Count', 'strong-testimonials' ); ?></h2>
42
 
43
- <p><?php printf( esc_html__( 'Use %s to display the number of testimonials.', 'strong-testimonials' ), '<code>&#91;testimonial_count&#93;</code>' ); ?></p>
44
 
45
  <table class="form-table shortcodes" cellpadding="0" cellspacing="0">
46
  <tr>
47
  <td>
48
- <p><?php esc_html_e( 'Default', 'strong-testimonials' ); ?></p>
49
  </td>
50
  <td class="shortcode">
51
  <?php /* translators: %s is a shortcode */ ?>
52
  <p>
53
- <?php printf( esc_html__( 'Read some of our %s testimonials!', 'strong-testimonials' ), '&#91;testimonial_count&#93;' ); ?>
54
  </p>
55
  </td>
56
  </tr>
57
  <tr>
58
  <td>
59
  <?php /* translators: %s is a shortcode attribute */ ?>
60
- <p><?php printf( esc_html__( 'To count for a specific category, add the %s attribute with the category slug.', 'strong-testimonials' ), '<code>category</code>' ); ?>
61
  </td>
62
  <td class="shortcode">
63
  <?php /* translators: %s is a shortcode */ ?>
64
  <p>
65
- <?php printf( esc_html__( 'Here\'s what %s local clients say', 'strong-testimonials' ), '&#91;testimonial_count category="local"&#93;' ); ?>
66
  </p>
67
  </td>
68
  </tr>
69
  </table>
70
 
71
- <h2><?php esc_html_e( 'Average Rating', 'strong-testimonials' ); ?></h2>
72
 
73
  <p>
74
  <?php /* translators: %s is a shortcode */ ?>
75
- <?php echo wp_kses_post( printf( __( 'If using a <strong>single</strong> rating field, use %s to display the average rating.', 'strong-testimonials' ), '<code>&#91;testimonial_average_rating&#93;</code>' ) ); ?>
76
  </p>
77
 
78
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
79
  <tr>
80
  <td>
81
- <p><?php esc_html_e( 'Default', 'strong-testimonials' ); ?></p>
82
- <p class="description"><?php echo wp_kses_post( _e( 'You must use the closing slash <code>/</code> if using the shortcode with content elsewhere on your page.', 'strong-testimonials' ) ); ?></p>
83
  </td>
84
  <td class="has-inner">
85
  <table class="inner" cellpadding="0" cellspacing="0">
@@ -90,7 +90,7 @@ class Strong_Testimonials_Page_Shortcodes {
90
  <td>
91
  <div class="strong-rating-wrapper average">
92
  <span class="strong-rating-title">Average Rating:</span>
93
- <?php echo wp_kses_post( $stars ); ?>
94
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
95
  </div>
96
  </td>
@@ -103,8 +103,8 @@ class Strong_Testimonials_Page_Shortcodes {
103
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
104
  <tr>
105
  <td>
106
- <p><?php esc_html_e( 'Customize using content tags.', 'strong-testimonials' ); ?></p>
107
- <p><?php esc_html_e( 'Default:', 'strong-testimonials' ); ?></p>
108
  <p><code>{title}</code><br><code>{stars}</code><br><code>{summary}</code></p>
109
  </td>
110
  <td class="has-inner">
@@ -116,7 +116,7 @@ class Strong_Testimonials_Page_Shortcodes {
116
  <td>
117
  <div class="strong-rating-wrapper average">
118
  <span class="strong-rating-title">Average Rating:</span>
119
- <?php echo wp_kses_post( $stars ); ?>
120
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
121
  </div>
122
  </td>
@@ -129,7 +129,7 @@ class Strong_Testimonials_Page_Shortcodes {
129
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
130
  <tr>
131
  <td>
132
- <p><?php esc_html_e( 'Alternate content tags.', 'strong-testimonials' ); ?></p>
133
  <p><code>{title2}</code><br><code>{summary2}</code></p>
134
  </td>
135
  <td class="has-inner">
@@ -141,7 +141,7 @@ class Strong_Testimonials_Page_Shortcodes {
141
  <td>
142
  <div class="strong-rating-wrapper average">
143
  <span class="strong-rating-title">Average of 9 Ratings:</span>
144
- <?php echo wp_kses_post( $stars ); ?>
145
  <span class="strong-rating-summary">4.3 stars</span>
146
  </div>
147
  </td>
@@ -154,7 +154,7 @@ class Strong_Testimonials_Page_Shortcodes {
154
  <table class="form-table shortcodes average">
155
  <tr>
156
  <td>
157
- <p><?php esc_html_e( 'Insert tags into your custom content.', 'strong-testimonials' ); ?></p>
158
  </td>
159
  <td class="has-inner">
160
  <table class="inner" cellpadding="0" cellspacing="0">
@@ -164,7 +164,7 @@ class Strong_Testimonials_Page_Shortcodes {
164
  <tr>
165
  <td>
166
  <div class="strong-rating-wrapper average">
167
- <?php echo wp_kses_post( $stars ); ?>
168
  Our average rating is <b><span class="strong-rating-summary">4.3 stars</span></b>
169
  </div>
170
  </td>
@@ -187,7 +187,7 @@ class Strong_Testimonials_Page_Shortcodes {
187
  <tr>
188
  <td>
189
  <div class="strong-rating-wrapper average">
190
- <?php echo wp_kses_post( $stars ); ?>
191
  </div>
192
  </td>
193
  </tr>
@@ -249,7 +249,7 @@ class Strong_Testimonials_Page_Shortcodes {
249
  <tr>
250
  <td>
251
  <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
252
- <?php echo wp_kses_post( $stars ); ?>
253
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
254
  </div>
255
  </td>
@@ -272,7 +272,7 @@ class Strong_Testimonials_Page_Shortcodes {
272
  <tr>
273
  <td>
274
  <div class="strong-rating-wrapper average centered"><span class="strong-rating-title">Average Rating:</span>
275
- <?php echo wp_kses_post( $stars ); ?>
276
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
277
  </div>
278
  </td>
@@ -295,7 +295,7 @@ class Strong_Testimonials_Page_Shortcodes {
295
  <tr>
296
  <td>
297
  <div class="strong-rating-wrapper average block centered"><span class="strong-rating-title">Average Rating:</span>
298
- <?php echo wp_kses_post( $stars ); ?>
299
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
300
  </div>
301
  </td>
@@ -308,7 +308,7 @@ class Strong_Testimonials_Page_Shortcodes {
308
  <table class="form-table shortcodes average">
309
  <tr>
310
  <td>
311
- <p><?php echo wp_kses_post( _e( 'The default container element is <code>div</code>. Select another element using <code>element</code>.', 'strong-testimonials' ) ); ?></p>
312
  </td>
313
  <td class="has-inner">
314
  <table class="inner" cellpadding="0" cellspacing="0">
@@ -319,7 +319,7 @@ class Strong_Testimonials_Page_Shortcodes {
319
  <td>
320
  <span class="strong-rating-wrapper average">
321
  <span class="strong-rating-title">Average Rating:</span>
322
- <?php echo wp_kses_post( $stars ); ?>
323
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
324
  </span>
325
  </td>
29
  ?>
30
  <div class="wrap wpmtst shortcodes has-stars">
31
 
32
+ <h1><?php _e( 'Shortcodes', 'strong-testimonials' ); ?></h1>
33
 
34
+ <h2><?php _e( 'Testimonial Views', 'strong-testimonials' ); ?></h2>
35
 
36
  <p>
37
+ <?php _e( 'Each view has a unique shortcode like <code>&#91;testimonial_view id="1"&#93;</code>.', 'strong-testimonials' ); ?>
38
+ <?php printf( '<a href="%s">%s</a>', esc_url( admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-views' ) ), __( 'Go to views', 'strong-testimonials' ) ); ?>
39
  </p>
40
 
41
+ <h2><?php _e( 'Testimonial Count', 'strong-testimonials' ); ?></h2>
42
 
43
+ <p><?php printf( __( 'Use %s to display the number of testimonials.', 'strong-testimonials' ), '<code>&#91;testimonial_count&#93;</code>' ); ?></p>
44
 
45
  <table class="form-table shortcodes" cellpadding="0" cellspacing="0">
46
  <tr>
47
  <td>
48
+ <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
49
  </td>
50
  <td class="shortcode">
51
  <?php /* translators: %s is a shortcode */ ?>
52
  <p>
53
+ <?php printf( __( 'Read some of our %s testimonials!', 'strong-testimonials' ), '&#91;testimonial_count&#93;' ); ?>
54
  </p>
55
  </td>
56
  </tr>
57
  <tr>
58
  <td>
59
  <?php /* translators: %s is a shortcode attribute */ ?>
60
+ <p><?php printf( __( 'To count for a specific category, add the %s attribute with the category slug.', 'strong-testimonials' ), '<code>category</code>' ); ?>
61
  </td>
62
  <td class="shortcode">
63
  <?php /* translators: %s is a shortcode */ ?>
64
  <p>
65
+ <?php printf( __( 'Here\'s what %s local clients say', 'strong-testimonials' ), '&#91;testimonial_count category="local"&#93;' ); ?>
66
  </p>
67
  </td>
68
  </tr>
69
  </table>
70
 
71
+ <h2><?php _e( 'Average Rating', 'strong-testimonials' ); ?></h2>
72
 
73
  <p>
74
  <?php /* translators: %s is a shortcode */ ?>
75
+ <?php printf( __( 'If using a <strong>single</strong> rating field, use %s to display the average rating.', 'strong-testimonials' ), '<code>&#91;testimonial_average_rating&#93;</code>' ); ?>
76
  </p>
77
 
78
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
79
  <tr>
80
  <td>
81
+ <p><?php _e( 'Default', 'strong-testimonials' ); ?></p>
82
+ <p class="description"><?php _e( 'You must use the closing slash <code>/</code> if using the shortcode with content elsewhere on your page.', 'strong-testimonials' ); ?></p>
83
  </td>
84
  <td class="has-inner">
85
  <table class="inner" cellpadding="0" cellspacing="0">
90
  <td>
91
  <div class="strong-rating-wrapper average">
92
  <span class="strong-rating-title">Average Rating:</span>
93
+ <?php echo $stars; ?>
94
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
95
  </div>
96
  </td>
103
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
104
  <tr>
105
  <td>
106
+ <p><?php _e( 'Customize using content tags.', 'strong-testimonials' ); ?></p>
107
+ <p><?php _e( 'Default:', 'strong-testimonials' ); ?></p>
108
  <p><code>{title}</code><br><code>{stars}</code><br><code>{summary}</code></p>
109
  </td>
110
  <td class="has-inner">
116
  <td>
117
  <div class="strong-rating-wrapper average">
118
  <span class="strong-rating-title">Average Rating:</span>
119
+ <?php echo $stars; ?>
120
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
121
  </div>
122
  </td>
129
  <table class="form-table shortcodes average" cellpadding="0" cellspacing="0">
130
  <tr>
131
  <td>
132
+ <p><?php _e( 'Alternate content tags.', 'strong-testimonials' ); ?></p>
133
  <p><code>{title2}</code><br><code>{summary2}</code></p>
134
  </td>
135
  <td class="has-inner">
141
  <td>
142
  <div class="strong-rating-wrapper average">
143
  <span class="strong-rating-title">Average of 9 Ratings:</span>
144
+ <?php echo $stars; ?>
145
  <span class="strong-rating-summary">4.3 stars</span>
146
  </div>
147
  </td>
154
  <table class="form-table shortcodes average">
155
  <tr>
156
  <td>
157
+ <p><?php _e( 'Insert tags into your custom content.', 'strong-testimonials' ); ?></p>
158
  </td>
159
  <td class="has-inner">
160
  <table class="inner" cellpadding="0" cellspacing="0">
164
  <tr>
165
  <td>
166
  <div class="strong-rating-wrapper average">
167
+ <?php echo $stars; ?>
168
  Our average rating is <b><span class="strong-rating-summary">4.3 stars</span></b>
169
  </div>
170
  </td>
187
  <tr>
188
  <td>
189
  <div class="strong-rating-wrapper average">
190
+ <?php echo $stars; ?>
191
  </div>
192
  </td>
193
  </tr>
249
  <tr>
250
  <td>
251
  <div class="strong-rating-wrapper average block"><span class="strong-rating-title">Average Rating:</span>
252
+ <?php echo $stars; ?>
253
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
254
  </div>
255
  </td>
272
  <tr>
273
  <td>
274
  <div class="strong-rating-wrapper average centered"><span class="strong-rating-title">Average Rating:</span>
275
+ <?php echo $stars; ?>
276
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
277
  </div>
278
  </td>
295
  <tr>
296
  <td>
297
  <div class="strong-rating-wrapper average block centered"><span class="strong-rating-title">Average Rating:</span>
298
+ <?php echo $stars; ?>
299
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
300
  </div>
301
  </td>
308
  <table class="form-table shortcodes average">
309
  <tr>
310
  <td>
311
+ <p><?php _e( 'The default container element is <code>div</code>. Select another element using <code>element</code>.', 'strong-testimonials' ); ?></p>
312
  </td>
313
  <td class="has-inner">
314
  <table class="inner" cellpadding="0" cellspacing="0">
319
  <td>
320
  <span class="strong-rating-wrapper average">
321
  <span class="strong-rating-title">Average Rating:</span>
322
+ <?php echo $stars; ?>
323
  <span class="strong-rating-summary">4.3 stars (based on 9 ratings)</span>
324
  </span>
325
  </td>
admin/class-strong-testimonials-post-editor.php CHANGED
@@ -54,12 +54,12 @@ class Strong_Testimonials_Post_Editor {
54
  $is_new = ( 'post-new.php' == $pagenow );
55
  ?>
56
  <?php do_action( 'wpmtst_before_client_fields_table' ); ?>
57
- <table class="options">
58
- <tr>
59
- <td colspan="2">
60
- <p><?php echo esc_html_x( 'To add a photo or logo, use the Featured Image option.', 'post editor', 'strong-testimonials' ); ?></p>
61
- </td>
62
- </tr>
63
  <?php
64
  do_action( 'wpmtst_before_client_fields' );
65
  foreach ( $fields as $key => $field ) {
@@ -69,23 +69,23 @@ class Strong_Testimonials_Post_Editor {
69
  continue;
70
  }
71
  ?>
72
- <tr>
73
- <th>
74
- <label for="<?php echo esc_attr( $field['name'] ); ?>">
75
- <?php echo wp_kses_post( apply_filters( 'wpmtst_l10n', $field['label'], 'strong-testimonials-form-fields', $field['name'] . ' : label' ) ); ?>
76
- </label>
77
- </th>
78
- <td>
79
- <div class="<?php echo esc_attr( $field['input_type'] ); ?>">
80
  <?php self::meta_option( $field, $post, $is_new ); ?>
81
- </div>
82
- </td>
83
- </tr>
84
  <?php
85
  }
86
  do_action( 'wpmtst_after_client_fields' );
87
  ?>
88
- </table>
89
  <?php
90
  do_action( 'wpmtst_after_client_fields_table' );
91
  }
@@ -107,27 +107,27 @@ class Strong_Testimonials_Post_Editor {
107
  // Check field type.
108
  else {
109
  switch ( $field['input_type'] ) {
110
- case 'rating':
111
  self::meta_option__rating( $field, $post, $is_new );
112
  break;
113
- case 'url':
114
  self::meta_option__url( $field, $post, $is_new );
115
  break;
116
- case 'checkbox':
117
  self::meta_option__checkbox( $field, $post, $is_new );
118
  break;
119
- case 'shortcode':
120
  self::meta_option__shortcode( $field, $post, $is_new );
121
  break;
122
- default:
123
  self::meta_option__text( $field, $post, $is_new );
124
  }
125
  }
126
  }
127
 
128
  /**
129
- * Custom action callback.
130
- *
131
  * @param $field
132
  * @param $post
133
  * @param $is_new
@@ -146,12 +146,8 @@ class Strong_Testimonials_Post_Editor {
146
  * @param $is_new
147
  */
148
  private static function meta_option__text( $field, $post, $is_new ) {
149
- printf(
150
- '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s">',
151
- esc_attr( $field['input_type'] ),
152
- esc_attr( $field['name'] ),
153
- esc_attr( $post->{$field['name']} )
154
- );
155
  }
156
 
157
  /**
@@ -163,24 +159,18 @@ class Strong_Testimonials_Post_Editor {
163
  */
164
  private static function meta_option__url( $field, $post, $is_new ) {
165
  ?>
166
- <div class="input-url">
167
- <?php
168
- printf(
169
- '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" size="">',
170
- esc_attr( $field['input_type'] ),
171
- esc_attr( $field['name'] ),
172
- esc_attr( $post->{$field['name']} )
173
- );
174
- ?>
175
- </div>
176
- <div class="input-nofollow">
177
- <label for="custom_nofollow"><code>rel="nofollow"</code></label>
178
- <select id="custom_nofollow" name="custom[nofollow]">
179
- <option value="default" <?php selected( $post->nofollow, 'default' ); ?>><?php esc_html_e( 'default', 'strong-testimonials' ); ?></option>
180
- <option value="yes" <?php selected( $post->nofollow, 'yes' ); ?>><?php esc_html_e( 'yes', 'strong-testimonials' ); ?></option>
181
- <option value="no" <?php selected( $post->nofollow, 'no' ); ?>><?php esc_html_e( 'no', 'strong-testimonials' ); ?></option>
182
- </select>
183
- </div>
184
  <?php
185
  }
186
 
@@ -192,13 +182,8 @@ class Strong_Testimonials_Post_Editor {
192
  * @param $is_new
193
  */
194
  private static function meta_option__checkbox( $field, $post, $is_new ) {
195
- printf(
196
- '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" %4$s>',
197
- esc_attr( $field['input_type'] ),
198
- esc_attr( $field['name'] ),
199
- 1,
200
- checked( $post->{$field['name']}, 1, false )
201
- );
202
  }
203
 
204
  /**
@@ -214,41 +199,45 @@ class Strong_Testimonials_Post_Editor {
214
  $rating = 0;
215
  }
216
  ?>
217
- <div class="edit-rating-box hide-if-no-js" data-field="<?php echo esc_attr( $field['name'] ); ?>">
218
 
219
  <?php wp_nonce_field( 'editrating', "edit-{$field['name']}-nonce", false ); ?>
220
- <input type="hidden" class="current-rating" value="<?php echo esc_attr( $rating ); ?>">
221
 
222
- <!-- form -->
223
- <div class="rating-form" style="<?php echo ( $is_new ) ? 'display: inline-block;' : 'display: none;'; ?>">
224
- <span class="inner">
225
- <?php wpmtst_star_rating_form( $field, $rating, 'in-metabox', true, 'custom' ); ?>
226
- </span>
227
  <?php if ( ! $is_new ) : ?>
228
- <span class="edit-rating-buttons-2">
229
- <button type="button" class="zero button-link"><?php esc_html_e( 'Zero', 'strong-testimonials' ); ?></button>&nbsp;
230
- <button type="button" class="save button button-small"><?php esc_html_e( 'OK' ); ?></button>&nbsp;
231
- <button type="button" class="cancel button-link"><?php esc_html_e( 'Cancel' ); ?></button>
232
- </span>
 
233
  <?php endif; ?>
234
- </div>
235
 
236
- <!-- display -->
237
- <div class="rating-display" style="<?php echo $is_new ? 'display: none;' : 'display: inline-block;'; ?>">
238
- <span class="inner">
239
- <?php wpmtst_star_rating_display( $rating, 'in-metabox' ); ?>
240
- </span>
241
 
242
  <?php if ( ! $is_new ) : ?>
243
- <span class="edit-rating-buttons-1">
244
- <button type="button" id="" class="edit-rating button button-small hide-if-no-js" aria-label="Edit rating"><?php esc_html_e( 'Edit' ); ?></button>
245
- </span>
 
 
 
246
  <?php endif; ?>
247
- </div>
248
 
249
- <span class="edit-rating-success"></span>
250
 
251
- </div>
252
  <?php
253
  }
254
 
@@ -260,12 +249,12 @@ class Strong_Testimonials_Post_Editor {
260
  * @param $is_new
261
  */
262
  public static function meta_option__shortcode( $field, $post, $is_new ) {
263
- $shortcode = str_replace( array( '[', ']' ), array( '', '' ), $field['shortcode_on_display'] );
264
- if ( shortcode_exists( $shortcode ) ) {
265
- echo do_shortcode( $field['shortcode_on_display'] );
266
- } else {
267
- echo '<div class="custom-input not-found">' . sprintf( esc_html__( 'shortcode %s not found', 'strong-testimonials' ), '<code>' . esc_html( $field['shortcode_on_display'] ) . '</code>' ) . '</div>';
268
- }
269
  }
270
 
271
  /**
@@ -296,10 +285,10 @@ class Strong_Testimonials_Post_Editor {
296
  // Determine whether to update or delete.
297
  // Similar to wpmtst_ajax_edit_rating() in admin-ajax.php.
298
  foreach ( $custom as $key => $value ) {
299
- $action = 'update';
300
 
301
- if ( isset( $custom_fields[ $key ] ) ) {
302
- if ( 'rating' == $custom_fields[ $key ]['input_type'] && ! $value ) {
303
  $action = 'delete';
304
  }
305
  }
@@ -307,7 +296,8 @@ class Strong_Testimonials_Post_Editor {
307
  if ( 'update' == $action ) {
308
  // empty values replace existing values
309
  update_post_meta( $_POST['post_ID'], $key, stripslashes( $value ) );
310
- } else {
 
311
  // delete value; e.g. zero rating
312
  delete_post_meta( $_POST['post_ID'], $key );
313
  }
@@ -316,19 +306,19 @@ class Strong_Testimonials_Post_Editor {
316
 
317
  /**
318
  * Prevent use of this plugin's shortcode in a testimonial.
319
- *
320
- * @since 2.32.2
321
  * @param $data
322
  * @param $postarr
323
  *
324
  * @return mixed
325
  */
326
  public static function prevent_shortcode( $data, $postarr ) {
327
- if ( 'wpm-testimonial' == $data['post_type'] ) {
328
- $data['post_content'] = preg_replace( '/\[testimonial_view (.*)\]/', '', $data['post_content'] );
329
- }
330
 
331
- return $data;
332
  }
333
 
334
  /**
@@ -354,10 +344,7 @@ class Strong_Testimonials_Post_Editor {
354
  }
355
 
356
  $display = wpmtst_star_rating_display( $rating, 'in-metabox', false );
357
- $response = array(
358
- 'display' => $display,
359
- 'message' => $message,
360
- );
361
  echo json_encode( $response );
362
  wp_die();
363
  }
54
  $is_new = ( 'post-new.php' == $pagenow );
55
  ?>
56
  <?php do_action( 'wpmtst_before_client_fields_table' ); ?>
57
+ <table class="options">
58
+ <tr>
59
+ <td colspan="2">
60
+ <p><?php _ex( 'To add a photo or logo, use the Featured Image option.', 'post editor', 'strong-testimonials' ); ?></p>
61
+ </td>
62
+ </tr>
63
  <?php
64
  do_action( 'wpmtst_before_client_fields' );
65
  foreach ( $fields as $key => $field ) {
69
  continue;
70
  }
71
  ?>
72
+ <tr>
73
+ <th>
74
+ <label for="<?php esc_attr_e( $field['name'] ); ?>">
75
+ <?php echo apply_filters( 'wpmtst_l10n', $field['label'], 'strong-testimonials-form-fields', $field['name'] . ' : label' ); ?>
76
+ </label>
77
+ </th>
78
+ <td>
79
+ <div class="<?php esc_attr_e( $field['input_type'] ); ?>">
80
  <?php self::meta_option( $field, $post, $is_new ); ?>
81
+ </div>
82
+ </td>
83
+ </tr>
84
  <?php
85
  }
86
  do_action( 'wpmtst_after_client_fields' );
87
  ?>
88
+ </table>
89
  <?php
90
  do_action( 'wpmtst_after_client_fields_table' );
91
  }
107
  // Check field type.
108
  else {
109
  switch ( $field['input_type'] ) {
110
+ case 'rating' :
111
  self::meta_option__rating( $field, $post, $is_new );
112
  break;
113
+ case 'url' :
114
  self::meta_option__url( $field, $post, $is_new );
115
  break;
116
+ case 'checkbox' :
117
  self::meta_option__checkbox( $field, $post, $is_new );
118
  break;
119
+ case 'shortcode' :
120
  self::meta_option__shortcode( $field, $post, $is_new );
121
  break;
122
+ default :
123
  self::meta_option__text( $field, $post, $is_new );
124
  }
125
  }
126
  }
127
 
128
  /**
129
+ * Custom action callback.
130
+ *
131
  * @param $field
132
  * @param $post
133
  * @param $is_new
146
  * @param $is_new
147
  */
148
  private static function meta_option__text( $field, $post, $is_new ) {
149
+ printf( '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s">',
150
+ $field['input_type'], $field['name'], esc_attr( $post->{$field['name']} ) );
 
 
 
 
151
  }
152
 
153
  /**
159
  */
160
  private static function meta_option__url( $field, $post, $is_new ) {
161
  ?>
162
+ <div class="input-url">
163
+ <?php printf( '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" size="">',
164
+ $field['input_type'], $field['name'], esc_attr( $post->{$field['name']} ) ); ?>
165
+ </div>
166
+ <div class="input-nofollow">
167
+ <label for="custom_nofollow"><code>rel="nofollow"</code></label>
168
+ <select id="custom_nofollow" name="custom[nofollow]">
169
+ <option value="default" <?php selected( $post->nofollow, 'default' ); ?>><?php _e( 'default', 'strong-testimonials' ); ?></option>
170
+ <option value="yes" <?php selected( $post->nofollow, 'yes' ); ?>><?php _e( 'yes', 'strong-testimonials' ); ?></option>
171
+ <option value="no" <?php selected( $post->nofollow, 'no' ); ?>><?php _e( 'no', 'strong-testimonials' ); ?></option>
172
+ </select>
173
+ </div>
 
 
 
 
 
 
174
  <?php
175
  }
176
 
182
  * @param $is_new
183
  */
184
  private static function meta_option__checkbox( $field, $post, $is_new ) {
185
+ printf( '<input id="%2$s" type="%1$s" class="custom-input" name="custom[%2$s]" value="%3$s" %4$s>',
186
+ $field['input_type'], $field['name'], 1, checked( $post->{$field['name']}, 1, false ) );
 
 
 
 
 
187
  }
188
 
189
  /**
199
  $rating = 0;
200
  }
201
  ?>
202
+ <div class="edit-rating-box hide-if-no-js" data-field="<?php echo $field['name']; ?>">
203
 
204
  <?php wp_nonce_field( 'editrating', "edit-{$field['name']}-nonce", false ); ?>
205
+ <input type="hidden" class="current-rating" value="<?php echo $rating; ?>">
206
 
207
+ <!-- form -->
208
+ <div class="rating-form" style="<?php echo ( $is_new ) ? 'display: inline-block;' : 'display: none;'; ?>">
209
+ <span class="inner">
210
+ <?php wpmtst_star_rating_form( $field, $rating, 'in-metabox', true, 'custom' ); ?>
211
+ </span>
212
  <?php if ( ! $is_new ) : ?>
213
+ <span class="edit-rating-buttons-2">
214
+ <button type="button"
215
+ class="zero button-link"><?php _e( 'Zero', 'strong-testimonials' ); ?></button>&nbsp;
216
+ <button type="button" class="save button button-small"><?php _e( 'OK' ); ?></button>&nbsp;
217
+ <button type="button" class="cancel button-link"><?php _e( 'Cancel' ); ?></button>
218
+ </span>
219
  <?php endif; ?>
220
+ </div>
221
 
222
+ <!-- display -->
223
+ <div class="rating-display" style="<?php echo $is_new ? 'display: none;' : 'display: inline-block;'; ?>">
224
+ <span class="inner">
225
+ <?php wpmtst_star_rating_display( $rating, 'in-metabox' ); ?>
226
+ </span>
227
 
228
  <?php if ( ! $is_new ) : ?>
229
+ <span class="edit-rating-buttons-1">
230
+ <button type="button"
231
+ id=""
232
+ class="edit-rating button button-small hide-if-no-js"
233
+ aria-label="Edit rating"><?php _e( 'Edit' ); ?></button>
234
+ </span>
235
  <?php endif; ?>
236
+ </div>
237
 
238
+ <span class="edit-rating-success"></span>
239
 
240
+ </div>
241
  <?php
242
  }
243
 
249
  * @param $is_new
250
  */
251
  public static function meta_option__shortcode( $field, $post, $is_new ) {
252
+ $shortcode = str_replace( array( '[', ']' ), array( '', '' ), $field['shortcode_on_display'] );
253
+ if ( shortcode_exists( $shortcode ) ) {
254
+ echo do_shortcode( $field['shortcode_on_display'] );
255
+ } else {
256
+ echo '<div class="custom-input not-found">' . sprintf( __( 'shortcode %s not found', 'strong-testimonials' ), '<code>' . $field['shortcode_on_display'] . '</code>' ) . '</div>';
257
+ }
258
  }
259
 
260
  /**
285
  // Determine whether to update or delete.
286
  // Similar to wpmtst_ajax_edit_rating() in admin-ajax.php.
287
  foreach ( $custom as $key => $value ) {
288
+ $action = 'update';
289
 
290
+ if ( isset( $custom_fields[ $key ] ) ) {
291
+ if ( 'rating' == $custom_fields[ $key ]['input_type'] && !$value ) {
292
  $action = 'delete';
293
  }
294
  }
296
  if ( 'update' == $action ) {
297
  // empty values replace existing values
298
  update_post_meta( $_POST['post_ID'], $key, stripslashes( $value ) );
299
+ }
300
+ else {
301
  // delete value; e.g. zero rating
302
  delete_post_meta( $_POST['post_ID'], $key );
303
  }
306
 
307
  /**
308
  * Prevent use of this plugin's shortcode in a testimonial.
309
+ *
310
+ * @since 2.32.2
311
  * @param $data
312
  * @param $postarr
313
  *
314
  * @return mixed
315
  */
316
  public static function prevent_shortcode( $data, $postarr ) {
317
+ if ( 'wpm-testimonial' == $data['post_type'] ) {
318
+ $data['post_content'] = preg_replace( "/\[testimonial_view (.*)\]/", '', $data['post_content'] );
319
+ }
320
 
321
+ return $data;
322
  }
323
 
324
  /**
344
  }
345
 
346
  $display = wpmtst_star_rating_display( $rating, 'in-metabox', false );
347
+ $response = array( 'display' => $display, 'message' => $message );
 
 
 
348
  echo json_encode( $response );
349
  wp_die();
350
  }
admin/class-strong-testimonials-updater.php CHANGED
@@ -29,7 +29,8 @@ class Strong_Testimonials_Updater {
29
  $this->old_version = get_option( 'wpmtst_plugin_version', false );
30
  if ( $this->old_version ) {
31
  $this->log( __CLASS__, 'old: ' . $this->old_version . ' --> new: ' . WPMTST_VERSION );
32
- } else {
 
33
  $this->log( __CLASS__, 'NEW INSTALL', WPMTST_VERSION );
34
  }
35
  }
@@ -53,13 +54,16 @@ class Strong_Testimonials_Updater {
53
  $this->new_log[] = $x;
54
  // then log the variable
55
  $this->new_log[] = $var;
56
- } else {
 
57
  $this->new_log[] = $x . $var;
58
  }
59
- } else {
 
60
  $this->new_log[] = $x;
61
  }
62
- } else {
 
63
  $this->new_log[] = $x;
64
  }
65
  }
@@ -244,7 +248,8 @@ class Strong_Testimonials_Updater {
244
  $admins->add_cap( 'strong_testimonials_fields' );
245
  $admins->add_cap( 'strong_testimonials_options' );
246
  $admins->add_cap( 'strong_testimonials_about' );
247
- } else {
 
248
  $this->log( __FUNCTION__, 'failed' );
249
  }
250
  }
@@ -345,6 +350,7 @@ class Strong_Testimonials_Updater {
345
  if ( isset( $options['client_section'] ) ) {
346
  unset( $options['client_section'] );
347
  }
 
348
  }
349
 
350
  /**
@@ -468,6 +474,7 @@ class Strong_Testimonials_Updater {
468
  if ( $new_default ) {
469
  $custom_forms[ $form_id ]['fields'][ $key ] = array_merge( $new_default, $form_field );
470
  }
 
471
  }
472
  }
473
 
@@ -561,39 +568,39 @@ class Strong_Testimonials_Updater {
561
  */
562
  switch ( $form_options['captcha'] ) {
563
 
564
- case 'gglcptch':
565
  // Google Captcha by BestWebSoft
566
  $form_options['captcha'] = 'google-captcha';
567
  $notice = false;
568
  break;
569
 
570
- case 'bwsmathpro':
571
  // Captcha Pro by BestWebSoft
572
  $form_options['captcha'] = 'captcha-pro';
573
  $notice = false;
574
  break;
575
 
576
- case 'miyoshi':
577
  // Really Simple Captcha by Takayuki Miyoshi
578
  $form_options['captcha'] = 'really-simple-captcha';
579
  $notice = false;
580
  break;
581
 
582
- case 'advnore':
583
  // Advanced noCaptcha reCaptcha by Shamim Hasan
584
  // Integration dropped @since 2.29.0
585
  $form_options['captcha'] = '';
586
  $notice = true;
587
  break;
588
 
589
- case 'bwsmath':
590
  // Craptcha by simplywordpress
591
  // Integration dropped @since 2.29.0
592
  $form_options['captcha'] = '';
593
  $notice = true;
594
  break;
595
 
596
- default:
597
  $notice = false;
598
  }
599
 
@@ -827,8 +834,8 @@ class Strong_Testimonials_Updater {
827
 
828
  $view_data['slideshow_settings']['show_single'] = array(
829
  'max_slides' => $view_data['slideshow_settings']['max_slides'],
830
- 'move_slides' => $view_data['slideshow_settings']['move_slides'],
831
- 'margin' => 1,
832
  );
833
 
834
  } else {
@@ -867,68 +874,68 @@ class Strong_Testimonials_Updater {
867
  /*
868
  Array
869
  (
870
- [0] => default:content
871
- [1] => default-dark:form
872
- [2] => default-dark:content
873
- [3] => default:form
874
- [4] => image-right:content
875
- [5] => no-quotes:content
876
- [6] => large:widget
877
- [7] => modern:content
878
- [8] => simple:content
879
- [9] => simple:form
880
- [10] => unstyled:content
881
- [11] => unstyled:form
882
- [12] => default:widget
883
- [13] => image-right:widget
884
  )
885
  */
886
  switch ( $view_data['template'] ) {
887
- case 'default:content':
888
  $view_data['template'] = 'default';
889
  break;
890
- case 'default-dark:form':
891
- $view_data['template'] = 'default-form';
892
  $view_data['template_settings'][ $view_data['template'] ] = array( 'theme' => 'dark' );
893
  break;
894
- case 'default-dark:content':
895
- $view_data['template'] = 'default';
896
  $view_data['template_settings'][ $view_data['template'] ] = array( 'theme' => 'dark' );
897
  break;
898
- case 'default:form':
899
  $view_data['template'] = 'default-form';
900
  break;
901
- case 'image-right:content':
902
- $view_data['template'] = 'default';
903
  $view_data['template_settings'][ $view_data['template'] ] = array( 'image_position' => 'right' );
904
  break;
905
- case 'no-quotes:content':
906
- $view_data['template'] = 'default';
907
  $view_data['template_settings'][ $view_data['template'] ] = array( 'quotes' => 'off' );
908
  break;
909
- case 'large:widget':
910
  $view_data['template'] = 'bold';
911
  break;
912
- case 'modern:content':
913
  $view_data['template'] = 'modern';
914
  break;
915
- case 'simple:content':
916
  $view_data['template'] = 'simple';
917
  break;
918
- case 'simple:form':
919
  $view_data['template'] = 'simple-form';
920
  break;
921
- case 'unstyled:content':
922
  $view_data['template'] = 'unstyled';
923
  break;
924
- case 'unstyled:form':
925
  $view_data['template'] = 'unstyled-form';
926
  break;
927
- case 'default:widget':
928
  $view_data['template'] = 'small-widget';
929
  break;
930
- case 'image-right:widget':
931
- $view_data['template'] = 'small-widget';
932
  $view_data['template_settings'][ $view_data['template'] ] = array( 'image_position' => 'right' );
933
  break;
934
  default:
@@ -950,16 +957,19 @@ class Strong_Testimonials_Updater {
950
  if ( ! $view_data['template'] ) {
951
  if ( 'form' == $view_data['mode'] ) {
952
  $type = 'form';
953
- } else {
 
954
  $type = 'content';
955
  }
956
 
957
  $view_data['template'] = "default:$type";
958
- } else {
 
959
  // Convert name; e.g. 'simple/testimonials.php'
960
  if ( 'widget/testimonials.php' == $view_data['template'] ) {
961
  $view_data['template'] = 'default:widget';
962
- } else {
 
963
  $view_data['template'] = str_replace( '/', ':', $view_data['template'] );
964
  $view_data['template'] = str_replace( 'testimonials.php', 'content', $view_data['template'] );
965
  $view_data['template'] = str_replace( 'testimonial-form.php', 'form', $view_data['template'] );
@@ -989,7 +999,8 @@ class Strong_Testimonials_Updater {
989
  $word_count = $word_count < 5 ? 5 : $word_count;
990
  $word_count = $word_count > 300 ? 300 : $word_count;
991
  $view_data['excerpt_length'] = $word_count;
992
- } else {
 
993
  $view_data['excerpt_length'] = $default_view['excerpt_length'];
994
  }
995
 
@@ -1015,7 +1026,8 @@ class Strong_Testimonials_Updater {
1015
  $view_data['more_page_id'] = $view_data['more_page'];
1016
  $view_data['more_page'] = 1;
1017
  $view_data['more_page_text'] = $view_data['more_text'];
1018
- } elseif ( isset( $view_data['more_post'] ) && $view_data['more_post'] ) {
 
1019
  $view_data['more_post_text'] = $view_data['more_text'];
1020
  }
1021
  unset( $view_data['more_text'] );
@@ -1248,16 +1260,21 @@ class Strong_Testimonials_Updater {
1248
 
1249
  if ( 'on' == $nofollow ) {
1250
  $new_value = 'yes';
1251
- } elseif ( 1 === $nofollow ) {
 
1252
  $new_value = 'yes';
1253
- } elseif ( 'off' == $nofollow ) {
 
1254
  $new_value = 'no';
1255
- } elseif ( 0 === $nofollow ) {
 
1256
  $new_value = 'no';
1257
- } elseif ( is_bool( $nofollow ) ) {
 
1258
  if ( $nofollow ) {
1259
  $new_value = 'yes';
1260
- } else {
 
1261
  $new_value = 'default';
1262
  }
1263
  }
29
  $this->old_version = get_option( 'wpmtst_plugin_version', false );
30
  if ( $this->old_version ) {
31
  $this->log( __CLASS__, 'old: ' . $this->old_version . ' --> new: ' . WPMTST_VERSION );
32
+ }
33
+ else {
34
  $this->log( __CLASS__, 'NEW INSTALL', WPMTST_VERSION );
35
  }
36
  }
54
  $this->new_log[] = $x;
55
  // then log the variable
56
  $this->new_log[] = $var;
57
+ }
58
+ else {
59
  $this->new_log[] = $x . $var;
60
  }
61
+ }
62
+ else {
63
  $this->new_log[] = $x;
64
  }
65
+ }
66
+ else {
67
  $this->new_log[] = $x;
68
  }
69
  }
248
  $admins->add_cap( 'strong_testimonials_fields' );
249
  $admins->add_cap( 'strong_testimonials_options' );
250
  $admins->add_cap( 'strong_testimonials_about' );
251
+ }
252
+ else {
253
  $this->log( __FUNCTION__, 'failed' );
254
  }
255
  }
350
  if ( isset( $options['client_section'] ) ) {
351
  unset( $options['client_section'] );
352
  }
353
+
354
  }
355
 
356
  /**
474
  if ( $new_default ) {
475
  $custom_forms[ $form_id ]['fields'][ $key ] = array_merge( $new_default, $form_field );
476
  }
477
+
478
  }
479
  }
480
 
568
  */
569
  switch ( $form_options['captcha'] ) {
570
 
571
+ case 'gglcptch' :
572
  // Google Captcha by BestWebSoft
573
  $form_options['captcha'] = 'google-captcha';
574
  $notice = false;
575
  break;
576
 
577
+ case 'bwsmathpro' :
578
  // Captcha Pro by BestWebSoft
579
  $form_options['captcha'] = 'captcha-pro';
580
  $notice = false;
581
  break;
582
 
583
+ case 'miyoshi' :
584
  // Really Simple Captcha by Takayuki Miyoshi
585
  $form_options['captcha'] = 'really-simple-captcha';
586
  $notice = false;
587
  break;
588
 
589
+ case 'advnore' :
590
  // Advanced noCaptcha reCaptcha by Shamim Hasan
591
  // Integration dropped @since 2.29.0
592
  $form_options['captcha'] = '';
593
  $notice = true;
594
  break;
595
 
596
+ case 'bwsmath' :
597
  // Craptcha by simplywordpress
598
  // Integration dropped @since 2.29.0
599
  $form_options['captcha'] = '';
600
  $notice = true;
601
  break;
602
 
603
+ default :
604
  $notice = false;
605
  }
606
 
834
 
835
  $view_data['slideshow_settings']['show_single'] = array(
836
  'max_slides' => $view_data['slideshow_settings']['max_slides'],
837
+ 'move_slides' => $view_data['slideshow_settings']['move_slides'],
838
+ 'margin' => 1,
839
  );
840
 
841
  } else {
874
  /*
875
  Array
876
  (
877
+ [0] => default:content
878
+ [1] => default-dark:form
879
+ [2] => default-dark:content
880
+ [3] => default:form
881
+ [4] => image-right:content
882
+ [5] => no-quotes:content
883
+ [6] => large:widget
884
+ [7] => modern:content
885
+ [8] => simple:content
886
+ [9] => simple:form
887
+ [10] => unstyled:content
888
+ [11] => unstyled:form
889
+ [12] => default:widget
890
+ [13] => image-right:widget
891
  )
892
  */
893
  switch ( $view_data['template'] ) {
894
+ case 'default:content' :
895
  $view_data['template'] = 'default';
896
  break;
897
+ case 'default-dark:form' :
898
+ $view_data['template'] = 'default-form';
899
  $view_data['template_settings'][ $view_data['template'] ] = array( 'theme' => 'dark' );
900
  break;
901
+ case 'default-dark:content' :
902
+ $view_data['template'] = 'default';
903
  $view_data['template_settings'][ $view_data['template'] ] = array( 'theme' => 'dark' );
904
  break;
905
+ case 'default:form' :
906
  $view_data['template'] = 'default-form';
907
  break;
908
+ case 'image-right:content' :
909
+ $view_data['template'] = 'default';
910
  $view_data['template_settings'][ $view_data['template'] ] = array( 'image_position' => 'right' );
911
  break;
912
+ case 'no-quotes:content' :
913
+ $view_data['template'] = 'default';
914
  $view_data['template_settings'][ $view_data['template'] ] = array( 'quotes' => 'off' );
915
  break;
916
+ case 'large:widget' :
917
  $view_data['template'] = 'bold';
918
  break;
919
+ case 'modern:content' :
920
  $view_data['template'] = 'modern';
921
  break;
922
+ case 'simple:content' :
923
  $view_data['template'] = 'simple';
924
  break;
925
+ case 'simple:form' :
926
  $view_data['template'] = 'simple-form';
927
  break;
928
+ case 'unstyled:content' :
929
  $view_data['template'] = 'unstyled';
930
  break;
931
+ case 'unstyled:form' :
932
  $view_data['template'] = 'unstyled-form';
933
  break;
934
+ case 'default:widget' :
935
  $view_data['template'] = 'small-widget';
936
  break;
937
+ case 'image-right:widget' :
938
+ $view_data['template'] = 'small-widget';
939
  $view_data['template_settings'][ $view_data['template'] ] = array( 'image_position' => 'right' );
940
  break;
941
  default:
957
  if ( ! $view_data['template'] ) {
958
  if ( 'form' == $view_data['mode'] ) {
959
  $type = 'form';
960
+ }
961
+ else {
962
  $type = 'content';
963
  }
964
 
965
  $view_data['template'] = "default:$type";
966
+ }
967
+ else {
968
  // Convert name; e.g. 'simple/testimonials.php'
969
  if ( 'widget/testimonials.php' == $view_data['template'] ) {
970
  $view_data['template'] = 'default:widget';
971
+ }
972
+ else {
973
  $view_data['template'] = str_replace( '/', ':', $view_data['template'] );
974
  $view_data['template'] = str_replace( 'testimonials.php', 'content', $view_data['template'] );
975
  $view_data['template'] = str_replace( 'testimonial-form.php', 'form', $view_data['template'] );
999
  $word_count = $word_count < 5 ? 5 : $word_count;
1000
  $word_count = $word_count > 300 ? 300 : $word_count;
1001
  $view_data['excerpt_length'] = $word_count;
1002
+ }
1003
+ else {
1004
  $view_data['excerpt_length'] = $default_view['excerpt_length'];
1005
  }
1006
 
1026
  $view_data['more_page_id'] = $view_data['more_page'];
1027
  $view_data['more_page'] = 1;
1028
  $view_data['more_page_text'] = $view_data['more_text'];
1029
+ }
1030
+ elseif ( isset( $view_data['more_post'] ) && $view_data['more_post'] ) {
1031
  $view_data['more_post_text'] = $view_data['more_text'];
1032
  }
1033
  unset( $view_data['more_text'] );
1260
 
1261
  if ( 'on' == $nofollow ) {
1262
  $new_value = 'yes';
1263
+ }
1264
+ elseif ( 1 === $nofollow ) {
1265
  $new_value = 'yes';
1266
+ }
1267
+ elseif ( 'off' == $nofollow ) {
1268
  $new_value = 'no';
1269
+ }
1270
+ elseif ( 0 === $nofollow ) {
1271
  $new_value = 'no';
1272
+ }
1273
+ elseif ( is_bool( $nofollow ) ) {
1274
  if ( $nofollow ) {
1275
  $new_value = 'yes';
1276
+ }
1277
+ else {
1278
  $new_value = 'default';
1279
  }
1280
  }
admin/class-strong-views-list-table.php CHANGED
@@ -7,7 +7,7 @@
7
 
8
  class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
9
 
10
- public $stickies;
11
 
12
  /**
13
  * Message to be displayed when there are no items
@@ -16,11 +16,11 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
16
  * @access public
17
  */
18
  public function no_items() {
19
- esc_html_e( 'No views found.', 'strong-testimonials' );
20
  }
21
 
22
  public function prepare_list( $data = array() ) {
23
- $this->stickies = get_option( 'wpmtst_sticky_views', array() );
24
 
25
  $columns = $this->get_columns();
26
  $hidden = $this->get_hidden_columns();
@@ -32,16 +32,16 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
32
  if ( isset( $_GET['orderby'] ) ) {
33
  usort( $data, array( &$this, 'usort_reorder' ) );
34
  }
35
- $data = $this->move_sticky( $data );
36
  $this->items = $data;
37
  }
38
 
39
- /**
40
- * Move sticky views to the top
41
- *
42
  * @param $data
43
- * @since 0.2.0
44
- * @return array
45
  */
46
  public function move_sticky( $data ) {
47
  $sticky_views = $views = array();
@@ -76,8 +76,8 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
76
 
77
  public function get_sortable_columns() {
78
  return array(
79
- 'id' => array( 'id', false ),
80
- 'name' => array( 'name', false ),
81
  );
82
  }
83
 
@@ -86,13 +86,13 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
86
  $orderby = ( ! empty( $_GET['orderby'] ) ) ? $_GET['orderby'] : 'name';
87
 
88
  // If no order, default to asc
89
- $order = ( ! empty( $_GET['order'] ) ) ? $_GET['order'] : 'asc';
90
 
91
  // Determine sort order
92
  if ( 'id' == $orderby ) {
93
  $result = $this->cmp( intval( $a[ $orderby ] ), intval( $b[ $orderby ] ) );
94
  } else {
95
- $result = strcasecmp( $a[ $orderby ], $b[ $orderby ] );
96
  }
97
 
98
  // Send final sort direction to usort
@@ -113,7 +113,7 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
113
 
114
  // Edit link
115
  $edit_link = $url . '&page=testimonial-views&action=edit&id=' . $item['id'];
116
- echo '<a class="row-title" href="' . esc_url( $edit_link ) . '">' . esc_html( $item['name'] ) . '</a>';
117
 
118
  // Duplicate link
119
  // @since 2.1.0
@@ -123,12 +123,12 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
123
  $delete_link = 'admin.php?action=delete-strong-view&id=' . $item['id'];
124
 
125
  // Assemble links
126
- $actions = array();
127
  $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
128
  $actions['duplicate'] = '<a href="' . $duplicate_link . '">' . __( 'Duplicate' ) . '</a>';
129
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( $delete_link, 'delete-strong-view_' . $item['id'] ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( 'Delete "%s"?' ), $item['name'] ) ) . "' ) ) { return true;} return false;\">" . __( 'Delete' ) . '</a>';
130
 
131
- echo wp_kses_post( $this->row_actions( $actions ) );
132
  }
133
 
134
  public function column_default( $item, $column_name ) {
@@ -137,18 +137,18 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
137
  $text = $item['id'];
138
  break;
139
  case 'sticky':
140
- $stuck = $this->is_stuck( $item['id'] ) ? 'stuck' : '';
141
- $text = '<a href="#" class="stickit ' . $stuck . '" title="' . __( 'stick to top of list', 'strong-testimonials' ) . '"></>';
142
  break;
143
  case 'name':
144
  $text = $item['name'];
145
  break;
146
  case 'mode':
147
- $mode = $item['data']['mode'];
148
- $text = $mode;
149
  $view_options = apply_filters( 'wpmtst_view_options', get_option( 'wpmtst_view_options' ) );
150
  if ( isset( $view_options['mode'][ $mode ]['label'] ) ) {
151
- $text = $view_options['mode'][ $mode ]['label'];
152
  }
153
  break;
154
  case 'template':
@@ -195,37 +195,34 @@ class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
195
  //$this->display_tablenav( 'top' );
196
 
197
  ?>
198
- <div class="wp-list-table-wrap">
199
- <div class="overlay" style="display: none;"></div>
200
- <table class="wp-list-table <?php echo esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>">
201
- <thead>
202
- <tr>
203
- <?php $this->print_column_headers(); ?>
204
- </tr>
205
- </thead>
206
-
207
- <tbody id="the-list"
208
- <?php
209
- if ( $singular ) {
210
- echo " data-wp-lists='list:" . esc_attr( $singular ) . "'";
211
- }
212
- ?>
213
- >
214
- <?php $this->display_rows_or_placeholder(); ?>
215
- </tbody>
216
-
217
- <tfoot>
218
- <tr>
219
- <?php $this->print_column_headers( false ); ?>
220
- </tr>
221
- </tfoot>
222
-
223
- </table>
224
- <?php
225
- //$this->display_tablenav( 'bottom' );
226
- ?>
227
- </div>
228
- <?php
229
  }
230
 
231
  }
7
 
8
  class Strong_Views_List_Table extends Strong_Testimonials_List_Table {
9
 
10
+ public $stickies;
11
 
12
  /**
13
  * Message to be displayed when there are no items
16
  * @access public
17
  */
18
  public function no_items() {
19
+ _e( 'No views found.', 'strong-testimonials' );
20
  }
21
 
22
  public function prepare_list( $data = array() ) {
23
+ $this->stickies = get_option( 'wpmtst_sticky_views', array() );
24
 
25
  $columns = $this->get_columns();
26
  $hidden = $this->get_hidden_columns();
32
  if ( isset( $_GET['orderby'] ) ) {
33
  usort( $data, array( &$this, 'usort_reorder' ) );
34
  }
35
+ $data = $this->move_sticky( $data );
36
  $this->items = $data;
37
  }
38
 
39
+ /**
40
+ * Move sticky views to the top
41
+ *
42
  * @param $data
43
+ * @since 0.2.0
44
+ * @return array
45
  */
46
  public function move_sticky( $data ) {
47
  $sticky_views = $views = array();
76
 
77
  public function get_sortable_columns() {
78
  return array(
79
+ 'id' => array( 'id', false ),
80
+ 'name' => array( 'name', false ),
81
  );
82
  }
83
 
86
  $orderby = ( ! empty( $_GET['orderby'] ) ) ? $_GET['orderby'] : 'name';
87
 
88
  // If no order, default to asc
89
+ $order = ( ! empty($_GET['order'] ) ) ? $_GET['order'] : 'asc';
90
 
91
  // Determine sort order
92
  if ( 'id' == $orderby ) {
93
  $result = $this->cmp( intval( $a[ $orderby ] ), intval( $b[ $orderby ] ) );
94
  } else {
95
+ $result = strcasecmp( $a[$orderby], $b[$orderby] );
96
  }
97
 
98
  // Send final sort direction to usort
113
 
114
  // Edit link
115
  $edit_link = $url . '&page=testimonial-views&action=edit&id=' . $item['id'];
116
+ echo '<a class="row-title" href="' . $edit_link . '">' . $item['name'] . '</a>';
117
 
118
  // Duplicate link
119
  // @since 2.1.0
123
  $delete_link = 'admin.php?action=delete-strong-view&id=' . $item['id'];
124
 
125
  // Assemble links
126
+ $actions = array();
127
  $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
128
  $actions['duplicate'] = '<a href="' . $duplicate_link . '">' . __( 'Duplicate' ) . '</a>';
129
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( $delete_link, 'delete-strong-view_' . $item['id'] ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "Delete \"%s\"?" ), $item['name'] ) ) . "' ) ) { return true;} return false;\">" . __( 'Delete' ) . "</a>";
130
 
131
+ echo $this->row_actions( $actions );
132
  }
133
 
134
  public function column_default( $item, $column_name ) {
137
  $text = $item['id'];
138
  break;
139
  case 'sticky':
140
+ $stuck = $this->is_stuck( $item['id'] ) ? 'stuck' : '';
141
+ $text = '<a href="#" class="stickit ' . $stuck . '" title="' . __( 'stick to top of list', 'strong-testimonials' ) . '"></>';
142
  break;
143
  case 'name':
144
  $text = $item['name'];
145
  break;
146
  case 'mode':
147
+ $mode = $item['data']['mode'];
148
+ $text = $mode;
149
  $view_options = apply_filters( 'wpmtst_view_options', get_option( 'wpmtst_view_options' ) );
150
  if ( isset( $view_options['mode'][ $mode ]['label'] ) ) {
151
+ $text = $view_options['mode'][ $mode ]['label'];
152
  }
153
  break;
154
  case 'template':
195
  //$this->display_tablenav( 'top' );
196
 
197
  ?>
198
+ <div class="wp-list-table-wrap">
199
+ <div class="overlay" style="display: none;"></div>
200
+ <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
201
+ <thead>
202
+ <tr>
203
+ <?php $this->print_column_headers(); ?>
204
+ </tr>
205
+ </thead>
206
+
207
+ <tbody id="the-list"<?php
208
+ if ( $singular ) {
209
+ echo " data-wp-lists='list:$singular'";
210
+ } ?>>
211
+ <?php $this->display_rows_or_placeholder(); ?>
212
+ </tbody>
213
+
214
+ <tfoot>
215
+ <tr>
216
+ <?php $this->print_column_headers( false ); ?>
217
+ </tr>
218
+ </tfoot>
219
+
220
+ </table>
221
+ <?php
222
+ //$this->display_tablenav( 'bottom' );
223
+ ?>
224
+ </div>
225
+ <?php
 
 
 
226
  }
227
 
228
  }
admin/class-walker-strong-category-checklist.php CHANGED
@@ -16,10 +16,7 @@
16
  */
17
  class Walker_Strong_Category_Checklist extends Walker {
18
  public $tree_type = 'category';
19
- public $db_fields = array(
20
- 'parent' => 'parent',
21
- 'id' => 'term_id',
22
- ); //TODO: decouple this
23
 
24
  /**
25
  * Starts the list before the elements are added.
@@ -33,7 +30,7 @@ class Walker_Strong_Category_Checklist extends Walker {
33
  * @param array $args An array of arguments. @see wp_terms_checklist()
34
  */
35
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
36
- $indent = str_repeat( "\t", $depth );
37
  $output .= "$indent<ul class='children'>\n";
38
  }
39
 
@@ -49,7 +46,7 @@ class Walker_Strong_Category_Checklist extends Walker {
49
  * @param array $args An array of arguments. @see wp_terms_checklist()
50
  */
51
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
52
- $indent = str_repeat( "\t", $depth );
53
  $output .= "$indent</ul>\n";
54
  }
55
 
@@ -73,10 +70,10 @@ class Walker_Strong_Category_Checklist extends Walker {
73
  $taxonomy = $args['taxonomy'];
74
  }
75
 
76
- $name = 'view[data][category]';
77
 
78
  $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
79
- $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
80
 
81
  $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
82
 
@@ -84,7 +81,7 @@ class Walker_Strong_Category_Checklist extends Walker {
84
 
85
  if ( ! empty( $args['list_only'] ) ) {
86
  $aria_cheched = 'false';
87
- $inner_class = 'category';
88
 
89
  if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
90
  $inner_class .= ' selected';
@@ -96,7 +93,8 @@ class Walker_Strong_Category_Checklist extends Walker {
96
  '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
97
  ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
98
  esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
99
- } else {
 
100
  /** This filter is documented in wp-includes/category-template.php */
101
  // newlines make for consistent spacing without extra CSS
102
  $output .= "\n" . '<li id="li-category-' . $category->term_id . '"' . $class . '>' . "\n";
16
  */
17
  class Walker_Strong_Category_Checklist extends Walker {
18
  public $tree_type = 'category';
19
+ public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
 
 
 
20
 
21
  /**
22
  * Starts the list before the elements are added.
30
  * @param array $args An array of arguments. @see wp_terms_checklist()
31
  */
32
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
33
+ $indent = str_repeat("\t", $depth);
34
  $output .= "$indent<ul class='children'>\n";
35
  }
36
 
46
  * @param array $args An array of arguments. @see wp_terms_checklist()
47
  */
48
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
49
+ $indent = str_repeat("\t", $depth);
50
  $output .= "$indent</ul>\n";
51
  }
52
 
70
  $taxonomy = $args['taxonomy'];
71
  }
72
 
73
+ $name = "view[data][category]";
74
 
75
  $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
76
+ $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
77
 
78
  $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
79
 
81
 
82
  if ( ! empty( $args['list_only'] ) ) {
83
  $aria_cheched = 'false';
84
+ $inner_class = 'category';
85
 
86
  if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
87
  $inner_class .= ' selected';
93
  '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
94
  ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
95
  esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
96
+ }
97
+ else {
98
  /** This filter is documented in wp-includes/category-template.php */
99
  // newlines make for consistent spacing without extra CSS
100
  $output .= "\n" . '<li id="li-category-' . $category->term_id . '"' . $class . '>' . "\n";
admin/class-walker-strong-form-category-checklist.php CHANGED
@@ -16,10 +16,7 @@
16
  */
17
  class Walker_Strong_Form_Category_Checklist extends Walker {
18
  public $tree_type = 'category';
19
- public $db_fields = array(
20
- 'parent' => 'parent',
21
- 'id' => 'term_id',
22
- ); //TODO: decouple this
23
 
24
  /**
25
  * Starts the list before the elements are added.
@@ -33,7 +30,7 @@ class Walker_Strong_Form_Category_Checklist extends Walker {
33
  * @param array $args An array of arguments. @see wp_terms_checklist()
34
  */
35
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
36
- $indent = str_repeat( "\t", $depth );
37
  $output .= "$indent<ul class='children'>\n";
38
  }
39
 
@@ -49,7 +46,7 @@ class Walker_Strong_Form_Category_Checklist extends Walker {
49
  * @param array $args An array of arguments. @see wp_terms_checklist()
50
  */
51
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
52
- $indent = str_repeat( "\t", $depth );
53
  $output .= "$indent</ul>\n";
54
  }
55
 
@@ -73,10 +70,10 @@ class Walker_Strong_Form_Category_Checklist extends Walker {
73
  $taxonomy = $args['taxonomy'];
74
  }
75
 
76
- $name = 'view[data][category-form]';
77
 
78
  $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
79
- $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
80
 
81
  $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
82
 
@@ -84,7 +81,7 @@ class Walker_Strong_Form_Category_Checklist extends Walker {
84
 
85
  if ( ! empty( $args['list_only'] ) ) {
86
  $aria_cheched = 'false';
87
- $inner_class = 'category';
88
 
89
  if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
90
  $inner_class .= ' selected';
@@ -96,7 +93,8 @@ class Walker_Strong_Form_Category_Checklist extends Walker {
96
  '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
97
  ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
98
  esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
99
- } else {
 
100
  /** This filter is documented in wp-includes/category-template.php */
101
  // newlines make for consistent spacing without extra CSS
102
  $output .= "\n" . '<li id="li-category-form-' . $category->term_id . '"' . $class . '>' . "\n";
16
  */
17
  class Walker_Strong_Form_Category_Checklist extends Walker {
18
  public $tree_type = 'category';
19
+ public $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
 
 
 
20
 
21
  /**
22
  * Starts the list before the elements are added.
30
  * @param array $args An array of arguments. @see wp_terms_checklist()
31
  */
32
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
33
+ $indent = str_repeat("\t", $depth);
34
  $output .= "$indent<ul class='children'>\n";
35
  }
36
 
46
  * @param array $args An array of arguments. @see wp_terms_checklist()
47
  */
48
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
49
+ $indent = str_repeat("\t", $depth);
50
  $output .= "$indent</ul>\n";
51
  }
52
 
70
  $taxonomy = $args['taxonomy'];
71
  }
72
 
73
+ $name = "view[data][category-form]";
74
 
75
  $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
76
+ $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
77
 
78
  $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
79
 
81
 
82
  if ( ! empty( $args['list_only'] ) ) {
83
  $aria_cheched = 'false';
84
+ $inner_class = 'category';
85
 
86
  if ( in_array( $category->term_id, $args['selected_cats'] ) ) {
87
  $inner_class .= ' selected';
93
  '<div class="' . $inner_class . '" data-term-id=' . $category->term_id .
94
  ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' .
95
  esc_html( apply_filters( 'the_category', $category->name ) ) . '</div>';
96
+ }
97
+ else {
98
  /** This filter is documented in wp-includes/category-template.php */
99
  // newlines make for consistent spacing without extra CSS
100
  $output .= "\n" . '<li id="li-category-form-' . $category->term_id . '"' . $class . '>' . "\n";
admin/compat.php CHANGED
@@ -38,7 +38,7 @@ function wpmtst_compat_admin_init() {
38
  * 1. on the `admin_init` hook
39
  * 2. UNconditionally
40
  */
41
- if ( 'Mercury' == $theme->get( 'Name' ) && 'http://themes.themegoods2.com/mercury' == $theme->get( 'ThemeURI' ) ) {
42
 
43
  /** Screen information is not available yet. */
44
  //$screen = get_current_screen();
@@ -49,6 +49,7 @@ function wpmtst_compat_admin_init() {
49
  remove_action( 'admin_init', 'pp_add_init' );
50
  }
51
  }
 
52
  }
53
  }
54
  add_action( 'admin_init', 'wpmtst_compat_admin_init', 1 );
@@ -66,25 +67,24 @@ function wpmtst_deny_plugins_init() {
66
  */
67
  if ( is_plugin_active( 'intuitive-custom-post-order/intuitive-custom-post-order.php' ) ) {
68
  $options = get_option( 'hicpo_options' );
69
- $update = false;
70
 
71
  if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) {
72
  if ( in_array( 'wpm-testimonial', $options['objects'] ) ) {
73
  $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) );
74
- $update = true;
75
  }
76
  }
77
 
78
  if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) {
79
  if ( in_array( 'wpm-testimonial-category', $options['tags'] ) ) {
80
  $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) );
81
- $update = true;
82
  }
83
  }
84
 
85
- if ( $update ) {
86
  update_option( 'hicpo_options', $options );
87
- }
88
  }
89
 
90
  /**
@@ -92,25 +92,24 @@ function wpmtst_deny_plugins_init() {
92
  */
93
  if ( is_plugin_active( 'simple-custom-post-order/simple-custom-post-order.php' ) ) {
94
  $options = get_option( 'scporder_options' );
95
- $update = false;
96
 
97
  if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) {
98
  if ( in_array( 'wpm-testimonial', $options['objects'] ) ) {
99
  $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) );
100
- $update = true;
101
  }
102
  }
103
 
104
  if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) {
105
  if ( in_array( 'wpm-testimonial-category', $options['tags'] ) ) {
106
  $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) );
107
- $update = true;
108
  }
109
  }
110
 
111
- if ( $update ) {
112
  update_option( 'scporder_options', $options );
113
- }
114
  }
115
 
116
  }
38
  * 1. on the `admin_init` hook
39
  * 2. UNconditionally
40
  */
41
+ if ( 'Mercury' == $theme->get( 'Name' ) && 'http://themes.themegoods2.com/mercury' == $theme->get( 'ThemeURI' ) ) {
42
 
43
  /** Screen information is not available yet. */
44
  //$screen = get_current_screen();
49
  remove_action( 'admin_init', 'pp_add_init' );
50
  }
51
  }
52
+
53
  }
54
  }
55
  add_action( 'admin_init', 'wpmtst_compat_admin_init', 1 );
67
  */
68
  if ( is_plugin_active( 'intuitive-custom-post-order/intuitive-custom-post-order.php' ) ) {
69
  $options = get_option( 'hicpo_options' );
70
+ $update = false;
71
 
72
  if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) {
73
  if ( in_array( 'wpm-testimonial', $options['objects'] ) ) {
74
  $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) );
75
+ $update = true;
76
  }
77
  }
78
 
79
  if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) {
80
  if ( in_array( 'wpm-testimonial-category', $options['tags'] ) ) {
81
  $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) );
82
+ $update = true;
83
  }
84
  }
85
 
86
+ if ( $update )
87
  update_option( 'hicpo_options', $options );
 
88
  }
89
 
90
  /**
92
  */
93
  if ( is_plugin_active( 'simple-custom-post-order/simple-custom-post-order.php' ) ) {
94
  $options = get_option( 'scporder_options' );
95
+ $update = false;
96
 
97
  if ( isset( $options['objects'] ) && is_array( $options['objects'] ) ) {
98
  if ( in_array( 'wpm-testimonial', $options['objects'] ) ) {
99
  $options['objects'] = array_diff( $options['objects'], array( 'wpm-testimonial' ) );
100
+ $update = true;
101
  }
102
  }
103
 
104
  if ( isset( $options['tags'] ) && is_array( $options['tags'] ) ) {
105
  if ( in_array( 'wpm-testimonial-category', $options['tags'] ) ) {
106
  $options['tags'] = array_diff( $options['tags'], array( 'wpm-testimonial-category' ) );
107
+ $update = true;
108
  }
109
  }
110
 
111
+ if ( $update )
112
  update_option( 'scporder_options', $options );
 
113
  }
114
 
115
  }
admin/custom-fields-ajax.php CHANGED
@@ -19,7 +19,7 @@ function wpmtst_add_field_function() {
19
  'label' => __( 'New Field', 'strong-testimonials' ),
20
  'show_label' => 1,
21
  );
22
- echo wp_kses_post( wpmtst_show_field( intval( $_REQUEST['nextKey'] ), $empty_field, true ) );
23
  wp_die();
24
  }
25
  add_action( 'wp_ajax_wpmtst_add_field', 'wpmtst_add_field_function' );
@@ -36,10 +36,10 @@ function wpmtst_add_field_2_function() {
36
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
37
 
38
  $empty_field = array_merge(
39
- $fields['field_types'][ $new_field_class ][ $new_field_type ],
40
  array( 'record_type' => $new_field_class )
41
  );
42
- echo wp_kses_post( wpmtst_show_field_secondary( intval( $_REQUEST['nextKey'] ), $empty_field ) );
43
  wp_die();
44
  }
45
  add_action( 'wp_ajax_wpmtst_add_field_2', 'wpmtst_add_field_2_function' );
@@ -56,10 +56,10 @@ function wpmtst_add_field_3_function() {
56
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
57
 
58
  $empty_field = array_merge(
59
- $fields['field_types'][ $new_field_class ][ $new_field_type ],
60
  array( 'record_type' => $new_field_class )
61
  );
62
- echo wp_kses_post( wpmtst_show_field_hidden( intval( $_REQUEST['nextKey'] ), $empty_field ) );
63
  wp_die();
64
  }
65
  add_action( 'wp_ajax_wpmtst_add_field_3', 'wpmtst_add_field_3_function' );
@@ -75,13 +75,13 @@ function wpmtst_add_field_4_function() {
75
  $new_field_class = $_REQUEST['fieldClass'];
76
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
77
  $empty_field = array();
78
- if ( isset( $fields['field_types'][ $new_field_class ][ $new_field_type ] ) ) {
79
  $empty_field = array_merge(
80
  $fields['field_types'][ $new_field_class ][ $new_field_type ],
81
  array( 'record_type' => $new_field_class )
82
  );
83
  }
84
- echo wp_kses_post( wpmtst_show_field_admin_table( intval( $_REQUEST['nextKey'] ), $empty_field ) );
85
  wp_die();
86
  }
87
  add_action( 'wp_ajax_wpmtst_add_field_4', 'wpmtst_add_field_4_function' );
@@ -93,7 +93,7 @@ add_action( 'wp_ajax_wpmtst_add_field_4', 'wpmtst_add_field_4_function' );
93
  function wpmtst_ajax_cat_count() {
94
  check_ajax_referer( 'wpmtst-admin', 'security', false );
95
 
96
- echo wp_kses_post( wpmtst_get_cat_count() );
97
  wp_die();
98
  }
99
  add_action( 'wp_ajax_wpmtst_get_cat_count', 'wpmtst_ajax_cat_count' );
19
  'label' => __( 'New Field', 'strong-testimonials' ),
20
  'show_label' => 1,
21
  );
22
+ echo wpmtst_show_field( intval( $_REQUEST['nextKey'] ), $empty_field, true );
23
  wp_die();
24
  }
25
  add_action( 'wp_ajax_wpmtst_add_field', 'wpmtst_add_field_function' );
36
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
37
 
38
  $empty_field = array_merge(
39
+ $fields['field_types'][$new_field_class][$new_field_type],
40
  array( 'record_type' => $new_field_class )
41
  );
42
+ echo wpmtst_show_field_secondary( intval( $_REQUEST['nextKey'] ), $empty_field );
43
  wp_die();
44
  }
45
  add_action( 'wp_ajax_wpmtst_add_field_2', 'wpmtst_add_field_2_function' );
56
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
57
 
58
  $empty_field = array_merge(
59
+ $fields['field_types'][$new_field_class][$new_field_type],
60
  array( 'record_type' => $new_field_class )
61
  );
62
+ echo wpmtst_show_field_hidden( intval( $_REQUEST['nextKey'] ), $empty_field );
63
  wp_die();
64
  }
65
  add_action( 'wp_ajax_wpmtst_add_field_3', 'wpmtst_add_field_3_function' );
75
  $new_field_class = $_REQUEST['fieldClass'];
76
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
77
  $empty_field = array();
78
+ if ( isset( $fields['field_types'][$new_field_class][$new_field_type] ) ) {
79
  $empty_field = array_merge(
80
  $fields['field_types'][ $new_field_class ][ $new_field_type ],
81
  array( 'record_type' => $new_field_class )
82
  );
83
  }
84
+ echo wpmtst_show_field_admin_table( intval( $_REQUEST['nextKey'] ), $empty_field );
85
  wp_die();
86
  }
87
  add_action( 'wp_ajax_wpmtst_add_field_4', 'wpmtst_add_field_4_function' );
93
  function wpmtst_ajax_cat_count() {
94
  check_ajax_referer( 'wpmtst-admin', 'security', false );
95
 
96
+ echo wpmtst_get_cat_count();
97
  wp_die();
98
  }
99
  add_action( 'wp_ajax_wpmtst_get_cat_count', 'wpmtst_ajax_cat_count' );
admin/custom-fields.php CHANGED
@@ -31,99 +31,101 @@ function wpmtst_update_custom_fields() {
31
  exit;
32
  }
33
 
34
- $form_id = $_POST['form_id'];
35
- $forms = get_option( 'wpmtst_custom_forms' );
36
- $field_options = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
37
 
38
- if ( isset( $_POST['reset'] ) ) {
39
 
40
- // Undo changes
41
  wpmtst_add_admin_notice( 'changes-cancelled' );
42
 
43
- } elseif ( isset( $_POST['restore-defaults'] ) ) {
 
44
 
45
- // Restore defaults
46
- $default_forms = Strong_Testimonials_Defaults::get_base_forms();
47
- $fields = $default_forms['default']['fields'];
48
- $forms[ $form_id ]['fields'] = $fields;
49
- update_option( 'wpmtst_custom_forms', $forms );
50
- do_action( 'wpmtst_fields_updated', $fields );
51
 
52
  wpmtst_add_admin_notice( 'defaults-restored' );
53
 
54
- } else {
 
55
 
56
- // Save changes
57
- $fields = array();
58
- $new_key = 0;
59
 
60
- /**
61
- * Strip the dang slashes from the dang magic quotes.
62
- *
63
- * @since 2.0.0
64
- */
65
- $post_fields = stripslashes_deep( $_POST['fields'] );
66
 
67
- foreach ( $post_fields as $key => $field ) {
68
 
69
- /*
70
- * Before merging onto base field, catch fields that are "off"
71
- * which the form does not submit. Otherwise, the default "on"
72
- * would override the requested (but not submitted) "off".
73
- */
74
- $field['show_label'] = isset( $field['show_label'] ) ? 1 : 0;
75
- $field['required'] = isset( $field['required'] ) ? 1 : 0;
76
 
77
- $field = array_merge( $field_options['field_base'], $field );
78
 
79
- $field['name'] = sanitize_text_field( $field['name'] );
80
- $field['label'] = sanitize_text_field( $field['label'] );
81
 
82
- // TODO Replace this special handling
83
- if ( 'checkbox' == $field['input_type'] ) {
84
- $field['default_form_value'] = wpmtst_sanitize_checkbox( $field, 'default_form_value' );
85
- } else {
86
- $field['default_form_value'] = sanitize_text_field( $field['default_form_value'] );
87
- }
88
- $field['action_input'] = isset( $field['action_input'] ) ? sanitize_text_field( $field['action_input'] ) : '';
89
- $field['action_output'] = isset( $field['action_output'] ) ? sanitize_text_field( $field['action_output'] ) : '';
90
 
91
- $field['default_display_value'] = sanitize_text_field( $field['default_display_value'] );
92
 
93
- $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
94
 
95
- if ( isset( $field['text'] ) ) {
96
- $field['text'] = wp_kses_post( $field['text'] );
97
- }
98
- $field['before'] = wp_kses_post( $field['before'] );
99
- $field['after'] = wp_kses_post( $field['after'] );
100
 
101
- $field['shortcode_on_form'] = sanitize_text_field( $field['shortcode_on_form'] );
102
- $field['shortcode_on_display'] = sanitize_text_field( $field['shortcode_on_display'] );
103
- $field['show_shortcode_options'] = $field['show_shortcode_options'] ? 1 : 0;
104
 
105
- // Hidden options (no need to check if isset)
106
- $field['admin_table'] = $field['admin_table'] ? 1 : 0;
107
- $field['show_admin_table_option'] = $field['show_admin_table_option'] ? 1 : 0;
108
- $field['show_text_option'] = $field['show_text_option'] ? 1 : 0;
109
- $field['show_placeholder_option'] = $field['show_placeholder_option'] ? 1 : 0;
110
- $field['show_default_options'] = $field['show_default_options'] ? 1 : 0;
111
 
112
- // add to fields array in display order
113
- $fields[ $new_key++ ] = $field;
114
 
115
- }
116
 
117
- $forms[ $form_id ]['fields'] = $fields;
118
 
119
- if ( isset( $_POST['field_group_label'] ) ) {
120
- // TODO Catch if empty.
121
- $new_label = sanitize_text_field( $_POST['field_group_label'] );
122
- $forms[ $form_id ]['label'] = $new_label;
123
- }
124
 
125
- update_option( 'wpmtst_custom_forms', $forms );
126
- do_action( 'wpmtst_fields_updated', $fields );
127
 
128
  wpmtst_add_admin_notice( 'fields-saved' );
129
 
@@ -142,70 +144,70 @@ add_action( 'admin_post_wpmtst_update_custom_fields', 'wpmtst_update_custom_fiel
142
  */
143
  function wpmtst_settings_custom_fields( $form_id = 1 ) {
144
  if ( ! current_user_can( 'strong_testimonials_fields' ) ) {
145
- wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
146
  }
147
 
148
  if ( ! $form_id ) {
149
- echo '<div class="wrap wpmtst"><p>' . esc_html__( 'No fields selected.', 'strong-testimonials' ) . '</p></div>';
150
  return;
151
  }
152
 
153
  $forms = get_option( 'wpmtst_custom_forms' );
154
- $fields = $forms[ $form_id ]['fields'];
155
  ?>
156
- <div class="wrap wpmtst">
157
- <h1 class="wp-heading-inline"><?php esc_html_e( 'Fields', 'strong-testimonials' ); ?></h1>
158
- <hr class="wp-header-end">
159
- <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
160
-
161
- <div id="left-col">
162
- <div>
163
- <h3><?php esc_html_e( 'Editor', 'strong-testimonials' ); ?></h3>
164
- <p>
165
- <?php esc_html_e( 'Click a field to open its options panel.', 'strong-testimonials' ); ?>
166
- <a class="open-help-tab" href="#tab-panel-wpmtst-help"><?php esc_html_e( 'Help' ); ?></a>
167
- </p>
168
- <?php do_action( 'wpmtst_before_fields_settings', 'form-fields' ); ?>
169
- </div>
170
-
171
- <form id="wpmtst-custom-fields-form" method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" autocomplete="off">
172
- <?php wp_nonce_field( 'wpmtst_custom_fields_form', 'wpmtst_form_submitted' ); ?>
173
- <input type="hidden" name="action" value="wpmtst_update_custom_fields">
174
- <input type="hidden" name="form_id" value="<?php echo esc_attr( $form_id ); ?>">
175
-
176
- <?php do_action( 'wpmtst_fields_editor_before_fields_editor', $forms[ $form_id ] ); ?>
177
-
178
- <ul id="custom-field-list">
179
- <?php
180
- foreach ( $fields as $key => $field ) {
181
- echo '<li id="field-' . esc_attr( $key ) . '">' . wp_kses_post( wpmtst_show_field( $key, $field, false ) ) . '</li>' . "\n";
182
- }
183
- ?>
184
- </ul>
185
-
186
- <div id="add-field-bar">
187
- <input id="add-field" type="button" class="button" name="add-field" value="<?php esc_attr_e( 'Add New Field', 'strong-testimonials' ); ?>">
188
- </div>
189
-
190
- <div id="field-group-actions">
191
- <div><?php submit_button( '', 'primary', 'submit-form', false ); ?></div>
192
- <div><?php submit_button( __( 'Cancel Changes', 'strong-testimonials' ), 'secondary', 'reset', false ); ?></div>
193
- <div><?php submit_button( __( 'Restore Defaults', 'strong-testimonials' ), 'secondary', 'restore-defaults', false ); ?></div>
194
- </div>
195
- </form>
196
- </div><!-- #left-col -->
197
-
198
- <div id="right-col">
199
- <div class="intro">
200
- <h3><?php esc_html_e( 'Basic Preview', 'strong-testimonials' ); ?></h3>
201
- <p><?php esc_html_e( 'Only to demonstrate the fields. May look different in your theme.', 'strong-testimonials' ); ?></p>
202
- </div>
203
- <div id="fields-editor-preview">
204
- <div><!-- placeholder --></div>
205
- </div>
206
- </div><!-- #right-col -->
207
-
208
- </div><!-- .wrap -->
209
  <?php
210
  }
211
 
@@ -222,33 +224,33 @@ function wpmtst_show_field( $key, $field, $adding ) {
222
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
223
  $field_types = $fields['field_types'];
224
 
225
- ob_start();
226
 
227
  include 'partials/fields/field-header.php';
228
- ?>
229
  <div class="custom-field" style="display: none;">
230
- <table class="field-table">
231
- <?php
232
- include 'partials/fields/field-type.php';
233
- include 'partials/fields/field-label.php';
234
- include 'partials/fields/field-name.php';
235
-
236
- if ( ! $adding ) {
237
- echo wp_kses_post( wpmtst_show_field_secondary( $key, $field ) );
238
- echo wp_kses_post( wpmtst_show_field_admin_table( $key, $field ) );
239
- }
240
- ?>
241
- </table>
242
-
243
- <?php
244
- if ( ! $adding ) {
245
- echo wp_kses_post( wpmtst_show_field_hidden( $key, $field ) );
246
- }
247
- include 'partials/fields/field-controls.php';
248
- ?>
249
  </div><!-- .custom-field -->
250
 
251
- <?php
252
  $html = ob_get_contents();
253
  ob_end_clean();
254
 
@@ -266,31 +268,31 @@ function wpmtst_show_field( $key, $field, $adding ) {
266
  * @return string
267
  */
268
  function wpmtst_show_field_secondary( $key, $field ) {
269
- $html = '';
270
 
271
  /*
272
  * Required
273
  */
274
- if ( isset( $field['show_required_option'] ) && $field['show_required_option'] ) {
275
- // Disable option if this is a core field like post_content.
276
- if ( isset( $field['core'] ) && $field['core'] ) {
277
- $disabled = ' disabled="disabled"';
278
- } else {
279
- $disabled = false;
280
- }
281
-
282
- $html .= '<tr class="field-secondary">' . "\n";
283
- $html .= '<th>' . __( 'Required', 'strong-testimonials' ) . '</th>' . "\n";
284
- $html .= '<td>' . "\n";
285
- if ( $disabled ) {
286
- $html .= '<input type="hidden" name="fields[' . $key . '][required]" value="' . $field['required'] . '">';
287
- $html .= '<input type="checkbox" ' . checked( $field['required'], true, false ) . $disabled . '>';
288
- } else {
289
- $html .= '<input type="checkbox" name="fields[' . $key . '][required]" ' . checked( $field['required'], true, false ) . '>';
290
- }
291
- $html .= '</td>' . "\n";
292
- $html .= '</tr>' . "\n";
293
- }
294
 
295
  /*
296
  * Placeholder
@@ -306,8 +308,8 @@ function wpmtst_show_field_secondary( $key, $field ) {
306
 
307
  /**
308
  * Text (checkbox, radio)
309
- *
310
- * @since 2.23.0
311
  */
312
  if ( $field['show_text_option'] ) {
313
  if ( isset( $field['text'] ) ) {
@@ -348,19 +350,19 @@ function wpmtst_show_field_secondary( $key, $field ) {
348
 
349
  $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '" class="as-number">';
350
  $html .= '<span class="help inline">' . __( 'stars', 'strong-testimonials' ) . '</span>';
351
- $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
352
 
353
  } elseif ( 'checkbox' == $field['input_type'] ) {
354
 
355
- $html .= '<label>';
356
- $html .= '<input type="checkbox" name="fields[' . $key . '][default_form_value]" ' . checked( $field['default_form_value'], true, false ) . '>';
357
  $html .= '<span class="help inline">' . __( 'Checked by default.', 'strong-testimonials' ) . '</span>';
358
  $html .= '</label>';
359
 
360
- } else {
361
 
362
  $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '">';
363
- $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
364
 
365
  }
366
 
@@ -373,7 +375,7 @@ function wpmtst_show_field_secondary( $key, $field ) {
373
  * Default Display Value
374
  */
375
  if ( $field['show_default_options'] ) {
376
- // TODO Replace this special handling for checkbox type
377
  if ( 'checkbox' != $field['input_type'] ) {
378
  if ( isset( $field['default_display_value'] ) ) {
379
  $html .= '<tr class="field-secondary">' . "\n";
@@ -433,7 +435,7 @@ function wpmtst_show_field_admin_table( $key, $field ) {
433
  return $html;
434
  }
435
 
436
- $html = '<tr class="field-admin-table">' . "\n";
437
  $html .= '<th>' . __( 'Admin List', 'strong-testimonials' ) . '</th>' . "\n";
438
  $html .= '<td>' . "\n";
439
  if ( $field['admin_table_option'] ) {
@@ -462,7 +464,7 @@ function wpmtst_show_field_admin_table( $key, $field ) {
462
  function wpmtst_show_field_hidden( $key, $field ) {
463
  $pattern = '<input type="hidden" name="fields[%s][%s]" value="%s">';
464
 
465
- $html = sprintf( $pattern, $key, 'record_type', $field['record_type'] ) . "\n";
466
  $html .= sprintf( $pattern, $key, 'input_type', $field['input_type'] ) . "\n";
467
  if ( isset( $field['action_input'] ) ) {
468
  $html .= sprintf( $pattern, $key, 'action_input', $field['action_input'] ) . "\n";
31
  exit;
32
  }
33
 
34
+ $form_id = $_POST['form_id'];
35
+ $forms = get_option( 'wpmtst_custom_forms' );
36
+ $field_options = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
37
 
38
+ if ( isset( $_POST['reset'] ) ) {
39
 
40
+ // Undo changes
41
  wpmtst_add_admin_notice( 'changes-cancelled' );
42
 
43
+ }
44
+ elseif ( isset( $_POST['restore-defaults'] ) ) {
45
 
46
+ // Restore defaults
47
+ $default_forms = Strong_Testimonials_Defaults::get_base_forms();
48
+ $fields = $default_forms['default']['fields'];
49
+ $forms[ $form_id ]['fields'] = $fields;
50
+ update_option( 'wpmtst_custom_forms', $forms );
51
+ do_action( 'wpmtst_fields_updated', $fields );
52
 
53
  wpmtst_add_admin_notice( 'defaults-restored' );
54
 
55
+ }
56
+ else {
57
 
58
+ // Save changes
59
+ $fields = array();
60
+ $new_key = 0;
61
 
62
+ /**
63
+ * Strip the dang slashes from the dang magic quotes.
64
+ *
65
+ * @since 2.0.0
66
+ */
67
+ $post_fields = stripslashes_deep( $_POST['fields'] );
68
 
69
+ foreach ( $post_fields as $key => $field ) {
70
 
71
+ /*
72
+ * Before merging onto base field, catch fields that are "off"
73
+ * which the form does not submit. Otherwise, the default "on"
74
+ * would override the requested (but not submitted) "off".
75
+ */
76
+ $field['show_label'] = isset( $field['show_label'] ) ? 1 : 0;
77
+ $field['required'] = isset( $field['required'] ) ? 1 : 0;
78
 
79
+ $field = array_merge( $field_options['field_base'], $field );
80
 
81
+ $field['name'] = sanitize_text_field( $field['name'] );
82
+ $field['label'] = sanitize_text_field( $field['label'] );
83
 
84
+ // TODO Replace this special handling
85
+ if ( 'checkbox' == $field['input_type'] ) {
86
+ $field['default_form_value'] = wpmtst_sanitize_checkbox( $field, 'default_form_value' );
87
+ } else {
88
+ $field['default_form_value'] = sanitize_text_field( $field['default_form_value'] );
89
+ }
90
+ $field['action_input'] = isset( $field['action_input'] ) ? sanitize_text_field( $field['action_input'] ) : '';
91
+ $field['action_output'] = isset( $field['action_output'] ) ? sanitize_text_field( $field['action_output'] ) : '';
92
 
93
+ $field['default_display_value'] = sanitize_text_field( $field['default_display_value'] );
94
 
95
+ $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
96
 
97
+ if ( isset( $field['text'] ) ) {
98
+ $field['text'] = wp_kses_post( $field['text'] );
99
+ }
100
+ $field['before'] = wp_kses_post( $field['before'] );
101
+ $field['after'] = wp_kses_post( $field['after'] );
102
 
103
+ $field['shortcode_on_form'] = sanitize_text_field( $field['shortcode_on_form'] );
104
+ $field['shortcode_on_display'] = sanitize_text_field( $field['shortcode_on_display'] );
105
+ $field['show_shortcode_options'] = $field['show_shortcode_options'] ? 1 : 0;
106
 
107
+ // Hidden options (no need to check if isset)
108
+ $field['admin_table'] = $field['admin_table'] ? 1 : 0;
109
+ $field['show_admin_table_option'] = $field['show_admin_table_option'] ? 1 : 0;
110
+ $field['show_text_option'] = $field['show_text_option'] ? 1 : 0;
111
+ $field['show_placeholder_option'] = $field['show_placeholder_option'] ? 1 : 0;
112
+ $field['show_default_options'] = $field['show_default_options'] ? 1 : 0;
113
 
114
+ // add to fields array in display order
115
+ $fields[ $new_key++ ] = $field;
116
 
117
+ }
118
 
119
+ $forms[ $form_id ]['fields'] = $fields;
120
 
121
+ if ( isset( $_POST['field_group_label'] ) ) {
122
+ // TODO Catch if empty.
123
+ $new_label = sanitize_text_field( $_POST['field_group_label'] );
124
+ $forms[ $form_id ]['label'] = $new_label;
125
+ }
126
 
127
+ update_option( 'wpmtst_custom_forms', $forms );
128
+ do_action( 'wpmtst_fields_updated', $fields );
129
 
130
  wpmtst_add_admin_notice( 'fields-saved' );
131
 
144
  */
145
  function wpmtst_settings_custom_fields( $form_id = 1 ) {
146
  if ( ! current_user_can( 'strong_testimonials_fields' ) ) {
147
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
148
  }
149
 
150
  if ( ! $form_id ) {
151
+ echo '<div class="wrap wpmtst"><p>' . __( 'No fields selected.', 'strong-testimonials' ) .'</p></div>';
152
  return;
153
  }
154
 
155
  $forms = get_option( 'wpmtst_custom_forms' );
156
+ $fields = $forms[$form_id]['fields'];
157
  ?>
158
+ <div class="wrap wpmtst">
159
+ <h1 class="wp-heading-inline"><?php _e( 'Fields', 'strong-testimonials' ); ?></h1>
160
+ <hr class="wp-header-end">
161
+ <?php do_action( 'wpmtst_fields_editor_before_fields_intro' ); ?>
162
+
163
+ <div id="left-col">
164
+ <div>
165
+ <h3><?php _e( 'Editor', 'strong-testimonials' ); ?></h3>
166
+ <p>
167
+ <?php _e( 'Click a field to open its options panel.', 'strong-testimonials' ); ?>
168
+ <a class="open-help-tab" href="#tab-panel-wpmtst-help"><?php _e( 'Help' ); ?></a>
169
+ </p>
170
+ <?php do_action( 'wpmtst_before_fields_settings', 'form-fields' ); ?>
171
+ </div>
172
+
173
+ <form id="wpmtst-custom-fields-form" method="post" action="<?php echo admin_url( 'admin-post.php' ); ?>" autocomplete="off">
174
+ <?php wp_nonce_field( 'wpmtst_custom_fields_form', 'wpmtst_form_submitted' ); ?>
175
+ <input type="hidden" name="action" value="wpmtst_update_custom_fields">
176
+ <input type="hidden" name="form_id" value="<?php echo $form_id; ?>">
177
+
178
+ <?php do_action( 'wpmtst_fields_editor_before_fields_editor', $forms[ $form_id ] ); ?>
179
+
180
+ <ul id="custom-field-list">
181
+ <?php
182
+ foreach ( $fields as $key => $field ) {
183
+ echo '<li id="field-' . $key . '">' . wpmtst_show_field( $key, $field, false ) . '</li>' . "\n";
184
+ }
185
+ ?>
186
+ </ul>
187
+
188
+ <div id="add-field-bar">
189
+ <input id="add-field" type="button" class="button" name="add-field" value="<?php _e( 'Add New Field', 'strong-testimonials' ); ?>">
190
+ </div>
191
+
192
+ <div id="field-group-actions">
193
+ <div><?php submit_button( '', 'primary', 'submit-form', false ); ?></div>
194
+ <div><?php submit_button( __( 'Cancel Changes', 'strong-testimonials' ), 'secondary', 'reset', false ); ?></div>
195
+ <div><?php submit_button( __( 'Restore Defaults', 'strong-testimonials' ), 'secondary', 'restore-defaults', false ); ?></div>
196
+ </div>
197
+ </form>
198
+ </div><!-- #left-col -->
199
+
200
+ <div id="right-col">
201
+ <div class="intro">
202
+ <h3><?php _e( 'Basic Preview', 'strong-testimonials' ); ?></h3>
203
+ <p><?php _e( 'Only to demonstrate the fields. May look different in your theme.', 'strong-testimonials' ); ?></p>
204
+ </div>
205
+ <div id="fields-editor-preview">
206
+ <div><!-- placeholder --></div>
207
+ </div>
208
+ </div><!-- #right-col -->
209
+
210
+ </div><!-- .wrap -->
211
  <?php
212
  }
213
 
224
  $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
225
  $field_types = $fields['field_types'];
226
 
227
+ ob_start();
228
 
229
  include 'partials/fields/field-header.php';
230
+ ?>
231
  <div class="custom-field" style="display: none;">
232
+ <table class="field-table">
233
+ <?php
234
+ include 'partials/fields/field-type.php';
235
+ include 'partials/fields/field-label.php';
236
+ include 'partials/fields/field-name.php';
237
+
238
+ if ( ! $adding ) {
239
+ echo wpmtst_show_field_secondary( $key, $field );
240
+ echo wpmtst_show_field_admin_table( $key, $field );
241
+ }
242
+ ?>
243
+ </table>
244
+
245
+ <?php
246
+ if ( ! $adding ) {
247
+ echo wpmtst_show_field_hidden( $key, $field );
248
+ }
249
+ include 'partials/fields/field-controls.php';
250
+ ?>
251
  </div><!-- .custom-field -->
252
 
253
+ <?php
254
  $html = ob_get_contents();
255
  ob_end_clean();
256
 
268
  * @return string
269
  */
270
  function wpmtst_show_field_secondary( $key, $field ) {
271
+ $html = '';
272
 
273
  /*
274
  * Required
275
  */
276
+ if ( isset( $field['show_required_option'] ) && $field['show_required_option'] ) {
277
+ // Disable option if this is a core field like post_content.
278
+ if ( isset( $field['core'] ) && $field['core'] ) {
279
+ $disabled = ' disabled="disabled"';
280
+ } else {
281
+ $disabled = false;
282
+ }
283
+
284
+ $html .= '<tr class="field-secondary">' . "\n";
285
+ $html .= '<th>' . __( 'Required', 'strong-testimonials' ) . '</th>' . "\n";
286
+ $html .= '<td>' . "\n";
287
+ if ( $disabled ) {
288
+ $html .= '<input type="hidden" name="fields[' . $key . '][required]" value="' . $field['required'] . '">';
289
+ $html .= '<input type="checkbox" ' . checked( $field['required'], true, false ) . $disabled . '>';
290
+ } else {
291
+ $html .= '<input type="checkbox" name="fields[' . $key . '][required]" ' . checked( $field['required'], true, false ) . '>';
292
+ }
293
+ $html .= '</td>' . "\n";
294
+ $html .= '</tr>' . "\n";
295
+ }
296
 
297
  /*
298
  * Placeholder
308
 
309
  /**
310
  * Text (checkbox, radio)
311
+ *
312
+ * @since 2.23.0
313
  */
314
  if ( $field['show_text_option'] ) {
315
  if ( isset( $field['text'] ) ) {
350
 
351
  $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '" class="as-number">';
352
  $html .= '<span class="help inline">' . __( 'stars', 'strong-testimonials' ) . '</span>';
353
+ $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
354
 
355
  } elseif ( 'checkbox' == $field['input_type'] ) {
356
 
357
+ $html .= '<label>';
358
+ $html .= '<input type="checkbox" name="fields[' . $key . '][default_form_value]" ' . checked( $field['default_form_value'], true, false ) . '>';
359
  $html .= '<span class="help inline">' . __( 'Checked by default.', 'strong-testimonials' ) . '</span>';
360
  $html .= '</label>';
361
 
362
+ } else {
363
 
364
  $html .= '<input type="text" name="fields[' . $key . '][default_form_value]" value="' . esc_attr( $field['default_form_value'] ) . '">';
365
+ $html .= '<span class="help">' . __( 'Populate the field with this value.', 'strong-testimonials' ) . '</span>';
366
 
367
  }
368
 
375
  * Default Display Value
376
  */
377
  if ( $field['show_default_options'] ) {
378
+ // TODO Replace this special handling for checkbox type
379
  if ( 'checkbox' != $field['input_type'] ) {
380
  if ( isset( $field['default_display_value'] ) ) {
381
  $html .= '<tr class="field-secondary">' . "\n";
435
  return $html;
436
  }
437
 
438
+ $html = '<tr class="field-admin-table">' . "\n";
439
  $html .= '<th>' . __( 'Admin List', 'strong-testimonials' ) . '</th>' . "\n";
440
  $html .= '<td>' . "\n";
441
  if ( $field['admin_table_option'] ) {
464
  function wpmtst_show_field_hidden( $key, $field ) {
465
  $pattern = '<input type="hidden" name="fields[%s][%s]" value="%s">';
466
 
467
+ $html = sprintf( $pattern, $key, 'record_type', $field['record_type'] ) . "\n";
468
  $html .= sprintf( $pattern, $key, 'input_type', $field['input_type'] ) . "\n";
469
  if ( isset( $field['action_input'] ) ) {
470
  $html .= sprintf( $pattern, $key, 'action_input', $field['action_input'] ) . "\n";
admin/form-preview.php CHANGED
@@ -1,15 +1,13 @@
1
  <?php
2
 
3
  function wpmtst_get_form_preview() {
4
- if ( ! isset( $_POST['fields'] ) ) {
5
- exit;
6
- }
7
 
8
  // parse_str decodes too; no need to use urldecode
9
  parse_str( stripslashes_deep( $_POST['fields'] ), $preview );
10
 
11
  $new_fields = array();
12
- $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
13
 
14
  foreach ( $preview['fields'] as $key => $field ) {
15
  /*
@@ -17,8 +15,8 @@ function wpmtst_get_form_preview() {
17
  * which the form does not submit. Otherwise, the default "on"
18
  * would override the requested (but not submitted) "off".
19
  */
20
- $field['show_label'] = isset( $field['show_label'] ) ? 1 : 0;
21
- $field['required'] = isset( $field['required'] ) ? 1 : 0;
22
 
23
  $field = array_merge( $fields['field_base'], $field );
24
 
@@ -26,17 +24,17 @@ function wpmtst_get_form_preview() {
26
  $field['input_type'] = 'text';
27
  }
28
 
29
- $field['name'] = sanitize_text_field( $field['name'] );
30
- $field['label'] = sanitize_text_field( $field['label'] );
31
  // TODO Replace this special handling
32
  if ( 'checkbox' == $field['input_type'] ) {
33
  $field['default_form_value'] = wpmtst_sanitize_checkbox( $field, 'default_form_value' );
34
  } else {
35
  $field['default_form_value'] = sanitize_text_field( $field['default_form_value'] );
36
  }
37
- $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
38
- $field['before'] = sanitize_text_field( $field['before'] );
39
- $field['after'] = sanitize_text_field( $field['after'] );
40
 
41
  // add to fields array in display order
42
  $new_fields[] = $field;
@@ -46,7 +44,7 @@ function wpmtst_get_form_preview() {
46
  include WPMTST_ADMIN . 'partials/templates/form-preview-template.php';
47
  $html = ob_get_contents();
48
  ob_end_clean();
49
- echo wp_kses_post( $html );
50
 
51
  exit;
52
  }
1
  <?php
2
 
3
  function wpmtst_get_form_preview() {
4
+ if ( ! isset( $_POST['fields'] ) ) exit;
 
 
5
 
6
  // parse_str decodes too; no need to use urldecode
7
  parse_str( stripslashes_deep( $_POST['fields'] ), $preview );
8
 
9
  $new_fields = array();
10
+ $fields = apply_filters( 'wpmtst_fields', get_option( 'wpmtst_fields' ) );
11
 
12
  foreach ( $preview['fields'] as $key => $field ) {
13
  /*
15
  * which the form does not submit. Otherwise, the default "on"
16
  * would override the requested (but not submitted) "off".
17
  */
18
+ $field['show_label'] = isset( $field['show_label'] ) ? 1 : 0;
19
+ $field['required'] = isset( $field['required'] ) ? 1 : 0;
20
 
21
  $field = array_merge( $fields['field_base'], $field );
22
 
24
  $field['input_type'] = 'text';
25
  }
26
 
27
+ $field['name'] = sanitize_text_field( $field['name'] );
28
+ $field['label'] = sanitize_text_field( $field['label'] );
29
  // TODO Replace this special handling
30
  if ( 'checkbox' == $field['input_type'] ) {
31
  $field['default_form_value'] = wpmtst_sanitize_checkbox( $field, 'default_form_value' );
32
  } else {
33
  $field['default_form_value'] = sanitize_text_field( $field['default_form_value'] );
34
  }
35
+ $field['placeholder'] = sanitize_text_field( $field['placeholder'] );
36
+ $field['before'] = sanitize_text_field( $field['before'] );
37
+ $field['after'] = sanitize_text_field( $field['after'] );
38
 
39
  // add to fields array in display order
40
  $new_fields[] = $field;
44
  include WPMTST_ADMIN . 'partials/templates/form-preview-template.php';
45
  $html = ob_get_contents();
46
  ob_end_clean();
47
+ echo $html;
48
 
49
  exit;
50
  }
admin/menu/class-strong-testimonials-menu-fields.php CHANGED
@@ -43,8 +43,8 @@ class Strong_Testimonials_Menu_Fields {
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => apply_filters( 'wpmtst_fields_page_title', __( 'Fields', 'strong-testimonials' ) ),
46
- 'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Fields', 'strong-testimonials' ) ),
47
- 'capability' => 'strong_testimonials_fields',
48
  'menu_slug' => 'testimonial-fields',
49
  'function' => 'wpmtst_form_admin',
50
  );
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => apply_filters( 'wpmtst_fields_page_title', __( 'Fields', 'strong-testimonials' ) ),
46
+ 'menu_title' => apply_filters( 'wpmtst_fields_menu_title', __( 'Fields', 'strong-testimonials' ) ),
47
+ 'capability' => 'strong_testimonials_fields',
48
  'menu_slug' => 'testimonial-fields',
49
  'function' => 'wpmtst_form_admin',
50
  );
admin/menu/class-strong-testimonials-menu-settings.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
  class Strong_Testimonials_Menu_Settings {
6
 
7
- public static $callbacks;
8
 
9
  /**
10
  * Strong_Testimonials_Menu_Settings constructor.
@@ -26,8 +26,8 @@ class Strong_Testimonials_Menu_Settings {
26
  }
27
 
28
  /**
29
- * Add submenu page.
30
- *
31
  * @param $pages
32
  *
33
  * @return mixed
@@ -38,15 +38,15 @@ class Strong_Testimonials_Menu_Settings {
38
  }
39
 
40
  /**
41
- * Return submenu page parameters.
42
- *
43
  * @return array
44
  */
45
  public static function get_submenu() {
46
  return array(
47
  'page_title' => __( 'Settings', 'strong-testimonials' ),
48
- 'menu_title' => __( 'Settings', 'strong-testimonials' ),
49
- 'capability' => 'strong_testimonials_options',
50
  'menu_slug' => 'testimonial-settings',
51
  'function' => array( 'Strong_Testimonials_Settings', 'settings_page' ),
52
  );
4
  */
5
  class Strong_Testimonials_Menu_Settings {
6
 
7
+ public static $callbacks;
8
 
9
  /**
10
  * Strong_Testimonials_Menu_Settings constructor.
26
  }
27
 
28
  /**
29
+ * Add submenu page.
30
+ *
31
  * @param $pages
32
  *
33
  * @return mixed
38
  }
39
 
40
  /**
41
+ * Return submenu page parameters.
42
+ *
43
  * @return array
44
  */
45
  public static function get_submenu() {
46
  return array(
47
  'page_title' => __( 'Settings', 'strong-testimonials' ),
48
+ 'menu_title' => __( 'Settings', 'strong-testimonials' ),
49
+ 'capability' => 'strong_testimonials_options',
50
  'menu_slug' => 'testimonial-settings',
51
  'function' => array( 'Strong_Testimonials_Settings', 'settings_page' ),
52
  );
admin/menu/class-strong-testimonials-menu-shortcodes.php CHANGED
@@ -43,8 +43,8 @@ class Strong_Testimonials_Menu_Shortcodes {
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => apply_filters( 'wpmtst_shortcodes_page_title', __( 'Shortcodes', 'strong-testimonials' ) ),
46
- 'menu_title' => apply_filters( 'wpmtst_shortcodes_menu_title', __( 'Shortcodes', 'strong-testimonials' ) ),
47
- 'capability' => 'strong_testimonials_options',
48
  'menu_slug' => 'testimonial-shortcodes',
49
  'function' => array( 'Strong_Testimonials_Page_Shortcodes', 'render_page' ),
50
  );
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => apply_filters( 'wpmtst_shortcodes_page_title', __( 'Shortcodes', 'strong-testimonials' ) ),
46
+ 'menu_title' => apply_filters( 'wpmtst_shortcodes_menu_title', __( 'Shortcodes', 'strong-testimonials' ) ),
47
+ 'capability' => 'strong_testimonials_options',
48
  'menu_slug' => 'testimonial-shortcodes',
49
  'function' => array( 'Strong_Testimonials_Page_Shortcodes', 'render_page' ),
50
  );
admin/menu/class-strong-testimonials-menu-views.php CHANGED
@@ -43,8 +43,8 @@ class Strong_Testimonials_Menu_Views {
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => __( 'Views', 'strong-testimonials' ),
46
- 'menu_title' => __( 'Views', 'strong-testimonials' ),
47
- 'capability' => 'strong_testimonials_views',
48
  'menu_slug' => 'testimonial-views',
49
  'function' => 'wpmtst_views_admin',
50
  );
43
  public static function get_submenu() {
44
  return array(
45
  'page_title' => __( 'Views', 'strong-testimonials' ),
46
+ 'menu_title' => __( 'Views', 'strong-testimonials' ),
47
+ 'capability' => 'strong_testimonials_views',
48
  'menu_slug' => 'testimonial-views',
49
  'function' => 'wpmtst_views_admin',
50
  );
admin/menu/class-strong-testimonials-menu.php CHANGED
@@ -7,44 +7,44 @@ class Strong_Testimonials_Menu {
7
  /**
8
  * The common parent slug.
9
  */
10
- const PARENT_SLUG = 'edit.php?post_type=wpm-testimonial';
11
 
12
  /**
13
  * Strong_Testimonials_Menu constructor.
14
  */
15
- public function __construct() {}
16
 
17
  /**
18
  * Initialize.
19
  */
20
- public static function init() {
21
- self::add_actions();
22
- }
23
 
24
  /**
25
  * Add actions and filters.
26
  */
27
- public static function add_actions() {
28
- add_action( 'admin_menu', array( __CLASS__, 'settings_menu' ) );
29
- }
30
 
31
  /**
32
  * Add submenu pages.
33
  */
34
- public static function settings_menu() {
35
- $submenu_pages = apply_filters( 'wpmtst_submenu_pages', array() );
36
- ksort( $submenu_pages );
37
- foreach ( $submenu_pages as $key => $submenu ) {
38
- add_submenu_page(
39
- self::PARENT_SLUG,
40
- $submenu['page_title'],
41
- $submenu['menu_title'],
42
- $submenu['capability'],
43
- $submenu['menu_slug'],
44
- $submenu['function']
45
- );
46
- }
47
- }
48
 
49
  }
50
 
7
  /**
8
  * The common parent slug.
9
  */
10
+ const PARENT_SLUG = 'edit.php?post_type=wpm-testimonial';
11
 
12
  /**
13
  * Strong_Testimonials_Menu constructor.
14
  */
15
+ public function __construct() {}
16
 
17
  /**
18
  * Initialize.
19
  */
20
+ public static function init() {
21
+ self::add_actions();
22
+ }
23
 
24
  /**
25
  * Add actions and filters.
26
  */
27
+ public static function add_actions() {
28
+ add_action( 'admin_menu', array( __CLASS__, 'settings_menu' ) );
29
+ }
30
 
31
  /**
32
  * Add submenu pages.
33
  */
34
+ public static function settings_menu() {
35
+ $submenu_pages = apply_filters( 'wpmtst_submenu_pages', array() );
36
+ ksort( $submenu_pages );
37
+ foreach ( $submenu_pages as $key => $submenu ) {
38
+ add_submenu_page(
39
+ self::PARENT_SLUG,
40
+ $submenu['page_title'],
41
+ $submenu['menu_title'],
42
+ $submenu['capability'],
43
+ $submenu['menu_slug'],
44
+ $submenu['function']
45
+ );
46
+ }
47
+ }
48
 
49
  }
50
 
admin/partials/fields/field-controls.php CHANGED
@@ -6,7 +6,7 @@ $is_core = ( isset( $field['core'] ) && $field['core'] );
6
  ?>
7
  <div class="controls">
8
  <?php if ( $adding || ! $is_core ) : ?>
9
- <span><a href="#" class="delete-field"><?php esc_html_e( 'Delete' ); ?></a></span>
10
  <?php endif; ?>
11
- <span class="close-field"><a href="#"><?php echo esc_html_x( 'Close', 'verb', 'strong-testimonials' ); ?></a></span>
12
  </div>
6
  ?>
7
  <div class="controls">
8
  <?php if ( $adding || ! $is_core ) : ?>
9
+ <span><a href="#" class="delete-field"><?php _e( 'Delete' ); ?></a></span>
10
  <?php endif; ?>
11
+ <span class="close-field"><a href="#"><?php _ex( 'Close', 'verb', 'strong-testimonials' ); ?></a></span>
12
  </div>
admin/partials/fields/field-header.php CHANGED
@@ -5,9 +5,9 @@
5
  $field_link = $field['label'] ? $field['label'] : ucwords( $field['name'] );
6
  ?>
7
  <div class="custom-field-header">
8
- <span class="link" title="<?php esc_html_e( 'click to open or close', 'strong-testimonials' ); ?>">
9
- <a class="field" href="#"><?php echo esc_html( $field_link ); ?></a>
10
- <span class="handle" title="<?php esc_html_e( 'drag and drop to reorder', 'strong-testimonials' ); ?>"></span>
11
  <span class="toggle"></span>
12
  </span>
13
  </div>
5
  $field_link = $field['label'] ? $field['label'] : ucwords( $field['name'] );
6
  ?>
7
  <div class="custom-field-header">
8
+ <span class="link" title="<?php _e( 'click to open or close', 'strong-testimonials' ); ?>">
9
+ <a class="field" href="#"><?php echo $field_link; ?></a>
10
+ <span class="handle" title="<?php _e( 'drag and drop to reorder', 'strong-testimonials' ); ?>"></span>
11
  <span class="toggle"></span>
12
  </span>
13
  </div>
admin/partials/fields/field-label.php CHANGED
@@ -4,12 +4,12 @@
4
  */
5
  ?>
6
  <tr class="field-label-row">
7
- <th><?php echo esc_html_x( 'Label', 'noun', 'strong-testimonials' ); ?></th>
8
- <td>
9
- <input class="field-label" type="text" name="fields[<?php echo esc_attr( $key ); ?>][label]" value="<?php echo esc_attr( $field['label'] ); ?>">
10
- <label>
11
- <input type="checkbox" name="fields[<?php echo esc_attr( $key ); ?>][show_label]" <?php checked( $field['show_label'], true ); ?>>
12
- <span class="help inline"><?php esc_html_e( 'Show this label on the form.', 'strong-testimonials' ); ?></span>
13
- </label>
14
- </td>
15
  </tr>
4
  */
5
  ?>
6
  <tr class="field-label-row">
7
+ <th><?php _ex( 'Label', 'noun', 'strong-testimonials' ); ?></th>
8
+ <td>
9
+ <input class="field-label" type="text" name="fields[<?php echo $key; ?>][label]" value="<?php echo esc_attr( $field['label'] ); ?>">
10
+ <label>
11
+ <input type="checkbox" name="fields[<?php echo $key; ?>][show_label]" <?php checked( $field['show_label'], true ); ?>>
12
+ <span class="help inline"><?php _e( 'Show this label on the form.', 'strong-testimonials' ); ?></span>
13
+ </label>
14
+ </td>
15
  </tr>
admin/partials/fields/field-name.php CHANGED
@@ -6,18 +6,17 @@
6
  */
7
  ?>
8
  <tr class="field-name-row">
9
- <th><?php echo esc_html_x( 'Name', 'noun', 'strong-testimonials' ); ?></th>
10
  <td>
11
  <?php
12
  // Field names for certain types are read-only.
13
- if ( $field['name_mutable'] ) :
14
- ?>
15
- <input class="field-name" type="text" name="fields[<?php echo esc_attr( $key ); ?>][name]" value="<?php echo isset( $field['name'] ) ? esc_attr( $field['name'] ) : ''; ?>">
16
- <span class="help field-name-help"><?php esc_html_e( 'Use only lowercase letters, numbers, and underscores.', 'strong-testimonials' ); ?></span>
17
- <span class="help field-name-help important"><?php esc_html_e( 'Cannot be "name" or "date".', 'strong-testimonials' ); ?></span>
18
  <?php else : ?>
19
- <input class="field-name" type="text" value="<?php echo esc_attr( $field['name'] ); ?>" disabled="disabled">
20
- <input type="hidden" name="fields[<?php echo esc_attr( $key ); ?>][name]" value="<?php echo esc_attr( $field['name'] ); ?>">
21
  <?php endif ?>
22
  </td>
23
  </tr>
6
  */
7
  ?>
8
  <tr class="field-name-row">
9
+ <th><?php _ex( 'Name', 'noun', 'strong-testimonials' ); ?></th>
10
  <td>
11
  <?php
12
  // Field names for certain types are read-only.
13
+ if ( $field['name_mutable'] ) : ?>
14
+ <input class="field-name" type="text" name="fields[<?php echo $key; ?>][name]" value="<?php echo isset( $field['name'] ) ? esc_attr( $field['name'] ) : ''; ?>">
15
+ <span class="help field-name-help"><?php _e( 'Use only lowercase letters, numbers, and underscores.', 'strong-testimonials' ); ?></span>
16
+ <span class="help field-name-help important"><?php _e( 'Cannot be "name" or "date".', 'strong-testimonials' ); ?></span>
 
17
  <?php else : ?>
18
+ <input class="field-name" type="text" value="<?php echo $field['name']; ?>" disabled="disabled">
19
+ <input type="hidden" name="fields[<?php echo $key; ?>][name]" value="<?php echo $field['name']; ?>">
20
  <?php endif ?>
21
  </td>
22
  </tr>
admin/partials/fields/field-text.php CHANGED
@@ -4,8 +4,11 @@
4
  */
5
  ?>
6
  <tr class="field-label-row">
7
- <th><?php echo esc_html_x( 'Text', 'noun', 'strong-testimonials' ); ?></th>
8
  <td>
9
- <input type="text" class="field-label" name="fields[<?php echo esc_attr( $key ); ?>][text]" value="<?php echo esc_attr( $field['text'] ); ?>" placeholder="<?php esc_html_e( 'next to the checkbox', 'strong-testimonials' ); ?>">
 
 
 
10
  </td>
11
  </tr>
4
  */
5
  ?>
6
  <tr class="field-label-row">
7
+ <th><?php _ex( 'Text', 'noun', 'strong-testimonials' ); ?></th>
8
  <td>
9
+ <input type="text" class="field-label"
10
+ name="fields[<?php echo $key; ?>][text]"
11
+ value="<?php echo esc_attr( $field['text'] ); ?>"
12
+ placeholder="<?php _e('next to the checkbox', 'strong-testimonials' ); ?>">
13
  </td>
14
  </tr>
admin/partials/fields/field-type.php CHANGED
@@ -6,41 +6,41 @@
6
  */
7
  ?>
8
  <tr>
9
- <th><?php echo esc_html_x( 'Type', 'noun', 'strong-testimonials' ); ?></th>
10
  <td>
11
  <?php
12
  if ( $adding ) :
13
- ?>
14
- <select class="first-field field-type new" name="fields[<?php echo esc_attr( $key ); ?>][input_type]">
15
 
16
  <?php /* Start with a blank option with event trigger to update optgroups */ ?>
17
  <option class="no-selection" value="none" name="none">&mdash;</option>
18
 
19
  <?php /* Post fields */ ?>
20
- <optgroup class="post" label="<?php esc_attr_e( 'Post Fields', 'strong-testimonials' ); ?>">
21
  <?php foreach ( $field_types['post'] as $field_key => $field_parts ) : ?>
22
- <option value="<?php echo esc_attr( $field_key ); ?>"><?php echo esc_html( $field_parts['option_label'] ); ?></option>
23
  <?php endforeach; ?>
24
  </optgroup>
25
 
26
  <?php /* Custom fields */ ?>
27
- <optgroup class="custom" label="<?php esc_attr_e( 'Custom Fields', 'strong-testimonials' ); ?>">
28
  <?php foreach ( $field_types['custom'] as $field_key => $field_parts ) : ?>
29
- <option value="<?php echo esc_attr( $field_key ); ?>"><?php echo esc_html( $field_parts['option_label'] ); ?></option>
30
  <?php endforeach; ?>
31
  </optgroup>
32
 
33
  <?php /* Special fields */ ?>
34
- <optgroup class="optional" label="<?php esc_attr_e( 'Special Fields', 'strong-testimonials' ); ?>">
35
  <?php foreach ( $field_types['optional'] as $field_key => $field_parts ) : ?>
36
- <?php $data = ( $field_parts['name'] ) ? ' data-force-name="' . esc_attr( $field_parts['name'] ) . '"' : ''; ?>
37
- <option value="<?php echo esc_attr( $field_key ); ?>"<?php echo $data; ?>><?php echo esc_html( $field_parts['option_label'] ); ?></option>
38
  <?php endforeach; ?>
39
  </optgroup>
40
 
41
  </select>
42
 
43
- <span class="help form-error-text" style="display: none;"><?php esc_html_e( 'Select a field type or delete this field.', 'strong-testimonials' ); ?></span>
44
 
45
  <?php else : ?>
46
 
@@ -48,27 +48,28 @@
48
  if ( 'post' == $field['record_type'] ) {
49
  foreach ( $field_types['post'] as $field_key => $field_parts ) {
50
  // compare field *name*
51
- if ( $field['name'] == $field_key ) {
52
- echo wp_kses_post( $field_parts['option_label'] );
53
- }
54
  }
55
- } elseif ( 'custom' == $field['record_type'] ) {
 
56
  foreach ( $field_types['custom'] as $field_key => $field_parts ) {
57
  // compare field *type*
58
  if ( $field['input_type'] == $field_key ) {
59
- echo wp_kses_post( $field_parts['option_label'] );
60
  }
61
  }
62
- } elseif ( 'optional' == $field['record_type'] ) {
 
63
  foreach ( $field_types['optional'] as $field_key => $field_parts ) {
64
  // compare field *type*
65
  if ( $field['input_type'] == $field_key ) {
66
- echo wp_kses_post( $field_parts['option_label'] );
67
  }
68
  }
69
  }
70
 
71
  endif; // editing
72
- ?>
73
  </td>
74
  </tr>
6
  */
7
  ?>
8
  <tr>
9
+ <th><?php _ex( 'Type', 'noun', 'strong-testimonials' ); ?></th>
10
  <td>
11
  <?php
12
  if ( $adding ) :
13
+ ?>
14
+ <select class="first-field field-type new" name="fields[<?php echo $key; ?>][input_type]">
15
 
16
  <?php /* Start with a blank option with event trigger to update optgroups */ ?>
17
  <option class="no-selection" value="none" name="none">&mdash;</option>
18
 
19
  <?php /* Post fields */ ?>
20
+ <optgroup class="post" label="<?php _e( 'Post Fields', 'strong-testimonials' ); ?>">
21
  <?php foreach ( $field_types['post'] as $field_key => $field_parts ) : ?>
22
+ <option value="<?php echo $field_key; ?>"><?php echo $field_parts['option_label']; ?></option>
23
  <?php endforeach; ?>
24
  </optgroup>
25
 
26
  <?php /* Custom fields */ ?>
27
+ <optgroup class="custom" label="<?php _e( 'Custom Fields', 'strong-testimonials' ); ?>">
28
  <?php foreach ( $field_types['custom'] as $field_key => $field_parts ) : ?>
29
+ <option value="<?php echo $field_key; ?>"><?php echo $field_parts['option_label']; ?></option>
30
  <?php endforeach; ?>
31
  </optgroup>
32
 
33
  <?php /* Special fields */ ?>
34
+ <optgroup class="optional" label="<?php _e( 'Special Fields', 'strong-testimonials' ); ?>">
35
  <?php foreach ( $field_types['optional'] as $field_key => $field_parts ) : ?>
36
+ <?php $data = ( $field_parts['name'] ) ? ' data-force-name="'.$field_parts['name'].'"' : ''; ?>
37
+ <option value="<?php echo $field_key; ?>"<?php echo $data; ?>><?php echo $field_parts['option_label']; ?></option>
38
  <?php endforeach; ?>
39
  </optgroup>
40
 
41
  </select>
42
 
43
+ <span class="help form-error-text" style="display: none;"><?php _e( 'Select a field type or delete this field.', 'strong-testimonials' ); ?></span>
44
 
45
  <?php else : ?>
46
 
48
  if ( 'post' == $field['record_type'] ) {
49
  foreach ( $field_types['post'] as $field_key => $field_parts ) {
50
  // compare field *name*
51
+ if ( $field['name'] == $field_key )
52
+ echo $field_parts['option_label'];
 
53
  }
54
+ }
55
+ elseif ( 'custom' == $field['record_type'] ) {
56
  foreach ( $field_types['custom'] as $field_key => $field_parts ) {
57
  // compare field *type*
58
  if ( $field['input_type'] == $field_key ) {
59
+ echo $field_parts['option_label'];
60
  }
61
  }
62
+ }
63
+ elseif ( 'optional' == $field['record_type'] ) {
64
  foreach ( $field_types['optional'] as $field_key => $field_parts ) {
65
  // compare field *type*
66
  if ( $field['input_type'] == $field_key ) {
67
+ echo $field_parts['option_label'];
68
  }
69
  }
70
  }
71
 
72
  endif; // editing
73
+ ?>
74
  </td>
75
  </tr>
admin/partials/templates/form-preview-template.php CHANGED
@@ -8,20 +8,20 @@
8
 
9
  <div id="wpmtst-form">
10
 
11
- <div class="strong-form-inner">
12
 
13
- <?php wpmtst_field_required_notice(); ?>
14
 
15
- <form enctype="multipart/form-data" autocomplete="off">
16
 
17
- <?php wpmtst_all_form_fields( $new_fields ); ?>
18
 
19
- <?php wpmtst_form_submit_button( true ); ?>
20
 
21
- </form>
22
 
23
- </div>
24
 
25
  </div>
26
 
27
- </div>
8
 
9
  <div id="wpmtst-form">
10
 
11
+ <div class="strong-form-inner">
12
 
13
+ <?php wpmtst_field_required_notice(); ?>
14
 
15
+ <form enctype="multipart/form-data" autocomplete="off">
16
 
17
+ <?php wpmtst_all_form_fields( $new_fields ); ?>
18
 
19
+ <?php wpmtst_form_submit_button( true ); ?>
20
 
21
+ </form>
22
 
23
+ </div>
24
 
25
  </div>
26
 
27
+ </div>
admin/partials/views/group-compat.php CHANGED
@@ -7,11 +7,11 @@ $then_classes = array(
7
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
8
  <h3>
9
  <?php /* translators: On the Views admin screen. */ ?>
10
- <?php esc_html_e( 'Compatibility', 'strong-testimonials' ); ?>
11
  </h3>
12
  <table class="form-table multiple group-general">
13
  <tr class="then then_display then_form then_slideshow then_not_single_template" style="display: none;">
14
- <?php require 'option-divi.php'; ?>
15
  </tr>
16
  </table>
17
  </div>
7
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
8
  <h3>
9
  <?php /* translators: On the Views admin screen. */ ?>
10
+ <?php _e( 'Compatibility', 'strong-testimonials' ); ?>
11
  </h3>
12
  <table class="form-table multiple group-general">
13
  <tr class="then then_display then_form then_slideshow then_not_single_template" style="display: none;">
14
+ <?php include( 'option-divi.php' ); ?>
15
  </tr>
16
  </table>
17
  </div>
admin/partials/views/group-extra.php CHANGED
@@ -11,14 +11,14 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
- <?php esc_html_e( 'Extra', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-layout">
17
  <tr class="then then_display then_not_form then_not_slideshow then_not_single then_multiple" style="display: none;">
18
- <?php require 'option-pagination.php'; ?>
19
  </tr>
20
  <tr class="then then_display then_not_form then_slideshow read-more" style="display: none;">
21
- <?php require 'option-read-more-page.php'; ?>
22
  </tr>
23
  </table>
24
  </div>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
+ <?php _e( 'Extra', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-layout">
17
  <tr class="then then_display then_not_form then_not_slideshow then_not_single then_multiple" style="display: none;">
18
+ <?php include( 'option-pagination.php' ); ?>
19
  </tr>
20
  <tr class="then then_display then_not_form then_slideshow read-more" style="display: none;">
21
+ <?php include( 'option-read-more-page.php' ); ?>
22
  </tr>
23
  </table>
24
  </div>
admin/partials/views/group-fields.php CHANGED
@@ -11,7 +11,7 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
- <?php esc_html_e( 'Fields', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-show">
17
 
@@ -26,7 +26,7 @@ $then_classes = array(
26
  );
27
  ?>
28
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
29
- <?php require 'option-title.php'; ?>
30
  </tr>
31
 
32
  <?php
@@ -40,7 +40,7 @@ $then_classes = array(
40
  );
41
  ?>
42
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
43
- <?php require 'option-thumbnail.php'; ?>
44
  </tr>
45
 
46
  <?php
@@ -54,7 +54,7 @@ $then_classes = array(
54
  );
55
  ?>
56
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
57
- <?php require 'option-content.php'; ?>
58
  </tr>
59
 
60
  <?php
@@ -68,7 +68,7 @@ $then_classes = array(
68
  );
69
  ?>
70
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
71
- <?php require 'option-client-section.php'; ?>
72
  </tr>
73
 
74
  </table>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
+ <?php _e( 'Fields', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-show">
17
 
26
  );
27
  ?>
28
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
29
+ <?php include( 'option-title.php' ); ?>
30
  </tr>
31
 
32
  <?php
40
  );
41
  ?>
42
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
43
+ <?php include( 'option-thumbnail.php' ); ?>
44
  </tr>
45
 
46
  <?php
54
  );
55
  ?>
56
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
57
+ <?php include( 'option-content.php' ); ?>
58
  </tr>
59
 
60
  <?php
68
  );
69
  ?>
70
  <tr class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
71
+ <?php include( 'option-client-section.php' ); ?>
72
  </tr>
73
 
74
  </table>
admin/partials/views/group-form.php CHANGED
@@ -11,14 +11,14 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
- <?php esc_html_e( 'Actions', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
  <tr>
18
- <?php require 'option-form-category.php'; ?>
19
  </tr>
20
  <tr>
21
- <?php require 'option-form-ajax.php'; ?>
22
  </tr>
23
  </table>
24
  </div>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
+ <?php _e( 'Actions', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
  <tr>
18
+ <?php include('option-form-category.php'); ?>
19
  </tr>
20
  <tr>
21
+ <?php include('option-form-ajax.php'); ?>
22
  </tr>
23
  </table>
24
  </div>
admin/partials/views/group-query.php CHANGED
@@ -11,34 +11,34 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
- <?php esc_html_e( 'Query', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
- <tr class="subheading">
18
- <td><?php esc_html_e( 'Option', 'strong-testimonials' ); ?></td>
19
- <td><?php esc_html_e( 'Setting', 'strong-testimonials' ); ?></td>
20
- <td class="divider" colspan="2">
21
- <?php esc_html_e( 'or Shortcode Attribute', 'strong-testimonials' ); ?>
22
  <span class="help-links">
23
  <span class="description">
24
- <a href="#tab-panel-wpmtst-help-shortcode" class="open-help-tab"><?php esc_html_e( 'Help' ); ?></a>
25
  </span>
26
  </span>
27
  </td>
28
- <td>Example</td>
29
- </tr>
30
  <tr class="then then_display then_not_slideshow then_not_form" style="display: none;">
31
- <?php require 'option-select.php'; ?>
32
  </tr>
33
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
34
- <?php require 'option-category.php'; ?>
35
  </tr>
36
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
37
- <?php require 'option-order.php'; ?>
38
  </tr>
39
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
40
- <?php require 'option-limit.php'; ?>
41
  </tr>
42
  <?php // TODO Add hook here ?>
43
- </table>
44
  </div>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
+ <?php _e( 'Query', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
+ <tr class="subheading">
18
+ <td><?php _e( 'Option', 'strong-testimonials' ); ?></td>
19
+ <td><?php _e( 'Setting', 'strong-testimonials' ); ?></td>
20
+ <td class="divider" colspan="2">
21
+ <?php _e( 'or Shortcode Attribute', 'strong-testimonials' ); ?>
22
  <span class="help-links">
23
  <span class="description">
24
+ <a href="#tab-panel-wpmtst-help-shortcode" class="open-help-tab"><?php _e( 'Help' ); ?></a>
25
  </span>
26
  </span>
27
  </td>
28
+ <td>Example</td>
29
+ </tr>
30
  <tr class="then then_display then_not_slideshow then_not_form" style="display: none;">
31
+ <?php include( 'option-select.php' ); ?>
32
  </tr>
33
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
34
+ <?php include( 'option-category.php' ); ?>
35
  </tr>
36
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
37
+ <?php include( 'option-order.php' ); ?>
38
  </tr>
39
  <tr class="then then_slideshow then_not_single then_multiple" style="display: none;">
40
+ <?php include( 'option-limit.php' ); ?>
41
  </tr>
42
  <?php // TODO Add hook here ?>
43
+ </table>
44
  </div>
admin/partials/views/group-slideshow.php CHANGED
@@ -11,20 +11,20 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: In the view editor. */ ?>
14
- <?php esc_html_e( 'Slideshow', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
  <tr>
18
- <?php require 'option-slideshow-num.php'; ?>
19
  </tr>
20
  <tr>
21
- <?php require 'option-slideshow-transition.php'; ?>
22
  </tr>
23
  <tr>
24
- <?php require 'option-slideshow-behavior.php'; ?>
25
  </tr>
26
  <tr>
27
- <?php require 'option-slideshow-navigation.php'; ?>
28
  </tr>
29
  </table>
30
  </div>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: In the view editor. */ ?>
14
+ <?php _e( 'Slideshow', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-select">
17
  <tr>
18
+ <?php include( 'option-slideshow-num.php' ); ?>
19
  </tr>
20
  <tr>
21
+ <?php include( 'option-slideshow-transition.php' ); ?>
22
  </tr>
23
  <tr>
24
+ <?php include( 'option-slideshow-behavior.php' ); ?>
25
  </tr>
26
  <tr>
27
+ <?php include( 'option-slideshow-navigation.php' ); ?>
28
  </tr>
29
  </table>
30
  </div>
admin/partials/views/group-style.php CHANGED
@@ -11,40 +11,40 @@ $then_classes = array(
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
- <?php esc_html_e( 'Style', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-style">
17
- <?php do_action( 'wpmtst_view_editor_before_template_list' ); ?>
18
  <tr class="then then_display then_not_form then_slideshow" style="display: none;">
19
  <?php
20
- $current_mode = 'template';
21
- $current_type = 'display';
22
- require 'option-template-list.php';
23
- ?>
24
  </tr>
25
  <tr class="then then_not_display then_form then_not_slideshow" style="display: none;">
26
  <?php
27
  $current_mode = 'form-template';
28
  $current_type = 'form';
29
- require 'option-template-list.php';
30
- ?>
31
  </tr>
32
  <?php do_action( 'wpmtst_view_editor_before_layout' ); ?>
33
  <tr class="then then_display then_not_form then_not_slideshow" style="display: none;">
34
- <?php require 'option-layout.php'; ?>
35
  </tr>
36
  <?php do_action( 'wpmtst_view_editor_before_background' ); ?>
37
 
38
- <tr id="group-style-option-background" class="then then_display then_form then_slideshow" style="display: none;">
39
- <?php require 'option-background.php'; ?>
40
  </tr>
41
- <tr id="group-style-option-color" class="then then_display then_form then_slideshow" style="display: none;">
42
- <?php require 'option-color.php'; ?>
43
  </tr>
44
 
45
  <?php do_action( 'wpmtst_view_editor_before_classes' ); ?>
46
  <tr class="then then_display then_form then_slideshow" style="display: none;">
47
- <?php require 'option-classes.php'; ?>
48
  </tr>
49
  <?php do_action( 'wpmtst_view_editor_after_style_section' ); ?>
50
  </table>
11
  <div class="<?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>" style="display: none;">
12
  <h3>
13
  <?php /* translators: On the Views admin screen. */ ?>
14
+ <?php _e( 'Style', 'strong-testimonials' ); ?>
15
  </h3>
16
  <table class="form-table multiple group-style">
17
+ <?php do_action( 'wpmtst_view_editor_before_template_list' ); ?>
18
  <tr class="then then_display then_not_form then_slideshow" style="display: none;">
19
  <?php
20
+ $current_mode = 'template';
21
+ $current_type = 'display';
22
+ include( 'option-template-list.php' );
23
+ ?>
24
  </tr>
25
  <tr class="then then_not_display then_form then_not_slideshow" style="display: none;">
26
  <?php
27
  $current_mode = 'form-template';
28
  $current_type = 'form';
29
+ include( 'option-template-list.php' );
30
+ ?>
31
  </tr>
32
  <?php do_action( 'wpmtst_view_editor_before_layout' ); ?>
33
  <tr class="then then_display then_not_form then_not_slideshow" style="display: none;">
34
+ <?php include( 'option-layout.php' ); ?>
35
  </tr>
36
  <?php do_action( 'wpmtst_view_editor_before_background' ); ?>
37
 
38
+ <tr id="group-style-option-background" class="then then_display then_form then_slideshow" style="display: none;">
39
+ <?php include( 'option-background.php' ); ?>
40
  </tr>
41
+ <tr id="group-style-option-color" class="then then_display then_form then_slideshow" style="display: none;">
42
+ <?php include( 'option-color.php' ); ?>
43
  </tr>
44
 
45
  <?php do_action( 'wpmtst_view_editor_before_classes' ); ?>
46
  <tr class="then then_display then_form then_slideshow" style="display: none;">
47
+ <?php include( 'option-classes.php' ); ?>
48
  </tr>
49
  <?php do_action( 'wpmtst_view_editor_after_style_section' ); ?>
50
  </table>
admin/partials/views/option-background.php CHANGED
@@ -1,105 +1,105 @@
1
  <th>
2
- <?php esc_html_e( 'Background', 'strong-testimonials' ); ?>
3
  </th>
4
  <td>
5
- <div class="section-radios background-section">
6
 
7
- <!-- Inputs -->
8
- <div class="radio-buttons">
9
- <ul class="radio-list background-list">
10
  <li>
11
- <input type="radio"
12
- id="bg-none"
13
- name="view[data][background][type]"
14
- value="" <?php checked( $view['background']['type'], '' ); ?>>
15
- <label for="bg-none">
16
- <?php esc_html_e( 'inherit from theme', 'strong-testimonials' ); ?>
17
- </label>
18
  </li>
19
  <li>
20
- <input type="radio"
21
- id="bg-single"
22
- name="view[data][background][type]"
23
- value="single" <?php checked( $view['background']['type'], 'single' ); ?>>
24
- <label for="bg-single">
25
- <?php esc_html_e( 'single color', 'strong-testimonials' ); ?>
26
- </label>
27
  </li>
28
  <li>
29
- <input type="radio"
30
- id="bg-gradient"
31
- name="view[data][background][type]"
32
- value="gradient" <?php checked( $view['background']['type'], 'gradient' ); ?>>
33
- <label for="bg-gradient">
34
- <?php esc_html_e( 'gradient', 'strong-testimonials' ); ?>
35
- </label>
36
  </li>
37
  <li>
38
- <input type="radio"
39
- id="bg-preset"
40
- name="view[data][background][type]"
41
- value="preset" <?php checked( $view['background']['type'], 'preset' ); ?>>
42
- <label for="bg-preset">
43
- <?php esc_html_e( 'preset', 'strong-testimonials' ); ?>
44
- </label>
45
  </li>
46
  </ul>
47
  </div>
48
 
49
- <!-- Background info -->
50
- <div class="radio-description" id="view-background-info">
51
 
52
- <div class="background-description bg-none">
53
- <div class="description-inner options">
54
- <div>
55
- <?php esc_html_e( 'No options', 'strong-testimonials' ); ?>
56
- </div>
57
- </div>
58
- </div>
59
 
60
  <div class="background-description bg-single">
61
- <div class="description-inner options">
62
- <div>
63
  <label>
64
- <input type="text"
65
- id="bg-color"
66
- name="view[data][background][color]"
67
- value="<?php echo esc_attr( $view['background']['color'] ); ?>"
68
- class="wp-color-picker-field">
69
  </label>
70
  </div>
71
  </div>
72
- </div>
73
 
74
  <div class="background-description bg-gradient">
75
- <div class="description-inner options">
76
- <div>
77
- <div class="color-picker-wrap">
78
- <div>
79
- <label for="bg-gradient1"><?php esc_html_e( 'From top', 'strong-testimonials' ); ?></label>
80
  </div>
81
- <div>
82
- <input type="text"
83
- id="bg-gradient1"
84
- name="view[data][background][gradient1]"
85
- value="<?php echo esc_attr( $view['background']['gradient1'] ); ?>"
86
- class="wp-color-picker-field gradient">
87
- </div>
88
  </div>
89
  </div>
90
- </div>
91
- <div class="description-inner options">
92
- <div>
93
- <div class="color-picker-wrap">
94
- <div>
95
- <label for ="bg-gradient2"><?php esc_html_e( 'To bottom', 'strong-testimonials' ); ?></label>
96
  </div>
97
- <div>
98
- <input type="text"
99
- id="bg-gradient2"
100
- name="view[data][background][gradient2]"
101
- value="<?php echo esc_attr( $view['background']['gradient2'] ); ?>"
102
- class="wp-color-picker-field gradient">
103
  </div>
104
  </div>
105
  </div>
@@ -108,16 +108,16 @@
108
  </div>
109
 
110
  <div class="background-description bg-preset">
111
- <div class="description-inner options">
112
- <div>
113
  <label for="view-background-preset">
114
  <select id="view-background-preset" name="view[data][background][preset]">
115
  <?php
116
- $presets = wpmtst_get_background_presets();
117
  $current_preset = ( isset( $view['background']['preset'] ) && $view['background']['preset'] ) ? $view['background']['preset'] : '';
118
  echo '<option value="" ' . selected( $current_preset, '', false ) . '>&mdash;</option>';
119
  foreach ( $presets as $key => $preset ) {
120
- echo '<option value="' . esc_attr( $key ) . '" ' . selected( $current_preset, $key, false ) . '>' . esc_html( $preset['label'] ) . '</option>';
121
  }
122
  ?>
123
  </select>
@@ -135,17 +135,17 @@
135
  </td>
136
 
137
  <td rowspan="2" class="rowspan">
138
- <div id="view-color-preview" class="table-cell">
139
 
140
- <div class="background-preview-wrap">
141
 
142
- <div id="background-preview">
143
- Lorem ipsum dolor sit amet, accusam complectitur an eos. No vix perpetua adolescens, vix vidisse maiorum
144
- in. No erat falli scripta qui, vis ubique scripta electram ad. Vix prompta adipisci no, ad vidisse
145
- expetendis.
146
- </div>
147
 
148
- </div>
149
 
150
- </div>
151
- </td>
1
  <th>
2
+ <?php _e( 'Background', 'strong-testimonials' ); ?>
3
  </th>
4
  <td>
5
+ <div class="section-radios background-section">
6
 
7
+ <!-- Inputs -->
8
+ <div class="radio-buttons">
9
+ <ul class="radio-list background-list">
10
  <li>
11
+ <input type="radio"
12
+ id="bg-none"
13
+ name="view[data][background][type]"
14
+ value="" <?php checked( $view['background']['type'], '' ); ?>>
15
+ <label for="bg-none">
16
+ <?php _e( 'inherit from theme', 'strong-testimonials' ); ?>
17
+ </label>
18
  </li>
19
  <li>
20
+ <input type="radio"
21
+ id="bg-single"
22
+ name="view[data][background][type]"
23
+ value="single" <?php checked( $view['background']['type'], 'single' ); ?>>
24
+ <label for="bg-single">
25
+ <?php _e( 'single color', 'strong-testimonials' ); ?>
26
+ </label>
27
  </li>
28
  <li>
29
+ <input type="radio"
30
+ id="bg-gradient"
31
+ name="view[data][background][type]"
32
+ value="gradient" <?php checked( $view['background']['type'], 'gradient' ); ?>>
33
+ <label for="bg-gradient">
34
+ <?php _e( 'gradient', 'strong-testimonials' ); ?>
35
+ </label>
36
  </li>
37
  <li>
38
+ <input type="radio"
39
+ id="bg-preset"
40
+ name="view[data][background][type]"
41
+ value="preset" <?php checked( $view['background']['type'], 'preset' ); ?>>
42
+ <label for="bg-preset">
43
+ <?php _e( 'preset', 'strong-testimonials' ); ?>
44
+ </label>
45
  </li>
46
  </ul>
47
  </div>
48
 
49
+ <!-- Background info -->
50
+ <div class="radio-description" id="view-background-info">
51
 
52
+ <div class="background-description bg-none">
53
+ <div class="description-inner options">
54
+ <div>
55
+ <?php _e( 'No options', 'strong-testimonials' ); ?>
56
+ </div>
57
+ </div>
58
+ </div>
59
 
60
  <div class="background-description bg-single">
61
+ <div class="description-inner options">
62
+ <div>
63
  <label>
64
+ <input type="text"
65
+ id="bg-color"
66
+ name="view[data][background][color]"
67
+ value="<?php echo $view['background']['color']; ?>"
68
+ class="wp-color-picker-field">
69
  </label>
70
  </div>
71
  </div>
72
+ </div>
73
 
74
  <div class="background-description bg-gradient">
75
+ <div class="description-inner options">
76
+ <div>
77
+ <div class="color-picker-wrap">
78
+ <div>
79
+ <label for="bg-gradient1"><?php _e( 'From top', 'strong-testimonials' ); ?></label>
80
  </div>
81
+ <div>
82
+ <input type="text"
83
+ id="bg-gradient1"
84
+ name="view[data][background][gradient1]"
85
+ value="<?php echo $view['background']['gradient1']; ?>"
86
+ class="wp-color-picker-field gradient">
87
+ </div>
88
  </div>
89
  </div>
90
+ </div>
91
+ <div class="description-inner options">
92
+ <div>
93
+ <div class="color-picker-wrap">
94
+ <div>
95
+ <label for ="bg-gradient2"><?php _e( 'To bottom', 'strong-testimonials' ); ?></label>
96
  </div>
97
+ <div>
98
+ <input type="text"
99
+ id="bg-gradient2"
100
+ name="view[data][background][gradient2]"
101
+ value="<?php echo $view['background']['gradient2']; ?>"
102
+ class="wp-color-picker-field gradient">
103
  </div>
104
  </div>
105
  </div>
108
  </div>
109
 
110
  <div class="background-description bg-preset">
111
+ <div class="description-inner options">
112
+ <div>
113
  <label for="view-background-preset">
114
  <select id="view-background-preset" name="view[data][background][preset]">
115
  <?php
116
+ $presets = wpmtst_get_background_presets();
117
  $current_preset = ( isset( $view['background']['preset'] ) && $view['background']['preset'] ) ? $view['background']['preset'] : '';
118
  echo '<option value="" ' . selected( $current_preset, '', false ) . '>&mdash;</option>';
119
  foreach ( $presets as $key => $preset ) {
120
+ echo '<option value="' . $key . '" ' . selected( $current_preset, $key, false ) . '>' . $preset['label'] . '</option>';
121
  }
122
  ?>
123
  </select>
135
  </td>
136
 
137
  <td rowspan="2" class="rowspan">
138
+ <div id="view-color-preview" class="table-cell">
139
 
140
+ <div class="background-preview-wrap">
141
 
142
+ <div id="background-preview">
143
+ Lorem ipsum dolor sit amet, accusam complectitur an eos. No vix perpetua adolescens, vix vidisse maiorum
144
+ in. No erat falli scripta qui, vis ubique scripta electram ad. Vix prompta adipisci no, ad vidisse
145
+ expetendis.
146
+ </div>
147
 
148
+ </div>
149
 
150
+ </div>
151
+ </td>
admin/partials/views/option-boilerplate.php CHANGED
@@ -1,39 +1,39 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-option">
4
- <?php esc_html_e( 'Option Name', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="inline">
9
  <select id="view-option" class="if selectper" name="view[data][option]">
10
  <option value="yes" <?php selected( 'yes', $view['option'] ); ?>>
11
- <?php esc_html_e( 'yes', 'strong-testimonials' ); ?>
12
  </option>
13
  <option value="no" <?php selected( 'no', $view['option'] ); ?>>
14
- <?php esc_html_e( 'no', 'strong-testimonials' ); ?>
15
  </option>
16
  <option value="maybe" <?php selected( 'maybe', $view['option'] ); ?>>
17
- <?php esc_html_e( 'maybe', 'strong-testimonials' ); ?>
18
  </option>
19
  </select>
20
  </div>
21
 
22
  <div class="inline then fast then_yes then_not_no then_not_maybe" style="display: none;">
23
  <p class="description tall">
24
- <?php esc_html_e( 'Yes', 'strong-testimonials' ); ?><br>
25
  </p>
26
  </div>
27
 
28
  <div class="inline then fast then_not_yes then_no then_not_maybe" style="display: none;">
29
  <p class="description tall">
30
- <?php esc_html_e( 'No', 'strong-testimonials' ); ?><br>
31
  </p>
32
  </div>
33
 
34
- <div class="inline then fast then_not_yes then_not_no then_maybe" style="display: none;">
35
- <p class="description tall">
36
- <?php esc_html_e( 'Maybe', 'strong-testimonials' ); ?><br>
37
- </p>
38
- </div>
39
  </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-option">
4
+ <?php _e( 'Option Name', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="inline">
9
  <select id="view-option" class="if selectper" name="view[data][option]">
10
  <option value="yes" <?php selected( 'yes', $view['option'] ); ?>>
11
+ <?php _e( 'yes', 'strong-testimonials' ); ?>
12
  </option>
13
  <option value="no" <?php selected( 'no', $view['option'] ); ?>>
14
+ <?php _e( 'no', 'strong-testimonials' ); ?>
15
  </option>
16
  <option value="maybe" <?php selected( 'maybe', $view['option'] ); ?>>
17
+ <?php _e( 'maybe', 'strong-testimonials' ); ?>
18
  </option>
19
  </select>
20
  </div>
21
 
22
  <div class="inline then fast then_yes then_not_no then_not_maybe" style="display: none;">
23
  <p class="description tall">
24
+ <?php _e( 'Yes', 'strong-testimonials' ); ?><br>
25
  </p>
26
  </div>
27
 
28
  <div class="inline then fast then_not_yes then_no then_not_maybe" style="display: none;">
29
  <p class="description tall">
30
+ <?php _e( 'No', 'strong-testimonials' ); ?><br>
31
  </p>
32
  </div>
33
 
34
+ <div class="inline then fast then_not_yes then_not_no then_maybe" style="display: none;">
35
+ <p class="description tall">
36
+ <?php _e( 'Maybe', 'strong-testimonials' ); ?><br>
37
+ </p>
38
+ </div>
39
  </td>
admin/partials/views/option-category.php CHANGED
@@ -1,56 +1,56 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <label for="view-category-select">
4
- <?php esc_html_e( 'Categories', 'strong-testimonials' ); ?>
5
- </label>
6
  </th>
7
  <?php if ( $cat_count ) : ?>
8
  <td>
9
- <div id="view-category" class="row">
10
- <div class="table inline">
11
- <div class="table-row">
12
- <div class="table-cell select-cell then_display then_slideshow then_not_form">
13
- <select id="view-category-select" class="if selectper" name="view[data][category_all]">
14
- <option value="allcats" <?php selected( $view['category'], 'all' ); ?>><?php esc_html_e( 'all', 'strong-testimonials' ); ?></option>
15
- <option value="somecats" <?php echo( 'all' != $view['category'] ? 'selected' : '' ); ?>><?php echo esc_html_x( 'select', 'verb', 'strong-testimonials' ); ?></option>
16
- </select>
17
- </div>
18
- <div class="table-cell then then_not_allcats then_somecats" style="display: none;">
19
- <div class="table">
20
  <?php if ( $cat_count > 5 ) : ?>
21
- <div class="table-row">
22
- <div class="table-cell">
23
- <div class="row" style="text-align: right; padding-bottom: 5px;">
24
- <input type="button" class="expand-cats button" value="expand list"/>
25
- </div>
26
- </div>
27
- </div>
28
- <?php endif; ?>
29
- <div class="table-row">
30
- <div class="table-cell">
31
  <?php wpmtst_category_checklist( $view_cats_array ); ?>
32
- </div>
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
  </td>
40
  <?php else : ?>
41
  <td>
42
- <div id="view-category" class="row">
43
- <input type="hidden" name="view[data][category_all]" value="all">
44
- <p class="description tall"><?php esc_html_e( 'No categories found', 'strong-testimonials' ); ?></p>
45
- </div>
46
  </td>
47
  <?php endif; ?>
48
  <td class="divider">
49
- <p><?php echo wp_kses_post( _e( '<code>category</code>', 'strong-testimonials' ) ); ?></p>
50
  </td>
51
  <td>
52
- <p><?php echo wp_kses_post( _e( 'a comma-separated list of category slugs or ID\'s', 'strong-testimonials' ) ); ?></p>
53
  </td>
54
  <td>
55
- <p><?php echo wp_kses_post( _e( '<code>category="accounting"</code>', 'strong-testimonials' ) ); ?></p>
56
- </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <label for="view-category-select">
4
+ <?php _e( 'Categories', 'strong-testimonials' ); ?>
5
+ </label>
6
  </th>
7
  <?php if ( $cat_count ) : ?>
8
  <td>
9
+ <div id="view-category" class="row">
10
+ <div class="table inline">
11
+ <div class="table-row">
12
+ <div class="table-cell select-cell then_display then_slideshow then_not_form">
13
+ <select id="view-category-select" class="if selectper" name="view[data][category_all]">
14
+ <option value="allcats" <?php selected( $view['category'], 'all' ); ?>><?php _e( 'all', 'strong-testimonials' ); ?></option>
15
+ <option value="somecats" <?php echo( 'all' != $view['category'] ? 'selected' : '' ); ?>><?php _ex( 'select', 'verb', 'strong-testimonials' ); ?></option>
16
+ </select>
17
+ </div>
18
+ <div class="table-cell then then_not_allcats then_somecats" style="display: none;">
19
+ <div class="table">
20
  <?php if ( $cat_count > 5 ) : ?>
21
+ <div class="table-row">
22
+ <div class="table-cell">
23
+ <div class="row" style="text-align: right; padding-bottom: 5px;">
24
+ <input type="button" class="expand-cats button" value="expand list"/>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <?php endif; ?>
29
+ <div class="table-row">
30
+ <div class="table-cell">
31
  <?php wpmtst_category_checklist( $view_cats_array ); ?>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
  </td>
40
  <?php else : ?>
41
  <td>
42
+ <div id="view-category" class="row">
43
+ <input type="hidden" name="view[data][category_all]" value="all">
44
+ <p class="description tall"><?php _e( 'No categories found', 'strong-testimonials' ); ?></p>
45
+ </div>
46
  </td>
47
  <?php endif; ?>
48
  <td class="divider">
49
+ <p><?php _e( '<code>category</code>', 'strong-testimonials' ); ?></p>
50
  </td>
51
  <td>
52
+ <p><?php _e( 'a comma-separated list of category slugs or ID\'s', 'strong-testimonials' ); ?></p>
53
  </td>
54
  <td>
55
+ <p><?php _e( '<code>category="accounting"</code>', 'strong-testimonials' ); ?></p>
56
+ </td>
admin/partials/views/option-classes.php CHANGED
@@ -1,14 +1,14 @@
1
  <th>
2
  <label for="view-class">
3
- <?php esc_html_e( 'CSS Classes', 'strong-testimonials' ); ?>
4
  </label>
5
  </th>
6
  <td colspan="2">
7
  <div class="then then_display then_form then_slideshow input" style="display: none;">
8
- <input type="text" id="view-class" class="long inline" name="view[data][class]" value="<?php echo esc_attr( $view['class'] ); ?>">
9
  <p class="inline description tall">
10
- <?php esc_html_e( 'For advanced users.', 'strong-testimonials' ); ?>
11
- <?php esc_html_e( 'Separate class names by spaces.', 'strong-testimonials' ); ?>
12
  </p>
13
  </div>
14
  </td>
1
  <th>
2
  <label for="view-class">
3
+ <?php _e( 'CSS Classes', 'strong-testimonials' ); ?>
4
  </label>
5
  </th>
6
  <td colspan="2">
7
  <div class="then then_display then_form then_slideshow input" style="display: none;">
8
+ <input type="text" id="view-class" class="long inline" name="view[data][class]" value="<?php echo $view['class']; ?>">
9
  <p class="inline description tall">
10
+ <?php _e( 'For advanced users.', 'strong-testimonials' ); ?>
11
+ <?php _e( 'Separate class names by spaces.', 'strong-testimonials' ); ?>
12
  </p>
13
  </div>
14
  </td>
admin/partials/views/option-client-section.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Custom Fields', 'strong-testimonials' ); ?>
4
  </th>
5
  <td colspan="2">
6
 
@@ -19,7 +19,11 @@
19
  </div>
20
 
21
  <div id="add-field-bar" class="is-below">
22
- <input id="add-field" type="button" name="add-field" value="<?php esc_attr_e( 'Add Field', 'strong-testimonials' ); ?>" class="button-secondary" />
 
 
 
 
23
  </div>
24
 
25
  </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <?php _e( 'Custom Fields', 'strong-testimonials' ); ?>
4
  </th>
5
  <td colspan="2">
6
 
19
  </div>
20
 
21
  <div id="add-field-bar" class="is-below">
22
+ <input id="add-field"
23
+ type="button"
24
+ name="add-field"
25
+ value="<?php _e( 'Add Field', 'strong-testimonials' ); ?>"
26
+ class="button-secondary" />
27
  </div>
28
 
29
  </td>
admin/partials/views/option-color.php CHANGED
@@ -1,40 +1,50 @@
1
  <th>
2
- <?php esc_html_e( 'Font Color', 'strong-testimonials' ); ?>
3
  </th>
4
  <td>
5
- <div class="section-radios font-color-section">
6
 
7
- <div class="radio-buttons">
8
- <ul class="radio-list font-folor-list">
9
  <li>
10
- <input type="radio" id="fc-none" name="view[data][font-color][type]" value="" <?php checked( $view['font-color']['type'], '' ); ?>>
11
- <label for="fc-none">
12
- <?php esc_html_e( 'inherit from theme', 'strong-testimonials' ); ?>
13
- </label>
 
 
 
14
  </li>
15
  <li>
16
- <input type="radio" id="fc-custom" name="view[data][font-color][type]" value="custom" <?php checked( $view['font-color']['type'], 'custom' ); ?>>
17
- <label for="fc-custom">
18
- <?php esc_html_e( 'custom', 'strong-testimonials' ); ?>
19
- </label>
 
 
 
20
  </li>
21
  </ul>
22
  </div>
23
 
24
- <div class="radio-description" id="view-font-color-info">
25
- <div class="font-color-description fc-none">
26
- <div class="description-inner options">
27
- <div>
28
- <?php esc_html_e( 'No options', 'strong-testimonials' ); ?>
29
- </div>
30
- </div>
31
- </div>
32
 
33
  <div class="font-color-description fc-custom">
34
- <div class="description-inner options">
35
- <div>
36
  <label>
37
- <input type="text" id="fc-color" name="view[data][font-color][color]" value="<?php echo esc_attr( $view['font-color']['color'] ); ?>" class="wp-color-picker-field">
 
 
 
 
38
  </label>
39
  </div>
40
  </div>
1
  <th>
2
+ <?php _e( 'Font Color', 'strong-testimonials' ); ?>
3
  </th>
4
  <td>
5
+ <div class="section-radios font-color-section">
6
 
7
+ <div class="radio-buttons">
8
+ <ul class="radio-list font-folor-list">
9
  <li>
10
+ <input type="radio"
11
+ id="fc-none"
12
+ name="view[data][font-color][type]"
13
+ value="" <?php checked( $view['font-color']['type'], '' ); ?>>
14
+ <label for="fc-none">
15
+ <?php _e( 'inherit from theme', 'strong-testimonials' ); ?>
16
+ </label>
17
  </li>
18
  <li>
19
+ <input type="radio"
20
+ id="fc-custom"
21
+ name="view[data][font-color][type]"
22
+ value="custom" <?php checked( $view['font-color']['type'], 'custom' ); ?>>
23
+ <label for="fc-custom">
24
+ <?php _e( 'custom', 'strong-testimonials' ); ?>
25
+ </label>
26
  </li>
27
  </ul>
28
  </div>
29
 
30
+ <div class="radio-description" id="view-font-color-info">
31
+ <div class="font-color-description fc-none">
32
+ <div class="description-inner options">
33
+ <div>
34
+ <?php _e( 'No options', 'strong-testimonials' ); ?>
35
+ </div>
36
+ </div>
37
+ </div>
38
 
39
  <div class="font-color-description fc-custom">
40
+ <div class="description-inner options">
41
+ <div>
42
  <label>
43
+ <input type="text"
44
+ id="fc-color"
45
+ name="view[data][font-color][color]"
46
+ value="<?php echo $view['font-color']['color']; ?>"
47
+ class="wp-color-picker-field">
48
  </label>
49
  </div>
50
  </div>
admin/partials/views/option-content.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-content">
4
- <?php esc_html_e( 'Content', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td colspan="2">
@@ -14,13 +14,13 @@
14
  <div class="inline">
15
  <select id="view-content" class="if selectper min-width-1 label-not-adjacent" name="view[data][content]">
16
  <option value="entire" <?php selected( 'entire', $view['content'] ); ?>>
17
- <?php echo esc_html_x( 'entire content', 'display setting', 'strong-testimonials' ); ?>
18
  </option>
19
  <option value="truncated" <?php selected( 'truncated', $view['content'] ); ?>>
20
- <?php echo esc_html_x( 'automatic excerpt', 'display setting', 'strong-testimonials' ); ?>
21
  </option>
22
  <option value="excerpt" <?php selected( 'excerpt', $view['content'] ); ?>>
23
- <?php echo esc_html_x( 'manual excerpt', 'display setting', 'strong-testimonials' ); ?>
24
  </option>
25
  </select>
26
  </div>
@@ -28,14 +28,14 @@
28
  <!-- info & screenshot -->
29
  <div class="inline then fast then_truncated then_not_entire then_not_excerpt" style="display: none;">
30
  <p class="description">
31
- <?php esc_html_e( 'This will strip tags like &lt;em&gt; and &lt;strong&gt;.', 'strong-testimonials' ); ?>
32
  </p>
33
  </div>
34
  <div class="inline then fast then_not_truncated then_not_entire then_excerpt" style="display: none;">
35
  <p class="description">
36
- <?php echo wp_kses_post( printf( __( 'To create manual excerpts, you may need to enable them in the post editor like in this <a href="%s" class="thickbox">screenshot</a>.', 'strong-testimonials' ), esc_url( '#TB_inline?width=&height=210&inlineId=screenshot-screen-options' ) ) ); ?>
37
  <span class="screenshot" id="screenshot-screen-options" style="display: none;">
38
- <img src="<?php echo esc_url( WPMTST_ADMIN_URL ); ?>img/screen-options.png" width="600">
39
  </span>
40
  </p>
41
  </div>
@@ -51,7 +51,7 @@
51
  <!-- info -->
52
  <div class="inline tight then then_excerpt then_not_truncated" style="display: none;">
53
  <span>
54
- <?php esc_html_e( 'If no manual excerpt, create an excerpt using', 'strong-testimonials' ); ?>
55
  </span>
56
  </div>
57
 
@@ -60,10 +60,10 @@
60
  <label>
61
  <select id="view-use_default_length" class="if selectgroup min-width-1" name="view[data][use_default_length]">
62
  <option value="1" <?php selected( $view['use_default_length'] ); ?>>
63
- <?php echo esc_html_x( 'default length', 'display setting', 'strong-testimonials' ); ?>
64
  </option>
65
  <option value="0" <?php selected( ! $view['use_default_length'] ); ?>>
66
- <?php echo esc_html_x( 'custom length', 'display setting', 'strong-testimonials' ); ?>
67
  </option>
68
  </select>
69
  </label>
@@ -72,14 +72,14 @@
72
  <!-- 1st option: default -->
73
  <div class="inline then fast then_use_default_length then_1 then_not_0" style="display: none;">
74
  <label for="view-use_default_length" class="inline-middle"><?php // Because partner option has <label>, this prevents micro-bounce ?>
75
- <p class="description tall"><?php esc_html_e( 'The default length is 55 words but your theme may override that.', 'strong-testimonials' ); ?></p>
76
  </label>
77
  </div>
78
 
79
  <!-- 2nd option: length -->
80
  <div class="inline then fast then_use_default_length then_0 then_not_1" style="display: none;">
81
  <label class="inline-middle">
82
- <?php printf( esc_html_x( 'the first %s words', 'the excerpt length', 'strong-testimonials' ), '<input id="view-excerpt_length" class="input-incremental" type="number" min="1" max="999" name="view[data][excerpt_length]" value="' . esc_attr( $view['excerpt_length'] ) . '">' ); ?>
83
  </label>
84
  </div>
85
 
@@ -92,103 +92,103 @@
92
 
93
  <div class="row-inner subgroup">
94
 
95
- <!-- action: full post or in place -->
96
- <div class="row-inner">
97
- <div class="inline">
98
- <?php echo wp_kses_post( _e( 'Add a <strong>Read more</strong> link to', 'strong-testimonials' ) ); ?>
99
- </div>
100
- <div class="inline tight">
101
- <label>
102
- <select id="view-more_post_in_place"
103
- class="if selectgroup"
104
- name="view[data][more_post_in_place]">
105
- <option value="0" <?php selected( ! $view['more_post_in_place'] ); ?>>
106
- <?php // TODO Get label from Properties ?>
107
- <?php esc_html_e( 'the full testimonial', 'strong-testimonials' ); ?>
108
- </option>
109
- <option value="1" <?php selected( $view['more_post_in_place'] ); ?>>
110
- <?php esc_html_e( 'expand content in place', 'strong-testimonials' ); ?>
111
- </option>
112
- </select>
113
- </label>
114
- </div>
115
- </div>
116
-
117
- <!-- ellipsis -->
118
- <div class="row-inner">
119
- <div class="then then_use_default_more then_0 then_not_1" style="display: none;">
120
  <div class="inline">
121
- <label>
122
- <select id="view-more_post_ellipsis"
123
- class="if selectgroup"
124
- name="view[data][more_post_ellipsis]">
125
- <option value="1" <?php selected( $view['more_post_ellipsis'] ); ?>>
126
- <?php esc_html_e( 'with an ellipsis', 'strong-testimonials' ); ?>
127
- </option>
128
- <option value="0" <?php selected( ! $view['more_post_ellipsis'] ); ?>>
129
- <?php esc_html_e( 'without an ellipsis', 'strong-testimonials' ); ?>
130
- </option>
131
- </select>
132
- </label>
133
  </div>
134
- <div class="inline then then_excerpt then_not_truncated" style="display: none;">
135
- <p class="description">
136
- <?php esc_html_e( 'Automatic excerpt only.', 'strong-testimonials' ); ?>
137
- </p>
138
- </div>
139
- </div>
140
- </div>
141
-
142
- <!-- default or custom -->
143
  <div class="row-inner">
144
- <div class="inline tight then fast then_more_post_in_place then_1 then_not_0" style="display: none;">
145
- <?php esc_html_e( 'with link text to read more', 'strong-testimonials' ); ?>
146
- </div>
147
  <div class="inline then fast then_more_post_in_place then_0 then_not_1" style="display: none;">
148
  <label>
149
  <select id="view-use_default_more"
150
- class="if selectgroup min-width-1"
151
- name="view[data][use_default_more]">
152
  <option value="1" <?php selected( $view['use_default_more'] ); ?>>
153
- <?php echo esc_html_x( 'with default link text', 'display setting', 'strong-testimonials' ); ?>
154
  </option>
155
  <option value="0" <?php selected( ! $view['use_default_more'] ); ?>>
156
- <?php echo esc_html_x( 'with custom link text', 'display setting', 'strong-testimonials' ); ?>
157
  </option>
158
  </select>
159
  </label>
160
- </div>
161
- <div class="inline then fast then_use_default_more then_1 then_not_0" style="display: none;">
162
- <p class="description"><?php echo wp_kses_post( _e( 'If you only see [&hellip;] without a link then use the custom link text instead.', 'strong-testimonials' ) ); ?></p>
163
- </div>
164
- <!-- read more -->
165
- <div class="inline then fast then_use_default_more then_0 then_not_1" style="display: none;">
166
  <span id="option-link-text" class="inline-span">
167
  <label for="view-more_post_text">
168
  <input type="text" id="view-more_post_text" name="view[data][more_post_text]"
169
- value="<?php echo esc_attr( $view['more_post_text'] ); ?>" size="22"
170
- placeholder="<?php esc_attr_e( 'enter a phrase', 'strong-testimonials' ); ?>">
171
  </label>
172
  </span>
173
- </div>
174
- </div>
175
-
176
- <!-- read less -->
177
- <div class="row-inner then fast then_more_post_in_place then_1 then_not_0" style="display: none;">
178
- <div class="inline tight">
179
- <?php esc_html_e( 'and link text to read less', 'strong-testimonials' ); ?>
180
- </div>
181
- <div class="inline tight">
182
  <span id="option-link-text-less" class="inline-span">
183
  <label for="view-less_post_text">
184
  <input type="text" id="view-less_post_text" name="view[data][less_post_text]"
185
- value="<?php echo esc_attr( $view['less_post_text'] ); ?>" size="22"
186
- placeholder="<?php esc_attr_e( 'enter a phrase', 'strong-testimonials' ); ?>">
187
  </label>
188
  </span>
189
- <p class="inline description"><?php esc_html_e( 'Leave blank to leave content expanded without a link.', 'strong-testimonials' ); ?></p>
190
- </div>
191
- </div>
192
 
193
  <!-- automatic or both -->
194
  <div class="row-inner then then_excerpt then_not_truncated" style="display: none;">
@@ -196,10 +196,10 @@
196
  <label>
197
  <select id="view-more_full_post" class="if selectgroup" name="view[data][more_full_post]">
198
  <option value="0" <?php selected( $view['more_full_post'], 0 ); ?>>
199
- <?php echo esc_html_x( 'for automatic excerpt only', 'display setting', 'strong-testimonials' ); ?>
200
  </option>
201
  <option value="1" <?php selected( $view['more_full_post'], 1 ); ?>>
202
- <?php echo esc_html_x( 'for both automatic and manual excerpts', 'display setting', 'strong-testimonials' ); ?>
203
  </option>
204
  </select>
205
  </label>
@@ -210,7 +210,7 @@
210
 
211
  <div class="row links then then_not_entire then_truncated then_excerpt" style="display: none;">
212
  <p class="description tall solo">
213
- <?php echo wp_kses_post( printf( __( '<a href="%s" target="_blank">Learn more about WordPress excerpts</a>', 'strong-testimonials' ), esc_url( 'http://buildwpyourself.com/wordpress-manual-excerpts-more-tag/' ) ) ); ?>
214
  </p>
215
  </div>
216
 
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-content">
4
+ <?php _e( 'Content', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td colspan="2">
14
  <div class="inline">
15
  <select id="view-content" class="if selectper min-width-1 label-not-adjacent" name="view[data][content]">
16
  <option value="entire" <?php selected( 'entire', $view['content'] ); ?>>
17
+ <?php _ex( 'entire content', 'display setting', 'strong-testimonials' ); ?>
18
  </option>
19
  <option value="truncated" <?php selected( 'truncated', $view['content'] ); ?>>
20
+ <?php _ex( 'automatic excerpt', 'display setting', 'strong-testimonials' ); ?>
21
  </option>
22
  <option value="excerpt" <?php selected( 'excerpt', $view['content'] ); ?>>
23
+ <?php _ex( 'manual excerpt', 'display setting', 'strong-testimonials' ); ?>
24
  </option>
25
  </select>
26
  </div>
28
  <!-- info & screenshot -->
29
  <div class="inline then fast then_truncated then_not_entire then_not_excerpt" style="display: none;">
30
  <p class="description">
31
+ <?php _e( 'This will strip tags like &lt;em&gt; and &lt;strong&gt;.', 'strong-testimonials' ); ?>
32
  </p>
33
  </div>
34
  <div class="inline then fast then_not_truncated then_not_entire then_excerpt" style="display: none;">
35
  <p class="description">
36
+ <?php printf( __( 'To create manual excerpts, you may need to enable them in the post editor like in this <a href="%s" class="thickbox">screenshot</a>.', 'strong-testimonials' ), esc_url( '#TB_inline?width=&height=210&inlineId=screenshot-screen-options' ) ); ?>
37
  <span class="screenshot" id="screenshot-screen-options" style="display: none;">
38
+ <img src="<?php echo WPMTST_ADMIN_URL; ?>img/screen-options.png" width="600">
39
  </span>
40
  </p>
41
  </div>
51
  <!-- info -->
52
  <div class="inline tight then then_excerpt then_not_truncated" style="display: none;">
53
  <span>
54
+ <?php _e( 'If no manual excerpt, create an excerpt using', 'strong-testimonials' ); ?>
55
  </span>
56
  </div>
57
 
60
  <label>
61
  <select id="view-use_default_length" class="if selectgroup min-width-1" name="view[data][use_default_length]">
62
  <option value="1" <?php selected( $view['use_default_length'] ); ?>>
63
+ <?php _ex( 'default length', 'display setting', 'strong-testimonials' ); ?>
64
  </option>
65
  <option value="0" <?php selected( ! $view['use_default_length'] ); ?>>
66
+ <?php _ex( 'custom length', 'display setting', 'strong-testimonials' ); ?>
67
  </option>
68
  </select>
69
  </label>
72
  <!-- 1st option: default -->
73
  <div class="inline then fast then_use_default_length then_1 then_not_0" style="display: none;">
74
  <label for="view-use_default_length" class="inline-middle"><?php // Because partner option has <label>, this prevents micro-bounce ?>
75
+ <p class="description tall"><?php _e( 'The default length is 55 words but your theme may override that.', 'strong-testimonials' ); ?></p>
76
  </label>
77
  </div>
78
 
79
  <!-- 2nd option: length -->
80
  <div class="inline then fast then_use_default_length then_0 then_not_1" style="display: none;">
81
  <label class="inline-middle">
82
+ <?php printf( _x( 'the first %s words', 'the excerpt length', 'strong-testimonials' ), '<input id="view-excerpt_length" class="input-incremental" type="number" min="1" max="999" name="view[data][excerpt_length]" value="' . $view['excerpt_length'] . '">' ); ?>
83
  </label>
84
  </div>
85
 
92
 
93
  <div class="row-inner subgroup">
94
 
95
+ <!-- action: full post or in place -->
96
+ <div class="row-inner">
97
+ <div class="inline">
98
+ <?php _e( 'Add a <strong>Read more</strong> link to', 'strong-testimonials' ); ?>
99
+ </div>
100
+ <div class="inline tight">
101
+ <label>
102
+ <select id="view-more_post_in_place"
103
+ class="if selectgroup"
104
+ name="view[data][more_post_in_place]">
105
+ <option value="0" <?php selected( ! $view['more_post_in_place'] ); ?>>
106
+ <?php // TODO Get label from Properties ?>
107
+ <?php _e( 'the full testimonial', 'strong-testimonials' ); ?>
108
+ </option>
109
+ <option value="1" <?php selected( $view['more_post_in_place'] ); ?>>
110
+ <?php _e( 'expand content in place', 'strong-testimonials' ); ?>
111
+ </option>
112
+ </select>
113
+ </label>
114
+ </div>
115
+ </div>
116
+
117
+ <!-- ellipsis -->
118
+ <div class="row-inner">
119
+ <div class="then then_use_default_more then_0 then_not_1" style="display: none;">
120
  <div class="inline">
121
+ <label>
122
+ <select id="view-more_post_ellipsis"
123
+ class="if selectgroup"
124
+ name="view[data][more_post_ellipsis]">
125
+ <option value="1" <?php selected( $view['more_post_ellipsis'] ); ?>>
126
+ <?php _e( 'with an ellipsis', 'strong-testimonials' ); ?>
127
+ </option>
128
+ <option value="0" <?php selected( ! $view['more_post_ellipsis'] ); ?>>
129
+ <?php _e( 'without an ellipsis', 'strong-testimonials' ); ?>
130
+ </option>
131
+ </select>
132
+ </label>
133
  </div>
134
+ <div class="inline then then_excerpt then_not_truncated" style="display: none;">
135
+ <p class="description">
136
+ <?php _e( 'Automatic excerpt only.', 'strong-testimonials' ); ?>
137
+ </p>
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+ <!-- default or custom -->
143
  <div class="row-inner">
144
+ <div class="inline tight then fast then_more_post_in_place then_1 then_not_0" style="display: none;">
145
+ <?php _e( 'with link text to read more', 'strong-testimonials' ); ?>
146
+ </div>
147
  <div class="inline then fast then_more_post_in_place then_0 then_not_1" style="display: none;">
148
  <label>
149
  <select id="view-use_default_more"
150
+ class="if selectgroup min-width-1"
151
+ name="view[data][use_default_more]">
152
  <option value="1" <?php selected( $view['use_default_more'] ); ?>>
153
+ <?php _ex( 'with default link text', 'display setting', 'strong-testimonials' ); ?>
154
  </option>
155
  <option value="0" <?php selected( ! $view['use_default_more'] ); ?>>
156
+ <?php _ex( 'with custom link text', 'display setting', 'strong-testimonials' ); ?>
157
  </option>
158
  </select>
159
  </label>
160
+ </div>
161
+ <div class="inline then fast then_use_default_more then_1 then_not_0" style="display: none;">
162
+ <p class="description"><?php _e( 'If you only see [&hellip;] without a link then use the custom link text instead.', 'strong-testimonials' ); ?></p>
163
+ </div>
164
+ <!-- read more -->
165
+ <div class="inline then fast then_use_default_more then_0 then_not_1" style="display: none;">
166
  <span id="option-link-text" class="inline-span">
167
  <label for="view-more_post_text">
168
  <input type="text" id="view-more_post_text" name="view[data][more_post_text]"
169
+ value="<?php echo $view['more_post_text']; ?>" size="22"
170
+ placeholder="<?php _e( 'enter a phrase', 'strong-testimonials' ); ?>">
171
  </label>
172
  </span>
173
+ </div>
174
+ </div>
175
+
176
+ <!-- read less -->
177
+ <div class="row-inner then fast then_more_post_in_place then_1 then_not_0" style="display: none;">
178
+ <div class="inline tight">
179
+ <?php _e( 'and link text to read less', 'strong-testimonials' ); ?>
180
+ </div>
181
+ <div class="inline tight">
182
  <span id="option-link-text-less" class="inline-span">
183
  <label for="view-less_post_text">
184
  <input type="text" id="view-less_post_text" name="view[data][less_post_text]"
185
+ value="<?php echo $view['less_post_text']; ?>" size="22"
186
+ placeholder="<?php _e( 'enter a phrase', 'strong-testimonials' ); ?>">
187
  </label>
188
  </span>
189
+ <p class="inline description"><?php _e( 'Leave blank to leave content expanded without a link.', 'strong-testimonials' ); ?></p>
190
+ </div>
191
+ </div>
192
 
193
  <!-- automatic or both -->
194
  <div class="row-inner then then_excerpt then_not_truncated" style="display: none;">
196
  <label>
197
  <select id="view-more_full_post" class="if selectgroup" name="view[data][more_full_post]">
198
  <option value="0" <?php selected( $view['more_full_post'], 0 ); ?>>
199
+ <?php _ex( 'for automatic excerpt only', 'display setting', 'strong-testimonials' ); ?>
200
  </option>
201
  <option value="1" <?php selected( $view['more_full_post'], 1 ); ?>>
202
+ <?php _ex( 'for both automatic and manual excerpts', 'display setting', 'strong-testimonials' ); ?>
203
  </option>
204
  </select>
205
  </label>
210
 
211
  <div class="row links then then_not_entire then_truncated then_excerpt" style="display: none;">
212
  <p class="description tall solo">
213
+ <?php printf( __( '<a href="%s" target="_blank">Learn more about WordPress excerpts</a>', 'strong-testimonials' ), esc_url( 'http://buildwpyourself.com/wordpress-manual-excerpts-more-tag/' ) ); ?>
214
  </p>
215
  </div>
216
 
admin/partials/views/option-divi.php CHANGED
@@ -3,21 +3,22 @@
3
  global $view;
4
  ?>
5
  <th>
6
- <label for="view-divi_builder"><?php esc_html_e( 'Divi Builder', 'strong-testimonials' ); ?></label>
7
  </th>
8
  <td>
9
- <div class="row">
10
- <div class="row-inner">
11
- <input type="checkbox" id="view-divi_builder" class="if toggle checkbox" name="view[data][divi_builder]" value="1" <?php checked( $view['divi_builder'] ); ?>/>
12
- <label for="view-divi_builder">
13
- <?php esc_html_e( 'Check this if adding this view (via shortcode or widget) using the Visual Builder in Divi Builder version 2.', 'strong-testimonials' ); ?>
14
- </label>
15
- <p class="description short">
16
- <?php esc_html_e( 'Not required if simply adding this view in the default editor.', 'strong-testimonials' ); ?>
17
- </p>
18
- <p class="description short">
19
- <?php esc_html_e( 'Not required if simply adding this view in the Divi theme using either the default editor or Divi Builder.', 'strong-testimonials' ); ?>
20
- </p>
21
- </div>
22
- </div>
 
23
  </td>
3
  global $view;
4
  ?>
5
  <th>
6
+ <label for="view-divi_builder"><?php _e( 'Divi Builder', 'strong-testimonials' ); ?></label>
7
  </th>
8
  <td>
9
+ <div class="row">
10
+ <div class="row-inner">
11
+ <input type="checkbox" id="view-divi_builder" class="if toggle checkbox"
12
+ name="view[data][divi_builder]" value="1" <?php checked( $view['divi_builder'] ); ?>/>
13
+ <label for="view-divi_builder">
14
+ <?php _e( 'Check this if adding this view (via shortcode or widget) using the Visual Builder in <b>Divi Builder version 2</b>.', 'strong-testimonials' ); ?>
15
+ </label>
16
+ <p class="description short">
17
+ <?php _e( 'Not required if simply adding this view in the default editor.', 'strong-testimonials' ); ?>
18
+ </p>
19
+ <p class="description short">
20
+ <?php _e( 'Not required if simply adding this view in the <b>Divi theme</b> using either the default editor or Divi Builder.', 'strong-testimonials' ); ?>
21
+ </p>
22
+ </div>
23
+ </div>
24
  </td>
admin/partials/views/option-form-ajax.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <input type="checkbox" id="view-form_ajax" class="checkbox if toggle" name="view[data][form_ajax]" value="1" <?php checked( $view['form_ajax'] ); ?>>
 
4
  <label for="view-form_ajax">
5
- <?php esc_html_e( 'Submit form without reloading the page (Ajax)', 'strong-testimonials' ); ?>
6
  </label>
7
  </th>
8
  <td>
9
  <p class="description tall">
10
- <?php esc_html_e( 'This will override the Success Redirect setting.', 'strong-testimonials' ); ?>
11
  </p>
12
  </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <input type="checkbox" id="view-form_ajax" class="checkbox if toggle"
4
+ name="view[data][form_ajax]" value="1" <?php checked( $view['form_ajax'] ); ?>>
5
  <label for="view-form_ajax">
6
+ <?php _e( 'Submit form without reloading the page (Ajax)', 'strong-testimonials' ); ?>
7
  </label>
8
  </th>
9
  <td>
10
  <p class="description tall">
11
+ <?php _e( 'This will override the <strong>Success Redirect</strong> setting.', 'strong-testimonials' ); ?>
12
  </p>
13
  </td>
admin/partials/views/option-form-category.php CHANGED
@@ -1,28 +1,28 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Assign to a category', 'strong-testimonials' ); ?>
4
  </th>
5
  <?php if ( $cat_count ) : ?>
6
- <td>
7
- <div class="table">
8
- <?php if ( $cat_count > 5 ) : ?>
9
- <div class="table-row">
10
- <div class="table-cell">
11
- <div class="row" style="text-align: right; padding-bottom: 5px;">
12
- <input type="button" class="expand-cats button" value="expand list"/>
13
- </div>
14
- </div>
15
- </div>
16
- <?php endif; ?>
17
- <div class="table-row">
18
- <div class="table-cell">
19
  <?php wpmtst_form_category_checklist( $view_cats_array ); ?>
20
- </div>
21
- </div>
22
- </div>
23
- </td>
24
  <?php else : ?>
25
- <td>
26
- <p class="description tall"><?php esc_html_e( 'No categories found', 'strong-testimonials' ); ?></p>
27
- </td>
28
  <?php endif; ?>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <?php _e( 'Assign to a category', 'strong-testimonials' ); ?>
4
  </th>
5
  <?php if ( $cat_count ) : ?>
6
+ <td>
7
+ <div class="table">
8
+ <?php if ( $cat_count > 5 ) : ?>
9
+ <div class="table-row">
10
+ <div class="table-cell">
11
+ <div class="row" style="text-align: right; padding-bottom: 5px;">
12
+ <input type="button" class="expand-cats button" value="expand list"/>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ <?php endif; ?>
17
+ <div class="table-row">
18
+ <div class="table-cell">
19
  <?php wpmtst_form_category_checklist( $view_cats_array ); ?>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </td>
24
  <?php else : ?>
25
+ <td>
26
+ <p class="description tall"><?php _e( 'No categories found', 'strong-testimonials' ); ?></p>
27
+ </td>
28
  <?php endif; ?>
admin/partials/views/option-id.php CHANGED
@@ -6,16 +6,16 @@
6
  <select id="view-id" name="view[data][id]">
7
  <option value="0"><?php _e( '&mdash; select &mdash;' ); ?></option>
8
  <?php foreach ( $testimonials_list as $post ) : ?>
9
- <option value="<?php echo esc_attr( $post->ID ); ?>" <?php selected( $view['id'], $post->ID ); ?>>
10
- <?php echo $post->post_title ? esc_html( $post->post_title ) : esc_html__( '(untitled)', 'strong-testimonials' ); ?>
11
  </option>
12
  <?php endforeach; ?>
13
  </select>
14
  </label>
15
- </div>
16
- <div class="row-inner">
17
  <label for="view-post_id">
18
- <?php echo esc_html_x( 'or enter its ID or slug', 'to select a testimonial', 'strong-testimonials' ); ?>
19
  </label>
20
  <input type="text" id="view-post_id" name="view[data][post_id]" size="30">
21
  </div>
6
  <select id="view-id" name="view[data][id]">
7
  <option value="0"><?php _e( '&mdash; select &mdash;' ); ?></option>
8
  <?php foreach ( $testimonials_list as $post ) : ?>
9
+ <option value="<?php echo $post->ID; ?>" <?php selected( $view['id'], $post->ID ); ?>>
10
+ <?php echo $post->post_title ? $post->post_title : __( '(untitled)', 'strong-testimonials' ); ?>
11
  </option>
12
  <?php endforeach; ?>
13
  </select>
14
  </label>
15
+ </div>
16
+ <div class="row-inner">
17
  <label for="view-post_id">
18
+ <?php _ex( 'or enter its ID or slug', 'to select a testimonial', 'strong-testimonials' ); ?>
19
  </label>
20
  <input type="text" id="view-post_id" name="view[data][post_id]" size="30">
21
  </div>
admin/partials/views/option-layout.php CHANGED
@@ -1,97 +1,98 @@
1
  <th>
2
- <?php esc_html_e( 'Layout', 'strong-testimonials' ); ?>
3
  </th>
4
  <td colspan="2">
5
- <div class="section-radios layout-section">
6
 
7
- <!-- Inputs -->
8
- <div class="radio-buttons">
9
- <ul class="radio-list layout-list">
10
  <li>
11
- <input type="radio" id="view-layout-normal" name="view[data][layout]" value="" <?php checked( false, $view['layout'] ); ?>>
 
 
 
12
  <label for="view-layout-normal">
13
- <?php esc_html_e( 'normal', 'strong-testimonials' ); ?>
14
  </label>
15
  </li>
16
  <li>
17
- <input type="radio"
18
- id="view-layout-masonry"
19
- name="view[data][layout]"
20
- value="masonry" <?php checked( 'masonry', $view['layout'] ); ?>>
21
  <label for="view-layout-masonry">
22
- <?php esc_html_e( 'Masonry', 'strong-testimonials' ); ?>
23
  </label>
24
  </li>
25
  <li>
26
- <input type="radio"
27
- id="view-layout-columns"
28
- name="view[data][layout]"
29
- value="columns" <?php checked( 'columns', $view['layout'] ); ?>>
30
  <label for="view-layout-columns">
31
- <?php esc_html_e( 'columns', 'strong-testimonials' ); ?>
32
  </label>
33
  </li>
34
  <li>
35
- <input type="radio"
36
- id="view-layout-grid"
37
- name="view[data][layout]"
38
- value="grid" <?php checked( 'grid', $view['layout'] ); ?>>
39
  <label for="view-layout-grid">
40
- <?php esc_html_e( 'grid', 'strong-testimonials' ); ?>
41
  </label>
42
  </li>
43
  </ul>
44
  </div>
45
 
46
  <!-- Layout Info -->
47
- <div>
48
- <div class="radio-description" id="view-layout-info">
49
 
50
  <div class="layout-description view-layout-normal">
51
- <p><?php esc_html_e( 'A single column.', 'strong-testimonials' ); ?></p>
52
- </div>
53
 
54
- <div class="layout-description view-layout-masonry">
55
- <p><?php echo wp_kses_post( printf( __( 'A cascading, responsive grid using the jQuery plugin <a href="%s" target="_blank">Masonry</a>.', 'strong-testimonials' ), esc_url( 'http://masonry.desandro.com/' ) ) ); ?></p>
56
- <p><?php esc_html_e( 'The universal solution that works well regardless of testimonial lengths.', 'strong-testimonials' ); ?></p>
57
- <p><?php esc_html_e( 'Not compatible with pagination.', 'strong-testimonials' ); ?></p>
58
- </div>
59
 
60
- <div class="layout-description view-layout-columns">
61
- <p><?php echo wp_kses_post( printf( __( 'Using <a href="%s" target="_blank">CSS multi-column</a>. Fill from top to bottom, then over to next column.', 'strong-testimonials' ), esc_url( 'https://css-tricks.com/guide-responsive-friendly-css-columns/' ) ) ); ?></p>
62
- <p><?php esc_html_e( 'Works well with both long and short testimonials.', 'strong-testimonials' ); ?></p>
63
- <p><?php esc_html_e( 'Compatible with pagination.', 'strong-testimonials' ); ?></p>
64
- </div>
65
 
66
- <div class="layout-description view-layout-grid">
67
- <p>
68
- <?php
69
  $url = 'https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties';
70
- echo wp_kses_post( printf( __( 'Using <a href="%s" target="_blank">CSS flexbox</a>.', 'strong-testimonials' ), esc_url( $url ) ) );
71
- ?>
72
- </p>
73
- <p><?php esc_html_e( 'Testimonials will be equal height so this works best when they are about the same length either naturally or using excerpts.', 'strong-testimonials' ); ?></p>
74
- <p><?php esc_html_e( 'Compatible with pagination.', 'strong-testimonials' ); ?></p>
75
- </div>
76
 
77
- </div>
78
 
79
- <!-- Column selector -->
80
- <div class="radio-description options" id="column-count-wrapper">
81
- <div>
82
- <label for="view-column-count"><?php esc_html_e( 'Number of columns', 'strong-testimonials' ); ?></label>
83
- <select id="view-column-count" name="view[data][column_count]">
84
- <option value="2" <?php selected( $view['column_count'], 2 ); ?>>2</option>
85
- <option value="3" <?php selected( $view['column_count'], 3 ); ?>>3</option>
86
- <option value="4" <?php selected( $view['column_count'], 4 ); ?>>4</option>
87
- </select>
88
- </div>
89
- </div>
90
- </div>
91
 
92
- <!-- Examples -->
93
- <div>
94
- <div class="layout-example view-layout-normal">
95
  <div class="example-container">
96
  <div class="box"><span>1</span></div>
97
  <div class="box size2"><span>2</span></div>
@@ -100,7 +101,7 @@
100
  <div class="box"><span>5</span></div>
101
  </div>
102
  </div>
103
- <div class="layout-example view-layout-masonry">
104
  <div class="example-container col-2">
105
  <div class="grid-sizer"></div>
106
  <div class="box"><span>1</span></div>
@@ -114,7 +115,7 @@
114
  <div class="box"><span>9</span></div>
115
  </div>
116
  </div>
117
- <div class="layout-example view-layout-columns">
118
  <div class="example-container col-2">
119
  <div class="box"><span>1</span></div>
120
  <div class="box size2"><span>2</span></div>
@@ -127,7 +128,7 @@
127
  <div class="box"><span>9</span></div>
128
  </div>
129
  </div>
130
- <div class="layout-example view-layout-grid">
131
  <div class="example-container col-2">
132
  <div class="box"><span>1</span></div>
133
  <div class="box"><span>2</span></div>
1
  <th>
2
+ <?php _e( 'Layout', 'strong-testimonials' ); ?>
3
  </th>
4
  <td colspan="2">
5
+ <div class="section-radios layout-section">
6
 
7
+ <!-- Inputs -->
8
+ <div class="radio-buttons">
9
+ <ul class="radio-list layout-list">
10
  <li>
11
+ <input type="radio"
12
+ id="view-layout-normal"
13
+ name="view[data][layout]"
14
+ value="" <?php checked( false, $view['layout'] ); ?>>
15
  <label for="view-layout-normal">
16
+ <?php _e( 'normal', 'strong-testimonials' ); ?>
17
  </label>
18
  </li>
19
  <li>
20
+ <input type="radio"
21
+ id="view-layout-masonry"
22
+ name="view[data][layout]"
23
+ value="masonry" <?php checked( 'masonry', $view['layout'] ); ?>>
24
  <label for="view-layout-masonry">
25
+ <?php _e( 'Masonry', 'strong-testimonials' ); ?>
26
  </label>
27
  </li>
28
  <li>
29
+ <input type="radio"
30
+ id="view-layout-columns"
31
+ name="view[data][layout]"
32
+ value="columns" <?php checked( 'columns', $view['layout'] ); ?>>
33
  <label for="view-layout-columns">
34
+ <?php _e( 'columns', 'strong-testimonials' ); ?>
35
  </label>
36
  </li>
37
  <li>
38
+ <input type="radio"
39
+ id="view-layout-grid"
40
+ name="view[data][layout]"
41
+ value="grid" <?php checked( 'grid', $view['layout'] ); ?>>
42
  <label for="view-layout-grid">
43
+ <?php _e( 'grid', 'strong-testimonials' ); ?>
44
  </label>
45
  </li>
46
  </ul>
47
  </div>
48
 
49
  <!-- Layout Info -->
50
+ <div>
51
+ <div class="radio-description" id="view-layout-info">
52
 
53
  <div class="layout-description view-layout-normal">
54
+ <p><?php _e( 'A single column.', 'strong-testimonials' ); ?></p>
55
+ </div>
56
 
57
+ <div class="layout-description view-layout-masonry">
58
+ <p><?php printf( __( 'A cascading, responsive grid using the jQuery plugin <a href="%s" target="_blank">Masonry</a>.', 'strong-testimonials' ), esc_url( 'http://masonry.desandro.com/' ) ); ?></p>
59
+ <p><?php _e( 'The universal solution that works well regardless of testimonial lengths.', 'strong-testimonials' ); ?></p>
60
+ <p><?php _e( 'Not compatible with pagination.', 'strong-testimonials' ); ?></p>
61
+ </div>
62
 
63
+ <div class="layout-description view-layout-columns">
64
+ <p><?php printf( __( 'Using <a href="%s" target="_blank">CSS multi-column</a>. Fill from top to bottom, then over to next column.', 'strong-testimonials' ), esc_url( 'https://css-tricks.com/guide-responsive-friendly-css-columns/' ) ); ?></p>
65
+ <p><?php _e( 'Works well with both long and short testimonials.', 'strong-testimonials' ); ?></p>
66
+ <p><?php _e( 'Compatible with pagination.', 'strong-testimonials' ); ?></p>
67
+ </div>
68
 
69
+ <div class="layout-description view-layout-grid">
70
+ <p><?php
 
71
  $url = 'https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties';
72
+ printf( __( 'Using <a href="%s" target="_blank">CSS flexbox</a>.', 'strong-testimonials' ), esc_url( $url ) );
73
+ ?></p>
74
+ <p><?php _e( 'Testimonials will be equal height so this works best when they are about the same length either naturally or using excerpts.', 'strong-testimonials' ); ?></p>
75
+ <p><?php _e( 'Compatible with pagination.', 'strong-testimonials' ); ?></p>
76
+ </div>
 
77
 
78
+ </div>
79
 
80
+ <!-- Column selector -->
81
+ <div class="radio-description options" id="column-count-wrapper">
82
+ <div>
83
+ <label for="view-column-count"><?php _e( 'Number of columns', 'strong-testimonials' ); ?></label>
84
+ <select id="view-column-count" name="view[data][column_count]">
85
+ <option value="2" <?php selected( $view['column_count'], 2 ); ?>>2</option>
86
+ <option value="3" <?php selected( $view['column_count'], 3 ); ?>>3</option>
87
+ <option value="4" <?php selected( $view['column_count'], 4 ); ?>>4</option>
88
+ </select>
89
+ </div>
90
+ </div>
91
+ </div>
92
 
93
+ <!-- Examples -->
94
+ <div>
95
+ <div class="layout-example view-layout-normal">
96
  <div class="example-container">
97
  <div class="box"><span>1</span></div>
98
  <div class="box size2"><span>2</span></div>
101
  <div class="box"><span>5</span></div>
102
  </div>
103
  </div>
104
+ <div class="layout-example view-layout-masonry">
105
  <div class="example-container col-2">
106
  <div class="grid-sizer"></div>
107
  <div class="box"><span>1</span></div>
115
  <div class="box"><span>9</span></div>
116
  </div>
117
  </div>
118
+ <div class="layout-example view-layout-columns">
119
  <div class="example-container col-2">
120
  <div class="box"><span>1</span></div>
121
  <div class="box size2"><span>2</span></div>
128
  <div class="box"><span>9</span></div>
129
  </div>
130
  </div>
131
+ <div class="layout-example view-layout-grid">
132
  <div class="example-container col-2">
133
  <div class="box"><span>1</span></div>
134
  <div class="box"><span>2</span></div>
admin/partials/views/option-limit.php CHANGED
@@ -1,31 +1,33 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-all">
4
- <?php esc_html_e( 'Quantity', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="row">
9
- <div class="inline">
10
- <select class="if select" id="view-all" name="view[data][all]">
11
- <option value="1" <?php selected( -1, $view['count'] ); ?>>
12
- <?php esc_html_e( 'all', 'strong-testimonials' ); ?>
13
- </option>
14
- <option class="trip" value="0" <?php selected( $view['count'] > 0 ); ?>>
15
- <?php echo esc_html_x( 'count', 'noun', 'strong-testimonials' ); ?>
16
- </option>
17
- </select>
18
- &nbsp;
19
- <label>
20
- <input class="input-incremental then_all" type="number" id="view-count" name="view[data][count]" value="<?php echo ( -1 == $view['count'] ) ? 1 : esc_attr( $view['count'] ); ?>" min="1" size="5" style="display: none;">
21
- </label>
22
- </div>
 
 
23
  </div>
24
  </td>
25
  <td class="divider">
26
- <p><?php echo wp_kses_post( _e( '<code>count</code>', 'strong-testimonials' ) ); ?></p>
27
  </td>
28
  <td></td>
29
  <td>
30
- <p><?php echo wp_kses_post( _e( '<code>count=5</code>', 'strong-testimonials' ) ); ?></p>
31
- </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-all">
4
+ <?php _e( 'Quantity', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="row">
9
+ <div class="inline">
10
+ <select class="if select" id="view-all" name="view[data][all]">
11
+ <option value="1" <?php selected( -1, $view['count'] ); ?>>
12
+ <?php _e( 'all', 'strong-testimonials' ); ?>
13
+ </option>
14
+ <option class="trip" value="0" <?php selected( $view['count'] > 0 ); ?>>
15
+ <?php _ex( 'count', 'noun', 'strong-testimonials' ); ?>
16
+ </option>
17
+ </select>
18
+ &nbsp;
19
+ <label>
20
+ <input class="input-incremental then_all" type="number" id="view-count"
21
+ name="view[data][count]" value="<?php echo ( -1 == $view['count'] ) ? 1 : $view['count']; ?>"
22
+ min="1" size="5" style="display: none;">
23
+ </label>
24
+ </div>
25
  </div>
26
  </td>
27
  <td class="divider">
28
+ <p><?php _e( '<code>count</code>', 'strong-testimonials' ); ?></p>
29
  </td>
30
  <td></td>
31
  <td>
32
+ <p><?php _e( '<code>count=5</code>', 'strong-testimonials' ); ?></p>
33
+ </td>
admin/partials/views/option-order.php CHANGED
@@ -1,26 +1,26 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-order">
4
- <?php echo esc_html_x( 'Order', 'noun', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="row">
9
- <div class="inline">
10
  <select id="view-order" name="view[data][order]">
11
  <?php foreach ( $view_options['order'] as $order => $order_label ) : ?>
12
- <option value="<?php echo esc_attr( $order ); ?>" <?php selected( $order, $view['order'] ); ?>><?php echo esc_html( $order_label ); ?></option>
13
  <?php endforeach; ?>
14
  </select>
15
  </div>
16
  </div>
17
  </td>
18
  <td class="divider">
19
- <p><?php echo wp_kses_post( _e( '<code>order</code>', 'strong-testimonials' ) ); ?></p>
20
  </td>
21
  <td>
22
- <p><?php echo wp_kses_post( _e( 'oldest | newest | random | menu_order', 'strong-testimonials' ) ); ?></p>
23
  </td>
24
  <td>
25
- <p><?php echo wp_kses_post( _e( '<code>order="random"</code>', 'strong-testimonials' ) ); ?></p>
26
- </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
  <label for="view-order">
4
+ <?php _ex( 'Order', 'noun', 'strong-testimonials' ); ?>
5
  </label>
6
  </th>
7
  <td>
8
  <div class="row">
9
+ <div class="inline">
10
  <select id="view-order" name="view[data][order]">
11
  <?php foreach ( $view_options['order'] as $order => $order_label ) : ?>
12
+ <option value="<?php echo $order; ?>" <?php selected( $order, $view['order'] ); ?>><?php echo $order_label; ?></option>
13
  <?php endforeach; ?>
14
  </select>
15
  </div>
16
  </div>
17
  </td>
18
  <td class="divider">
19
+ <p><?php _e( '<code>order</code>', 'strong-testimonials' ); ?></p>
20
  </td>
21
  <td>
22
+ <p><?php _e( 'oldest | newest | random | menu_order', 'strong-testimonials' ); ?></p>
23
  </td>
24
  <td>
25
+ <p><?php _e( '<code>order="random"</code>', 'strong-testimonials' ); ?></p>
26
+ </td>
admin/partials/views/option-pagination.php CHANGED
@@ -1,145 +1,165 @@
1
  <?php
2
- $links = '<span class="help-links">';
3
  $links .= '<a href="#tab-panel-wpmtst-help-pagination" class="open-help-tab">' . __( 'Help' ) . '</a>';
4
  $links .= '</span>';
5
  ?>
6
  <?php /* translators: On the Views admin screen. */ ?>
7
  <th>
8
- <input class="if toggle checkbox" id="view-pagination" name="view[data][pagination]"
9
- type="checkbox" value="1" <?php checked( $view['pagination'] ); ?>/>
10
- <label for="view-pagination">
11
- <?php esc_html_e( 'Pagination', 'strong-testimonials' ); ?>
12
- </label>
13
  </th>
14
  <td>
15
- <div class="row then then_pagination" style="display: none;">
16
- <div class="row-inner">
17
- <div class="inline">
18
- <label for="view-pagination_type">
19
- <select class="if selectper" id="view-pagination_type" name="view[data][pagination_settings][type]">
20
- <option value="simple" <?php selected( 'simple', $view['pagination_settings']['type'] ); ?>>
21
- <?php esc_html_e( 'simple', 'strong-testimonials' ); ?>
22
- </option>
23
- <option value="standard" <?php selected( 'standard', $view['pagination_settings']['type'] ); ?>>
24
- <?php esc_html_e( 'WordPress standard', 'strong-testimonials' ); ?>
25
- </option>
26
- </select>
27
- </label>
28
- </div>
29
- <div class="inline then fast then_simple then_not_standard" style="display: none;">
30
- <p class="description">
31
- <?php esc_html_e( 'Using JavaScript. Intended for small scale.', 'strong-testimonials' ); ?>
32
- <?php echo wp_kses_post( $links ); ?>
33
- </p>
34
- </div>
35
- <div class="inline then fast then_not_simple then_standard" style="display: none;">
36
- <p class="description">
37
- <?php esc_html_e( 'Using paged URLs: /page/2, /page/3, etc. Best for large scale.', 'strong-testimonials' ); ?>
38
- <?php echo wp_kses_post( $links ); ?>
39
- </p>
40
- </div>
41
- </div>
42
- </div>
43
 
44
- <div class="row then then_pagination" style="display: none;">
45
- <div class="row-inner">
46
- <div class="inline">
47
- <label for="view-per_page">
48
- <?php echo esc_html_x( 'Per page', 'quantity', 'strong-testimonials' ); ?>
49
- </label>
50
- <input class="input-incremental" id="view-per_page" name="view[data][pagination_settings][per_page]" type="number" min="1" step="1" value="<?php echo esc_attr( $view['pagination_settings']['per_page'] ); ?>"/>
51
- </div>
 
 
 
52
 
53
- <div class="inline">
54
- <label for="view-nav">
55
- <?php esc_html_e( 'Navigation', 'strong-testimonials' ); ?>
56
- </label>
57
- <select id="view-nav" name="view[data][pagination_settings][nav]">
58
- <option value="before" <?php selected( $view['pagination_settings']['nav'], 'before' ); ?>>
59
- <?php esc_html_e( 'before', 'strong-testimonials' ); ?>
60
- </option>
61
- <option value="after" <?php selected( $view['pagination_settings']['nav'], 'after' ); ?>>
62
- <?php esc_html_e( 'after', 'strong-testimonials' ); ?>
63
- </option>
64
- <option value="before,after" <?php selected( $view['pagination_settings']['nav'], 'before,after' ); ?>>
65
- <?php esc_html_e( 'before & after', 'strong-testimonials' ); ?>
66
- </option>
67
- </select>
68
- </div>
69
- </div>
70
 
71
- <div class="row then then_not_simple then_standard" style="display: none;">
72
- <div class="row-inner">
73
- <div class="inline">
74
- <label for="view-pagination-show_all">
75
- <select class="if select" id="view-pagination-show_all"
76
- name="view[data][pagination_settings][show_all]">
77
- <option value="on" <?php selected( $view['pagination_settings']['show_all'] ); ?>>
78
- <?php esc_html_e( 'Show all page numbers', 'strong-testimonials' ); ?>
79
- </option>
80
- <option value="off" <?php selected( ! $view['pagination_settings']['show_all'] ); ?> class="trip">
81
- <?php esc_html_e( 'Show condensed page numbers', 'strong-testimonials' ); ?>
82
- </option>
83
- </select>
84
- </label>
85
- </div>
86
- <div class="inline then then_show_all" style="display: none;">
87
- <div class="inline">
88
- <label for="view-pagination-end_size">
89
- <?php echo esc_html_x( 'End size', 'quantity', 'strong-testimonials' ); ?>
90
- </label>
91
- <input class="input-incremental" id="view-pagination-end_size" name="view[data][pagination_settings][end_size]" type="number" min="1" step="1" value="<?php echo esc_attr( $view['pagination_settings']['end_size'] ); ?>"/>
92
- </div>
93
- <div class="inline">
94
- <label for="view-pagination-mid_size">
95
- <?php echo esc_html_x( 'Middle size', 'quantity', 'strong-testimonials' ); ?>
96
- </label>
97
- <input class="input-incremental" id="view-pagination-mid_size" name="view[data][pagination_settings][mid_size]" type="number" min="1" step="1" value="<?php echo esc_attr( $view['pagination_settings']['mid_size'] ); ?>"/>
98
- </div>
99
- </div>
100
- </div>
101
- </div>
 
 
 
 
 
 
 
102
 
103
- <div class="row then then_not_simple then_standard" style="display: none;">
104
- <div class="row-inner">
105
- <div class="inline inline-middle">
106
- <input class="if toggle checkbox" id="view-pagination-prev_next" name="view[data][pagination_settings][prev_next]" type="checkbox" value="1" <?php checked( $view['pagination_settings']['prev_next'] ); ?>>
107
- <label for="view-pagination-prev_next">
108
- <?php esc_html_e( 'Show previous/next links', 'strong-testimonials' ); ?>
109
- </label>
110
- </div>
111
- <div class="then then_prev_next inline inline-middle">
112
- <label for="view-pagination-prev_text">
113
- <?php esc_html_e( 'Previous text', 'strong-testimonials' ); ?>
114
- </label>
115
- <input class="code" id="view-pagination-prev_text" name="view[data][pagination_settings][prev_text]" type="text" value="<?php echo htmlentities( $view['pagination_settings']['prev_text'] ); ?>">
116
- </div>
117
- <div class="then then_prev_next inline inline-middle">
118
- <label for="view-pagination-next_text">
119
- <?php esc_html_e( 'Next text', 'strong-testimonials' ); ?>
120
- </label>
121
- <input class="code" id="view-pagination-next_text" name="view[data][pagination_settings][next_text]" type="text" value="<?php echo htmlentities( $view['pagination_settings']['next_text'] ); ?>">
122
- </div>
123
- </div>
124
- </div>
 
 
 
 
 
 
125
 
126
- <div class="row then then_not_simple then_standard" style="display: none;">
127
- <div class="row-inner">
128
- <div class="inline">
129
- <label for="view-pagination-before_page_number">
130
- <?php esc_html_e( 'Before page number', 'strong-testimonials' ); ?>
131
- </label>
132
- <input class="small-text" id="view-pagination-before_page_number" name="view[data][pagination_settings][before_page_number]" type="text" value="<?php echo esc_attr( $view['pagination_settings']['before_page_number'] ); ?>">
133
- </div>
134
- <div class="inline">
135
- <label for="view-pagination-after_page_number">
136
- <?php esc_html_e( 'After page number', 'strong-testimonials' ); ?>
137
- </label>
138
- <input class="small-text" id="view-pagination-after_page_number" name="view[data][pagination_settings][after_page_number]" type="text" value="<?php echo esc_attr( $view['pagination_settings']['after_page_number'] ); ?>">
139
- </div>
140
- </div>
141
- </div>
142
- </div>
 
 
 
 
143
 
144
  <?php do_action( 'wpmtst_view_editor_pagination_row_end' ); ?>
145
  </td>
1
  <?php
2
+ $links = '<span class="help-links">';
3
  $links .= '<a href="#tab-panel-wpmtst-help-pagination" class="open-help-tab">' . __( 'Help' ) . '</a>';
4
  $links .= '</span>';
5
  ?>
6
  <?php /* translators: On the Views admin screen. */ ?>
7
  <th>
8
+ <input class="if toggle checkbox" id="view-pagination" name="view[data][pagination]"
9
+ type="checkbox" value="1" <?php checked( $view['pagination'] ); ?>/>
10
+ <label for="view-pagination">
11
+ <?php _e( 'Pagination', 'strong-testimonials' ); ?>
12
+ </label>
13
  </th>
14
  <td>
15
+ <div class="row then then_pagination" style="display: none;">
16
+ <div class="row-inner">
17
+ <div class="inline">
18
+ <label for="view-pagination_type">
19
+ <select class="if selectper" id="view-pagination_type" name="view[data][pagination_settings][type]">
20
+ <option value="simple" <?php selected( 'simple', $view['pagination_settings']['type'] ); ?>>
21
+ <?php _e( 'simple', 'strong-testimonials' ); ?>
22
+ </option>
23
+ <option value="standard" <?php selected( 'standard', $view['pagination_settings']['type'] ); ?>>
24
+ <?php _e( 'WordPress standard', 'strong-testimonials' ); ?>
25
+ </option>
26
+ </select>
27
+ </label>
28
+ </div>
29
+ <div class="inline then fast then_simple then_not_standard" style="display: none;">
30
+ <p class="description">
31
+ <?php _e( 'Using JavaScript. Intended for small scale.', 'strong-testimonials' ); ?>
32
+ <?php echo $links; ?>
33
+ </p>
34
+ </div>
35
+ <div class="inline then fast then_not_simple then_standard" style="display: none;">
36
+ <p class="description">
37
+ <?php _e( 'Using paged URLs: /page/2, /page/3, etc. Best for large scale.', 'strong-testimonials' ); ?>
38
+ <?php echo $links; ?>
39
+ </p>
40
+ </div>
41
+ </div>
42
+ </div>
43
 
44
+ <div class="row then then_pagination" style="display: none;">
45
+ <div class="row-inner">
46
+ <div class="inline">
47
+ <label for="view-per_page">
48
+ <?php _ex( 'Per page', 'quantity', 'strong-testimonials' ); ?>
49
+ </label>
50
+ <input class="input-incremental" id="view-per_page"
51
+ name="view[data][pagination_settings][per_page]"
52
+ type="number" min="1" step="1"
53
+ value="<?php echo $view['pagination_settings']['per_page']; ?>"/>
54
+ </div>
55
 
56
+ <div class="inline">
57
+ <label for="view-nav">
58
+ <?php _e( 'Navigation', 'strong-testimonials' ); ?>
59
+ </label>
60
+ <select id="view-nav" name="view[data][pagination_settings][nav]">
61
+ <option value="before" <?php selected( $view['pagination_settings']['nav'], 'before' ); ?>>
62
+ <?php _e( 'before', 'strong-testimonials' ); ?>
63
+ </option>
64
+ <option value="after" <?php selected( $view['pagination_settings']['nav'], 'after' ); ?>>
65
+ <?php _e( 'after', 'strong-testimonials' ); ?>
66
+ </option>
67
+ <option value="before,after" <?php selected( $view['pagination_settings']['nav'], 'before,after' ); ?>>
68
+ <?php _e( 'before & after', 'strong-testimonials' ); ?>
69
+ </option>
70
+ </select>
71
+ </div>
72
+ </div>
73
 
74
+ <div class="row then then_not_simple then_standard" style="display: none;">
75
+ <div class="row-inner">
76
+ <div class="inline">
77
+ <label for="view-pagination-show_all">
78
+ <select class="if select" id="view-pagination-show_all"
79
+ name="view[data][pagination_settings][show_all]">
80
+ <option value="on" <?php selected( $view['pagination_settings']['show_all'] ); ?>>
81
+ <?php _e( 'Show all page numbers', 'strong-testimonials' ); ?>
82
+ </option>
83
+ <option value="off" <?php selected( ! $view['pagination_settings']['show_all'] ); ?>
84
+ class="trip">
85
+ <?php _e( 'Show condensed page numbers', 'strong-testimonials' ); ?>
86
+ </option>
87
+ </select>
88
+ </label>
89
+ </div>
90
+ <div class="inline then then_show_all" style="display: none;">
91
+ <div class="inline">
92
+ <label for="view-pagination-end_size">
93
+ <?php _ex( 'End size', 'quantity', 'strong-testimonials' ); ?>
94
+ </label>
95
+ <input class="input-incremental" id="view-pagination-end_size"
96
+ name="view[data][pagination_settings][end_size]"
97
+ type="number" min="1" step="1"
98
+ value="<?php echo $view['pagination_settings']['end_size']; ?>"/>
99
+ </div>
100
+ <div class="inline">
101
+ <label for="view-pagination-mid_size">
102
+ <?php _ex( 'Middle size', 'quantity', 'strong-testimonials' ); ?>
103
+ </label>
104
+ <input class="input-incremental" id="view-pagination-mid_size"
105
+ name="view[data][pagination_settings][mid_size]"
106
+ type="number" min="1" step="1"
107
+ value="<?php echo $view['pagination_settings']['mid_size']; ?>"/>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
 
113
+ <div class="row then then_not_simple then_standard" style="display: none;">
114
+ <div class="row-inner">
115
+ <div class="inline inline-middle">
116
+ <input class="if toggle checkbox" id="view-pagination-prev_next"
117
+ name="view[data][pagination_settings][prev_next]"
118
+ type="checkbox" value="1" <?php checked( $view['pagination_settings']['prev_next'] ); ?>>
119
+ <label for="view-pagination-prev_next">
120
+ <?php _e( 'Show previous/next links', 'strong-testimonials' ); ?>
121
+ </label>
122
+ </div>
123
+ <div class="then then_prev_next inline inline-middle">
124
+ <label for="view-pagination-prev_text">
125
+ <?php _e( 'Previous text', 'strong-testimonials' ); ?>
126
+ </label>
127
+ <input class="code" id="view-pagination-prev_text"
128
+ name="view[data][pagination_settings][prev_text]"
129
+ type="text" value="<?php echo htmlentities( $view['pagination_settings']['prev_text'] ); ?>">
130
+ </div>
131
+ <div class="then then_prev_next inline inline-middle">
132
+ <label for="view-pagination-next_text">
133
+ <?php _e( 'Next text', 'strong-testimonials' ); ?>
134
+ </label>
135
+ <input class="code" id="view-pagination-next_text"
136
+ name="view[data][pagination_settings][next_text]"
137
+ type="text" value="<?php echo htmlentities( $view['pagination_settings']['next_text'] ); ?>">
138
+ </div>
139
+ </div>
140
+ </div>
141
 
142
+ <div class="row then then_not_simple then_standard" style="display: none;">
143
+ <div class="row-inner">
144
+ <div class="inline">
145
+ <label for="view-pagination-before_page_number">
146
+ <?php _e( 'Before page number', 'strong-testimonials' ); ?>
147
+ </label>
148
+ <input class="small-text" id="view-pagination-before_page_number"
149
+ name="view[data][pagination_settings][before_page_number]"
150
+ type="text" value="<?php echo $view['pagination_settings']['before_page_number']; ?>">
151
+ </div>
152
+ <div class="inline">
153
+ <label for="view-pagination-after_page_number">
154
+ <?php _e( 'After page number', 'strong-testimonials' ); ?>
155
+ </label>
156
+ <input class="small-text" id="view-pagination-after_page_number"
157
+ name="view[data][pagination_settings][after_page_number]"
158
+ type="text" value="<?php echo $view['pagination_settings']['after_page_number']; ?>">
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
 
164
  <?php do_action( 'wpmtst_view_editor_pagination_row_end' ); ?>
165
  </td>
admin/partials/views/option-read-more-page.php CHANGED
@@ -5,9 +5,9 @@
5
  <th>
6
  <div class="checkbox">
7
  <input type="checkbox" id="view-more_page" class="if toggle" name="view[data][more_page]" value="1"
8
- <?php checked( isset( $view['more_page'] ) && $view['more_page'] ); ?> class="checkbox">
9
  <label for="view-more_page">
10
- <?php esc_html_e( '"Read more" link to a page or post', 'strong-testimonials' ); ?>
11
  </label>
12
  </div>
13
  </th>
@@ -20,34 +20,34 @@
20
  <label>
21
  <select id="view-page" name="view[data][more_page_id]">
22
  <option value=""><?php _e( '&mdash; select &mdash;' ); ?></option>
23
- <?php
24
- do_action( 'wpmtst_readmore_page_list', $view );
25
- if ( $custom_list ) {
26
- ?>
27
- <optgroup label="<?php esc_html_e( 'Custom', 'strong-testimonials' ); ?>">
28
- <?php
29
- foreach ( $custom_list as $page ) {
30
- echo wp_kses_post( $page );
31
  }
32
- ?>
33
- </optgroup>
34
- <?php
35
  }
36
- ?>
37
- <optgroup label="<?php esc_attr_e( 'Pages' ); ?>">
38
  <?php foreach ( $pages_list as $pages ) : ?>
39
- <option value="<?php echo esc_attr( $pages->ID ); ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $pages->ID ); ?>><?php echo esc_html( $pages->post_title ); ?></option>
40
  <?php endforeach; ?>
41
  </optgroup>
42
- <optgroup label="<?php esc_attr_e( 'Posts' ); ?>">
43
  <?php foreach ( $posts_list as $posts ) : ?>
44
- <option value="<?php echo esc_attr( $posts->ID ); ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $posts->ID ); ?>><?php echo esc_html( $posts->post_title ); ?></option>
45
  <?php endforeach; ?>
46
  </optgroup>
47
  </select>
48
  </label>
49
  <label for="view-page_id2">
50
- <?php echo esc_html_x( 'or enter its ID or slug', 'to select a target page', 'strong-testimonials' ); ?>
51
  </label>
52
  <input type="text" id="view-page_id2" name="view[data][more_page_id2]" size="30">
53
  </div>
@@ -58,9 +58,10 @@
58
  <div class="row-inner">
59
  <div class="inline">
60
  <label for="view-more_page_text">
61
- <?php esc_html_e( 'with link text', 'strong-testimonials' ); ?>
62
  </label>
63
- <input type="text" id="view-more_page_text" name="view[data][more_page_text]" value="<?php echo esc_attr( $view['more_page_text'] ); ?>" size="50">
 
64
  </div>
65
  </div>
66
  </div>
@@ -71,10 +72,10 @@
71
  <label>
72
  <select id="view-more_page_hook" name="view[data][more_page_hook]">
73
  <option value="wpmtst_view_footer" <?php selected( 'wpmtst_view_footer', $view['more_page_hook'] ); ?>>
74
- <?php echo esc_html_x( 'after the last testimonial', 'display setting', 'strong-testimonials' ); ?>
75
  </option>
76
  <option value="wpmtst_after_testimonial" <?php selected( 'wpmtst_after_testimonial', $view['more_page_hook'] ); ?>>
77
- <?php echo esc_html_x( 'in each testimonial', 'display setting', 'strong-testimonials' ); ?>
78
  </option>
79
  </select>
80
  </label>
5
  <th>
6
  <div class="checkbox">
7
  <input type="checkbox" id="view-more_page" class="if toggle" name="view[data][more_page]" value="1"
8
+ <?php checked( isset( $view['more_page'] ) && $view['more_page'] );?> class="checkbox">
9
  <label for="view-more_page">
10
+ <?php _e( '"Read more" link to a page or post', 'strong-testimonials' ); ?>
11
  </label>
12
  </div>
13
  </th>
20
  <label>
21
  <select id="view-page" name="view[data][more_page_id]">
22
  <option value=""><?php _e( '&mdash; select &mdash;' ); ?></option>
23
+ <?php
24
+ do_action( 'wpmtst_readmore_page_list', $view );
25
+ if ( $custom_list ) {
26
+ ?>
27
+ <optgroup label="<?php _e( 'Custom', 'strong-testimonials' ); ?>">
28
+ <?php
29
+ foreach ( $custom_list as $page ) {
30
+ echo $page;
31
  }
32
+ ?>
33
+ </optgroup>
34
+ <?php
35
  }
36
+ ?>
37
+ <optgroup label="<?php _e( 'Pages' ); ?>">
38
  <?php foreach ( $pages_list as $pages ) : ?>
39
+ <option value="<?php echo $pages->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $pages->ID ); ?>><?php echo $pages->post_title; ?></option>
40
  <?php endforeach; ?>
41
  </optgroup>
42
+ <optgroup label="<?php _e( 'Posts' ); ?>">
43
  <?php foreach ( $posts_list as $posts ) : ?>
44
+ <option value="<?php echo $posts->ID; ?>" <?php selected( isset( $view['more_page_id'] ) ? $view['more_page_id'] : 0, $posts->ID ); ?>><?php echo $posts->post_title; ?></option>
45
  <?php endforeach; ?>
46
  </optgroup>
47
  </select>
48
  </label>
49
  <label for="view-page_id2">
50
+ <?php _ex( 'or enter its ID or slug', 'to select a target page', 'strong-testimonials' ); ?>
51
  </label>
52
  <input type="text" id="view-page_id2" name="view[data][more_page_id2]" size="30">
53
  </div>
58
  <div class="row-inner">
59
  <div class="inline">
60
  <label for="view-more_page_text">
61
+ <?php _e( 'with link text', 'strong-testimonials' ); ?>
62
  </label>
63
+ <input type="text" id="view-more_page_text" name="view[data][more_page_text]"
64
+ value="<?php echo $view['more_page_text']; ?>" size="50">
65
  </div>
66
  </div>
67
  </div>
72
  <label>
73
  <select id="view-more_page_hook" name="view[data][more_page_hook]">
74
  <option value="wpmtst_view_footer" <?php selected( 'wpmtst_view_footer', $view['more_page_hook'] ); ?>>
75
+ <?php _ex( 'after the last testimonial', 'display setting', 'strong-testimonials' ); ?>
76
  </option>
77
  <option value="wpmtst_after_testimonial" <?php selected( 'wpmtst_after_testimonial', $view['more_page_hook'] ); ?>>
78
+ <?php _ex( 'in each testimonial', 'display setting', 'strong-testimonials' ); ?>
79
  </option>
80
  </select>
81
  </label>
admin/partials/views/option-select.php CHANGED
@@ -1,29 +1,29 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <label for="view-single_or_multiple"><?php echo esc_html_x( 'Select', 'verb', 'strong-testimonials' ); ?></label>
4
  </th>
5
  <td>
6
 
7
  <div class="row">
8
  <div class="row-inner">
9
  <select id="view-single_or_multiple" class="if selectper" name="view[data][select]">
10
- <option value="multiple" <?php echo (int) $view['id'] == 0 ? 'selected' : ''; ?>><?php esc_html_e( 'one or more testimonials', 'strong-testimonials' ); ?></option>
11
- <option value="single" <?php echo (int) $view['id'] >= 1 ? 'selected' : ''; ?>><?php esc_html_e( 'a specific testimonial', 'strong-testimonials' ); ?></option>
12
  </select>
13
  </div>
14
  </div>
15
 
16
  <div class="row">
17
- <?php require 'option-id.php'; ?>
18
  </div>
19
 
20
  </td>
21
  <td class="divider">
22
- <p><?php echo wp_kses_post( _e( '<code>post_ids</code>', 'strong-testimonials' ) ); ?></p>
23
  </td>
24
  <td>
25
- <p><?php echo wp_kses_post( _e( 'a comma-separated list of post ID\'s', 'strong-testimonials' ) ); ?></p>
26
  </td>
27
  <td>
28
- <p><?php echo wp_kses_post( _e( '<code>post_ids="123,456"</code>', 'strong-testimonials' ) ); ?></p>
29
- </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <label for="view-single_or_multiple"><?php _ex( 'Select', 'verb', 'strong-testimonials' ); ?></label>
4
  </th>
5
  <td>
6
 
7
  <div class="row">
8
  <div class="row-inner">
9
  <select id="view-single_or_multiple" class="if selectper" name="view[data][select]">
10
+ <option value="multiple" <?php echo (int) $view['id'] == 0 ? 'selected' : ''; ?>><?php _e( 'one or more testimonials', 'strong-testimonials' ); ?></option>
11
+ <option value="single" <?php echo (int) $view['id'] >= 1 ? 'selected' : ''; ?>><?php _e( 'a specific testimonial', 'strong-testimonials' ); ?></option>
12
  </select>
13
  </div>
14
  </div>
15
 
16
  <div class="row">
17
+ <?php include( 'option-id.php' ); ?>
18
  </div>
19
 
20
  </td>
21
  <td class="divider">
22
+ <p><?php _e( '<code>post_ids</code>' , 'strong-testimonials' ); ?></p>
23
  </td>
24
  <td>
25
+ <p><?php _e( 'a comma-separated list of post ID\'s' , 'strong-testimonials' ); ?></p>
26
  </td>
27
  <td>
28
+ <p><?php _e( '<code>post_ids="123,456"</code>', 'strong-testimonials' ); ?></p>
29
+ </td>
admin/partials/views/option-slideshow-behavior.php CHANGED
@@ -1,23 +1,25 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Behavior', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
 
7
- <div class="row">
8
  <div class="inline inline-middle">
9
- <input type="checkbox" id="view-auto_start" name="view[data][slideshow_settings][auto_start]" value="0" <?php checked( $view['slideshow_settings']['auto_start'] ); ?> class="checkbox">
 
10
  <label for="view-auto_start">
11
- <?php echo esc_html_x( 'Start automatically', 'slideshow setting', 'strong-testimonials' ); ?>
12
  </label>
13
  </div>
14
  </div>
15
 
16
  <div class="row">
17
  <div class="inline inline-middle">
18
- <input type="checkbox" id="view-auto_hover" name="view[data][slideshow_settings][auto_hover]" value="0" <?php checked( $view['slideshow_settings']['auto_hover'] ); ?> class="checkbox">
 
19
  <label for="view-auto_hover">
20
- <?php echo esc_html_x( 'Pause on hover', 'slideshow setting', 'strong-testimonials' ); ?>
21
  </label>
22
  </div>
23
  </div>
@@ -25,14 +27,14 @@
25
  <div class="row">
26
  <div class="inline inline-middle">
27
  <input type="checkbox" id="view-stop_auto_on_click"
28
- name="view[data][slideshow_settings][stop_auto_on_click]" value="0"
29
  <?php checked( $view['slideshow_settings']['stop_auto_on_click'] ); ?> class="checkbox">
30
  <label for="view-stop_auto_on_click">
31
- <?php echo esc_html_x( 'Stop on interaction', 'slideshow setting', 'strong-testimonials' ); ?>
32
  </label>
33
  </div>
34
  <div class="inline inline-middle">
35
- <p class="description"><?php esc_html_e( 'Recommended if using navigation.', 'strong-testimonials' ); ?></p>
36
  </div>
37
  </div>
38
 
@@ -41,7 +43,7 @@
41
  $height = 'dynamic';
42
  } else {
43
  $height = 'static';
44
- }
45
  ?>
46
  <div class="row">
47
  <div class="row-inner">
@@ -50,8 +52,9 @@
50
  <label for="view-slideshow_height">
51
  <select id="view-slideshow_height" name="view[data][slideshow_settings][height]" class="if selectgroup">
52
  <?php foreach ( $view_options['slideshow_height'] as $key => $type ) : ?>
53
- <option value="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" <?php selected( $height, $key ); ?>>
54
- <?php echo esc_html( $type ); ?>
 
55
  </option>
56
  <?php endforeach; ?>
57
  </select>
@@ -60,28 +63,31 @@
60
 
61
  <div class="inline then then_slideshow_height then_dynamic then_not_static" style="display: none;">
62
  <label for="view-adapt_height_speed">
63
- <?php esc_html_e( 'Duration', 'strong-testimonials' ); ?>
64
  </label>
65
- <input type="number" id="view-adapt_height_speed" class="input-incremental" name="view[data][slideshow_settings][adapt_height_speed]" min="0" step="0.1" value="<?php echo esc_attr( $view['slideshow_settings']['adapt_height_speed'] ); ?>" size="3"/>
66
- <?php echo esc_html_x( 'seconds', 'time setting', 'strong-testimonials' ); ?>
 
 
67
  </div>
68
 
69
  <div class="inline then then_slideshow_height then_not_dynamic then_static" style="display: none;">
70
- <input type="checkbox" id="view-stretch" name="view[data][slideshow_settings][stretch]" value="1" <?php checked( $view['slideshow_settings']['stretch'] ); ?> class="checkbox">
 
71
  <label for="view-stretch">
72
- <?php esc_html_e( 'Stretch slides vertically', 'strong-testimonials' ); ?>
73
  </label>
74
 
75
  <div class="inline description">
76
- <a href="#tab-panel-wpmtst-help-stretch" class="open-help-tab"><?php esc_html_e( 'Help' ); ?></a>
77
  </div>
78
  </div>
79
 
80
  </div>
81
  </div>
82
 
83
- <div class="row tall">
84
- <p class="description"><?php esc_html_e( 'The slideshow will pause if the browser window becomes inactive.', 'strong-testimonials' ); ?></p>
85
- </div>
86
 
87
  </td>
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
+ <?php _e( 'Behavior', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
 
7
+ <div class="row">
8
  <div class="inline inline-middle">
9
+ <input type="checkbox" id="view-auto_start" name="view[data][slideshow_settings][auto_start]" value="0"
10
+ <?php checked( $view['slideshow_settings']['auto_start'] ); ?> class="checkbox">
11
  <label for="view-auto_start">
12
+ <?php _ex( 'Start automatically', 'slideshow setting', 'strong-testimonials' ); ?>
13
  </label>
14
  </div>
15
  </div>
16
 
17
  <div class="row">
18
  <div class="inline inline-middle">
19
+ <input type="checkbox" id="view-auto_hover" name="view[data][slideshow_settings][auto_hover]" value="0"
20
+ <?php checked( $view['slideshow_settings']['auto_hover'] ); ?> class="checkbox">
21
  <label for="view-auto_hover">
22
+ <?php _ex( 'Pause on hover', 'slideshow setting', 'strong-testimonials' ); ?>
23
  </label>
24
  </div>
25
  </div>
27
  <div class="row">
28
  <div class="inline inline-middle">
29
  <input type="checkbox" id="view-stop_auto_on_click"
30
+ name="view[data][slideshow_settings][stop_auto_on_click]" value="0"
31
  <?php checked( $view['slideshow_settings']['stop_auto_on_click'] ); ?> class="checkbox">
32
  <label for="view-stop_auto_on_click">
33
+ <?php _ex( 'Stop on interaction', 'slideshow setting', 'strong-testimonials' ); ?>
34
  </label>
35
  </div>
36
  <div class="inline inline-middle">
37
+ <p class="description"><?php _e( 'Recommended if using navigation.', 'strong-testimonials' ); ?></p>
38
  </div>
39
  </div>
40
 
43
  $height = 'dynamic';
44
  } else {
45
  $height = 'static';
46
+ }
47
  ?>
48
  <div class="row">
49
  <div class="row-inner">
52
  <label for="view-slideshow_height">
53
  <select id="view-slideshow_height" name="view[data][slideshow_settings][height]" class="if selectgroup">
54
  <?php foreach ( $view_options['slideshow_height'] as $key => $type ) : ?>
55
+ <option value="<?php echo $key; ?>" id="<?php echo $key; ?>"
56
+ <?php selected( $height, $key ); ?>>
57
+ <?php echo $type; ?>
58
  </option>
59
  <?php endforeach; ?>
60
  </select>
63
 
64
  <div class="inline then then_slideshow_height then_dynamic then_not_static" style="display: none;">
65
  <label for="view-adapt_height_speed">
66
+ <?php _e( 'Duration', 'strong-testimonials' ); ?>
67
  </label>
68
+ <input type="number" id="view-adapt_height_speed" class="input-incremental"
69
+ name="view[data][slideshow_settings][adapt_height_speed]" min="0" step="0.1"
70
+ value="<?php echo $view['slideshow_settings']['adapt_height_speed']; ?>" size="3"/>
71
+ <?php _ex( 'seconds', 'time setting', 'strong-testimonials' ); ?>
72
  </div>
73
 
74
  <div class="inline then then_slideshow_height then_not_dynamic then_static" style="display: none;">
75
+ <input type="checkbox" id="view-stretch" name="view[data][slideshow_settings][stretch]" value="1"
76
+ <?php checked( $view['slideshow_settings']['stretch'] ); ?> class="checkbox">
77
  <label for="view-stretch">
78
+ <?php _e( 'Stretch slides vertically', 'strong-testimonials' ); ?>
79
  </label>
80
 
81
  <div class="inline description">
82
+ <a href="#tab-panel-wpmtst-help-stretch" class="open-help-tab"><?php _e( 'Help' ); ?></a>
83
  </div>
84
  </div>
85
 
86
  </div>
87
  </div>
88
 
89
+ <div class="row tall">
90
+ <p class="description"><?php _e( 'The slideshow will pause if the browser window becomes inactive.', 'strong-testimonials' ); ?></p>
91
+ </div>
92
 
93
  </td>
admin/partials/views/option-slideshow-breakpoints.php CHANGED
@@ -1,81 +1,95 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <div class="inline then then_slider_type then_not_show_single then_show_multiple" style="display: none;">
3
- <div class="row">
4
 
5
- <div class="inner-table is-below">
6
- <div class="inner-table-row bordered header">
7
- <div class="inner-table-cell">
8
- <?php esc_html_e( 'minimum screen width', 'strong-testimonials' ); ?>
9
- </div>
10
- <div class="inner-table-cell">
11
- <?php esc_html_e( 'show', 'strong-testimonials' ); ?>
12
- </div>
13
- <div class="inner-table-cell">
14
- <?php esc_html_e( 'margin', 'strong-testimonials' ); ?>
15
- </div>
16
- <div class="inner-table-cell">
17
- <?php esc_html_e( 'move', 'strong-testimonials' ); ?>
18
- </div>
19
- </div>
20
 
21
  <?php foreach ( $view['slideshow_settings']['breakpoints'] as $key => $breakpoint ) : ?>
22
- <div class="inner-table-row bordered">
23
 
24
- <div class="inner-table-cell">
25
- <label>
26
- <input id="view-breakpoint_<?php echo esc_attr( $key ); ?>" name="view[data][slideshow_settings][breakpoints][<?php echo esc_attr( $key ); ?>][width]" value="<?php echo esc_attr( $breakpoint['width'] ); ?>" type="number" class="input-incremental">
27
- px
28
- </label>
29
- </div>
 
 
 
30
 
31
- <div class="inner-table-cell">
32
- <label>
33
- <select id="view-max_slides_<?php echo esc_attr( $key ); ?>" name="view[data][slideshow_settings][breakpoints][<?php echo esc_attr( $key ); ?>][max_slides]" class="if selectgroup">
34
- <option value="1" <?php selected( $breakpoint['max_slides'], 1 ); ?>>1</option>
35
- <option value="2" <?php selected( $breakpoint['max_slides'], 2 ); ?>>2</option>
36
- <option value="3" <?php selected( $breakpoint['max_slides'], 3 ); ?>>3</option>
37
- <option value="4" <?php selected( $breakpoint['max_slides'], 4 ); ?>>4</option>
38
- </select>
39
- </label>
40
- <div class="option-desc singular" style="display: none;">
41
- <?php esc_html_e( 'slide', 'strong-testimonials' ); ?>
42
- </div>
43
- <div class="option-desc plural" style="display: none;">
44
- <?php esc_html_e( 'slides', 'strong-testimonials' ); ?>
45
- </div>
46
- </div>
 
 
47
 
48
- <div class="inner-table-cell">
49
- <input id="view-margin_<?php echo esc_attr( $key ); ?>" name="view[data][slideshow_settings][breakpoints][<?php echo esc_attr( $key ); ?>][margin]" value="<?php echo esc_attr( $breakpoint['margin'] ); ?>" type="number" min="1" step="1" size="3" class="input-incremental"/>
50
- px
51
- </div>
 
 
 
52
 
53
- <div class="inner-table-cell">
54
- <label>
55
- <select id="view-move_slides_<?php echo esc_attr( $key ); ?>" name="view[data][slideshow_settings][breakpoints][<?php echo esc_attr( $key ); ?>][move_slides]" class="if selectgroup">
56
- <option value="1" <?php selected( $breakpoint['move_slides'], 1 ); ?>>1</option>
57
- <option value="2" <?php selected( $breakpoint['move_slides'], 2 ); ?>>2</option>
58
- <option value="3" <?php selected( $breakpoint['move_slides'], 3 ); ?>>3</option>
59
- <option value="4" <?php selected( $breakpoint['move_slides'], 4 ); ?>>4</option>
60
- </select>
61
- </label>
62
- <div class="option-desc singular" style="display: none;">
63
- <?php esc_html_e( 'slide', 'strong-testimonials' ); ?>
64
- </div>
65
- <div class="option-desc plural" style="display: none;">
66
- <?php esc_html_e( 'slides', 'strong-testimonials' ); ?>
67
- </div>
68
- </div>
 
 
69
 
70
- </div>
71
 
72
  <?php endforeach; ?>
73
- </div>
74
 
75
- </div>
76
 
77
- <div class="is-below">
78
- <input id="restore-default-breakpoints" type="button" name="restore-default-breakpoints" value="<?php esc_attr_e( 'Restore Default Breakpoints', 'strong-testimonials' ); ?>" class="button-secondary" />
79
- <span id="restored-message"><?php esc_html_e( 'defaults restored', 'strong-testimonials' ); ?></span>
80
- </div>
 
 
 
 
81
  </div>
1
  <?php /* translators: In the view editor. */ ?>
2
  <div class="inline then then_slider_type then_not_show_single then_show_multiple" style="display: none;">
3
+ <div class="row">
4
 
5
+ <div class="inner-table is-below">
6
+ <div class="inner-table-row bordered header">
7
+ <div class="inner-table-cell">
8
+ <?php _e( 'minimum screen width', 'strong-testimonials' ); ?>
9
+ </div>
10
+ <div class="inner-table-cell">
11
+ <?php _e( 'show', 'strong-testimonials' ); ?>
12
+ </div>
13
+ <div class="inner-table-cell">
14
+ <?php _e( 'margin', 'strong-testimonials' ); ?>
15
+ </div>
16
+ <div class="inner-table-cell">
17
+ <?php _e( 'move', 'strong-testimonials' ); ?>
18
+ </div>
19
+ </div>
20
 
21
  <?php foreach ( $view['slideshow_settings']['breakpoints'] as $key => $breakpoint ) : ?>
22
+ <div class="inner-table-row bordered">
23
 
24
+ <div class="inner-table-cell">
25
+ <label>
26
+ <input id="view-breakpoint_<?php echo $key; ?>"
27
+ name="view[data][slideshow_settings][breakpoints][<?php echo $key; ?>][width]"
28
+ value="<?php echo $breakpoint['width']; ?>"
29
+ type="number"
30
+ class="input-incremental"> px
31
+ </label>
32
+ </div>
33
 
34
+ <div class="inner-table-cell">
35
+ <label>
36
+ <select id="view-max_slides_<?php echo $key; ?>"
37
+ name="view[data][slideshow_settings][breakpoints][<?php echo $key; ?>][max_slides]"
38
+ class="if selectgroup">
39
+ <option value="1" <?php selected( $breakpoint['max_slides'], 1 ); ?>>1</option>
40
+ <option value="2" <?php selected( $breakpoint['max_slides'], 2 ); ?>>2</option>
41
+ <option value="3" <?php selected( $breakpoint['max_slides'], 3 ); ?>>3</option>
42
+ <option value="4" <?php selected( $breakpoint['max_slides'], 4 ); ?>>4</option>
43
+ </select>
44
+ </label>
45
+ <div class="option-desc singular" style="display: none;">
46
+ <?php _e( 'slide', 'strong-testimonials' ); ?>
47
+ </div>
48
+ <div class="option-desc plural" style="display: none;">
49
+ <?php _e( 'slides', 'strong-testimonials' ); ?>
50
+ </div>
51
+ </div>
52
 
53
+ <div class="inner-table-cell">
54
+ <input id="view-margin_<?php echo $key; ?>"
55
+ name="view[data][slideshow_settings][breakpoints][<?php echo $key; ?>][margin]"
56
+ value="<?php echo $breakpoint['margin']; ?>"
57
+ type="number" min="1" step="1" size="3"
58
+ class="input-incremental"/> px
59
+ </div>
60
 
61
+ <div class="inner-table-cell">
62
+ <label>
63
+ <select id="view-move_slides_<?php echo $key; ?>"
64
+ name="view[data][slideshow_settings][breakpoints][<?php echo $key; ?>][move_slides]"
65
+ class="if selectgroup">
66
+ <option value="1" <?php selected( $breakpoint['move_slides'], 1 ); ?>>1</option>
67
+ <option value="2" <?php selected( $breakpoint['move_slides'], 2 ); ?>>2</option>
68
+ <option value="3" <?php selected( $breakpoint['move_slides'], 3 ); ?>>3</option>
69
+ <option value="4" <?php selected( $breakpoint['move_slides'], 4 ); ?>>4</option>
70
+ </select>
71
+ </label>
72
+ <div class="option-desc singular" style="display: none;">
73
+ <?php _e( 'slide', 'strong-testimonials' ); ?>
74
+ </div>
75
+ <div class="option-desc plural" style="display: none;">
76
+ <?php _e( 'slides', 'strong-testimonials' ); ?>
77
+ </div>
78
+ </div>
79
 
80
+ </div>
81
 
82
  <?php endforeach; ?>
83
+ </div>
84
 
85
+ </div>
86
 
87
+ <div class="is-below">
88
+ <input id="restore-default-breakpoints"
89
+ type="button"
90
+ name="restore-default-breakpoints"
91
+ value="<?php _e( 'Restore Default Breakpoints', 'strong-testimonials' ); ?>"
92
+ class="button-secondary" />
93
+ <span id="restored-message"><?php _e( 'defaults restored', 'strong-testimonials' ); ?></span>
94
+ </div>
95
  </div>
admin/partials/views/option-slideshow-navigation.php CHANGED
@@ -1,108 +1,104 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
- <label for="view-slideshow_nav">
4
- <?php esc_html_e( 'Navigation', 'strong-testimonials' ); ?>
5
- </label>
6
  </th>
7
  <td>
8
 
9
  <?php /* ----- CONTROLS ----- */ ?>
10
- <div class="row">
11
- <div class="row-inner">
12
 
13
  <?php /* ----- TYPE ----- */ ?>
14
- <div class="inline">
15
- <label for="view-slideshow_controls_type"><?php esc_html_e( 'Controls', 'strong-testimonials' ); ?></label>
16
- <select id="view-slideshow_controls_type"
17
- name="view[data][slideshow_settings][controls_type]"
18
- class="if selectnot">
19
  <?php foreach ( $view_options['slideshow_nav_method']['controls'] as $key => $type ) : ?>
20
- <option value="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
21
  <?php selected( $view['slideshow_settings']['controls_type'], $key ); ?>
22
- <?php
23
- if ( 'none' == $key ) {
24
  echo ' class="trip"';
25
- }
26
- ?>
27
- >
28
- <?php echo esc_html( $type['label'] ); ?>
29
- </option>
30
  <?php endforeach; ?>
31
- </select>
32
- </div>
33
 
34
  <?php /* ----- STYLE ----- */ ?>
35
- <div class="inline then then_slideshow_controls_type" style="display: none;">
36
- <label for="view-slideshow_controls_style"><?php esc_html_e( 'Style', 'strong-testimonials' ); ?></label>
37
- <select id="view-slideshow_controls_style" name="view[data][slideshow_settings][controls_style]">
38
  <?php foreach ( $view_options['slideshow_nav_style']['controls'] as $key => $style ) : ?>
39
- <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $view['slideshow_settings']['controls_style'], $key ); ?>><?php echo esc_html( $style['label'] ); ?></option>
40
  <?php endforeach; ?>
41
- </select>
42
- </div>
43
 
44
- </div>
45
- </div>
46
 
47
  <?php /* ----- PAGER ----- */ ?>
48
- <div class="row">
49
- <div class="row-inner then then_has-pager">
50
 
51
  <?php /* ----- TYPE ----- */ ?>
52
- <div class="inline">
53
- <label for="view-slideshow_pager_type"><?php esc_html_e( 'Pagination', 'strong-testimonials' ); ?></label>
54
- <select id="view-slideshow_pager_type"
55
- name="view[data][slideshow_settings][pager_type]"
56
- class="if selectnot">
57
  <?php foreach ( $view_options['slideshow_nav_method']['pager'] as $key => $type ) : ?>
58
- <option value="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
59
  <?php selected( $view['slideshow_settings']['pager_type'], $key ); ?>
60
- <?php
61
- if ( 'none' == $key ) {
62
  echo ' class="trip"';
63
- }
64
- ?>
65
- >
66
- <?php echo esc_html( $type['label'] ); ?>
67
- </option>
68
  <?php endforeach; ?>
69
- </select>
70
- </div>
71
 
72
  <?php /* ----- STYLE ----- */ ?>
73
- <div class="inline then then_slideshow_pager_type" style="display: none;">
74
- <label for="view-slideshow_pager_style"><?php esc_html_e( 'Style', 'strong-testimonials' ); ?></label>
75
- <select id="view-slideshow_pager_style" name="view[data][slideshow_settings][pager_style]" class="if selectnot">
 
 
76
  <?php foreach ( $view_options['slideshow_nav_style']['pager'] as $key => $style ) : ?>
77
- <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $view['slideshow_settings']['pager_style'], $key ); ?>><?php echo esc_html( $style['label'] ); ?></option>
78
  <?php endforeach; ?>
79
- </select>
80
- </div>
81
 
82
- </div>
83
- </div>
84
 
85
  <?php /* ----- POSITION ----- */ ?>
86
- <div class="row">
87
- <div class="row-inner">
88
 
89
- <div class="then then_slider_type then_show_single then_not_show_multiple" style="display: none;">
90
- <div class="inline then then_has-position" style="display: none;">
91
- <label for="view-slideshow_nav_position"><?php esc_html_e( 'Position', 'strong-testimonials' ); ?></label>
92
 
93
- <select id="view-slideshow_nav_position" name="view[data][slideshow_settings][nav_position]">
94
  <?php foreach ( $view_options['slideshow_nav_position'] as $key => $label ) : ?>
95
- <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $view['slideshow_settings']['nav_position'], $key ); ?>><?php echo esc_html( $label ); ?></option>
96
  <?php endforeach; ?>
97
- </select>
98
 
99
  <?php //_e( 'outside', 'strong-testimonials' ); ?>
100
 
101
- <?php esc_html_e( 'the testimonial frame', 'strong-testimonials' ); ?>
102
- </div>
103
- </div>
104
 
105
- </div>
106
- </div>
107
 
108
  </td>
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
+ <label for="view-slideshow_nav">
4
+ <?php _e( 'Navigation', 'strong-testimonials' ); ?>
5
+ </label>
6
  </th>
7
  <td>
8
 
9
  <?php /* ----- CONTROLS ----- */ ?>
10
+ <div class="row">
11
+ <div class="row-inner">
12
 
13
  <?php /* ----- TYPE ----- */ ?>
14
+ <div class="inline">
15
+ <label for="view-slideshow_controls_type"><?php _e( 'Controls', 'strong-testimonials' ); ?></label>
16
+ <select id="view-slideshow_controls_type"
17
+ name="view[data][slideshow_settings][controls_type]"
18
+ class="if selectnot">
19
  <?php foreach ( $view_options['slideshow_nav_method']['controls'] as $key => $type ) : ?>
20
+ <option value="<?php echo $key; ?>" id="<?php echo $key; ?>"
21
  <?php selected( $view['slideshow_settings']['controls_type'], $key ); ?>
22
+ <?php if ( 'none' == $key ) {
 
23
  echo ' class="trip"';
24
+ } ?>>
25
+ <?php echo $type['label']; ?>
26
+ </option>
 
 
27
  <?php endforeach; ?>
28
+ </select>
29
+ </div>
30
 
31
  <?php /* ----- STYLE ----- */ ?>
32
+ <div class="inline then then_slideshow_controls_type" style="display: none;">
33
+ <label for="view-slideshow_controls_style"><?php _e( 'Style', 'strong-testimonials' ); ?></label>
34
+ <select id="view-slideshow_controls_style" name="view[data][slideshow_settings][controls_style]">
35
  <?php foreach ( $view_options['slideshow_nav_style']['controls'] as $key => $style ) : ?>
36
+ <option value="<?php echo $key; ?>" <?php selected( $view['slideshow_settings']['controls_style'], $key ); ?>><?php echo $style['label']; ?></option>
37
  <?php endforeach; ?>
38
+ </select>
39
+ </div>
40
 
41
+ </div>
42
+ </div>
43
 
44
  <?php /* ----- PAGER ----- */ ?>
45
+ <div class="row">
46
+ <div class="row-inner then then_has-pager">
47
 
48
  <?php /* ----- TYPE ----- */ ?>
49
+ <div class="inline">
50
+ <label for="view-slideshow_pager_type"><?php _e( 'Pagination', 'strong-testimonials' ); ?></label>
51
+ <select id="view-slideshow_pager_type"
52
+ name="view[data][slideshow_settings][pager_type]"
53
+ class="if selectnot">
54
  <?php foreach ( $view_options['slideshow_nav_method']['pager'] as $key => $type ) : ?>
55
+ <option value="<?php echo $key; ?>" id="<?php echo $key; ?>"
56
  <?php selected( $view['slideshow_settings']['pager_type'], $key ); ?>
57
+ <?php if ( 'none' == $key ) {
 
58
  echo ' class="trip"';
59
+ } ?>>
60
+ <?php echo $type['label']; ?>
61
+ </option>
 
 
62
  <?php endforeach; ?>
63
+ </select>
64
+ </div>
65
 
66
  <?php /* ----- STYLE ----- */ ?>
67
+ <div class="inline then then_slideshow_pager_type" style="display: none;">
68
+ <label for="view-slideshow_pager_style"><?php _e( 'Style', 'strong-testimonials' ); ?></label>
69
+ <select id="view-slideshow_pager_style"
70
+ name="view[data][slideshow_settings][pager_style]"
71
+ class="if selectnot">
72
  <?php foreach ( $view_options['slideshow_nav_style']['pager'] as $key => $style ) : ?>
73
+ <option value="<?php echo $key; ?>" <?php selected( $view['slideshow_settings']['pager_style'], $key ); ?>><?php echo $style['label']; ?></option>
74
  <?php endforeach; ?>
75
+ </select>
76
+ </div>
77
 
78
+ </div>
79
+ </div>
80
 
81
  <?php /* ----- POSITION ----- */ ?>
82
+ <div class="row">
83
+ <div class="row-inner">
84
 
85
+ <div class="then then_slider_type then_show_single then_not_show_multiple" style="display: none;">
86
+ <div class="inline then then_has-position" style="display: none;">
87
+ <label for="view-slideshow_nav_position"><?php _e( 'Position', 'strong-testimonials' ); ?></label>
88
 
89
+ <select id="view-slideshow_nav_position" name="view[data][slideshow_settings][nav_position]">
90
  <?php foreach ( $view_options['slideshow_nav_position'] as $key => $label ) : ?>
91
+ <option value="<?php echo $key; ?>" <?php selected( $view['slideshow_settings']['nav_position'], $key ); ?>><?php echo $label; ?></option>
92
  <?php endforeach; ?>
93
+ </select>
94
 
95
  <?php //_e( 'outside', 'strong-testimonials' ); ?>
96
 
97
+ <?php _e( 'the testimonial frame', 'strong-testimonials' ); ?>
98
+ </div>
99
+ </div>
100
 
101
+ </div>
102
+ </div>
103
 
104
  </td>
admin/partials/views/option-slideshow-num.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Show', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
- <?php require 'option-slideshow-type.php'; ?>
7
- <?php require 'option-slideshow-breakpoints.php'; ?>
8
  </td>
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
+ <?php _e( 'Show', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
+ <?php include( 'option-slideshow-type.php' ); ?>
7
+ <?php include( 'option-slideshow-breakpoints.php' ); ?>
8
  </td>
admin/partials/views/option-slideshow-transition.php CHANGED
@@ -1,41 +1,45 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Transition', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
  <div class="row">
7
 
8
  <div class="inline inline-middle">
9
  <label for="view-pause">
10
- <?php echo esc_html_x( 'Show slides for', 'slideshow setting', 'strong-testimonials' ); ?>
11
  </label>
12
- <input type="number" id="view-pause" class="input-incremental" name="view[data][slideshow_settings][pause]" min=".1" step=".1" value="<?php echo esc_attr( $view['slideshow_settings']['pause'] ); ?>" size="3"/>
13
- <?php echo esc_html_x( 'seconds', 'time setting', 'strong-testimonials' ); ?>
 
 
14
  </div>
15
 
16
  <div class="inline inline-middle then then_slider_type then_show_single then_not_show_multiple fast" style="display: none;">
17
  <label for="view-effect">
18
- <?php esc_html_e( 'then', 'strong-testimonials' ); ?>
19
  </label>
20
  <select id="view-effect" name="view[data][slideshow_settings][effect]" class="if selectnot">
21
  <?php foreach ( $view_options['slideshow_effect'] as $key => $label ) : ?>
22
- <option value="<?php echo esc_attr( $key ); ?>"
23
  <?php selected( $view['slideshow_settings']['effect'], $key ); ?>
24
- <?php echo 'none' == $key ? 'class="trip"' : ''; ?>><?php echo esc_html( $label ); ?></option>
25
  <?php endforeach; ?>
26
  </select>
27
  </div>
28
 
29
- <div class="inline inline-middle then then_slider_type then_not_show_single then_show_multiple fast" style="display: none;">
30
- <?php esc_html_e( 'then', 'strong-testimonials' ); ?> <?php echo esc_html_x( 'scroll horizontally', 'slideshow transition option', 'strong-testimonials' ); ?>
31
- </div>
32
 
33
  <div class="inline inline-middle then then_effect then_none">
34
  <label for="view-speed">
35
- <?php esc_html_e( 'for', 'strong-testimonials' ); ?>
36
  </label>
37
- <input type="number" id="view-speed" class="input-incremental" name="view[data][slideshow_settings][speed]" min=".1" step=".1" value="<?php echo esc_attr( $view['slideshow_settings']['speed'] ); ?>" size="3"/>
38
- <?php echo esc_html_x( 'seconds', 'time setting', 'strong-testimonials' ); ?>
 
 
39
  </div>
40
 
41
  </div>
1
  <?php /* translators: In the view editor. */ ?>
2
  <th>
3
+ <?php _e( 'Transition', 'strong-testimonials' ); ?>
4
  </th>
5
  <td>
6
  <div class="row">
7
 
8
  <div class="inline inline-middle">
9
  <label for="view-pause">
10
+ <?php _ex( 'Show slides for', 'slideshow setting', 'strong-testimonials' ); ?>
11
  </label>
12
+ <input type="number" id="view-pause" class="input-incremental"
13
+ name="view[data][slideshow_settings][pause]" min=".1" step=".1"
14
+ value="<?php echo $view['slideshow_settings']['pause']; ?>" size="3"/>
15
+ <?php _ex( 'seconds', 'time setting', 'strong-testimonials' ); ?>
16
  </div>
17
 
18
  <div class="inline inline-middle then then_slider_type then_show_single then_not_show_multiple fast" style="display: none;">
19
  <label for="view-effect">
20
+ <?php _e( 'then', 'strong-testimonials' ); ?>
21
  </label>
22
  <select id="view-effect" name="view[data][slideshow_settings][effect]" class="if selectnot">
23
  <?php foreach ( $view_options['slideshow_effect'] as $key => $label ) : ?>
24
+ <option value="<?php echo $key; ?>"
25
  <?php selected( $view['slideshow_settings']['effect'], $key ); ?>
26
+ <?php echo 'none' == $key ? 'class="trip"' : ''; ?>><?php echo $label; ?></option>
27
  <?php endforeach; ?>
28
  </select>
29
  </div>
30
 
31
+ <div class="inline inline-middle then then_slider_type then_not_show_single then_show_multiple fast" style="display: none;">
32
+ <?php _e( 'then', 'strong-testimonials' ); ?> <?php _ex( 'scroll horizontally', 'slideshow transition option', 'strong-testimonials' ); ?>
33
+ </div>
34
 
35
  <div class="inline inline-middle then then_effect then_none">
36
  <label for="view-speed">
37
+ <?php _e( 'for', 'strong-testimonials' ); ?>
38
  </label>
39
+ <input type="number" id="view-speed" class="input-incremental"
40
+ name="view[data][slideshow_settings][speed]" min=".1" step=".1"
41
+ value="<?php echo $view['slideshow_settings']['speed']; ?>" size="3"/>
42
+ <?php _ex( 'seconds', 'time setting', 'strong-testimonials' ); ?>
43
  </div>
44
 
45
  </div>
admin/partials/views/option-slideshow-type.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php /* translators: In the view editor. */ ?>
2
  <div class="row">
3
 
4
- <div class="inline inline-middle">
5
- <label>
6
- <select id="view-slider_type" name="view[data][slideshow_settings][type]" class="if selectgroup">
7
- <option value="show_single" <?php selected( $view['slideshow_settings']['type'], 'show_single' ); ?>><?php esc_html_e( 'single', 'strong-testimonials' ); ?></option>
8
- <option value="show_multiple" <?php selected( $view['slideshow_settings']['type'], 'show_multiple' ); ?>><?php esc_html_e( 'multiple', 'strong-testimonials' ); ?></option>
9
- </select>
10
- </label>
11
- <div class="option-desc singular" style="display: none;">
12
- <?php esc_html_e( 'slide at a time', 'strong-testimonials' ); ?>
13
- </div>
14
- <div class="option-desc plural" style="display: none;">
15
- <?php esc_html_e( 'slides at a time with these responsive breakpoints:', 'strong-testimonials' ); ?>
16
- </div>
17
- </div>
18
 
19
  </div>
1
  <?php /* translators: In the view editor. */ ?>
2
  <div class="row">
3
 
4
+ <div class="inline inline-middle">
5
+ <label>
6
+ <select id="view-slider_type" name="view[data][slideshow_settings][type]" class="if selectgroup">
7
+ <option value="show_single" <?php selected( $view['slideshow_settings']['type'], 'show_single' ); ?>><?php _e( 'single', 'strong-testimonials' ); ?></option>
8
+ <option value="show_multiple" <?php selected( $view['slideshow_settings']['type'], 'show_multiple' ); ?>><?php _e( 'multiple', 'strong-testimonials' ); ?></option>
9
+ </select>
10
+ </label>
11
+ <div class="option-desc singular" style="display: none;">
12
+ <?php _e( 'slide at a time', 'strong-testimonials' ); ?>
13
+ </div>
14
+ <div class="option-desc plural" style="display: none;">
15
+ <?php _e( 'slides at a time with these responsive breakpoints:', 'strong-testimonials' ); ?>
16
+ </div>
17
+ </div>
18
 
19
  </div>
admin/partials/views/option-template-list.php CHANGED
@@ -1,22 +1,22 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
- <?php esc_html_e( 'Template', 'strong-testimonials' ); ?>
4
  </th>
5
  <td colspan="2">
6
- <div id="view-template-list">
7
- <div class="radio-buttons">
8
 
9
- <?php require 'template-not-found.php'; ?>
10
 
11
- <ul class="radio-list template-list">
12
- <?php foreach ( $templates[ $current_type ] as $key => $template ) : ?>
13
- <li>
14
- <?php include 'template-input.php'; ?>
15
- <?php include 'template-options.php'; ?>
16
- </li>
17
- <?php endforeach; ?>
18
- </ul>
19
 
20
- </div>
21
- </div>
22
  </td>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <th>
3
+ <?php _e( 'Template', 'strong-testimonials' ); ?>
4
  </th>
5
  <td colspan="2">
6
+ <div id="view-template-list">
7
+ <div class="radio-buttons">
8
 
9
+ <?php include 'template-not-found.php'; ?>
10
 
11
+ <ul class="radio-list template-list">
12
+ <?php foreach ( $templates[ $current_type ] as $key => $template ) : ?>
13
+ <li>
14
+ <?php include 'template-input.php'; ?>
15
+ <?php include 'template-options.php'; ?>
16
+ </li>
17
+ <?php endforeach; ?>
18
+ </ul>
19
 
20
+ </div>
21
+ </div>
22
  </td>
admin/partials/views/option-thumbnail.php CHANGED
@@ -2,7 +2,7 @@
2
  <th>
3
  <input type="checkbox" id="view-images" class="checkbox if toggle" name="view[data][thumbnail]" value="1" <?php checked( $view['thumbnail'] ); ?>>
4
  <label for="view-images">
5
- <?php esc_html_e( 'Featured Image', 'strong-testimonials' ); ?>
6
  </label>
7
  </th>
8
  <td colspan="2">
@@ -17,25 +17,20 @@
17
  </label>
18
  <select id="view-thumbnail_size" class="if select" name="view[data][thumbnail_size]">
19
  <?php foreach ( $image_sizes as $key => $size ) : ?>
20
- <option
21
- <?php
22
- if ( 'custom' == $key ) {
23
- echo ' class="trip"';}
24
- ?>
25
- value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $view['thumbnail_size'] ); ?>><?php echo esc_html( $size['label'] ); ?></option>
26
  <?php endforeach; ?>
27
  </select>
28
  </div>
29
  <div class="inline then then_thumbnail_size" style="margin-left: 1em;">
30
  <label for="thumbnail_width">
31
- <?php esc_html_e( 'width', 'strong-testimonials' ); ?>
32
  </label>
33
- <input id="thumbnail_width" class="input-number-px" type="text" name="view[data][thumbnail_width]" value="<?php echo esc_attr( $view['thumbnail_width'] ); ?>"> px
34
  <span style="display: inline-block; color: #BBB; margin: 0 1em;">|</span>
35
- <label for="thumbnail_height">
36
- <?php esc_html_e( 'height', 'strong-testimonials' ); ?>
37
  </label>
38
- <input id="thumbnail_height" class="input-number-px" type="text" name="view[data][thumbnail_height]" value="<?php echo esc_attr( $view['thumbnail_height'] ); ?>"> px
39
  </div>
40
  </div>
41
  </div>
@@ -46,26 +41,26 @@
46
  <input type="checkbox" id="view-lightbox" class="if toggle" name="view[data][lightbox]"
47
  value="1" <?php checked( $view['lightbox'] ); ?> class="checkbox">
48
  <label for="view-lightbox">
49
- <?php esc_html_e( 'Open full-size image in a lightbox', 'strong-testimonials' ); ?>
50
  </label>
51
  </div>
52
  <div class="inline then then_lightbox">
53
- <p class="description"><?php esc_html_e( 'Requires a lightbox provided by your theme or another plugin.', 'strong-testimonials' ); ?></p>
54
  </div>
55
  </div>
56
  </div>
57
 
58
  <div class="row">
59
  <div class="row-inner">
60
- <div class="inline then then_lightbox input" style="display: none;">
61
- <label for="view-lightbox_class">
62
- <?php esc_html_e( 'CSS class', 'strong-testimonials' ); ?>
63
- </label>
64
- <input type="text" id="view-lightbox_class" class="medium inline" name="view[data][lightbox_class]" value="<?php echo esc_attr( $view['lightbox_class'] ); ?>">
65
- <p class="inline description tall">
66
- <?php esc_html_e( 'To add a class to the image link.', 'strong-testimonials' ); ?>
67
- </p>
68
- </div>
69
  </div>
70
  </div>
71
 
@@ -73,18 +68,18 @@
73
  <div class="row-inner">
74
  <div class="inline">
75
  <label for="view-gravatar">
76
- <?php esc_html_e( 'If no Featured Image', 'strong-testimonials' ); ?>
77
  </label>
78
  <select id="view-gravatar" class="if select selectper" name="view[data][gravatar]">
79
- <option value="no" <?php selected( $view['gravatar'], 'no' ); ?>><?php esc_html_e( 'show nothing', 'strong-testimonials' ); ?></option>
80
- <option value="yes" <?php selected( $view['gravatar'], 'yes' ); ?>><?php esc_html_e( 'show Gravatar', 'strong-testimonials' ); ?></option>
81
- <option value="if" <?php selected( $view['gravatar'], 'if' ); ?>><?php esc_html_e( 'show Gravatar only if found', 'strong-testimonials' ); ?></option>
82
  </select>
83
  </div>
84
  <div class="inline">
85
  <div class="then fast then_not_no then_yes then_if" style="display: none;">
86
  <p class="description tall">
87
- <a href="<?php echo esc_url( admin_url( 'options-discussion.php' ) ); ?>"><?php esc_html_e( 'Gravatar settings', 'strong-testimonials' ); ?></a>
88
  </p>
89
  </div>
90
  </div>
2
  <th>
3
  <input type="checkbox" id="view-images" class="checkbox if toggle" name="view[data][thumbnail]" value="1" <?php checked( $view['thumbnail'] ); ?>>
4
  <label for="view-images">
5
+ <?php _e( 'Featured Image', 'strong-testimonials' ); ?>
6
  </label>
7
  </th>
8
  <td colspan="2">
17
  </label>
18
  <select id="view-thumbnail_size" class="if select" name="view[data][thumbnail_size]">
19
  <?php foreach ( $image_sizes as $key => $size ) : ?>
20
+ <option<?php if ( 'custom' == $key ) echo ' class="trip"'; ?> value="<?php echo $key; ?>"<?php selected( $key, $view['thumbnail_size'] ); ?>><?php echo $size['label']; ?></option>
 
 
 
 
 
21
  <?php endforeach; ?>
22
  </select>
23
  </div>
24
  <div class="inline then then_thumbnail_size" style="margin-left: 1em;">
25
  <label for="thumbnail_width">
26
+ <?php _e( 'width', 'strong-testimonials' ); ?>
27
  </label>
28
+ <input id="thumbnail_width" class="input-number-px" type="text" name="view[data][thumbnail_width]" value="<?php echo $view['thumbnail_width']; ?>"> px
29
  <span style="display: inline-block; color: #BBB; margin: 0 1em;">|</span>
30
+ <label for="thumbnail_height">
31
+ <?php _e( 'height', 'strong-testimonials' ); ?>
32
  </label>
33
+ <input id="thumbnail_height" class="input-number-px" type="text" name="view[data][thumbnail_height]" value="<?php echo $view['thumbnail_height']; ?>"> px
34
  </div>
35
  </div>
36
  </div>
41
  <input type="checkbox" id="view-lightbox" class="if toggle" name="view[data][lightbox]"
42
  value="1" <?php checked( $view['lightbox'] ); ?> class="checkbox">
43
  <label for="view-lightbox">
44
+ <?php _e( 'Open full-size image in a lightbox', 'strong-testimonials' ); ?>
45
  </label>
46
  </div>
47
  <div class="inline then then_lightbox">
48
+ <p class="description"><?php _e( 'Requires a lightbox provided by your theme or another plugin.', 'strong-testimonials' ); ?></p>
49
  </div>
50
  </div>
51
  </div>
52
 
53
  <div class="row">
54
  <div class="row-inner">
55
+ <div class="inline then then_lightbox input" style="display: none;">
56
+ <label for="view-lightbox_class">
57
+ <?php _e( 'CSS class', 'strong-testimonials' ); ?>
58
+ </label>
59
+ <input type="text" id="view-lightbox_class" class="medium inline" name="view[data][lightbox_class]" value="<?php echo $view['lightbox_class']; ?>">
60
+ <p class="inline description tall">
61
+ <?php _e( 'To add a class to the image link.', 'strong-testimonials' ); ?>
62
+ </p>
63
+ </div>
64
  </div>
65
  </div>
66
 
68
  <div class="row-inner">
69
  <div class="inline">
70
  <label for="view-gravatar">
71
+ <?php _e( 'If no Featured Image', 'strong-testimonials' ); ?>
72
  </label>
73
  <select id="view-gravatar" class="if select selectper" name="view[data][gravatar]">
74
+ <option value="no" <?php selected( $view['gravatar'], 'no' ); ?>><?php _e( 'show nothing', 'strong-testimonials' ); ?></option>
75
+ <option value="yes" <?php selected( $view['gravatar'], 'yes' ); ?>><?php _e( 'show Gravatar', 'strong-testimonials' ); ?></option>
76
+ <option value="if" <?php selected( $view['gravatar'], 'if' ); ?>><?php _e( 'show Gravatar only if found', 'strong-testimonials' ); ?></option>
77
  </select>
78
  </div>
79
  <div class="inline">
80
  <div class="then fast then_not_no then_yes then_if" style="display: none;">
81
  <p class="description tall">
82
+ <a href="<?php echo admin_url( 'options-discussion.php' ); ?>"><?php _e( 'Gravatar settings', 'strong-testimonials' ); ?></a>
83
  </p>
84
  </div>
85
  </div>
admin/partials/views/option-title.php CHANGED
@@ -1,18 +1,20 @@
1
  <th>
2
- <input type="checkbox" id="view-title" name="view[data][title]" value="1" <?php checked( $view['title'] ); ?> class="checkbox if toggle">
3
- <label for="view-title">
4
- <?php esc_html_e( 'Title', 'strong-testimonials' ); ?>
5
- </label>
 
6
  </th>
7
  <td colspan="2">
8
- <div class="row">
9
- <div class="row-inner">
10
- <div class="then then_title" style="display: none;">
11
- <input type="checkbox" id="view-title_link" name="view[data][title_link]" value="1" <?php checked( $view['title_link'] ); ?> class="checkbox">
12
- <label for="view-title_link">
13
- <?php printf( esc_html_x( 'Link to full %s', 'The name of this post type. "Testimonial" by default.', 'strong-testimonials' ), strtolower( apply_filters( 'wpmtst_cpt_singular_name', __( 'Testimonial', 'strong-testimonials' ) ) ) ); ?>
14
- </label>
15
- </div>
16
- </div>
17
- </div>
 
18
  </td>
1
  <th>
2
+ <input type="checkbox" id="view-title" name="view[data][title]" value="1" <?php checked( $view['title'] ); ?>
3
+ class="checkbox if toggle">
4
+ <label for="view-title">
5
+ <?php _e( 'Title', 'strong-testimonials' ); ?>
6
+ </label>
7
  </th>
8
  <td colspan="2">
9
+ <div class="row">
10
+ <div class="row-inner">
11
+ <div class="then then_title" style="display: none;">
12
+ <input type="checkbox" id="view-title_link" name="view[data][title_link]"
13
+ value="1" <?php checked( $view['title_link'] ); ?> class="checkbox">
14
+ <label for="view-title_link">
15
+ <?php printf( _x( 'Link to full %s', 'The name of this post type. "Testimonial" by default.', 'strong-testimonials' ), strtolower( apply_filters( 'wpmtst_cpt_singular_name', __( 'Testimonial', 'strong-testimonials' ) ) ) ); ?>
16
+ </label>
17
+ </div>
18
+ </div>
19
+ </div>
20
  </td>
admin/partials/views/template-input.php CHANGED
@@ -1,6 +1,8 @@
1
  <div>
2
- <input type="radio" id="template-<?php echo esc_attr( $key ); ?>" name="view[data][<?php echo esc_attr( $current_mode ); ?>]" value="<?php echo esc_attr( $key ); ?>" <?php checked( $key, $view['template'] ); ?>>
3
- <label for="template-<?php echo esc_attr( $key ); ?>">
4
- <?php echo wp_kses_post( $template['config']['name'] ); ?>
5
- </label>
 
 
6
  </div>
1
  <div>
2
+ <input type="radio" id="template-<?php esc_attr_e( $key ); ?>"
3
+ name="view[data][<?php esc_attr_e( $current_mode ); ?>]"
4
+ value="<?php esc_attr_e( $key ); ?>" <?php checked( $key, $view['template'] ); ?>>
5
+ <label for="template-<?php esc_attr_e( $key ); ?>">
6
+ <?php echo $template['config']['name']; ?>
7
+ </label>
8
  </div>
admin/partials/views/template-not-found.php CHANGED
@@ -3,22 +3,23 @@
3
  /* translators: On the Views admin screen. */
4
  ?>
5
  <?php if ( ! $template_found ) : ?>
6
- <ul class="radio-list template-list">
7
- <li>
8
- <div>
9
- <input class="error" type="radio" id="<?php echo esc_attr( $view['template'] ); ?>" name="view[data][<?php echo esc_attr( $current_mode ); ?>]" value="<?php echo esc_attr( $view['template'] ); ?>" checked>
10
- <label for="<?php echo esc_attr( $view['template'] ); ?>">
11
- <?php echo esc_html( $view['template'] ); ?>
12
- </label>
13
- </div>
14
- <div class="template-description">
15
- <p>
16
- <span class="dashicons dashicons-warning error"></span>&nbsp;
17
- <span class="error"><?php esc_html_e( 'not found', 'strong-testimonials' ); ?></span>
18
- </p>
 
 
19
  <?php // TODO Explain: Add template key and explain this could be due to switching themes or deactivating a template plugin. It's OK to leave this setting as is if testing or troubleshooting. ?>
20
- </div>
21
- </li>
22
- </ul>
23
- <?php
24
- endif;
3
  /* translators: On the Views admin screen. */
4
  ?>
5
  <?php if ( ! $template_found ) : ?>
6
+ <ul class="radio-list template-list">
7
+ <li>
8
+ <div>
9
+ <input class="error" type="radio" id="<?php esc_attr_e( $view['template'] ); ?>"
10
+ name="view[data][<?php esc_attr_e( $current_mode ); ?>]"
11
+ value="<?php esc_attr_e( $view['template'] ); ?>" checked>
12
+ <label for="<?php esc_attr_e( $view['template'] ); ?>">
13
+ <?php echo $view['template']; ?>
14
+ </label>
15
+ </div>
16
+ <div class="template-description">
17
+ <p>
18
+ <span class="dashicons dashicons-warning error"></span>&nbsp;
19
+ <span class="error"><?php _e( 'not found', 'strong-testimonials' ); ?></span>
20
+ </p>
21
  <?php // TODO Explain: Add template key and explain this could be due to switching themes or deactivating a template plugin. It's OK to leave this setting as is if testing or troubleshooting. ?>
22
+ </div>
23
+ </li>
24
+ </ul>
25
+ <?php endif;
 
admin/partials/views/template-options.php CHANGED
@@ -1,77 +1,78 @@
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <div class="template-description">
3
- <p>
4
- <?php
5
- if ( isset( $template['config']['description'] ) && $template['config']['description'] ) {
6
- echo wp_kses_post( $template['config']['description'] );
7
- } else {
8
- esc_html_e( 'no description', 'strong-testimonials' );
9
- }
10
- ?>
11
- </p>
12
- <div class="options">
13
- <div>
14
- <?php if ( ! isset( $template['config']['options'] ) || ! is_array( $template['config']['options'] ) ) : ?>
15
- <span><?php esc_html_e( 'No options', 'strong-testimonials' ); ?></span>
16
- <?php else : ?>
17
- <span><?php esc_html_e( 'Options', 'strong-testimonials' ); ?></span>
 
18
 
19
- <?php foreach ( $template['config']['options'] as $option ) : ?>
20
- <span>
21
- <?php
22
- $name = sprintf( 'view[data][template_settings][%s][%s]', $key, $option->name );
23
- $id = $key . '-' . $option->name;
24
- switch ( $option->type ) {
25
- case 'select':
26
- // Get default if not set
27
- if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) {
28
- $view['template_settings'][ $key ][ $option->name ] = $option->default;
29
- }
30
 
31
- if ( $option->label ) {
32
- printf( '<label for="%s">%s</label>', esc_attr( $id ), esc_html( $option->label ) );
33
- }
34
 
35
- printf( '<select id="%s" name="%s">', esc_attr( $id ), esc_attr( $name ) );
36
 
37
- foreach ( $option->values as $value ) {
38
- $selected = selected( $value->value, $view['template_settings'][ $key ][ $option->name ], false );
39
- printf( '<option value="%s" %s>%s</option>', esc_attr( $value->value ), esc_attr( $selected ), esc_html( $value->description ) );
40
- }
41
 
42
- echo '</select>';
43
- break;
44
 
45
- case 'radio':
46
- if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) {
47
- $view['template_settings'][ $key ][ $option->name ] = $option->default;
48
- }
49
 
50
- foreach ( $option->values as $value ) {
51
- $checked = checked( $value->value, $view['template_settings'][ $key ][ $option->name ], false );
52
- printf( '<input type="radio" id="%s" name="%s" value="%s" %s>', esc_attr( $id ), esc_attr( $name ), esc_attr( $value->value ), esc_attr( $checked ) );
53
- printf( '<label for="%s">%s</label>', esc_attr( $id ), esc_html( $value->description ) );
54
- }
55
- break;
56
 
57
- case 'checkbox':
58
- /** This breaks checkboxes: */
59
- //if ( ! isset( $view['template_settings'][ $option->name ] ) ) {
60
- // $view['template_settings'][ $option->name ] = $option->default;
61
- //}
62
 
63
- $checked = checked( true, $view['template_settings'][ $key ][ $option->name ], false );
64
- printf( '<input type="checkbox" id="%s" name="%s" value="1" %s>', esc_attr( $id ), esc_attr( $name ), esc_attr( $checked ) );
65
- printf( '<label for="%s">%s</label>', esc_attr( $id ), esc_html( $option->label ) );
66
- break;
67
 
68
- default:
69
- }
70
- ?>
71
- </span>
72
- <?php endforeach; ?>
73
 
74
- <?php endif; ?>
75
- </div>
76
- </div>
77
  </div>
1
  <?php /* translators: On the Views admin screen. */ ?>
2
  <div class="template-description">
3
+ <p>
4
+ <?php
5
+ if ( isset( $template['config']['description'] ) && $template['config']['description'] ) {
6
+ echo $template['config']['description'];
7
+ }
8
+ else {
9
+ _e( 'no description', 'strong-testimonials' );
10
+ }
11
+ ?>
12
+ </p>
13
+ <div class="options">
14
+ <div>
15
+ <?php if ( ! isset( $template['config']['options'] ) || ! is_array( $template['config']['options'] ) ) : ?>
16
+ <span><?php _e( 'No options', 'strong-testimonials' ); ?></span>
17
+ <?php else : ?>
18
+ <span><?php _e( 'Options', 'strong-testimonials' ); ?></span>
19
 
20
+ <?php foreach ( $template['config']['options'] as $option ) : ?>
21
+ <span>
22
+ <?php
23
+ $name = sprintf( 'view[data][template_settings][%s][%s]', $key, $option->name );
24
+ $id = $key . '-' . $option->name;
25
+ switch ( $option->type ) {
26
+ case 'select':
27
+ // Get default if not set
28
+ if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) {
29
+ $view['template_settings'][ $key ][ $option->name ] = $option->default;
30
+ }
31
 
32
+ if ( $option->label ) {
33
+ printf( '<label for="%s">%s</label>', $id, $option->label );
34
+ }
35
 
36
+ printf( '<select id="%s" name="%s">', $id, $name );
37
 
38
+ foreach ( $option->values as $value ) {
39
+ $selected = selected( $value->value, $view['template_settings'][ $key ][ $option->name ], false );
40
+ printf( '<option value="%s" %s>%s</option>', $value->value, $selected, $value->description );
41
+ }
42
 
43
+ echo '</select>';
44
+ break;
45
 
46
+ case 'radio':
47
+ if ( ! isset( $view['template_settings'][ $key ][ $option->name ] ) ) {
48
+ $view['template_settings'][ $key ][ $option->name ] = $option->default;
49
+ }
50
 
51
+ foreach ( $option->values as $value ) {
52
+ $checked = checked( $value->value, $view['template_settings'][ $key ][ $option->name ], false );
53
+ printf( '<input type="radio" id="%s" name="%s" value="%s" %s>', $id, $name, $value->value, $checked );
54
+ printf( '<label for="%s">%s</label>', $id, $value->description );
55
+ }
56
+ break;
57
 
58
+ case 'checkbox':
59
+ /** This breaks checkboxes: */
60
+ //if ( ! isset( $view['template_settings'][ $option->name ] ) ) {
61
+ // $view['template_settings'][ $option->name ] = $option->default;
62
+ //}
63
 
64
+ $checked = checked( true, $view['template_settings'][ $key ][ $option->name ], false );
65
+ printf( '<input type="checkbox" id="%s" name="%s" value="1" %s>', $id, $name, $checked );
66
+ printf( '<label for="%s">%s</label>', $id, $option->label );
67
+ break;
68
 
69
+ default:
70
+ }
71
+ ?>
72
+ </span>
73
+ <?php endforeach; ?>
74
 
75
+ <?php endif; ?>
76
+ </div>
77
+ </div>
78
  </div>
admin/partials/views/view-mode.php CHANGED
@@ -1,17 +1,18 @@
1
  <div id="view-mode" class="table-row mode-select">
2
- <div class="table-cell">
3
- <?php esc_html_e( 'Mode', 'strong-testimonials' ); ?>
4
- </div>
5
- <div class="table-cell">
6
- <div class="mode-list">
7
- <?php foreach ( $view_options['mode'] as $mode ) : ?>
8
- <label>
9
- <input id="<?php echo esc_attr( $mode['name'] ); ?>" type="radio" name="view[data][mode]" value="<?php echo esc_attr( $mode['name'] ); ?>" <?php checked( $view['mode'], $mode['name'] ); ?>>
10
- <?php echo esc_html( $mode['label'] ); ?>
11
- <div class="mode-line"></div>
12
- </label>
13
- <?php endforeach; ?>
14
- </div>
15
- <div class="mode-description"></div>
16
- </div>
 
17
  </div>
1
  <div id="view-mode" class="table-row mode-select">
2
+ <div class="table-cell">
3
+ <?php _e( 'Mode', 'strong-testimonials' ); ?>
4
+ </div>
5
+ <div class="table-cell">
6
+ <div class="mode-list">
7
+ <?php foreach ( $view_options['mode'] as $mode ) : ?>
8
+ <label>
9
+ <input id="<?php echo esc_attr( $mode['name'] ); ?>" type="radio" name="view[data][mode]"
10
+ value="<?php echo esc_attr( $mode['name'] ); ?>" <?php checked( $view['mode'], $mode['name'] ); ?>>
11
+ <?php echo $mode['label']; ?>
12
+ <div class="mode-line"></div>
13
+ </label>
14
+ <?php endforeach; ?>
15
+ </div>
16
+ <div class="mode-description"></div>
17
+ </div>
18
  </div>
admin/partials/views/view-name.php CHANGED
@@ -5,12 +5,13 @@
5
  * @since 2.11.14
6
  */
7
  ?>
8
- <div class="table-cell">
9
- <label for="view-name">
10
- <?php esc_html_e( 'Name', 'strong-testimonials' ); ?>
11
- </label>
12
- </div>
13
- <div class="table-cell">
14
- <input type="text" id="view-name" class="view-name" name="view[name]" value="<?php echo esc_attr( htmlspecialchars( stripslashes( $view_name ) ) ); ?>" tabindex="1">
 
15
  </div>
16
  </div>
5
  * @since 2.11.14
6
  */
7
  ?>
8
+ <div class="table-cell">
9
+ <label for="view-name">
10
+ <?php _e( 'Name', 'strong-testimonials' ); ?>
11
+ </label>
12
+ </div>
13
+ <div class="table-cell">
14
+ <input type="text" id="view-name" class="view-name" name="view[name]"
15
+ value="<?php echo htmlspecialchars( stripslashes( $view_name ) ); ?>" tabindex="1">
16
  </div>
17
  </div>
admin/partials/views/view-shortcode.php CHANGED
@@ -1,4 +1,14 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
 
3
  $then_classes = array(
4
  'then',
@@ -12,21 +22,11 @@ $then_classes = array(
12
 
13
  <div class="table-row form-view-shortcode <?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>">
14
  <div class="table-cell">
15
- <label for="view-shortcode">
16
- <?php esc_html_e( 'Shortcode', 'strong-testimonials' ); ?>
17
- </label>
18
  </div>
19
  <div class="table-cell">
20
- <?php if ( 'edit' == $action ) : ?>
21
- <div class="saved">
22
- <input id="view-shortcode" type="text" value="[testimonial_view id=&quot;<?php echo esc_attr( $view_id ); ?>&quot;]" readonly />
23
- <input id="copy-shortcode" class="button small" type="button" value="<?php echo esc_attr__( 'copy to clipboard', 'strong-testimonials' ); ?>" data-copytarget="#view-shortcode" />
24
- <span id="copy-message">copied</span>
25
- </div>
26
- <?php else : ?>
27
- <div class="unsaved">
28
- <?php echo esc_html_x( 'will be available after you save this view', 'The shortcode for a new View.', 'strong-testimonials' ); ?>
29
- </div>
30
- <?php endif; ?>
31
  </div>
32
  </div>
1
  <?php
2
+ // avoiding the tab character before the shortcode for better copy-n-paste
3
+ if ( 'edit' == $action ) {
4
+ $shortcode = '<div class="saved">';
5
+ $shortcode .= '<input id="view-shortcode" type="text" value="[testimonial_view id=&quot;' . esc_attr( $view_id ) . '&quot;]" readonly />';
6
+ $shortcode .= '<input id="copy-shortcode" class="button small" type="button" value="' . esc_attr__( 'copy to clipboard', 'strong-testimonials' ) . '" data-copytarget="#view-shortcode" />';
7
+ $shortcode .= '<span id="copy-message">copied</span>';
8
+ $shortcode .= '</div>';
9
+ } else {
10
+ $shortcode = '<div class="unsaved">' . _x( 'will be available after you save this', 'The shortcode for a new View.', 'strong-testimonials' ) . '</div>';
11
+ }
12
 
13
  $then_classes = array(
14
  'then',
22
 
23
  <div class="table-row form-view-shortcode <?php echo esc_attr( join( array_filter( $then_classes ), ' ' ) ); ?>">
24
  <div class="table-cell">
25
+ <label for="view-shortcode">
26
+ <?php _e( 'Shortcode', 'strong-testimonials' ); ?>
27
+ </label>
28
  </div>
29
  <div class="table-cell">
30
+ <?php echo $shortcode; ?>
 
 
 
 
 
 
 
 
 
 
31
  </div>
32
  </div>
admin/settings/class-strong-testimonials-settings-compat.php CHANGED
@@ -40,11 +40,10 @@ class Strong_Testimonials_Settings_Compat {
40
  * @param $url
41
  */
42
  public function register_tab( $active_tab, $url ) {
43
- printf(
44
- '<a href="%s" class="nav-tab %s">%s</a>',
45
- esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
46
- esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
47
- esc_html__( 'Compatibility', 'strong-testimonials' )
48
  );
49
  }
50
 
@@ -98,15 +97,15 @@ class Strong_Testimonials_Settings_Compat {
98
  $input['controller']['initialize_on'] = sanitize_text_field( $input['controller']['initialize_on'] );
99
 
100
  // FIXME: Special handling until proper use of default values in v3.0
101
- $default = array(
102
- 'enabled' => false,
103
- 'classes' => array(
104
- array(
105
- 'start' => '',
106
- 'finish' => '',
107
- ),
108
- ),
109
- );
110
 
111
  if ( ! isset( $input['lazyload'] ) ) {
112
 
@@ -121,24 +120,27 @@ class Strong_Testimonials_Settings_Compat {
121
  // May be multiple pairs.
122
  foreach ( $input['lazyload']['classes'] as $key => $classes ) {
123
 
124
- // Sanitize classes or remove empty pairs.
125
  // Reduce multiple empty pairs down to default value of single empty pair.
126
  if ( $classes['start'] || $classes['finish'] ) {
127
  $input['lazyload']['classes'][ $key ]['start'] = str_replace( '.', '', sanitize_text_field( $classes['start'] ) );
128
  $input['lazyload']['classes'][ $key ]['finish'] = str_replace( '.', '', sanitize_text_field( $classes['finish'] ) );
129
  } else {
130
- unset( $input['lazyload']['classes'][ $key ] );
131
  }
132
 
133
  if ( ! count( $input['lazyload']['classes'] ) ) {
134
  $input['lazyload'] = $default;
135
  }
 
136
  }
 
137
  } else {
138
 
139
  $input['lazyload'] = $default['classes'];
140
 
141
  }
 
142
  }
143
 
144
  return $input;
@@ -172,7 +174,7 @@ class Strong_Testimonials_Settings_Compat {
172
  */
173
  public function settings_intro() {
174
  ?>
175
- <h2><?php esc_html_e( 'Common Scenarios', 'strong-testimonials' ); ?></h2>
176
  <table class="form-table" cellpadding="0" cellspacing="0">
177
  <tr valign="top">
178
  <td>
@@ -180,31 +182,31 @@ class Strong_Testimonials_Settings_Compat {
180
 
181
  <div class="row header">
182
  <div>
183
- <?php esc_html_e( 'Symptom', 'strong-testimonials' ); ?>
184
  </div>
185
  <div>
186
- <?php esc_html_e( 'Possible Cause', 'strong-testimonials' ); ?>
187
  </div>
188
  <div>
189
- <?php esc_html_e( 'Try', 'strong-testimonials' ); ?>
190
  </div>
191
  </div>
192
 
193
  <div class="row">
194
  <div>
195
- <p><strong><?php esc_html_e( 'Views not working', 'strong-testimonials' ); ?></strong></p>
196
- <p><?php echo wp_kses_post( _e( 'A testimonial view does not appear correctly the <strong>first time</strong> you view the page but it does when you <strong>refresh</strong> the page.', 'strong-testimonials' ) ); ?></p>
197
- <p><?php esc_html_e( 'For example, it has no style, no pagination, or the slider has not started.', 'strong-testimonials' ); ?></p>
198
  </div>
199
  <div>
200
- <p><?php echo wp_kses_post( _e( 'Your site uses <strong>Ajax page loading</strong> &ndash; also known as page animations, transition effects or Pjax (pushState Ajax) &ndash; provided by your theme or another plugin.', 'strong-testimonials' ) ); ?></p>
201
- <p><?php esc_html_e( 'Instead of loading the entire page, this technique fetches only the new content.', 'strong-testimonials' ); ?></p>
202
  </div>
203
  <div>
204
- <p><strong><?php esc_html_e( 'Ajax Page Loading', 'strong-testimonials' ); ?>:</strong> <?php esc_html_e( 'General', 'strong-testimonials' ); ?></p>
205
  <p>
206
  <a href="#" id="set-scenario-1">
207
- <?php /* translators: link text on Settings > Compatibility tab */ esc_html_e( 'Set this now', 'strong-testimonials' ); ?>
208
  </a>
209
  </p>
210
  </div>
@@ -212,27 +214,27 @@ class Strong_Testimonials_Settings_Compat {
212
 
213
  <div class="row">
214
  <div>
215
- <p><strong><?php esc_html_e( 'Slider never starts', 'strong-testimonials' ); ?></strong></p>
216
- <p><?php esc_html_e( 'A testimonial slider does not start or is missing navigation controls.', 'strong-testimonials' ); ?></p>
217
  </div>
218
  <div>
219
- <p><?php esc_html_e( 'The page is very busy loading image galleries, other sliders or third-party resources like social media posts.', 'strong-testimonials' ); ?></p>
220
  </div>
221
  <div>
222
- <p><strong><?php esc_html_e( 'Load Event', 'strong-testimonials' ); ?>:</strong> <?php esc_html_e( 'window load', 'strong-testimonials' ); ?></p>
223
  </div>
224
  </div>
225
 
226
  <div class="row">
227
  <div>
228
- <p><strong><?php esc_html_e( 'Masonry layout not working', 'strong-testimonials' ); ?></strong></p>
229
- <p><?php esc_html_e( 'A testimonial view with the Masonry layout has only one column or works inconsistently in different browsers or devices.', 'strong-testimonials' ); ?></p>
230
  </div>
231
  <div>
232
- <p><?php esc_html_e( 'The page is very busy loading image galleries, other sliders or third-party resources like social media posts.', 'strong-testimonials' ); ?></p>
233
  </div>
234
  <div>
235
- <p><strong><?php esc_html_e( 'Load Event', 'strong-testimonials' ); ?>:</strong> <?php esc_html_e( 'window load', 'strong-testimonials' ); ?></p>
236
  </div>
237
  </div>
238
 
@@ -241,7 +243,7 @@ class Strong_Testimonials_Settings_Compat {
241
  </tr>
242
  </table>
243
 
244
- <h2><?php esc_html_e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
245
 
246
  <?php
247
  }
@@ -254,13 +256,13 @@ class Strong_Testimonials_Settings_Compat {
254
  <table class="form-table" cellpadding="0" cellspacing="0">
255
  <tr valign="top">
256
  <th scope="row">
257
- <?php esc_html_e( 'Ajax Page Loading', 'strong-testimonials' ); ?>
258
  </th>
259
  <td>
260
  <div class="row header">
261
  <p>
262
- <?php esc_html_e( 'This does not perform Ajax page loading.', 'strong-testimonials' ); ?>
263
- <?php esc_html_e( 'It provides compatibility with themes and plugins that use Ajax to load pages, also known as page animation or transition effects.', 'strong-testimonials' ); ?>
264
  </p>
265
  </div>
266
  <fieldset data-radio-group="prerender">
@@ -283,15 +285,19 @@ class Strong_Testimonials_Settings_Compat {
283
  ?>
284
  <div class="row">
285
  <div>
286
- <label <?php echo esc_attr( $class ); ?> for="page-loading-none">
287
- <input id="page-loading-none" name="wpmtst_compat_options[page_loading]" type="radio" value="" <?php echo esc_attr( $checked ); ?> />
288
- <?php esc_html_e( 'None', 'strong-testimonials' ); ?>
289
- <em><?php esc_html_e( '(default)', 'strong-testimonials' ); ?></em>
 
 
 
 
290
  </label>
291
  </div>
292
  <div>
293
- <p class="about"><?php esc_html_e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
294
- <p class="about"><?php esc_html_e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
295
  </div>
296
  </div>
297
  <?php
@@ -306,14 +312,18 @@ class Strong_Testimonials_Settings_Compat {
306
  ?>
307
  <div class="row">
308
  <div>
309
- <label <?php echo esc_attr( $class ); ?> for="page-loading-general">
310
- <input id="page-loading-general" name="wpmtst_compat_options[page_loading]" type="radio" value="general" <?php echo esc_attr( $checked ); ?> />
311
- <?php esc_html_e( 'General', 'strong-testimonials' ); ?>
 
 
 
 
312
  </label>
313
  </div>
314
  <div>
315
- <p class="about"><?php esc_html_e( 'Be ready to render any view at any time.', 'strong-testimonials' ); ?></p>
316
- <p class="about"><?php esc_html_e( 'This works well with common Ajax methods.', 'strong-testimonials' ); ?></p>
317
  </div>
318
  </div>
319
  <?php
@@ -328,13 +338,18 @@ class Strong_Testimonials_Settings_Compat {
328
  ?>
329
  <div class="row">
330
  <div>
331
- <label <?php echo esc_attr( $class ); ?> for="page-loading-advanced">
332
- <input id="page-loading-advanced" name="wpmtst_compat_options[page_loading]" data-group="advanced" type="radio" value="advanced" <?php echo esc_attr( $checked ); ?> />
333
- <?php esc_html_e( 'Advanced', 'strong-testimonials' ); ?>
 
 
 
 
 
334
  </label>
335
  </div>
336
  <div>
337
- <p class="about"><?php esc_html_e( 'For specific configurations.', 'strong-testimonials' ); ?></p>
338
  </div>
339
  </div>
340
  <?php
@@ -348,12 +363,12 @@ class Strong_Testimonials_Settings_Compat {
348
  <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
349
  <tr valign="top">
350
  <th scope="row">
351
- <?php esc_html_e( 'Prerender', 'strong-testimonials' ); ?>
352
  </th>
353
  <td>
354
  <div class="row header">
355
- <p><?php esc_html_e( 'Load stylesheets and populate script variables up front.', 'strong-testimonials' ); ?>
356
- <a class="open-help-tab" href="#tab-panel-wpmtst-help-prerender"><?php esc_html_e( 'Help' ); ?></a>
357
  </p>
358
  </div>
359
  <fieldset data-radio-group="prerender">
@@ -376,15 +391,19 @@ class Strong_Testimonials_Settings_Compat {
376
  ?>
377
  <div class="row">
378
  <div>
379
- <label <?php echo esc_attr( $class ); ?> for="prerender-current">
380
- <input id="prerender-current" name="wpmtst_compat_options[prerender]" type="radio" value="current" <?php echo esc_attr( $checked ); ?> />
381
- <?php esc_html_e( 'Current page', 'strong-testimonials' ); ?>
382
- <em><?php esc_html_e( '(default)', 'strong-testimonials' ); ?></em>
 
 
 
 
383
  </label>
384
  </div>
385
  <div>
386
- <p class="about"><?php esc_html_e( 'For the current page only.', 'strong-testimonials' ); ?></p>
387
- <p class="about"><?php esc_html_e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
388
  </div>
389
  </div>
390
  <?php
@@ -399,14 +418,18 @@ class Strong_Testimonials_Settings_Compat {
399
  ?>
400
  <div class="row">
401
  <div>
402
- <label <?php echo esc_attr( $class ); ?> for="prerender-all">
403
- <input id="prerender-all" type="radio" name="wpmtst_compat_options[prerender]" value="all" <?php echo esc_attr( $checked ); ?> />
404
- <?php esc_html_e( 'All views', 'strong-testimonials' ); ?>
 
 
 
 
405
  </label>
406
  </div>
407
  <div>
408
- <p class="about"><?php esc_html_e( 'For all views. Required for Ajax page loading.', 'strong-testimonials' ); ?></p>
409
- <p class="about"><?php echo wp_kses_post( _e( 'Then select an option for <strong>Monitor</strong> below.', 'strong-testimonials' ) ); ?></p>
410
  </div>
411
  </div>
412
  <?php
@@ -421,13 +444,17 @@ class Strong_Testimonials_Settings_Compat {
421
  ?>
422
  <div class="row">
423
  <div>
424
- <label <?php echo esc_attr( $class ); ?> for="prerender-none">
425
- <input id="prerender-none" type="radio" name="wpmtst_compat_options[prerender]" value="none" <?php echo esc_attr( $checked ); ?> />
426
- <?php esc_html_e( 'None', 'strong-testimonials' ); ?>
 
 
 
 
427
  </label>
428
  </div>
429
  <div>
430
- <p class="about"><?php esc_html_e( 'When the shortcode is rendered. May result in a flash of unstyled content.', 'strong-testimonials' ); ?></p>
431
  </div>
432
  </div>
433
  <?php
@@ -441,11 +468,11 @@ class Strong_Testimonials_Settings_Compat {
441
  <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
442
  <tr valign="top">
443
  <th scope="row">
444
- <?php esc_html_e( 'Monitor', 'strong-testimonials' ); ?>
445
  </th>
446
  <td>
447
  <div class="row header">
448
- <p><?php esc_html_e( 'Initialize sliders, pagination and form validation as pages change.', 'strong-testimonials' ); ?></p>
449
  </div>
450
  <fieldset data-radio-group="method">
451
  <?php $this->settings_monitor_none(); ?>
@@ -469,14 +496,18 @@ class Strong_Testimonials_Settings_Compat {
469
  ?>
470
  <div class="row">
471
  <div>
472
- <label <?php echo esc_attr( $class ); ?> for="method-none">
473
- <input id="method-none" type="radio" name="wpmtst_compat_options[ajax][method]" value="" <?php echo esc_attr( $checked ); ?> />
474
- <?php esc_html_e( 'None', 'strong-testimonials' ); ?>
475
- <em><?php esc_html_e( '(default)', 'strong-testimonials' ); ?></em>
 
 
 
 
476
  </label>
477
  </div>
478
  <div>
479
- <p class="about"><?php esc_html_e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
480
  </div>
481
  </div>
482
  <?php
@@ -491,25 +522,35 @@ class Strong_Testimonials_Settings_Compat {
491
  ?>
492
  <div class="row">
493
  <div>
494
- <label <?php echo esc_attr( $class ); ?> for="method-universal">
495
- <input id="method-universal" name="wpmtst_compat_options[ajax][method]" type="radio" value="universal" data-group="universal" <?php echo esc_attr( $checked ); ?> />
496
- <?php esc_html_e( 'Universal', 'strong-testimonials' ); ?>
 
 
 
 
 
497
  </label>
498
  </div>
499
  <div>
500
- <p class="about"><?php esc_html_e( 'Watch for page changes on a timer.', 'strong-testimonials' ); ?></p>
501
  </div>
502
  </div>
503
 
504
  <div class="row" data-sub="universal">
505
  <div class="radio-sub">
506
  <label for="universal-timer">
507
- <?php echo esc_html_x( 'Check every', 'timer setting', 'strong-testimonials' ); ?>
508
  </label>
509
  </div>
510
  <div>
511
- <input id="universal-timer" name="wpmtst_compat_options[ajax][universal_timer]" type="number" min=".1" max="5" step=".1" value="<?php echo esc_attr( $this->options['ajax']['universal_timer'] ); ?>" size="3" />
512
- <?php echo esc_html_x( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
 
 
 
 
 
513
  </div>
514
  </div>
515
  <?php
@@ -524,14 +565,19 @@ class Strong_Testimonials_Settings_Compat {
524
  ?>
525
  <div class="row">
526
  <div>
527
- <label <?php echo esc_attr( $class ); ?> for="method-observer">
528
- <input id="method-observer" name="wpmtst_compat_options[ajax][method]" data-group="observer" type="radio" value="observer" <?php echo esc_attr( $checked ); ?> />
529
- <?php esc_html_e( 'Observer', 'strong-testimonials' ); ?>
 
 
 
 
 
530
  </label>
531
  </div>
532
  <div>
533
- <p class="about"><?php esc_html_e( 'React to changes in specific page elements.', 'strong-testimonials' ); ?></p>
534
- <p class="description"><?php esc_html_e( 'For advanced users.', 'strong-testimonials' ); ?></p>
535
  </div>
536
  </div>
537
 
@@ -543,12 +589,17 @@ class Strong_Testimonials_Settings_Compat {
543
  <div class="row" data-sub="observer">
544
  <div class="radio-sub">
545
  <label for="observer-timer">
546
- <?php echo esc_html_x( 'Check once after', 'timer setting', 'strong-testimonials' ); ?>
547
  </label>
548
  </div>
549
  <div>
550
- <input id="observer-timer" name="wpmtst_compat_options[ajax][observer_timer]" type="number" min=".1" max="5" step=".1" value="<?php echo esc_attr( $this->options['ajax']['observer_timer'] ); ?>" size="3" />
551
- <?php echo esc_html_x( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
 
 
 
 
 
552
  </div>
553
  </div>
554
 
@@ -560,13 +611,17 @@ class Strong_Testimonials_Settings_Compat {
560
  <div class="row" data-sub="observer">
561
  <div class="radio-sub">
562
  <label for="container-id">
563
- <?php esc_html_e( 'Container ID', 'strong-testimonials' ); ?>
564
  </label>
565
  </div>
566
  <div>
567
  <span class="code input-before">#</span>
568
- <input class="code element" id="container-id" name="wpmtst_compat_options[ajax][container_id]" type="text" value="<?php echo esc_attr( $this->options['ajax']['container_id'] ); ?>" />
569
- <p class="about adjacent"><?php esc_html_e( 'the element to observe', 'strong-testimonials' ); ?></p>
 
 
 
 
570
  </div>
571
  </div>
572
 
@@ -578,13 +633,17 @@ class Strong_Testimonials_Settings_Compat {
578
  <div class="row" data-sub="observer">
579
  <div class="radio-sub">
580
  <label for="addednode-id">
581
- <?php esc_html_e( 'Added node ID', 'strong-testimonials' ); ?>
582
  </label>
583
  </div>
584
  <div>
585
  <span class="code input-before">#</span>
586
- <input class="code element" id="addednode-id" name="wpmtst_compat_options[ajax][addednode_id]" type="text" value="<?php echo esc_attr( $this->options['ajax']['addednode_id'] ); ?>" />
587
- <p class="about adjacent"><?php esc_html_e( 'the element being added', 'strong-testimonials' ); ?></p>
 
 
 
 
588
  </div>
589
  </div>
590
  <?php
@@ -595,29 +654,38 @@ class Strong_Testimonials_Settings_Compat {
595
  */
596
  public function settings_monitor_event() {
597
  $checked = checked( $this->options['ajax']['method'], 'event', false );
598
- $class = $checked ? ' class="current"' : '';
599
- ?>
600
  <div class="row">
601
  <div>
602
- <label <?php echo esc_attr( $class ); ?> for="method-event">
603
- <input id="method-event" name="wpmtst_compat_options[ajax][method]" data-group="event" type="radio" value="event" <?php echo esc_attr( $checked ); ?> />
604
- <?php esc_html_e( 'Custom event', 'strong-testimonials' ); ?>
 
 
 
 
 
605
  </label>
606
  </div>
607
  <div>
608
- <p class="about"><?php esc_html_e( 'Listen for specific events.', 'strong-testimonials' ); ?></p>
609
- <p class="description"><?php esc_html_e( 'For advanced users.', 'strong-testimonials' ); ?></p>
610
  </div>
611
  </div>
612
 
613
  <div class="row" data-sub="event">
614
  <div class="radio-sub">
615
  <label for="event-name">
616
- <?php esc_html_e( 'Event name', 'strong-testimonials' ); ?>
617
  </label>
618
  </div>
619
  <div>
620
- <input class="code" id="event-name" name="wpmtst_compat_options[ajax][event]" type="text" value="<?php echo esc_attr( $this->options['ajax']['event'] ); ?>" size="30" />
 
 
 
 
 
621
  </div>
622
  </div>
623
  <?php
@@ -632,27 +700,32 @@ class Strong_Testimonials_Settings_Compat {
632
  ?>
633
  <div class="row">
634
  <div>
635
- <label <?php echo esc_attr( $class ); ?> for="method-script">
636
- <input id="method-script" name="wpmtst_compat_options[ajax][method]" data-group="script" type="radio" value="script" <?php echo esc_attr( $checked ); ?> />
637
- <?php esc_html_e( 'Specific script', 'strong-testimonials' ); ?>
 
 
 
 
 
638
  </label>
639
  </div>
640
  <div>
641
- <p class="about"><?php esc_html_e( 'Register a callback for a specific Ajax script.', 'strong-testimonials' ); ?></p>
642
- <p class="description"><?php esc_html_e( 'For advanced users.', 'strong-testimonials' ); ?></p>
643
  </div>
644
  </div>
645
 
646
  <div class="row" data-sub="script">
647
  <div class="radio-sub">
648
  <label for="script-name">
649
- <?php esc_html_e( 'Script name', 'strong-testimonials' ); ?>
650
  </label>
651
  </div>
652
  <div>
653
  <select id="script-name" name="wpmtst_compat_options[ajax][script]">
654
  <option value="" <?php selected( $this->options['ajax']['script'], '' ); ?>>
655
- <?php esc_html_e( '&mdash; Select &mdash;' ); ?>
656
  </option>
657
  <option value="barba" <?php selected( $this->options['ajax']['script'], 'barba' ); ?>>
658
  Barba.js
@@ -673,11 +746,11 @@ class Strong_Testimonials_Settings_Compat {
673
  <table class="form-table" cellpadding="0" cellspacing="0">
674
  <tr valign="top">
675
  <th scope="row">
676
- <?php esc_html_e( 'Load Event', 'strong-testimonials' ); ?>
677
  </th>
678
  <td>
679
  <div class="row header">
680
- <p><?php esc_html_e( 'When to start sliders, Masonry, pagination and form validation.', 'strong-testimonials' ); ?></p>
681
  </div>
682
  <fieldset>
683
  <?php $this->settings_page_controller_documentready(); ?>
@@ -698,14 +771,18 @@ class Strong_Testimonials_Settings_Compat {
698
  ?>
699
  <div class="row">
700
  <div>
701
- <label <?php echo esc_attr( $class ); ?> for="controller-documentready">
702
- <input id="controller-documentready" name="wpmtst_compat_options[controller][initialize_on]" type="radio" value="documentReady" <?php echo esc_attr( $checked ); ?> />
703
- <?php esc_html_e( 'document ready', 'strong-testimonials' ); ?>
704
- <em><?php esc_html_e( '(default)', 'strong-testimonials' ); ?></em>
 
 
 
 
705
  </label>
706
  </div>
707
  <div>
708
- <p class="about"><?php esc_html_e( 'This works well if your page load time is less than a few seconds.', 'strong-testimonials' ); ?></p>
709
  </div>
710
  </div>
711
  <?php
@@ -720,13 +797,17 @@ class Strong_Testimonials_Settings_Compat {
720
  ?>
721
  <div class="row">
722
  <div>
723
- <label <?php echo esc_attr( $class ); ?> for="controller-windowload">
724
- <input id="controller-windowload" name="wpmtst_compat_options[controller][initialize_on]" type="radio" value="windowLoad" <?php echo esc_attr( $checked ); ?> />
725
- <?php esc_html_e( 'window load', 'strong-testimonials' ); ?>
 
 
 
 
726
  </label>
727
  </div>
728
  <div>
729
- <p class="about"><?php esc_html_e( 'Try this if your page load time is more than a few seconds.', 'strong-testimonials' ); ?></p>
730
  </div>
731
  </div>
732
  <?php
@@ -742,11 +823,11 @@ class Strong_Testimonials_Settings_Compat {
742
  <table class="form-table" cellpadding="0" cellspacing="0">
743
  <tr valign="top">
744
  <th scope="row">
745
- <?php esc_html_e( 'Lazy Loading Images', 'strong-testimonials' ); ?>
746
  </th>
747
  <td>
748
  <div class="row header">
749
- <p><?php esc_html_e( 'Watch for lazy loading images in themes and plugins.', 'strong-testimonials' ); ?></p>
750
  </div>
751
  <fieldset>
752
  <?php $this->settings_page_lazyload_enabled(); ?>
@@ -773,13 +854,13 @@ class Strong_Testimonials_Settings_Compat {
773
  name="wpmtst_compat_options[lazyload][enabled]"
774
  data-group="lazyload"
775
  type="checkbox"
776
- <?php echo esc_attr( $checked ); ?> />
777
- <?php esc_html_e( 'Enable watcher', 'strong-testimonials' ); ?>
778
  </label>
779
  </div>
780
  <div data-sub="lazyload">
781
- <p class="about"><?php esc_html_e( 'Most lazy loading techniques use one or two CSS class names to indicate which images to lazy load and when the lazy loading is finished.', 'strong-testimonials' ); ?></p>
782
- <p class="about"><?php esc_html_e( 'Contact support for your theme or plugin to ask if it uses CSS class names.', 'strong-testimonials' ); ?></p>
783
  </div>
784
  </div>
785
  <?php
@@ -795,7 +876,7 @@ class Strong_Testimonials_Settings_Compat {
795
  <div class="row" data-sub="lazyload">
796
  <div>
797
  <label>
798
- <?php esc_html_e( 'CSS Class Names', 'strong-testimonials' ); ?>
799
  </label>
800
  </div>
801
  <div class="lazyload-pairs">
@@ -807,7 +888,10 @@ class Strong_Testimonials_Settings_Compat {
807
  }
808
  ?>
809
  <div class="pair-actions">
810
- <input class="button" id="add-pair" value="<?php esc_attr_e( 'Add Classes', 'strong-testimonials' ); ?>" type="button" />
 
 
 
811
  </div>
812
  </div>
813
  </div>
@@ -823,13 +907,19 @@ class Strong_Testimonials_Settings_Compat {
823
  ?>
824
  <div class="pair">
825
  <label>
826
- <?php echo esc_html_x( 'start', 'noun', 'strong-testimonials' ); ?>
827
- <input class="element code" name="wpmtst_compat_options[lazyload][classes][<?php echo esc_attr( $key ); ?>][start]" type="text" value="<?php echo esc_attr( $pair['start'] ); ?>" />
 
 
 
828
  </label>
829
  <span class="pair-sep"></span>
830
  <label>
831
- <?php echo esc_html_x( 'finish', 'noun', 'strong-testimonials' ); ?>
832
- <input class="element code" name="wpmtst_compat_options[lazyload][classes][<?php echo esc_attr( $key ); ?>][finish]" type="text" value="<?php echo esc_attr( $pair['finish'] ); ?>" />
 
 
 
833
  </label>
834
  </div>
835
  <?php
@@ -840,13 +930,7 @@ class Strong_Testimonials_Settings_Compat {
840
  */
841
  public function add_lazyload_pair() {
842
  ob_start();
843
- $this->settings_page_lazyload_class_inputs(
844
- $_REQUEST['key'],
845
- array(
846
- 'start' => '',
847
- 'finish' => '',
848
- )
849
- );
850
  wp_send_json_success( ob_get_clean() );
851
  }
852
 
40
  * @param $url
41
  */
42
  public function register_tab( $active_tab, $url ) {
43
+ printf( '<a href="%s" class="nav-tab %s">%s</a>',
44
+ esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
45
+ esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
46
+ __( 'Compatibility', 'strong-testimonials' )
 
47
  );
48
  }
49
 
97
  $input['controller']['initialize_on'] = sanitize_text_field( $input['controller']['initialize_on'] );
98
 
99
  // FIXME: Special handling until proper use of default values in v3.0
100
+ $default = array(
101
+ 'enabled' => false,
102
+ 'classes' => array(
103
+ array(
104
+ 'start' => '',
105
+ 'finish' => '',
106
+ ),
107
+ ),
108
+ );
109
 
110
  if ( ! isset( $input['lazyload'] ) ) {
111
 
120
  // May be multiple pairs.
121
  foreach ( $input['lazyload']['classes'] as $key => $classes ) {
122
 
123
+ // Sanitize classes or remove empty pairs.
124
  // Reduce multiple empty pairs down to default value of single empty pair.
125
  if ( $classes['start'] || $classes['finish'] ) {
126
  $input['lazyload']['classes'][ $key ]['start'] = str_replace( '.', '', sanitize_text_field( $classes['start'] ) );
127
  $input['lazyload']['classes'][ $key ]['finish'] = str_replace( '.', '', sanitize_text_field( $classes['finish'] ) );
128
  } else {
129
+ unset( $input['lazyload']['classes'][$key] );
130
  }
131
 
132
  if ( ! count( $input['lazyload']['classes'] ) ) {
133
  $input['lazyload'] = $default;
134
  }
135
+
136
  }
137
+
138
  } else {
139
 
140
  $input['lazyload'] = $default['classes'];
141
 
142
  }
143
+
144
  }
145
 
146
  return $input;
174
  */
175
  public function settings_intro() {
176
  ?>
177
+ <h2><?php _e( 'Common Scenarios', 'strong-testimonials' ); ?></h2>
178
  <table class="form-table" cellpadding="0" cellspacing="0">
179
  <tr valign="top">
180
  <td>
182
 
183
  <div class="row header">
184
  <div>
185
+ <?php _e( 'Symptom', 'strong-testimonials' ); ?>
186
  </div>
187
  <div>
188
+ <?php _e( 'Possible Cause', 'strong-testimonials' ); ?>
189
  </div>
190
  <div>
191
+ <?php _e( 'Try', 'strong-testimonials' ); ?>
192
  </div>
193
  </div>
194
 
195
  <div class="row">
196
  <div>
197
+ <p><strong><?php _e( 'Views not working', 'strong-testimonials' ); ?></strong></p>
198
+ <p><?php _e( 'A testimonial view does not appear correctly the <strong>first time</strong> you view the page but it does when you <strong>refresh</strong> the page.', 'strong-testimonials' ); ?></p>
199
+ <p><?php _e( 'For example, it has no style, no pagination, or the slider has not started.', 'strong-testimonials' ); ?></p>
200
  </div>
201
  <div>
202
+ <p><?php _e( 'Your site uses <strong>Ajax page loading</strong> &ndash; also known as page animations, transition effects or Pjax (pushState Ajax) &ndash; provided by your theme or another plugin.', 'strong-testimonials' ); ?></p>
203
+ <p><?php _e( 'Instead of loading the entire page, this technique fetches only the new content.', 'strong-testimonials' ); ?></p>
204
  </div>
205
  <div>
206
+ <p><strong><?php _e( 'Ajax Page Loading', 'strong-testimonials' ); ?>:</strong> <?php _e( 'General', 'strong-testimonials' ); ?></p>
207
  <p>
208
  <a href="#" id="set-scenario-1">
209
+ <?php /* translators: link text on Settings > Compatibility tab */ _e( 'Set this now', 'strong-testimonials' ); ?>
210
  </a>
211
  </p>
212
  </div>
214
 
215
  <div class="row">
216
  <div>
217
+ <p><strong><?php _e( 'Slider never starts', 'strong-testimonials' ); ?></strong></p>
218
+ <p><?php _e( 'A testimonial slider does not start or is missing navigation controls.', 'strong-testimonials' ); ?></p>
219
  </div>
220
  <div>
221
+ <p><?php _e( 'The page is very busy loading image galleries, other sliders or third-party resources like social media posts.', 'strong-testimonials' ); ?></p>
222
  </div>
223
  <div>
224
+ <p><strong><?php _e( 'Load Event', 'strong-testimonials' ); ?>:</strong> <?php _e( 'window load', 'strong-testimonials' ); ?></p>
225
  </div>
226
  </div>
227
 
228
  <div class="row">
229
  <div>
230
+ <p><strong><?php _e( 'Masonry layout not working', 'strong-testimonials' ); ?></strong></p>
231
+ <p><?php _e( 'A testimonial view with the Masonry layout has only one column or works inconsistently in different browsers or devices.', 'strong-testimonials' ); ?></p>
232
  </div>
233
  <div>
234
+ <p><?php _e( 'The page is very busy loading image galleries, other sliders or third-party resources like social media posts.', 'strong-testimonials' ); ?></p>
235
  </div>
236
  <div>
237
+ <p><strong><?php _e( 'Load Event', 'strong-testimonials' ); ?>:</strong> <?php _e( 'window load', 'strong-testimonials' ); ?></p>
238
  </div>
239
  </div>
240
 
243
  </tr>
244
  </table>
245
 
246
+ <h2><?php _e( 'Compatibility Settings', 'strong-testimonials' ); ?></h2>
247
 
248
  <?php
249
  }
256
  <table class="form-table" cellpadding="0" cellspacing="0">
257
  <tr valign="top">
258
  <th scope="row">
259
+ <?php _e( 'Ajax Page Loading', 'strong-testimonials' ); ?>
260
  </th>
261
  <td>
262
  <div class="row header">
263
  <p>
264
+ <?php _e( 'This does not perform Ajax page loading.', 'strong-testimonials' ); ?>
265
+ <?php _e( 'It provides compatibility with themes and plugins that use Ajax to load pages, also known as page animation or transition effects.', 'strong-testimonials' ); ?>
266
  </p>
267
  </div>
268
  <fieldset data-radio-group="prerender">
285
  ?>
286
  <div class="row">
287
  <div>
288
+ <label<?php echo $class; ?> for="page-loading-none">
289
+ <input id="page-loading-none"
290
+ name="wpmtst_compat_options[page_loading]"
291
+ type="radio"
292
+ value=""
293
+ <?php echo $checked; ?> />
294
+ <?php _e( 'None', 'strong-testimonials' ); ?>
295
+ <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
296
  </label>
297
  </div>
298
  <div>
299
+ <p class="about"><?php _e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
300
+ <p class="about"><?php _e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
301
  </div>
302
  </div>
303
  <?php
312
  ?>
313
  <div class="row">
314
  <div>
315
+ <label<?php echo $class; ?> for="page-loading-general">
316
+ <input id="page-loading-general"
317
+ name="wpmtst_compat_options[page_loading]"
318
+ type="radio"
319
+ value="general"
320
+ <?php echo $checked; ?> />
321
+ <?php _e( 'General', 'strong-testimonials' ); ?>
322
  </label>
323
  </div>
324
  <div>
325
+ <p class="about"><?php _e( 'Be ready to render any view at any time.', 'strong-testimonials' ); ?></p>
326
+ <p class="about"><?php _e( 'This works well with common Ajax methods.', 'strong-testimonials' ); ?></p>
327
  </div>
328
  </div>
329
  <?php
338
  ?>
339
  <div class="row">
340
  <div>
341
+ <label<?php echo $class; ?> for="page-loading-advanced">
342
+ <input id="page-loading-advanced"
343
+ name="wpmtst_compat_options[page_loading]"
344
+ data-group="advanced"
345
+ type="radio"
346
+ value="advanced"
347
+ <?php echo $checked; ?> />
348
+ <?php _e( 'Advanced', 'strong-testimonials' ); ?>
349
  </label>
350
  </div>
351
  <div>
352
+ <p class="about"><?php _e( 'For specific configurations.', 'strong-testimonials' ); ?></p>
353
  </div>
354
  </div>
355
  <?php
363
  <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
364
  <tr valign="top">
365
  <th scope="row">
366
+ <?php _e( 'Prerender', 'strong-testimonials' ); ?>
367
  </th>
368
  <td>
369
  <div class="row header">
370
+ <p><?php _e( 'Load stylesheets and populate script variables up front.', 'strong-testimonials' ); ?>
371
+ <a class="open-help-tab" href="#tab-panel-wpmtst-help-prerender"><?php _e( 'Help' ); ?></a>
372
  </p>
373
  </div>
374
  <fieldset data-radio-group="prerender">
391
  ?>
392
  <div class="row">
393
  <div>
394
+ <label<?php echo $class; ?> for="prerender-current">
395
+ <input id="prerender-current"
396
+ name="wpmtst_compat_options[prerender]"
397
+ type="radio"
398
+ value="current"
399
+ <?php echo $checked; ?> />
400
+ <?php _e( 'Current page', 'strong-testimonials' ); ?>
401
+ <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
402
  </label>
403
  </div>
404
  <div>
405
+ <p class="about"><?php _e( 'For the current page only.', 'strong-testimonials' ); ?></p>
406
+ <p class="about"><?php _e( 'This works well for most themes.', 'strong-testimonials' ); ?></p>
407
  </div>
408
  </div>
409
  <?php
418
  ?>
419
  <div class="row">
420
  <div>
421
+ <label<?php echo $class; ?> for="prerender-all">
422
+ <input id="prerender-all"
423
+ type="radio"
424
+ name="wpmtst_compat_options[prerender]"
425
+ value="all"
426
+ <?php echo $checked; ?> />
427
+ <?php _e( 'All views', 'strong-testimonials' ); ?>
428
  </label>
429
  </div>
430
  <div>
431
+ <p class="about"><?php _e( 'For all views. Required for Ajax page loading.', 'strong-testimonials' ); ?></p>
432
+ <p class="about"><?php _e( 'Then select an option for <strong>Monitor</strong> below.', 'strong-testimonials' ); ?></p>
433
  </div>
434
  </div>
435
  <?php
444
  ?>
445
  <div class="row">
446
  <div>
447
+ <label<?php echo $class; ?> for="prerender-none">
448
+ <input id="prerender-none"
449
+ type="radio"
450
+ name="wpmtst_compat_options[prerender]"
451
+ value="none"
452
+ <?php echo $checked; ?> />
453
+ <?php _e( 'None', 'strong-testimonials' ); ?>
454
  </label>
455
  </div>
456
  <div>
457
+ <p class="about"><?php _e( 'When the shortcode is rendered. May result in a flash of unstyled content.', 'strong-testimonials' ); ?></p>
458
  </div>
459
  </div>
460
  <?php
468
  <table class="form-table" cellpadding="0" cellspacing="0" data-sub="advanced">
469
  <tr valign="top">
470
  <th scope="row">
471
+ <?php _e( 'Monitor', 'strong-testimonials' ); ?>
472
  </th>
473
  <td>
474
  <div class="row header">
475
+ <p><?php _e( 'Initialize sliders, pagination and form validation as pages change.', 'strong-testimonials' ); ?></p>
476
  </div>
477
  <fieldset data-radio-group="method">
478
  <?php $this->settings_monitor_none(); ?>
496
  ?>
497
  <div class="row">
498
  <div>
499
+ <label<?php echo $class; ?> for="method-none">
500
+ <input id="method-none"
501
+ type="radio"
502
+ name="wpmtst_compat_options[ajax][method]"
503
+ value=""
504
+ <?php echo $checked; ?> />
505
+ <?php _e( 'None', 'strong-testimonials' ); ?>
506
+ <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
507
  </label>
508
  </div>
509
  <div>
510
+ <p class="about"><?php _e( 'No compatibility needed.', 'strong-testimonials' ); ?></p>
511
  </div>
512
  </div>
513
  <?php
522
  ?>
523
  <div class="row">
524
  <div>
525
+ <label<?php echo $class; ?> for="method-universal">
526
+ <input id="method-universal"
527
+ name="wpmtst_compat_options[ajax][method]"
528
+ type="radio"
529
+ value="universal"
530
+ data-group="universal"
531
+ <?php echo $checked; ?> />
532
+ <?php _e( 'Universal', 'strong-testimonials' ); ?>
533
  </label>
534
  </div>
535
  <div>
536
+ <p class="about"><?php _e( 'Watch for page changes on a timer.', 'strong-testimonials' ); ?></p>
537
  </div>
538
  </div>
539
 
540
  <div class="row" data-sub="universal">
541
  <div class="radio-sub">
542
  <label for="universal-timer">
543
+ <?php _ex( 'Check every', 'timer setting', 'strong-testimonials' ); ?>
544
  </label>
545
  </div>
546
  <div>
547
+ <input id="universal-timer"
548
+ name="wpmtst_compat_options[ajax][universal_timer]"
549
+ type="number"
550
+ min=".1" max="5" step=".1"
551
+ value="<?php echo $this->options['ajax']['universal_timer']; ?>"
552
+ size="3" />
553
+ <?php _ex( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
554
  </div>
555
  </div>
556
  <?php
565
  ?>
566
  <div class="row">
567
  <div>
568
+ <label<?php echo $class; ?> for="method-observer">
569
+ <input id="method-observer"
570
+ name="wpmtst_compat_options[ajax][method]"
571
+ data-group="observer"
572
+ type="radio"
573
+ value="observer"
574
+ <?php echo $checked; ?> />
575
+ <?php _e( 'Observer', 'strong-testimonials' ); ?>
576
  </label>
577
  </div>
578
  <div>
579
+ <p class="about"><?php _e( 'React to changes in specific page elements.', 'strong-testimonials' ); ?></p>
580
+ <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
581
  </div>
582
  </div>
583
 
589
  <div class="row" data-sub="observer">
590
  <div class="radio-sub">
591
  <label for="observer-timer">
592
+ <?php _ex( 'Check once after', 'timer setting', 'strong-testimonials' ); ?>
593
  </label>
594
  </div>
595
  <div>
596
+ <input id="observer-timer"
597
+ name="wpmtst_compat_options[ajax][observer_timer]"
598
+ type="number"
599
+ min=".1" max="5" step=".1"
600
+ value="<?php echo $this->options['ajax']['observer_timer']; ?>"
601
+ size="3" />
602
+ <?php _ex( 'seconds', 'timer setting', 'strong-testimonials' ); ?>
603
  </div>
604
  </div>
605
 
611
  <div class="row" data-sub="observer">
612
  <div class="radio-sub">
613
  <label for="container-id">
614
+ <?php _e( 'Container ID', 'strong-testimonials' ); ?>
615
  </label>
616
  </div>
617
  <div>
618
  <span class="code input-before">#</span>
619
+ <input class="code element"
620
+ id="container-id"
621
+ name="wpmtst_compat_options[ajax][container_id]"
622
+ type="text"
623
+ value="<?php echo $this->options['ajax']['container_id']; ?>" />
624
+ <p class="about adjacent"><?php _e( 'the element to observe', 'strong-testimonials' ); ?></p>
625
  </div>
626
  </div>
627
 
633
  <div class="row" data-sub="observer">
634
  <div class="radio-sub">
635
  <label for="addednode-id">
636
+ <?php _e( 'Added node ID', 'strong-testimonials' ); ?>
637
  </label>
638
  </div>
639
  <div>
640
  <span class="code input-before">#</span>
641
+ <input class="code element"
642
+ id="addednode-id"
643
+ name="wpmtst_compat_options[ajax][addednode_id]"
644
+ type="text"
645
+ value="<?php echo $this->options['ajax']['addednode_id']; ?>" />
646
+ <p class="about adjacent"><?php _e( 'the element being added', 'strong-testimonials' ); ?></p>
647
  </div>
648
  </div>
649
  <?php
654
  */
655
  public function settings_monitor_event() {
656
  $checked = checked( $this->options['ajax']['method'], 'event', false );
657
+ $class = $checked ? ' class="current"' : ''; ?>
 
658
  <div class="row">
659
  <div>
660
+ <label<?php echo $class; ?> for="method-event">
661
+ <input id="method-event"
662
+ name="wpmtst_compat_options[ajax][method]"
663
+ data-group="event"
664
+ type="radio"
665
+ value="event"
666
+ <?php echo $checked; ?> />
667
+ <?php _e( 'Custom event', 'strong-testimonials' ); ?>
668
  </label>
669
  </div>
670
  <div>
671
+ <p class="about"><?php _e( 'Listen for specific events.', 'strong-testimonials' ); ?></p>
672
+ <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
673
  </div>
674
  </div>
675
 
676
  <div class="row" data-sub="event">
677
  <div class="radio-sub">
678
  <label for="event-name">
679
+ <?php _e( 'Event name', 'strong-testimonials' ); ?>
680
  </label>
681
  </div>
682
  <div>
683
+ <input class="code"
684
+ id="event-name"
685
+ name="wpmtst_compat_options[ajax][event]"
686
+ type="text"
687
+ value="<?php echo $this->options['ajax']['event']; ?>"
688
+ size="30" />
689
  </div>
690
  </div>
691
  <?php
700
  ?>
701
  <div class="row">
702
  <div>
703
+ <label<?php echo $class; ?> for="method-script">
704
+ <input id="method-script"
705
+ name="wpmtst_compat_options[ajax][method]"
706
+ data-group="script"
707
+ type="radio"
708
+ value="script"
709
+ <?php echo $checked; ?> />
710
+ <?php _e( 'Specific script', 'strong-testimonials' ); ?>
711
  </label>
712
  </div>
713
  <div>
714
+ <p class="about"><?php _e( 'Register a callback for a specific Ajax script.', 'strong-testimonials' ); ?></p>
715
+ <p class="description"><?php _e( 'For advanced users.', 'strong-testimonials' ); ?></p>
716
  </div>
717
  </div>
718
 
719
  <div class="row" data-sub="script">
720
  <div class="radio-sub">
721
  <label for="script-name">
722
+ <?php _e( 'Script name', 'strong-testimonials' ); ?>
723
  </label>
724
  </div>
725
  <div>
726
  <select id="script-name" name="wpmtst_compat_options[ajax][script]">
727
  <option value="" <?php selected( $this->options['ajax']['script'], '' ); ?>>
728
+ <?php _e( '&mdash; Select &mdash;' ); ?>
729
  </option>
730
  <option value="barba" <?php selected( $this->options['ajax']['script'], 'barba' ); ?>>
731
  Barba.js
746
  <table class="form-table" cellpadding="0" cellspacing="0">
747
  <tr valign="top">
748
  <th scope="row">
749
+ <?php _e( 'Load Event', 'strong-testimonials' ); ?>
750
  </th>
751
  <td>
752
  <div class="row header">
753
+ <p><?php _e( 'When to start sliders, Masonry, pagination and form validation.', 'strong-testimonials' ); ?></p>
754
  </div>
755
  <fieldset>
756
  <?php $this->settings_page_controller_documentready(); ?>
771
  ?>
772
  <div class="row">
773
  <div>
774
+ <label<?php echo $class; ?> for="controller-documentready">
775
+ <input id="controller-documentready"
776
+ name="wpmtst_compat_options[controller][initialize_on]"
777
+ type="radio"
778
+ value="documentReady"
779
+ <?php echo $checked; ?> />
780
+ <?php _e( 'document ready', 'strong-testimonials' ); ?>
781
+ <em><?php _e( '(default)', 'strong-testimonials' ); ?></em>
782
  </label>
783
  </div>
784
  <div>
785
+ <p class="about"><?php _e( 'This works well if your page load time is less than a few seconds.', 'strong-testimonials' ); ?></p>
786
  </div>
787
  </div>
788
  <?php
797
  ?>
798
  <div class="row">
799
  <div>
800
+ <label<?php echo $class; ?> for="controller-windowload">
801
+ <input id="controller-windowload"
802
+ name="wpmtst_compat_options[controller][initialize_on]"
803
+ type="radio"
804
+ value="windowLoad"
805
+ <?php echo $checked; ?> />
806
+ <?php _e( 'window load', 'strong-testimonials' ); ?>
807
  </label>
808
  </div>
809
  <div>
810
+ <p class="about"><?php _e( 'Try this if your page load time is more than a few seconds.', 'strong-testimonials' ); ?></p>
811
  </div>
812
  </div>
813
  <?php
823
  <table class="form-table" cellpadding="0" cellspacing="0">
824
  <tr valign="top">
825
  <th scope="row">
826
+ <?php _e( 'Lazy Loading Images', 'strong-testimonials' ); ?>
827
  </th>
828
  <td>
829
  <div class="row header">
830
+ <p><?php _e( 'Watch for lazy loading images in themes and plugins.', 'strong-testimonials' ); ?></p>
831
  </div>
832
  <fieldset>
833
  <?php $this->settings_page_lazyload_enabled(); ?>
854
  name="wpmtst_compat_options[lazyload][enabled]"
855
  data-group="lazyload"
856
  type="checkbox"
857
+ <?php echo $checked; ?> />
858
+ <?php _e( 'Enable watcher', 'strong-testimonials' ); ?>
859
  </label>
860
  </div>
861
  <div data-sub="lazyload">
862
+ <p class="about"><?php _e( 'Most lazy loading techniques use one or two CSS class names to indicate which images to lazy load and when the lazy loading is finished.', 'strong-testimonials' ); ?></p>
863
+ <p class="about"><?php _e( 'Contact support for your theme or plugin to ask if it uses CSS class names.', 'strong-testimonials' ); ?></p>
864
  </div>
865
  </div>
866
  <?php
876
  <div class="row" data-sub="lazyload">
877
  <div>
878
  <label>
879
+ <?php _e( 'CSS Class Names', 'strong-testimonials' ); ?>
880
  </label>
881
  </div>
882
  <div class="lazyload-pairs">
888
  }
889
  ?>
890
  <div class="pair-actions">
891
+ <input class="button"
892
+ id="add-pair"
893
+ value="<?php esc_attr_e( 'Add Classes', 'strong-testimonials' ); ?>"
894
+ type="button" />
895
  </div>
896
  </div>
897
  </div>
907
  ?>
908
  <div class="pair">
909
  <label>
910
+ <?php _ex( 'start', 'noun', 'strong-testimonials' ); ?>
911
+ <input class="element code"
912
+ name="wpmtst_compat_options[lazyload][classes][<?php echo $key; ?>][start]"
913
+ type="text"
914
+ value="<?php echo esc_attr( $pair['start'] ); ?>" />
915
  </label>
916
  <span class="pair-sep"></span>
917
  <label>
918
+ <?php _ex( 'finish', 'noun', 'strong-testimonials' ); ?>
919
+ <input class="element code"
920
+ name="wpmtst_compat_options[lazyload][classes][<?php echo $key; ?>][finish]"
921
+ type="text"
922
+ value="<?php echo esc_attr( $pair['finish'] ); ?>" />
923
  </label>
924
  </div>
925
  <?php
930
  */
931
  public function add_lazyload_pair() {
932
  ob_start();
933
+ $this->settings_page_lazyload_class_inputs( $_REQUEST['key'], array( 'start' => '', 'finish' => '' ) );
 
 
 
 
 
 
934
  wp_send_json_success( ob_get_clean() );
935
  }
936
 
admin/settings/class-strong-testimonials-settings-form.php CHANGED
@@ -26,7 +26,7 @@ class Strong_Testimonials_Settings_Form {
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_settings_tabs', array( __CLASS__, 'register_tab' ), 2, 2 );
31
  add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
 
@@ -43,11 +43,10 @@ class Strong_Testimonials_Settings_Form {
43
  * @param $url
44
  */
45
  public static function register_tab( $active_tab, $url ) {
46
- printf(
47
- '<a href="%s" class="nav-tab %s">%s</a>',
48
  esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
49
  esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
50
- esc_html__( 'Form', 'strong-testimonials' )
51
  );
52
  }
53
 
@@ -75,7 +74,7 @@ class Strong_Testimonials_Settings_Form {
75
  */
76
  public static function settings_page() {
77
  settings_fields( self::GROUP_NAME );
78
- include WPMTST_ADMIN . 'settings/partials/form.php';
79
  }
80
 
81
  /**
@@ -138,9 +137,9 @@ class Strong_Testimonials_Settings_Form {
138
  $input['email_subject'] = isset( $input['email_subject'] ) ? wp_kses_post( trim( $input['email_subject'] ) ) : '';
139
  $input['email_message'] = isset( $input['email_message'] ) ? wp_kses_post( rtrim( $input['email_message'] ) ) : '';
140
 
141
- $input['honeypot_before'] = wpmtst_sanitize_checkbox( $input, 'honeypot_before' );
142
- $input['honeypot_after'] = wpmtst_sanitize_checkbox( $input, 'honeypot_after' );
143
- $input['captcha'] = sanitize_text_field( $input['captcha'] );
144
 
145
  foreach ( $input['messages'] as $key => $message ) {
146
  if ( 'submission-success' == $key ) {
@@ -172,29 +171,17 @@ class Strong_Testimonials_Settings_Form {
172
  }
173
 
174
  // Check the "ID or slug" field next
175
- if ( isset( $input['success_redirect_2'] ) && $input['success_redirect_2'] ) {
176
 
177
  // is post ID?
178
  $id = sanitize_text_field( $input['success_redirect_2'] );
179
  if ( is_numeric( $id ) ) {
180
- if ( ! get_posts(
181
- array(
182
- 'p' => $id,
183
- 'post_type' => array( 'page' ),
184
- 'post_status' => 'publish',
185
- )
186
- ) ) {
187
  $id = null;
188
  }
189
  } else {
190
  // is post slug?
191
- $target = get_posts(
192
- array(
193
- 'name' => $id,
194
- 'post_type' => array( 'page' ),
195
- 'post_status' => 'publish',
196
- )
197
- );
198
  if ( $target ) {
199
  $id = $target[0]->ID;
200
  }
@@ -203,11 +190,13 @@ class Strong_Testimonials_Settings_Form {
203
  if ( $id ) {
204
  $input['success_redirect_id'] = $id;
205
  }
 
206
  } else {
207
 
208
  if ( isset( $input['success_redirect_id'] ) ) {
209
  $input['success_redirect_id'] = (int) sanitize_text_field( $input['success_redirect_id'] );
210
  }
 
211
  }
212
 
213
  unset( $input['success_redirect_2'] );
@@ -223,7 +212,7 @@ class Strong_Testimonials_Settings_Form {
223
  */
224
  public static function restore_default_messages_function() {
225
  $default_form_options = Strong_Testimonials_Defaults::get_form_options();
226
- $messages = $default_form_options['messages'];
227
  echo json_encode( $messages );
228
  wp_die();
229
  }
@@ -234,9 +223,9 @@ class Strong_Testimonials_Settings_Form {
234
  * @since 1.13
235
  */
236
  public static function restore_default_message_function() {
237
- $input = str_replace( '_', '-', $_REQUEST['field'] );
238
  $default_form_options = Strong_Testimonials_Defaults::get_form_options();
239
- $message = $default_form_options['messages'][ $input ];
240
  echo json_encode( $message );
241
  wp_die();
242
  }
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_settings_tabs', array( __CLASS__, 'register_tab' ), 2, 2 );
31
  add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
 
43
  * @param $url
44
  */
45
  public static function register_tab( $active_tab, $url ) {
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
+ __( 'Form', 'strong-testimonials' )
50
  );
51
  }
52
 
74
  */
75
  public static function settings_page() {
76
  settings_fields( self::GROUP_NAME );
77
+ include( WPMTST_ADMIN . 'settings/partials/form.php' );
78
  }
79
 
80
  /**
137
  $input['email_subject'] = isset( $input['email_subject'] ) ? wp_kses_post( trim( $input['email_subject'] ) ) : '';
138
  $input['email_message'] = isset( $input['email_message'] ) ? wp_kses_post( rtrim( $input['email_message'] ) ) : '';
139
 
140
+ $input['honeypot_before'] = wpmtst_sanitize_checkbox( $input, 'honeypot_before' );
141
+ $input['honeypot_after'] = wpmtst_sanitize_checkbox( $input, 'honeypot_after' );
142
+ $input['captcha'] = sanitize_text_field( $input['captcha'] );
143
 
144
  foreach ( $input['messages'] as $key => $message ) {
145
  if ( 'submission-success' == $key ) {
171
  }
172
 
173
  // Check the "ID or slug" field next
174
+ if ( isset( $input['success_redirect_2']) && $input['success_redirect_2'] ) {
175
 
176
  // is post ID?
177
  $id = sanitize_text_field( $input['success_redirect_2'] );
178
  if ( is_numeric( $id ) ) {
179
+ if ( ! get_posts( array( 'p' => $id, 'post_type' => array( 'page' ), 'post_status' => 'publish' ) ) ) {
 
 
 
 
 
 
180
  $id = null;
181
  }
182
  } else {
183
  // is post slug?
184
+ $target = get_posts( array( 'name' => $id, 'post_type' => array( 'page' ), 'post_status' => 'publish' ) );
 
 
 
 
 
 
185
  if ( $target ) {
186
  $id = $target[0]->ID;
187
  }
190
  if ( $id ) {
191
  $input['success_redirect_id'] = $id;
192
  }
193
+
194
  } else {
195
 
196
  if ( isset( $input['success_redirect_id'] ) ) {
197
  $input['success_redirect_id'] = (int) sanitize_text_field( $input['success_redirect_id'] );
198
  }
199
+
200
  }
201
 
202
  unset( $input['success_redirect_2'] );
212
  */
213
  public static function restore_default_messages_function() {
214
  $default_form_options = Strong_Testimonials_Defaults::get_form_options();
215
+ $messages = $default_form_options['messages'];
216
  echo json_encode( $messages );
217
  wp_die();
218
  }
223
  * @since 1.13
224
  */
225
  public static function restore_default_message_function() {
226
+ $input = str_replace( '_', '-', $_REQUEST['field'] );
227
  $default_form_options = Strong_Testimonials_Defaults::get_form_options();
228
+ $message = $default_form_options['messages'][$input];
229
  echo json_encode( $message );
230
  wp_die();
231
  }
admin/settings/class-strong-testimonials-settings-general.php CHANGED
@@ -26,9 +26,9 @@ class Strong_Testimonials_Settings_General {
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_settings_tabs', array( __CLASS__, 'register_tab' ), 1, 2 );
31
- add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
  }
33
 
34
  /**
@@ -38,11 +38,10 @@ class Strong_Testimonials_Settings_General {
38
  * @param $url
39
  */
40
  public static function register_tab( $active_tab, $url ) {
41
- printf(
42
- '<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
- esc_html_x( 'General', 'adjective', 'strong-testimonials' )
46
  );
47
  }
48
 
@@ -54,15 +53,15 @@ class Strong_Testimonials_Settings_General {
54
  }
55
 
56
  /**
57
- * Register settings page.
58
- *
59
  * @param $pages
60
  *
61
  * @return mixed
62
  */
63
  public static function register_settings_page( $pages ) {
64
- $pages[ self::TAB_NAME ] = array( __CLASS__, 'settings_page' );
65
- return $pages;
66
  }
67
 
68
  /**
@@ -70,7 +69,7 @@ class Strong_Testimonials_Settings_General {
70
  */
71
  public static function settings_page() {
72
  settings_fields( self::GROUP_NAME );
73
- include WPMTST_ADMIN . 'settings/partials/general.php';
74
  }
75
 
76
  /**
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_settings_tabs', array( __CLASS__, 'register_tab' ), 1, 2 );
31
+ add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
  }
33
 
34
  /**
38
  * @param $url
39
  */
40
  public static function register_tab( $active_tab, $url ) {
41
+ printf( '<a href="%s" class="nav-tab %s">%s</a>',
 
42
  esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
43
  esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
44
+ _x( 'General', 'adjective', 'strong-testimonials' )
45
  );
46
  }
47
 
53
  }
54
 
55
  /**
56
+ * Register settings page.
57
+ *
58
  * @param $pages
59
  *
60
  * @return mixed
61
  */
62
  public static function register_settings_page( $pages ) {
63
+ $pages[ self::TAB_NAME ] = array( __CLASS__, 'settings_page' );
64
+ return $pages;
65
  }
66
 
67
  /**
69
  */
70
  public static function settings_page() {
71
  settings_fields( self::GROUP_NAME );
72
+ include( WPMTST_ADMIN . 'settings/partials/general.php' );
73
  }
74
 
75
  /**
admin/settings/class-strong-testimonials-settings-licenses.php CHANGED
@@ -26,7 +26,7 @@ class Strong_Testimonials_Settings_Licenses {
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_settings_tabs', array( __CLASS__, 'register_tab' ), 90, 2 );
31
  add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
  }
@@ -48,11 +48,10 @@ class Strong_Testimonials_Settings_Licenses {
48
  */
49
  public static function register_tab( $active_tab, $url ) {
50
  if ( self::has_active_addons() ) {
51
- printf(
52
- '<a href="%s" class="nav-tab %s">%s</a>',
53
  esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
54
  esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
55
- esc_html__( 'Licenses', 'strong-testimonials' )
56
  );
57
  }
58
  }
@@ -81,7 +80,7 @@ class Strong_Testimonials_Settings_Licenses {
81
  */
82
  public static function settings_page() {
83
  settings_fields( self::GROUP_NAME );
84
- include WPMTST_ADMIN . 'settings/partials/licenses.php';
85
  }
86
 
87
  /**
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_settings_tabs', array( __CLASS__, 'register_tab' ), 90, 2 );
31
  add_filter( 'wpmtst_settings_callbacks', array( __CLASS__, 'register_settings_page' ) );
32
  }
48
  */
49
  public static function register_tab( $active_tab, $url ) {
50
  if ( self::has_active_addons() ) {
51
+ printf( '<a href="%s" class="nav-tab %s">%s</a>',
 
52
  esc_url( add_query_arg( 'tab', self::TAB_NAME, $url ) ),
53
  esc_attr( $active_tab == self::TAB_NAME ? 'nav-tab-active' : '' ),
54
+ __( 'Licenses', 'strong-testimonials' )
55
  );
56
  }
57
  }
80
  */
81
  public static function settings_page() {
82
  settings_fields( self::GROUP_NAME );
83
+ include( WPMTST_ADMIN . 'settings/partials/licenses.php' );
84
  }
85
 
86
  /**
admin/settings/class-strong-testimonials-settings.php CHANGED
@@ -4,9 +4,9 @@
4
  */
5
  class Strong_Testimonials_Settings {
6
 
7
- const DEFAULT_TAB = 'general';
8
 
9
- public static $callbacks;
10
 
11
  /**
12
  * Strong_Testimonials_Settings constructor.
@@ -33,27 +33,26 @@ class Strong_Testimonials_Settings {
33
  */
34
  public static function register_settings() {
35
  self::$callbacks = apply_filters( 'wpmtst_settings_callbacks', array() );
36
- do_action( 'wpmtst_register_settings' );
37
  }
38
 
39
  /**
40
  * Settings page
41
  */
42
  public static function settings_page() {
43
- if ( ! current_user_can( 'strong_testimonials_options' ) ) {
44
- wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
45
- }
46
 
47
  $tab = self::get_tab();
48
  $url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings' );
49
  ?>
50
  <div class="wrap wpmtst">
51
 
52
- <h1><?php echo wp_kses_post( apply_filters( 'wpmtst_cpt_singular_name', esc_html__( 'Testimonial', 'strong-testimonials' ) ) ); ?> <?php esc_html_e( 'Settings' ); ?></h1>
53
 
54
  <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
55
  <div id="message" class="updated notice is-dismissible">
56
- <p><?php esc_html_e( 'Settings saved.' ); ?></p>
57
  </div>
58
  <?php endif; ?>
59
 
@@ -61,7 +60,7 @@ class Strong_Testimonials_Settings {
61
  <?php do_action( 'wpmtst_settings_tabs', $tab, $url ); ?>
62
  </h2>
63
 
64
- <form id="<?php echo esc_attr( $tab ); ?>-form" method="post" action="options.php">
65
  <?php
66
  if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
67
  call_user_func( self::$callbacks[ $tab ] );
@@ -70,11 +69,11 @@ class Strong_Testimonials_Settings {
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
 
80
  </div><!-- .wrap -->
4
  */
5
  class Strong_Testimonials_Settings {
6
 
7
+ const DEFAULT_TAB = 'general';
8
 
9
+ public static $callbacks;
10
 
11
  /**
12
  * Strong_Testimonials_Settings constructor.
33
  */
34
  public static function register_settings() {
35
  self::$callbacks = apply_filters( 'wpmtst_settings_callbacks', array() );
36
+ do_action( 'wpmtst_register_settings' );
37
  }
38
 
39
  /**
40
  * Settings page
41
  */
42
  public static function settings_page() {
43
+ if ( ! current_user_can( 'strong_testimonials_options' ) )
44
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
 
45
 
46
  $tab = self::get_tab();
47
  $url = admin_url( 'edit.php?post_type=wpm-testimonial&page=testimonial-settings' );
48
  ?>
49
  <div class="wrap wpmtst">
50
 
51
+ <h1><?php echo apply_filters( 'wpmtst_cpt_singular_name', __( 'Testimonial', 'strong-testimonials' ) ); ?> <?php _e( 'Settings' ); ?></h1>
52
 
53
  <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
54
  <div id="message" class="updated notice is-dismissible">
55
+ <p><?php _e( 'Settings saved.' ) ?></p>
56
  </div>
57
  <?php endif; ?>
58
 
60
  <?php do_action( 'wpmtst_settings_tabs', $tab, $url ); ?>
61
  </h2>
62
 
63
+ <form id="<?php esc_attr_e( $tab ); ?>-form" method="post" action="options.php">
64
  <?php
65
  if ( isset( self::$callbacks[ $tab ] ) && wpmtst_callback_exists( self::$callbacks[ $tab ] ) ) {
66
  call_user_func( self::$callbacks[ $tab ] );
69
  }
70
 
71
  if ( has_action( 'wpmtst_settings_submit_row' ) ) {
72
+ echo '<p class="submit-buttons">';
73
  do_action( 'wpmtst_settings_submit_row' );
74
+ echo '</p>';
75
+ }
76
+ ?>
77
  </form>
78
 
79
  </div><!-- .wrap -->
admin/settings/partials/email-from.php CHANGED
@@ -1,77 +1,93 @@
1
  <div class="match-height gutter">
2
- <fieldset>
3
- <label for="wpmtst-options-mail-queue">
4
- <input id="wpmtst-options-mail-queue" type="checkbox" name="wpmtst_form_options[mail_queue]" <?php checked( $form_options['mail_queue'] ); ?>>
5
- <?php esc_html_e( 'Use mail queue. For services like Mandrill. Off by default.', 'strong-testimonials' ); ?>
6
- </label>
7
- </fieldset>
 
 
8
  </div>
9
 
10
  <div class="email-option-first">
11
- <div class="email-option-row">
12
-
13
- <div class="email-option-desc">
14
- <?php esc_html_e( 'From', 'strong-testimonials' ); ?>
15
- </div>
16
-
17
- <div class="email-option-inputs">
18
-
19
- <div class="email-option header">
20
-
21
- <div class="email-option-part">
22
- <div class="email-option-label">
23
- <?php esc_html_e( 'Name', 'strong-testimonials' ); ?>
24
- </div>
25
- </div>
26
-
27
- <div class="email-option-part">
28
- <div class="email-option-label">
29
- <?php esc_html_e( 'Email', 'strong-testimonials' ); ?>
30
- </div>
31
- </div>
32
-
33
- </div>
34
-
35
- <div class="email-option body recipient">
36
-
37
- <div class="email-option-part">
38
- <div class="email-option-fieldset">
39
- <div class="controls"></div>
40
- <div class="fields">
41
- <input type="text" id="wpmtst-options-sender-name" name="wpmtst_form_options[sender_name]" value="<?php echo esc_attr( $form_options['sender_name'] ); ?>" placeholder="<?php esc_attr_e( '(optional)', 'strong-testimonials' ); ?>">
42
- </div>
43
- </div>
44
- </div>
45
-
46
- <div class="email-option-part">
47
-
48
- <div class="email-option-fieldset">
49
-
50
- <div class="controls">
51
- <input type="radio" id="wpmtst-options-sender-site-email-1" name="wpmtst_form_options[sender_site_email]" <?php checked( $form_options['sender_site_email'], 1 ); ?> value="1">
52
- </div>
53
- <div class="fields">
54
- <?php esc_html_e( 'admin:', 'strong-testimonials' ); ?>
55
- &nbsp;<?php echo wp_kses_post( get_bloginfo( 'admin_email' ) ); ?>
56
- </div>
57
-
58
- </div>
59
-
60
- <div class="email-option-fieldset">
61
-
62
- <div class="controls">
63
- <input class="focus-next-field" type="radio" id="wpmtst-options-sender-site-email-0" name="wpmtst_form_options[sender_site_email]" <?php checked( $form_options['sender_site_email'], 0 ); ?> value="0">
64
- </div>
65
- <div class="fields">
66
- <input type="email" id="wpmtst-options-sender-email" name="wpmtst_form_options[sender_email]" value="<?php echo esc_attr( $form_options['sender_email'] ); ?>" placeholder="<?php esc_attr_e( 'email address', 'strong-testimonials' ); ?>">
67
- </div>
68
-
69
- </div>
70
- </div>
71
-
72
- </div>
73
-
74
- </div>
75
-
76
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  </div>
1
  <div class="match-height gutter">
2
+ <fieldset>
3
+ <label for="wpmtst-options-mail-queue">
4
+ <input id="wpmtst-options-mail-queue"
5
+ type="checkbox"
6
+ name="wpmtst_form_options[mail_queue]" <?php checked( $form_options['mail_queue'] ); ?>>
7
+ <?php _e( 'Use mail queue. For services like Mandrill. Off by default.', 'strong-testimonials' ); ?>
8
+ </label>
9
+ </fieldset>
10
  </div>
11
 
12
  <div class="email-option-first">
13
+ <div class="email-option-row">
14
+
15
+ <div class="email-option-desc">
16
+ <?php _e( "From", 'strong-testimonials' ); ?>
17
+ </div>
18
+
19
+ <div class="email-option-inputs">
20
+
21
+ <div class="email-option header">
22
+
23
+ <div class="email-option-part">
24
+ <div class="email-option-label">
25
+ <?php _e( "Name", 'strong-testimonials' ); ?>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="email-option-part">
30
+ <div class="email-option-label">
31
+ <?php _e( "Email", 'strong-testimonials' ); ?>
32
+ </div>
33
+ </div>
34
+
35
+ </div>
36
+
37
+ <div class="email-option body recipient">
38
+
39
+ <div class="email-option-part">
40
+ <div class="email-option-fieldset">
41
+ <div class="controls"></div>
42
+ <div class="fields">
43
+ <input type="text"
44
+ id="wpmtst-options-sender-name"
45
+ name="wpmtst_form_options[sender_name]"
46
+ value="<?php echo esc_attr( $form_options['sender_name'] ); ?>"
47
+ placeholder="<?php _e( '(optional)', 'strong-testimonials' ); ?>">
48
+ </div>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="email-option-part">
53
+
54
+ <div class="email-option-fieldset">
55
+
56
+ <div class="controls">
57
+ <input type="radio"
58
+ id="wpmtst-options-sender-site-email-1"
59
+ name="wpmtst_form_options[sender_site_email]" <?php checked( $form_options['sender_site_email'], 1 ); ?>
60
+ value="1">
61
+ </div>
62
+ <div class="fields">
63
+ <?php _e( 'admin:', 'strong-testimonials' ); ?>
64
+ &nbsp;<?php echo get_bloginfo( 'admin_email' ); ?>
65
+ </div>
66
+
67
+ </div>
68
+
69
+ <div class="email-option-fieldset">
70
+
71
+ <div class="controls">
72
+ <input class="focus-next-field" type="radio"
73
+ id="wpmtst-options-sender-site-email-0"
74
+ name="wpmtst_form_options[sender_site_email]" <?php checked( $form_options['sender_site_email'], 0 ); ?>
75
+ value="0">
76
+ </div>
77
+ <div class="fields">
78
+ <input type="email"
79
+ id="wpmtst-options-sender-email"
80
+ name="wpmtst_form_options[sender_email]"
81
+ value="<?php echo esc_attr( $form_options['sender_email'] ); ?>"
82
+ placeholder="<?php _e( 'email address', 'strong-testimonials' ); ?>">
83
+ </div>
84
+
85
+ </div>
86
+ </div>
87
+
88
+ </div>
89
+
90
+ </div>
91
+
92
+ </div>
93
  </div>
admin/settings/partials/email-to.php CHANGED
@@ -1,27 +1,27 @@
1
  <div>
2
- <div class="email-option-row">
3
 
4
- <div class="email-option-desc">
5
- <?php esc_html_e( 'To', 'strong-testimonials' ); ?>
6
- </div>
7
 
8
- <div class="email-option-inputs">
9
 
10
- <div class="email-option header">
11
 
12
- <div class="email-option-part">
13
- <div class="email-option-label">
14
- <?php esc_html_e( 'Name', 'strong-testimonials' ); ?>
15
- </div>
16
- </div>
17
 
18
- <div class="email-option-part">
19
- <div class="email-option-label">
20
- <?php esc_html_e( 'Email', 'strong-testimonials' ); ?>
21
- </div>
22
- </div>
23
 
24
- </div>
25
 
26
  <?php
27
  if ( isset( $form_options['recipients'] ) && $form_options['recipients'] ) {
@@ -31,12 +31,13 @@
31
  }
32
  ?>
33
 
34
- <div class="email-option footer">
35
- <input class="button" type="button" id="add-recipient" value="<?php esc_attr_e( 'Add recipient', 'strong-testimonials' ); ?>">
36
- </div>
 
37
 
38
- </div>
39
 
40
- </div>
41
 
42
- </div>
1
  <div>
2
+ <div class="email-option-row">
3
 
4
+ <div class="email-option-desc">
5
+ <?php _e( "To", 'strong-testimonials' ); ?>
6
+ </div>
7
 
8
+ <div class="email-option-inputs">
9
 
10
+ <div class="email-option header">
11
 
12
+ <div class="email-option-part">
13
+ <div class="email-option-label">
14
+ <?php _e( 'Name', 'strong-testimonials' ); ?>
15
+ </div>
16
+ </div>
17
 
18
+ <div class="email-option-part">
19
+ <div class="email-option-label">
20
+ <?php _e( 'Email', 'strong-testimonials' ); ?>
21
+ </div>
22
+ </div>
23
 
24
+ </div>
25
 
26
  <?php
27
  if ( isset( $form_options['recipients'] ) && $form_options['recipients'] ) {
31
  }
32
  ?>
33
 
34
+ <div class="email-option footer">
35
+ <input class="button" type="button" id="add-recipient"
36
+ value="<?php esc_attr_e( 'Add recipient', 'strong-testimonials' ); ?>">
37
+ </div>
38
 
39
+ </div>
40
 
41
+ </div>
42
 
43
+ </div>
admin/settings/partials/email.php CHANGED
@@ -1,55 +1,64 @@
1
  <div class="email-option-row">
2
 
3
- <div class="email-option-desc">
4
- <label for="wpmtst-option-email-subject">
5
- <?php esc_html_e( 'Subject', 'strong-testimonials' ); ?>
6
- </label>
7
- </div>
8
-
9
- <div class="email-option-inputs">
10
- <div class="email-option body">
11
- <input class="wide" type="text" id="wpmtst-option-email-subject" name="wpmtst_form_options[email_subject]" value="<?php echo esc_attr( $form_options['email_subject'] ); ?>" placeholder="<?php esc_attr_e( 'subject line', 'strong-testimonials' ); ?>" size="50">
12
- </div>
13
- </div>
 
 
 
 
 
 
14
 
15
  </div>
16
 
17
  <div class="email-option-row">
18
 
19
- <div class="email-option-desc">
20
- <label for="wpmtst-option-email-message">
21
- <?php esc_html_e( 'Message', 'strong-testimonials' ); ?>
22
- </label>
23
- </div>
24
 
25
  <?php $line_count = max( count( explode( "\n", $form_options['email_message'] ) ), 3 ); ?>
26
- <div class="email-option-inputs">
27
- <div class="email-option body">
28
- <textarea class="autosize" id="wpmtst-option-email-message" name="wpmtst_form_options[email_message]" rows="<?php echo esc_attr( $line_count ); ?>" placeholder="<?php esc_attr_e( 'message text', 'strong-testimonials' ); ?>"><?php echo esc_attr( $form_options['email_message'] ); ?></textarea>
29
- </div>
30
- </div>
 
 
 
31
 
32
  </div>
33
 
34
  <div class="email-option-row column no-padding">
35
 
36
- <div class="template-tags-help">
37
- <div class="title"><?php esc_html_e( 'Tags for Subject and Message', 'strong-testimonials' ); ?></div>
38
- <div class="content">
39
- <ul id="wpmtst-tags-list">
40
- <li>%BLOGNAME%</li>
41
- <li>%TITLE%</li>
42
- <li>%CONTENT%</li>
43
- <li>%STATUS%</li>
44
- <li>%SUBMIT_DATE%</li>
45
- <?php
46
  $custom_fields = wpmtst_get_custom_fields();
47
  foreach ( $custom_fields as $field ) {
48
- echo '<li>%' . esc_html( strtoupper( $field['name'] ) ) . '%</li>' . "\n";
49
  }
50
  ?>
51
- </ul>
52
- </div>
53
- </div>
54
 
55
  </div>
1
  <div class="email-option-row">
2
 
3
+ <div class="email-option-desc">
4
+ <label for="wpmtst-option-email-subject">
5
+ <?php _e( "Subject", 'strong-testimonials' ); ?>
6
+ </label>
7
+ </div>
8
+
9
+ <div class="email-option-inputs">
10
+ <div class="email-option body">
11
+ <input class="wide"
12
+ type="text"
13
+ id="wpmtst-option-email-subject"
14
+ name="wpmtst_form_options[email_subject]"
15
+ value="<?php echo esc_attr( $form_options['email_subject'] ); ?>"
16
+ placeholder="<?php _e( 'subject line', 'strong-testimonials' ); ?>"
17
+ size="50">
18
+ </div>
19
+ </div>
20
 
21
  </div>
22
 
23
  <div class="email-option-row">
24
 
25
+ <div class="email-option-desc">
26
+ <label for="wpmtst-option-email-message">
27
+ <?php _e( "Message", 'strong-testimonials' ); ?>
28
+ </label>
29
+ </div>
30
 
31
  <?php $line_count = max( count( explode( "\n", $form_options['email_message'] ) ), 3 ); ?>
32
+ <div class="email-option-inputs">
33
+ <div class="email-option body">
34
+ <textarea class="autosize"
35
+ id="wpmtst-option-email-message" name="wpmtst_form_options[email_message]"
36
+ rows="<?php echo esc_attr( $line_count ); ?>"
37
+ placeholder="<?php _e( 'message text', 'strong-testimonials' ); ?>"><?php echo esc_attr( $form_options['email_message'] ); ?></textarea>
38
+ </div>
39
+ </div>
40
 
41
  </div>
42
 
43
  <div class="email-option-row column no-padding">
44
 
45
+ <div class="template-tags-help">
46
+ <div class="title"><?php _e( "Tags for Subject and Message", 'strong-testimonials' ); ?></div>
47
+ <div class="content">
48
+ <ul id="wpmtst-tags-list">
49
+ <li>%BLOGNAME%</li>
50
+ <li>%TITLE%</li>
51
+ <li>%CONTENT%</li>
52
+ <li>%STATUS%</li>
53
+ <li>%SUBMIT_DATE%</li>
54
+ <?php
55
  $custom_fields = wpmtst_get_custom_fields();
56
  foreach ( $custom_fields as $field ) {
57
+ echo '<li>%' . strtoupper( $field['name'] ) . '%</li>' . "\n";
58
  }
59
  ?>
60
+ </ul>
61
+ </div>
62
+ </div>
63
 
64
  </div>
admin/settings/partials/form.php CHANGED
@@ -32,9 +32,12 @@ foreach ( $plugins as $key => $plugin ) {
32
  $form_options['captcha'] = '';
33
  update_option( 'wpmtst_form_options', $form_options );
34
  }
 
35
  }
36
  ?>
37
- <input type="hidden" name="wpmtst_form_options[default_recipient]" value="<?php echo esc_attr( htmlentities( serialize( $form_options['default_recipient'] ) ) ); ?>">
 
 
38
 
39
  <?php
40
  /**
@@ -43,14 +46,14 @@ foreach ( $plugins as $key => $plugin ) {
43
  * ========================================
44
  */
45
  ?>
46
- <h2><?php esc_html_e( 'Form Labels & Messages', 'strong-testimonials' ); ?></h2>
47
 
48
  <?php do_action( 'wpmtst_before_form_settings', 'form-messages' ); ?>
49
 
50
  <table class="form-table compact" cellpadding="0" cellspacing="0">
51
  <?php
52
  $messages = $form_options['messages'];
53
- foreach ( $messages as $key => $message ) :
54
  $required = isset( $message['required'] ) ? $message['required'] : true;
55
 
56
  $elid = str_replace( '-', '_', $key );
@@ -58,15 +61,16 @@ foreach ( $plugins as $key => $plugin ) {
58
  $content = apply_filters( 'wpmtst_l10n', $message['text'], 'strong-testimonials-form-messages', $message['description'] );
59
  ?>
60
 
61
- <tr>
62
- <th scope="row">
63
- <label for="<?php echo esc_attr( $elid ); ?>">
64
- <?php echo esc_html( $message['description'] ); ?>
65
- </label>
66
- <input type="hidden" name="wpmtst_form_options[messages][<?php echo esc_attr( $key ); ?>][description]" value="<?php echo esc_attr( $message['description'] ); ?>"/>
67
- </th>
68
- <td>
69
- <?php if ( 'submission_success' == $elid ) : ?>
 
70
  <?php
71
  $settings = array(
72
  'textarea_name' => "wpmtst_form_options[messages][$key][text]",
@@ -74,54 +78,65 @@ foreach ( $plugins as $key => $plugin ) {
74
  );
75
  wp_editor( $content, $elid, $settings );
76
  ?>
77
- <?php else : ?>
78
- <?php if ( 'required_field' == $elid ) : ?>
79
- <fieldset>
80
- <label>
81
- <input type="checkbox" name="wpmtst_form_options[messages][<?php echo esc_attr( $key ); ?>][enabled]" <?php checked( $message['enabled'] ); ?>">
82
- <?php esc_html_e( 'Display required notice at top of form', 'strong-testimonials' ); ?>
83
- </label
84
- </fieldset>
 
 
85
  <?php endif; ?>
86
- <input type="text" id="<?php echo esc_attr( $elid ); ?>" name="wpmtst_form_options[messages][<?php echo esc_attr( $key ); ?>][text]" value="<?php echo esc_attr( $content ); ?>" <?php echo $required ? 'required' : ''; ?>/>
 
 
 
87
  <?php endif; ?>
88
- </td>
89
- <td class="actions">
90
- <input type="button" class="button secondary restore-default-message" value="<?php echo esc_attr_x( 'restore default', 'singular', 'strong-testimonials' ); ?>" data-target-id="<?php echo esc_attr( $elid ); ?>"/>
91
- </td>
92
- </tr>
 
 
93
 
94
  <?php endforeach; ?>
95
 
96
- <tr>
97
- <td colspan="3">
98
- <input type="button" id="restore-default-messages" class="button" name="restore-default-messages" value="<?php esc_attr_e( 'Restore Default Messages', 'strong-testimonials' ); ?>"/>
99
- </td>
100
- </tr>
 
 
101
  </table>
102
 
103
  <table class="form-table" cellpadding="0" cellspacing="0">
104
- <tr>
105
- <th scope="row" class="tall">
106
- <?php esc_html_e( 'Scroll', 'strong-testimonials' ); ?>
107
- </th>
108
- <td>
109
- <fieldset>
110
- <div>
111
- <label>
112
- <input type="checkbox" name="wpmtst_form_options[scrolltop_error]" <?php checked( $form_options['scrolltop_error'] ); ?>/>
113
- <?php echo wp_kses_post( printf( __( 'If errors, scroll to the first error minus %s pixels. On by default.', 'strong-testimonials' ), '<input type="text" name="wpmtst_form_options[scrolltop_error_offset]" value="' . $form_options['scrolltop_error_offset'] . '" size="3">' ) ); ?>
114
- </label>
115
- </div>
116
- <div>
117
- <label class="block">
118
- <input type="checkbox" name="wpmtst_form_options[scrolltop_success]" <?php checked( $form_options['scrolltop_success'] ); ?>/>
119
- <?php echo wp_kses_post( printf( __( 'If success, scroll to the success message minus %s pixels. On by default.', 'strong-testimonials' ), '<input type="text" name="wpmtst_form_options[scrolltop_success_offset]" value="' . $form_options['scrolltop_success_offset'] . '" size="3">' ) ); ?>
120
- </label>
121
- </div>
122
- </fieldset>
123
- </td>
124
- </tr>
 
 
125
  </table>
126
 
127
  <?php
@@ -132,113 +147,127 @@ foreach ( $plugins as $key => $plugin ) {
132
  */
133
  ?>
134
  <hr>
135
- <h3><?php esc_html_e( 'Form Actions', 'strong-testimonials' ); ?></h3>
136
 
137
  <table class="form-table" cellpadding="0" cellspacing="0">
138
- <tr>
139
- <th scope="row">
140
- <label for="redirect-page">
141
- <?php esc_html_e( 'Upon Successful Submission', 'strong-testimonials' ); ?>
142
- </label>
143
- </th>
144
- <td>
145
- <div>
146
- <label class="success-action">
147
- <input type="radio" name="wpmtst_form_options[success_action]" value="message" <?php checked( 'message', $form_options['success_action'] ); ?>/> <?php esc_html_e( 'display message', 'strong-testimonials' ); ?>
148
- </label>
149
- </div>
150
-
151
- <div>
152
- <label class="success-action">
153
- <input type="radio" name="wpmtst_form_options[success_action]" value="id" <?php checked( 'id', $form_options['success_action'] ); ?>/> <?php esc_html_e( 'redirect to a page', 'strong-testimonials' ); ?>
154
- </label>
155
-
156
- <select id="redirect-page" name="wpmtst_form_options[success_redirect_id]">
157
-
158
- <option value=""><?php esc_html_e( '&mdash; select a page &mdash;' ); ?></option>
 
 
 
 
159
 
160
  <?php foreach ( $pages_list as $pages ) : ?>
161
 
162
- <option value="<?php echo esc_attr( $pages->ID ); ?>" <?php selected( isset( $form_options['success_redirect_id'] ) ? $form_options['success_redirect_id'] : 0, $pages->ID ); ?>>
163
- <?php echo esc_html( $pages->post_title ); ?>
164
- </option>
165
 
166
  <?php endforeach; ?>
167
 
168
- </select>
169
-
170
- <div style="display: inline-block; text-indent: 20px;">
171
- <label>
172
- <?php echo esc_html_x( 'or enter its ID or slug', 'to select a redirect page', 'strong-testimonials' ); ?>
173
- &nbsp;
174
- <input type="text" id="redirect-page-2" name="wpmtst_form_options[success_redirect_2]" size="30">
175
- </label>
176
- </div>
177
- </div>
178
-
179
- <div>
180
- <label class="success-action">
181
- <input type="radio" name="wpmtst_form_options[success_action]" value="url" <?php checked( 'url', $form_options['success_action'] ); ?>/>
182
- <?php esc_html_e( 'redirect to a URL', 'strong-testimonials' ); ?>
183
- </label>
184
- <label>
185
- <input type="text" id="redirect-page-3" name="wpmtst_form_options[success_redirect_url]" value="<?php echo esc_attr( $form_options['success_redirect_url'] ); ?>" size="75"/>
186
- </label>
187
- </div>
188
-
189
- </td>
190
- </tr>
191
-
192
- <tr>
193
- <th scope="row">
194
- <label>
195
- <?php esc_html_e( 'Post Status', 'strong-testimonials' ); ?>
196
- </label>
197
- </th>
198
- <td>
199
- <ul class="compact">
200
- <li>
201
- <label>
202
- <input type="radio" name="wpmtst_form_options[post_status]" value="pending" <?php checked( 'pending', $form_options['post_status'] ); ?>/>
203
- <?php esc_html_e( 'Pending', 'strong-testimonials' ); ?>
204
- </label>
205
- </li>
206
- <li>
207
- <label>
208
- <input type="radio" name="wpmtst_form_options[post_status]" value="publish" <?php checked( 'publish', $form_options['post_status'] ); ?>/>
209
- <?php esc_html_e( 'Published' ); ?>
210
- </label>
211
- </li>
212
- </ul>
213
- </td>
214
- </tr>
215
-
216
- <tr>
217
- <th scope="row">
218
- <label for="wpmtst-options-admin-notify">
219
- <?php esc_html_e( 'Notification Email', 'strong-testimonials' ); ?>
220
- </label>
221
- </th>
222
-
223
- <td>
224
- <div class="match-height">
225
- <fieldset>
226
- <label for="wpmtst-options-admin-notify">
227
- <input id="wpmtst-options-admin-notify" type="checkbox" name="wpmtst_form_options[admin_notify]" <?php checked( $form_options['admin_notify'] ); ?>/>
228
- <?php esc_html_e( 'Send an email upon new testimonial submission.', 'strong-testimonials' ); ?>
229
- </label>
230
- </fieldset>
231
- </div>
232
- <div class="email-container" id="admin-notify-fields" <?php echo ( $form_options['admin_notify'] ) ? '' : 'style="display: none;"'; ?>>
 
 
 
 
 
 
 
 
 
 
233
  <?php
234
- require 'email-from.php';
235
- require 'email-to.php';
236
- require 'email.php';
237
  do_action( 'wpmtst_after_notification_fields', 'notification' );
238
  ?>
239
- </div>
240
- </td>
241
- </tr>
242
  </table>
243
 
244
  <?php
@@ -249,120 +278,114 @@ foreach ( $plugins as $key => $plugin ) {
249
  */
250
  ?>
251
  <hr>
252
- <h3><?php esc_html_e( 'Form Spam Control', 'strong-testimonials' ); ?></h3>
253
 
254
  <table class="form-table" cellpadding="0" cellspacing="0">
255
- <tr>
256
- <th scope="row">
257
- <label>
258
- <?php echo esc_html_x( 'Honeypot', 'spam control techniques', 'strong-testimonials' ); ?>
259
- </label>
260
- </th>
261
- <td>
262
- <p>