Version Description
(2021-11-03) = - Updates the SAP library to version 2.6.1 - Updates setting's so that a number display only conditionally on other settings' values - Fix for the 'X' in the search box not re-triggering the AJAX search
Download this release
Release Info
Developer | Rustaurius |
Plugin | Ultimate FAQ |
Version | 2.0.25 |
Comparing to | |
See all releases |
Code changes from version 2.0.24 to 2.0.25
- assets/js/ewd-ufaq.js +5 -0
- ewd-ufaq-templates/faq-title.php +1 -1
- includes/Dashboard.class.php +1 -1
- includes/FAQ.class.php +1 -1
- includes/Notifications.class.php +7 -2
- includes/Permissions.class.php +14 -5
- includes/Settings.class.php +42 -15
- lib/simple-admin-pages/classes/AdminPage.Menu.class.php +1 -1
- lib/simple-admin-pages/classes/AdminPage.Submenu.class.php +1 -1
- lib/simple-admin-pages/classes/AdminPage.Themes.class.php +1 -1
- lib/simple-admin-pages/classes/AdminPage.class.php +62 -1
- lib/simple-admin-pages/classes/AdminPageSection.class.php +1 -1
- lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php +28 -26
- lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php +2 -2
- lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php +2 -2
- lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php +4 -4
- lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php +8 -2
- lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php +21 -17
- lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php +8 -2
- lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php +10 -8
- lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php +19 -5
- lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php +51 -1
- lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php +51 -1
- lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php +7 -3
- lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php +5 -1
- lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php +2 -2
- lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php +2 -2
- lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php +5 -1
- lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php +5 -1
- lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php +17 -11
- lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php +5 -1
- lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php +5 -1
- lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php +7 -6
- lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php +6 -6
- lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php +37 -0
- lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php +3 -3
- lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php +2 -2
- lib/simple-admin-pages/classes/AdminPageSetting.class.php +58 -5
- lib/simple-admin-pages/classes/Library.class.php +38 -4
- lib/simple-admin-pages/css/admin-settings-blue.css +4 -0
- lib/simple-admin-pages/css/admin-settings-purple.css +4 -0
- lib/simple-admin-pages/css/admin-settings.css +25 -21
- lib/simple-admin-pages/css/infinite_table.css +0 -3
- lib/simple-admin-pages/js/admin-settings.js +40 -17
- lib/simple-admin-pages/js/count.js +9 -5
- lib/simple-admin-pages/js/infinite_table.js +21 -4
- readme.txt +5 -0
- ultimate-faqs.php +2 -2
- views/View.FAQ.class.php +12 -1
assets/js/ewd-ufaq.js
CHANGED
@@ -93,6 +93,11 @@ function ufaqSetClickHandlers() {
|
|
93 |
|
94 |
jQuery( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
|
95 |
});
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
function UFAQSetAutoCompleteClickHandlers() {
|
93 |
|
94 |
jQuery( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
|
95 |
});
|
96 |
+
|
97 |
+
jQuery( '.ewd-ufaq-text-input ' ).on( 'search', function() {
|
98 |
+
|
99 |
+
ewd_ufaq_ajax_reload();
|
100 |
+
});
|
101 |
}
|
102 |
|
103 |
function UFAQSetAutoCompleteClickHandlers() {
|
ewd-ufaq-templates/faq-title.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class='ewd-ufaq-faq-title <?php echo ( ! $this->get_option( 'disable-faq-toggle' ) ? 'ewd-ufaq-faq-toggle' : '' ) ?>'>
|
2 |
|
3 |
-
<a class='ewd-ufaq-post-margin' href='<?php echo esc_attr(
|
4 |
|
5 |
<div class='ewd-ufaq-post-margin-symbol <?php echo $this->get_color_block_shape(); ?>'>
|
6 |
<span ><?php echo $this->get_toggle_symbol(); ?></span>
|
1 |
<div class='ewd-ufaq-faq-title <?php echo ( ! $this->get_option( 'disable-faq-toggle' ) ? 'ewd-ufaq-faq-toggle' : '' ) ?>'>
|
2 |
|
3 |
+
<a class='ewd-ufaq-post-margin' href='<?php echo esc_attr( $this->get_anchor_permalink() ); ?>'>
|
4 |
|
5 |
<div class='ewd-ufaq-post-margin-symbol <?php echo $this->get_color_block_shape(); ?>'>
|
6 |
<span ><?php echo $this->get_toggle_symbol(); ?></span>
|
includes/Dashboard.class.php
CHANGED
@@ -169,7 +169,7 @@ class ewdufaqDashboard {
|
|
169 |
</div>
|
170 |
</div>
|
171 |
|
172 |
-
<div class="ewd-ufaq-dashboard-new-widget-box
|
173 |
<div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
|
174 |
<div class="ewd-ufaq-dashboard-new-widget-box-bottom">
|
175 |
<ul class="ewd-ufaq-dashboard-testimonials">
|
169 |
</div>
|
170 |
</div>
|
171 |
|
172 |
+
<div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
|
173 |
<div class="ewd-ufaq-dashboard-new-widget-box-top">What People Are Saying</div>
|
174 |
<div class="ewd-ufaq-dashboard-new-widget-box-bottom">
|
175 |
<ul class="ewd-ufaq-dashboard-testimonials">
|
includes/FAQ.class.php
CHANGED
@@ -341,7 +341,7 @@ class ewdufaqFAQ {
|
|
341 |
*/
|
342 |
public function insert_post_categories() {
|
343 |
|
344 |
-
if (
|
345 |
|
346 |
$submit_categories = array();
|
347 |
foreach ( $this->categories as $category ) { $submit_categories[] = $category->term_id; }
|
341 |
*/
|
342 |
public function insert_post_categories() {
|
343 |
|
344 |
+
if ( empty( $this->categories ) or ! is_array( $this->categories ) ) { return; }
|
345 |
|
346 |
$submit_categories = array();
|
347 |
foreach ( $this->categories as $category ) { $submit_categories[] = $category->term_id; }
|
includes/Notifications.class.php
CHANGED
@@ -34,8 +34,13 @@ class ewdufaqNotifications {
|
|
34 |
|
35 |
$message_body = __( 'Hello Admin,', 'ultimate-faqs' ) . '<br/><br/>';
|
36 |
$message_body .= __( 'You\'ve received a new question titled ', 'ultimate-faqs' ) . $faq->question . '.<br/><br/>';
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
39 |
$message_body .= __( 'You can view the question in the admin area by going to the following link:<br>', 'ultimate-faqs' );
|
40 |
$message_body .= '<a href=\'' . $faq_link . '\'>' . __( 'See the FAQ', 'ultimate-faqs' ) . '</a><br/><br/>';
|
41 |
$message_body .= __( 'Have a great day,', 'ultimate-faqs' ) . '<br/><br/>';
|
34 |
|
35 |
$message_body = __( 'Hello Admin,', 'ultimate-faqs' ) . '<br/><br/>';
|
36 |
$message_body .= __( 'You\'ve received a new question titled ', 'ultimate-faqs' ) . $faq->question . '.<br/><br/>';
|
37 |
+
|
38 |
+
if ( ! empty( $faq->answer ) ) {
|
39 |
+
|
40 |
+
$message_body .= __( 'The answer reads:<br>', 'ultimate-faqs' );
|
41 |
+
$message_body .= esc_html( $faq->answer ) . '<br><br><br>';
|
42 |
+
}
|
43 |
+
|
44 |
$message_body .= __( 'You can view the question in the admin area by going to the following link:<br>', 'ultimate-faqs' );
|
45 |
$message_body .= '<a href=\'' . $faq_link . '\'>' . __( 'See the FAQ', 'ultimate-faqs' ) . '</a><br/><br/>';
|
46 |
$message_body .= __( 'Have a great day,', 'ultimate-faqs' ) . '<br/><br/>';
|
includes/Permissions.class.php
CHANGED
@@ -29,20 +29,29 @@ class ewdufaqPermissions {
|
|
29 |
}
|
30 |
|
31 |
public function set_permissions() {
|
32 |
-
global $
|
33 |
|
34 |
-
if ( get_option( 'ewd-ufaq-permission-level' )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
$this->permission_level = get_option( 'EWD_UFAQ_Full_Version' ) == 'Yes' ? 2 : 1;
|
37 |
|
38 |
-
update_option( 'ewd-ufaq-permission-level', $this->permission_level );
|
39 |
}
|
40 |
|
41 |
public function get_permission_level() {
|
42 |
|
43 |
-
|
|
|
|
|
44 |
|
45 |
-
|
46 |
}
|
47 |
|
48 |
public function check_permission( $permission_type = '' ) {
|
29 |
}
|
30 |
|
31 |
public function set_permissions() {
|
32 |
+
global $ewd_otp_controller;
|
33 |
|
34 |
+
if ( is_array( get_option( 'ewd-ufaq-permission-level' ) ) ) { return; }
|
35 |
+
|
36 |
+
if ( ! empty( get_option( 'ewd-ufaq-permission-level' ) ) ) {
|
37 |
+
|
38 |
+
update_option( 'ewd-ufaq-permission-level', array( get_option( 'ewd-ufaq-permission-level' ) ) );
|
39 |
+
|
40 |
+
return;
|
41 |
+
}
|
42 |
|
43 |
$this->permission_level = get_option( 'EWD_UFAQ_Full_Version' ) == 'Yes' ? 2 : 1;
|
44 |
|
45 |
+
update_option( 'ewd-ufaq-permission-level', array( $this->permission_level ) );
|
46 |
}
|
47 |
|
48 |
public function get_permission_level() {
|
49 |
|
50 |
+
if ( ! is_array( get_option( 'ewd-ufaq-permission-level' ) ) ) { $this->set_permissions(); }
|
51 |
+
|
52 |
+
$permissions_array = get_option( 'ewd-ufaq-permission-level' );
|
53 |
|
54 |
+
$this->permission_level = is_array( $permissions_array ) ? reset( $permissions_array ) : $permissions_array;
|
55 |
}
|
56 |
|
57 |
public function check_permission( $permission_type = '' ) {
|
includes/Settings.class.php
CHANGED
@@ -131,8 +131,9 @@ class ewdufaqSettings {
|
|
131 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
|
132 |
$sap = sap_initialize_library(
|
133 |
$args = array(
|
134 |
-
'version' => '2.
|
135 |
'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
|
|
|
136 |
)
|
137 |
);
|
138 |
|
@@ -300,7 +301,9 @@ class ewdufaqSettings {
|
|
300 |
array(
|
301 |
'id' => 'faq-accordion',
|
302 |
'title' => __( 'FAQ Accordion', 'ultimate-faqs' ),
|
303 |
-
'description' => __( 'Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)', 'ultimate-faqs' )
|
|
|
|
|
304 |
)
|
305 |
);
|
306 |
|
@@ -322,7 +325,9 @@ class ewdufaqSettings {
|
|
322 |
array(
|
323 |
'id' => 'faq-category-accordion',
|
324 |
'title' => __( 'FAQ Category Accordion', 'ultimate-faqs' ),
|
325 |
-
'description' => __( 'Should it only be possible to open one FAQ category at a time, if FAQ categories are being toggled ("FAQ Category Toggle" must be enabled above)?', 'ultimate-faqs' )
|
|
|
|
|
326 |
)
|
327 |
);
|
328 |
|
@@ -333,7 +338,9 @@ class ewdufaqSettings {
|
|
333 |
array(
|
334 |
'id' => 'expand-collapse-all',
|
335 |
'title' => __( 'FAQ Expand/Collapse All', 'ultimate-faqs' ),
|
336 |
-
'description' => __( 'Should there be a control to open and close all FAQs simultaneously?', 'ultimate-faqs' )
|
|
|
|
|
337 |
)
|
338 |
);
|
339 |
|
@@ -578,7 +585,9 @@ class ewdufaqSettings {
|
|
578 |
array(
|
579 |
'id' => 'thumbs-up-image',
|
580 |
'title' => __( 'FAQ Ratings \'Thumbs Up\' Image', 'ultimate-faqs' ),
|
581 |
-
'description' => __( 'You can use this to upload your own image to replace the default "thumbs up" image.', 'ultimate-faqs' )
|
|
|
|
|
582 |
)
|
583 |
);
|
584 |
|
@@ -589,7 +598,9 @@ class ewdufaqSettings {
|
|
589 |
array(
|
590 |
'id' => 'thumbs-down-image',
|
591 |
'title' => __( 'FAQ Ratings \'Thumbs Down\' Image', 'ultimate-faqs' ),
|
592 |
-
'description' => __( 'You can use this to upload your own image to replace the default "thumbs down" image.', 'ultimate-faqs' )
|
|
|
|
|
593 |
)
|
594 |
);
|
595 |
|
@@ -611,7 +622,9 @@ class ewdufaqSettings {
|
|
611 |
array(
|
612 |
'id' => 'disable-homepage-canoncial-redirect',
|
613 |
'title' => __( 'Disable Front-Page Canonical Redirects', 'ultimate-faqs' ),
|
614 |
-
'description' => __( 'Should canonical redirects be disabled for the front page of your site? Only necessary if you\'re using the plugin on your homepage and have pretty permalinks enabled.', 'ultimate-faqs' )
|
|
|
|
|
615 |
)
|
616 |
);
|
617 |
|
@@ -686,7 +699,9 @@ class ewdufaqSettings {
|
|
686 |
array(
|
687 |
'id' => 'woocommerce-use-product',
|
688 |
'title' => __( 'Use WooCommerce Product Object', 'ultimate-faqs' ),
|
689 |
-
'description' => __( 'Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?', 'ultimate-faqs' )
|
|
|
|
|
690 |
)
|
691 |
);
|
692 |
|
@@ -721,7 +736,9 @@ class ewdufaqSettings {
|
|
721 |
'id' => 'wpforms-post-count',
|
722 |
'title' => __( 'WP Forms Post Count', 'ultimate-faqs' ),
|
723 |
'description' => __( 'How many posts should be displayed below paragraph text fields, if WP Forms Integration has been turned on?', 'ultimate-faqs' ),
|
724 |
-
'small' => true
|
|
|
|
|
725 |
)
|
726 |
);
|
727 |
|
@@ -737,7 +754,9 @@ class ewdufaqSettings {
|
|
737 |
'above' => __( 'Above', 'ultimate-faqs' ),
|
738 |
'below' => __( 'Below', 'ultimate-faqs' ),
|
739 |
),
|
740 |
-
'default' => $this->defaults['wpforms-faq-location']
|
|
|
|
|
741 |
)
|
742 |
);
|
743 |
|
@@ -832,7 +851,9 @@ class ewdufaqSettings {
|
|
832 |
'id' => 'admin-notification-email',
|
833 |
'title' => __( 'Admin Notification Email', 'ultimate-faqs' ),
|
834 |
'description' => __( 'What email address should the notifications be sent to if "Admin Question Notification" is enabled above? If blank, the default WordPress admin email will be used.', 'ultimate-faqs' ),
|
835 |
-
'small' => true
|
|
|
|
|
836 |
)
|
837 |
);
|
838 |
|
@@ -916,7 +937,9 @@ class ewdufaqSettings {
|
|
916 |
array(
|
917 |
'id' => 'group-by-category-count',
|
918 |
'title' => __( 'Display FAQ Category Count', 'ultimate-faqs' ),
|
919 |
-
'description' => __( 'If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?', 'ultimate-faqs' )
|
|
|
|
|
920 |
)
|
921 |
);
|
922 |
|
@@ -933,7 +956,9 @@ class ewdufaqSettings {
|
|
933 |
'name' => __( 'Name', 'ultimate-faqs' ),
|
934 |
'count' => __( 'FAQ Count', 'ultimate-faqs' ),
|
935 |
'slug' => __( 'Slug', 'ultimate-faqs' ),
|
936 |
-
)
|
|
|
|
|
937 |
)
|
938 |
);
|
939 |
|
@@ -949,7 +974,9 @@ class ewdufaqSettings {
|
|
949 |
'asc' => __( 'Ascending', 'ultimate-faqs' ),
|
950 |
'desc' => __( 'Descending', 'ultimate-faqs' ),
|
951 |
),
|
952 |
-
'default' => $this->defaults['category-order']
|
|
|
|
|
953 |
)
|
954 |
);
|
955 |
|
@@ -1224,7 +1251,7 @@ class ewdufaqSettings {
|
|
1224 |
'text',
|
1225 |
array(
|
1226 |
'id' => 'label-enter-question',
|
1227 |
-
'title' => __( 'Enter your
|
1228 |
'description' => ''
|
1229 |
)
|
1230 |
);
|
131 |
require_once( EWD_UFAQ_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
|
132 |
$sap = sap_initialize_library(
|
133 |
$args = array(
|
134 |
+
'version' => '2.6.1',
|
135 |
'lib_url' => EWD_UFAQ_PLUGIN_URL . '/lib/simple-admin-pages/',
|
136 |
+
'theme' => 'purple',
|
137 |
)
|
138 |
);
|
139 |
|
301 |
array(
|
302 |
'id' => 'faq-accordion',
|
303 |
'title' => __( 'FAQ Accordion', 'ultimate-faqs' ),
|
304 |
+
'description' => __( 'Should the FAQs accordion? (Only one FAQ is open at a time, requires FAQ Toggle)', 'ultimate-faqs' ),
|
305 |
+
'conditional_on' => 'disable-faq-toggle',
|
306 |
+
'conditional_on_value' => false
|
307 |
)
|
308 |
);
|
309 |
|
325 |
array(
|
326 |
'id' => 'faq-category-accordion',
|
327 |
'title' => __( 'FAQ Category Accordion', 'ultimate-faqs' ),
|
328 |
+
'description' => __( 'Should it only be possible to open one FAQ category at a time, if FAQ categories are being toggled ("FAQ Category Toggle" must be enabled above)?', 'ultimate-faqs' ),
|
329 |
+
'conditional_on' => 'faq-category-toggle',
|
330 |
+
'conditional_on_value' => true
|
331 |
)
|
332 |
);
|
333 |
|
338 |
array(
|
339 |
'id' => 'expand-collapse-all',
|
340 |
'title' => __( 'FAQ Expand/Collapse All', 'ultimate-faqs' ),
|
341 |
+
'description' => __( 'Should there be a control to open and close all FAQs simultaneously?', 'ultimate-faqs' ),
|
342 |
+
'conditional_on' => 'disable-faq-toggle',
|
343 |
+
'conditional_on_value' => false
|
344 |
)
|
345 |
);
|
346 |
|
585 |
array(
|
586 |
'id' => 'thumbs-up-image',
|
587 |
'title' => __( 'FAQ Ratings \'Thumbs Up\' Image', 'ultimate-faqs' ),
|
588 |
+
'description' => __( 'You can use this to upload your own image to replace the default "thumbs up" image.', 'ultimate-faqs' ),
|
589 |
+
'conditional_on' => 'faq-ratings',
|
590 |
+
'conditional_on_value' => true
|
591 |
)
|
592 |
);
|
593 |
|
598 |
array(
|
599 |
'id' => 'thumbs-down-image',
|
600 |
'title' => __( 'FAQ Ratings \'Thumbs Down\' Image', 'ultimate-faqs' ),
|
601 |
+
'description' => __( 'You can use this to upload your own image to replace the default "thumbs down" image.', 'ultimate-faqs' ),
|
602 |
+
'conditional_on' => 'faq-ratings',
|
603 |
+
'conditional_on_value' => true
|
604 |
)
|
605 |
);
|
606 |
|
622 |
array(
|
623 |
'id' => 'disable-homepage-canoncial-redirect',
|
624 |
'title' => __( 'Disable Front-Page Canonical Redirects', 'ultimate-faqs' ),
|
625 |
+
'description' => __( 'Should canonical redirects be disabled for the front page of your site? Only necessary if you\'re using the plugin on your homepage and have pretty permalinks enabled.', 'ultimate-faqs' ),
|
626 |
+
'conditional_on' => 'pretty-permalinks',
|
627 |
+
'conditional_on_value' => true
|
628 |
)
|
629 |
);
|
630 |
|
699 |
array(
|
700 |
'id' => 'woocommerce-use-product',
|
701 |
'title' => __( 'Use WooCommerce Product Object', 'ultimate-faqs' ),
|
702 |
+
'description' => __( 'Should the FAQ tab be set up using the WooCommerce product object, as in the WC documentation, or just using the ID of the page?', 'ultimate-faqs' ),
|
703 |
+
'conditional_on' => 'woocommerce-faqs',
|
704 |
+
'conditional_on_value' => true
|
705 |
)
|
706 |
);
|
707 |
|
736 |
'id' => 'wpforms-post-count',
|
737 |
'title' => __( 'WP Forms Post Count', 'ultimate-faqs' ),
|
738 |
'description' => __( 'How many posts should be displayed below paragraph text fields, if WP Forms Integration has been turned on?', 'ultimate-faqs' ),
|
739 |
+
'small' => true,
|
740 |
+
'conditional_on' => 'wpforms-integration',
|
741 |
+
'conditional_on_value' => true
|
742 |
)
|
743 |
);
|
744 |
|
754 |
'above' => __( 'Above', 'ultimate-faqs' ),
|
755 |
'below' => __( 'Below', 'ultimate-faqs' ),
|
756 |
),
|
757 |
+
'default' => $this->defaults['wpforms-faq-location'],
|
758 |
+
'conditional_on' => 'wpforms-integration',
|
759 |
+
'conditional_on_value' => true
|
760 |
)
|
761 |
);
|
762 |
|
851 |
'id' => 'admin-notification-email',
|
852 |
'title' => __( 'Admin Notification Email', 'ultimate-faqs' ),
|
853 |
'description' => __( 'What email address should the notifications be sent to if "Admin Question Notification" is enabled above? If blank, the default WordPress admin email will be used.', 'ultimate-faqs' ),
|
854 |
+
'small' => true,
|
855 |
+
'conditional_on' => 'admin-question-notification',
|
856 |
+
'conditional_on_value' => true
|
857 |
)
|
858 |
);
|
859 |
|
937 |
array(
|
938 |
'id' => 'group-by-category-count',
|
939 |
'title' => __( 'Display FAQ Category Count', 'ultimate-faqs' ),
|
940 |
+
'description' => __( 'If FAQs are grouped by category, should the number of FAQs in a category be displayed beside the category name?', 'ultimate-faqs' ),
|
941 |
+
'conditional_on' => 'group-by-category',
|
942 |
+
'conditional_on_value' => true
|
943 |
)
|
944 |
);
|
945 |
|
956 |
'name' => __( 'Name', 'ultimate-faqs' ),
|
957 |
'count' => __( 'FAQ Count', 'ultimate-faqs' ),
|
958 |
'slug' => __( 'Slug', 'ultimate-faqs' ),
|
959 |
+
),
|
960 |
+
'conditional_on' => 'group-by-category',
|
961 |
+
'conditional_on_value' => true
|
962 |
)
|
963 |
);
|
964 |
|
974 |
'asc' => __( 'Ascending', 'ultimate-faqs' ),
|
975 |
'desc' => __( 'Descending', 'ultimate-faqs' ),
|
976 |
),
|
977 |
+
'default' => $this->defaults['category-order'],
|
978 |
+
'conditional_on' => 'group-by-category',
|
979 |
+
'conditional_on_value' => true
|
980 |
)
|
981 |
);
|
982 |
|
1251 |
'text',
|
1252 |
array(
|
1253 |
'id' => 'label-enter-question',
|
1254 |
+
'title' => __( 'Enter your question', 'ultimate-faqs' ),
|
1255 |
'description' => ''
|
1256 |
)
|
1257 |
);
|
lib/simple-admin-pages/classes/AdminPage.Menu.class.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
-
class
|
12 |
|
13 |
public $setup_function = 'add_menu_page'; // WP function to register the page
|
14 |
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
+
class sapAdminPageMenu_2_6_1 extends sapAdminPage_2_6_1 {
|
12 |
|
13 |
public $setup_function = 'add_menu_page'; // WP function to register the page
|
14 |
|
lib/simple-admin-pages/classes/AdminPage.Submenu.class.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
-
class
|
12 |
|
13 |
public $setup_function = 'add_submenu_page'; // WP function to register the page
|
14 |
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
+
class sapAdminPageSubmenu_2_6_1 extends sapAdminPage_2_6_1 {
|
12 |
|
13 |
public $setup_function = 'add_submenu_page'; // WP function to register the page
|
14 |
|
lib/simple-admin-pages/classes/AdminPage.Themes.class.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
-
class
|
12 |
|
13 |
public $setup_function = 'add_theme_page'; // WP function to register the page
|
14 |
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
|
11 |
+
class sapAdminPageThemes_2_6_1 extends sapAdminPage_2_6_1 {
|
12 |
|
13 |
public $setup_function = 'add_theme_page'; // WP function to register the page
|
14 |
|
lib/simple-admin-pages/classes/AdminPage.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $title;
|
13 |
public $menu_title;
|
@@ -175,6 +175,9 @@ class sapAdminPage_2_5_3 {
|
|
175 |
|
176 |
$current_page = $this->get_current_page( $_GET );
|
177 |
|
|
|
|
|
|
|
178 |
?>
|
179 |
|
180 |
<div class="wrap sap-settings-page">
|
@@ -229,4 +232,62 @@ class sapAdminPage_2_5_3 {
|
|
229 |
<?php
|
230 |
}
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPage_2_6_1 {
|
11 |
|
12 |
public $title;
|
13 |
public $menu_title;
|
175 |
|
176 |
$current_page = $this->get_current_page( $_GET );
|
177 |
|
178 |
+
$this->order_tabs_by_rank();
|
179 |
+
$this->order_sections_by_rank();
|
180 |
+
|
181 |
?>
|
182 |
|
183 |
<div class="wrap sap-settings-page">
|
232 |
<?php
|
233 |
}
|
234 |
|
235 |
+
/**
|
236 |
+
* Order the tabs as per the value of rank
|
237 |
+
* @since 2.6
|
238 |
+
*/
|
239 |
+
public function order_tabs_by_rank()
|
240 |
+
{
|
241 |
+
// Fetch and Order sections/tabs
|
242 |
+
$tab_list = [];
|
243 |
+
$section_list = [];
|
244 |
+
foreach( $this->sections as $id => $section ) {
|
245 |
+
if ( isset( $section->is_tab ) && $section->is_tab === true ) {
|
246 |
+
if( property_exists( $section, 'rank' ) && count( $tab_list ) > $section->rank ) {
|
247 |
+
// array start from 0, rank start from 1
|
248 |
+
array_splice($tab_list, ($section->rank - 1), 0, [$id => $section]);
|
249 |
+
}
|
250 |
+
else {
|
251 |
+
$tab_list[$id] = $section;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
else {
|
255 |
+
$section_list[$id] = $section;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
$this->sections = array_merge($tab_list, $section_list);
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Order the sections in tabs as per the value of rank
|
264 |
+
* @since 2.6
|
265 |
+
*/
|
266 |
+
public function order_sections_by_rank()
|
267 |
+
{
|
268 |
+
// Fetch and Order sections/tabs
|
269 |
+
$tab_list = [];
|
270 |
+
$non_tab_list = [];
|
271 |
+
foreach( $this->sections as $id => $section ) {
|
272 |
+
if ( isset( $section->is_tab ) && $section->is_tab == true ) {
|
273 |
+
$tab_list[$id] = $section;
|
274 |
+
}
|
275 |
+
else {
|
276 |
+
$non_tab_list[$id] = $section;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
foreach( $this->sections as $id => $section ) {
|
281 |
+
if ( empty( $section->is_tab ) ) {
|
282 |
+
if( property_exists( $section, 'rank' ) && count( $non_tab_list ) > $section->rank ) {
|
283 |
+
// array start from 0, rank start from 1
|
284 |
+
unset( $non_tab_list[$id]);
|
285 |
+
array_splice($non_tab_list, ($section->rank - 1), 0, [$id => $section]);
|
286 |
+
}
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
$this->sections = array_merge($tab_list, $non_tab_list);
|
291 |
+
}
|
292 |
+
|
293 |
}
|
lib/simple-admin-pages/classes/AdminPageSection.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
// Page defaults
|
13 |
public $id; // unique id for this section
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSection_2_6_1 {
|
11 |
|
12 |
// Page defaults
|
13 |
public $id; // unique id for this section
|
lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
/*
|
13 |
* Size of this textarea
|
@@ -124,31 +124,33 @@ class sapAdminPageSettingAddress_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
124 |
|
125 |
?>
|
126 |
|
127 |
-
<
|
128 |
-
<
|
129 |
-
|
130 |
-
<
|
131 |
-
|
132 |
-
|
133 |
-
<?php
|
134 |
-
|
135 |
-
<?php
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
152 |
|
153 |
<?php
|
154 |
}
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingAddress_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
/*
|
13 |
* Size of this textarea
|
124 |
|
125 |
?>
|
126 |
|
127 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
128 |
+
<div class="sap-address" id="<?php echo $this->id; ?>">
|
129 |
+
<textarea name="<?php echo $this->get_input_name(); ?>[text]" id="<?php echo $this->get_input_name(); ?>" class="<?php echo $this->size; ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>><?php echo $this->value['text']; ?></textarea>
|
130 |
+
<p class="sap-map-coords-wrapper">
|
131 |
+
<span class="dashicons dashicons-location-alt"></span>
|
132 |
+
<span class="sap-map-coords">
|
133 |
+
<?php if ( empty( $this->value['lat'] ) || empty( $this->value['lon'] ) ) : ?>
|
134 |
+
<?php echo $this->strings['no-setting']; ?>
|
135 |
+
<?php else : ?>
|
136 |
+
<?php echo $this->value['lat'] . $this->strings['sep-lat-lon'] . $this->value['lon']; ?>
|
137 |
+
<a href="//maps.google.com/maps?q=<?php echo esc_attr( $this->value['lat'] ) . ',' . esc_attr( $this->value['lon'] ); ?>" class="sap-view-coords" target="_blank"><?php echo $this->strings['view']; ?></a>
|
138 |
+
<?php endif; ?>
|
139 |
+
</span>
|
140 |
+
</p>
|
141 |
+
<p class="sap-coords-action-wrapper">
|
142 |
+
<a href="#" class="sap-get-coords">
|
143 |
+
<?php echo $this->strings['retrieve']; ?>
|
144 |
+
</a>
|
145 |
+
<?php echo $this->strings['sep-action-links']; ?>
|
146 |
+
<a href="#" class="sap-remove-coords">
|
147 |
+
<?php echo $this->strings['remove']; ?>
|
148 |
+
</a>
|
149 |
+
</p>
|
150 |
+
<input type="hidden" class="lat" name="<?php echo $this->get_input_name(); ?>[lat]" value="<?php echo $this->value['lat']; ?>">
|
151 |
+
<input type="hidden" class="lon" name="<?php echo $this->get_input_name(); ?>[lon]" value="<?php echo $this->value['lon']; ?>">
|
152 |
+
</div>
|
153 |
+
</fieldset>
|
154 |
|
155 |
<?php
|
156 |
}
|
lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
-
class
|
23 |
|
24 |
//public $sanitize_callback = 'sanitize_text_field';
|
25 |
|
@@ -33,7 +33,7 @@ class sapAdminPageSettingCheckbox_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
33 |
$values = ( is_array( $this->value ) ? $this->value : array() );
|
34 |
|
35 |
?>
|
36 |
-
<fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?>>
|
37 |
<?php foreach ( $this->options as $id => $title ) : ?>
|
38 |
<label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
|
39 |
<input type="checkbox" name="<?php echo $input_name; ?>[]" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( in_array($id, $values) ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
+
class sapAdminPageSettingCheckbox_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
23 |
|
24 |
//public $sanitize_callback = 'sanitize_text_field';
|
25 |
|
33 |
$values = ( is_array( $this->value ) ? $this->value : array() );
|
34 |
|
35 |
?>
|
36 |
+
<fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
|
37 |
<?php foreach ( $this->options as $id => $title ) : ?>
|
38 |
<label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
|
39 |
<input type="checkbox" name="<?php echo $input_name; ?>[]" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( in_array($id, $values) ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
@@ -24,7 +24,7 @@ class sapAdminPageSettingColorPicker_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
-
<fieldset class="sap-colorpicker"
|
28 |
<input class="sap-spectrum" name="<?php echo $this->get_input_name(); ?>" type="text" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
29 |
|
30 |
<?php $this->display_disabled(); ?>
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingColorPicker_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
+
<fieldset class="sap-colorpicker" <?php $this->print_conditional_data(); ?>>
|
28 |
<input class="sap-spectrum" name="<?php echo $this->get_input_name(); ?>" type="text" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
29 |
|
30 |
<?php $this->display_disabled(); ?>
|
lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
* @package Simple Admin Pages
|
25 |
*/
|
26 |
|
27 |
-
class
|
28 |
|
29 |
public $sanitize_callback = 'sanitize_text_field';
|
30 |
|
@@ -68,11 +68,11 @@ class sapAdminPageSettingCount_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
68 |
$this->value = $this->value ? $this->value : $this->default;
|
69 |
|
70 |
$count = strpos( $this->value, '_' ) !== false ? substr( $this->value, 0, strpos( $this->value, '_' ) ) : $this->value;
|
71 |
-
$unit = substr( $this->value, strpos( $this->value, '_' ) + 1 );
|
72 |
-
|
73 |
?>
|
74 |
|
75 |
-
<fieldset
|
76 |
<input id='<?php echo $this->id; ?>' type='hidden' name='<?php echo $this->get_input_name(); ?>' value='<?php echo $this->value; ?>' />
|
77 |
<select id="<?php echo $this->id; ?>_count" <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-count' data-id='<?php echo $this->id; ?>'>
|
78 |
|
24 |
* @package Simple Admin Pages
|
25 |
*/
|
26 |
|
27 |
+
class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
28 |
|
29 |
public $sanitize_callback = 'sanitize_text_field';
|
30 |
|
68 |
$this->value = $this->value ? $this->value : $this->default;
|
69 |
|
70 |
$count = strpos( $this->value, '_' ) !== false ? substr( $this->value, 0, strpos( $this->value, '_' ) ) : $this->value;
|
71 |
+
$unit = strpos( $this->value, '_' ) !== false ? substr( $this->value, strpos( $this->value, '_' ) + 1 ) : '';
|
72 |
+
|
73 |
?>
|
74 |
|
75 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
76 |
<input id='<?php echo $this->id; ?>' type='hidden' name='<?php echo $this->get_input_name(); ?>' value='<?php echo $this->value; ?>' />
|
77 |
<select id="<?php echo $this->id; ?>_count" <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-count' data-id='<?php echo $this->id; ?>'>
|
78 |
|
lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'wp_kses_post';
|
13 |
|
@@ -35,7 +35,13 @@ class sapAdminPageSettingEditor_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
35 |
|
36 |
$value = empty( $this->value ) && !empty( $this->default ) ? $this->default : $this->value;
|
37 |
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
$this->display_description();
|
41 |
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingEditor_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'wp_kses_post';
|
13 |
|
35 |
|
36 |
$value = empty( $this->value ) && !empty( $this->default ) ? $this->default : $this->value;
|
37 |
|
38 |
+
?>
|
39 |
+
|
40 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
41 |
+
<?php wp_editor( $value, preg_replace( '/[^\da-z]/i', '', $this->id), $this->args ); ?>
|
42 |
+
</fieldset>
|
43 |
+
|
44 |
+
<?php
|
45 |
|
46 |
$this->display_description();
|
47 |
|
lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @package Simple Admin Pages
|
16 |
*/
|
17 |
|
18 |
-
class
|
19 |
|
20 |
public $sanitize_callback = 'esc_url_raw';
|
21 |
|
@@ -40,23 +40,27 @@ class sapAdminPageSettingFileUpload_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
40 |
|
41 |
?>
|
42 |
|
43 |
-
<
|
44 |
-
|
45 |
-
<span class="sap-file-upload-preview
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
</span>
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
<br /><br />
|
62 |
|
15 |
* @package Simple Admin Pages
|
16 |
*/
|
17 |
|
18 |
+
class sapAdminPageSettingFileUpload_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
19 |
|
20 |
public $sanitize_callback = 'esc_url_raw';
|
21 |
|
40 |
|
41 |
?>
|
42 |
|
43 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
44 |
+
|
45 |
+
<span class="sap-file-upload-preview">
|
46 |
+
|
47 |
+
<span class="sap-file-upload-preview-label">
|
48 |
+
<?php _e( 'Current image:', 'simple-admin-pages' ); ?>
|
49 |
+
</span>
|
50 |
+
|
51 |
+
<span class="sap-file-upload-preview-value">
|
52 |
+
<?php echo $this->value; ?>
|
53 |
+
</span>
|
54 |
+
|
55 |
</span>
|
56 |
+
|
57 |
+
<?php echo ( $this->value != '' ? '<br /><br />' : '' ); ?>
|
58 |
+
|
59 |
+
<input name="<?php echo $this->get_input_name(); ?>" type="hidden" id="<?php echo $this->get_input_name(); ?>" class="file-upload" value="<?php echo $this->value; ?>" />
|
60 |
+
|
61 |
+
<input class="button sap-file-upload-button" type="button" value="<?php _e( 'Upload Image', 'simple-admin-pages' ); ?>" />
|
62 |
+
|
63 |
+
</fieldset>
|
64 |
|
65 |
<br /><br />
|
66 |
|
lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
* @package Simple Admin Pages
|
15 |
*/
|
16 |
|
17 |
-
class
|
18 |
|
19 |
public $sanitize_callback = 'sanitize_text_field';
|
20 |
|
@@ -24,7 +24,13 @@ class sapAdminPageSettingHTML_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
24 |
*/
|
25 |
public function display_setting() {
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
$this->display_description();
|
30 |
|
14 |
* @package Simple Admin Pages
|
15 |
*/
|
16 |
|
17 |
+
class sapAdminPageSettingHTML_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
18 |
|
19 |
public $sanitize_callback = 'sanitize_text_field';
|
20 |
|
24 |
*/
|
25 |
public function display_setting() {
|
26 |
|
27 |
+
?>
|
28 |
+
|
29 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
30 |
+
<?php echo $this->html; ?>
|
31 |
+
</fieldset>
|
32 |
+
|
33 |
+
<?php
|
34 |
|
35 |
$this->display_description();
|
36 |
|
lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'absint';
|
13 |
|
@@ -42,13 +42,15 @@ class sapAdminPageSettingImage_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
42 |
$image_url = $this->value ? wp_get_attachment_url( $this->value ) : '';
|
43 |
?>
|
44 |
|
45 |
-
<
|
46 |
-
<
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
52 |
|
53 |
<?php
|
54 |
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingImage_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'absint';
|
13 |
|
42 |
$image_url = $this->value ? wp_get_attachment_url( $this->value ) : '';
|
43 |
?>
|
44 |
|
45 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
46 |
+
<div class="sap-image-wrapper <?php echo $this->value ? 'sap-image-wrapper-has-image' : 'sap-image-wrapper-no-image'; ?>" data-id="sap-<?php echo $this->id; ?>">
|
47 |
+
<input name="<?php echo $this->get_input_name(); ?>" type="hidden" id="sap-<?php echo $this->id; ?>" value="<?php echo $this->value; ?>">
|
48 |
+
<img src="<?php echo esc_attr( $image_url ); ?>">
|
49 |
+
<button class="button sap-image-btn-add" id="sap-<?php echo $this->id; ?>-add"><?php echo esc_html( $this->strings['add_image'] ); ?></button>
|
50 |
+
<button class="button sap-image-btn-change" id="sap-<?php echo $this->id; ?>-change"><?php echo esc_html( $this->strings['change_image'] ); ?></button>
|
51 |
+
<button class="button sap-image-btn-remove" id="sap-<?php echo $this->id; ?>-remove"><?php echo esc_html( $this->strings['remove_image'] ); ?></button>
|
52 |
+
</div>
|
53 |
+
</fieldset>
|
54 |
|
55 |
<?php
|
56 |
|
lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
* @package Simple Admin Pages
|
25 |
*/
|
26 |
|
27 |
-
class
|
28 |
|
29 |
public $sanitize_callback = 'sanitize_textarea_field';
|
30 |
|
@@ -74,7 +74,7 @@ class sapAdminPageSettingInfiniteTable_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
74 |
|
75 |
?>
|
76 |
|
77 |
-
<fieldset
|
78 |
<div class='sap-infinite-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>' data-fieldids='<?php echo $fields; ?>'>
|
79 |
<input type='hidden' id="sap-infinite-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo $this->value; ?>' />
|
80 |
<table>
|
@@ -90,13 +90,20 @@ class sapAdminPageSettingInfiniteTable_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
90 |
<?php foreach ($values as $row) { ?>
|
91 |
<tr class='sap-infinite-table-row'>
|
92 |
<?php foreach ($this->fields as $field_id => $field) { ?>
|
93 |
-
<td>
|
|
|
|
|
|
|
|
|
94 |
<?php if ($field['type'] == 'text') : ?>
|
95 |
<input type='text' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
96 |
<?php endif; ?>
|
97 |
<?php if ($field['type'] == 'textarea') : ?>
|
98 |
<textarea data-name='<?php echo $field_id; ?>'><?php echo $row->$field_id; ?></textarea>
|
99 |
<?php endif; ?>
|
|
|
|
|
|
|
100 |
<?php if ($field['type'] == 'hidden') : ?>
|
101 |
<span class='sap-infinite-table-hidden-value'><?php echo $row->$field_id; ?></span>
|
102 |
<input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
@@ -122,13 +129,20 @@ class sapAdminPageSettingInfiniteTable_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
122 |
<tfoot>
|
123 |
<tr class='sap-infinite-table-row-template sap-hidden'>
|
124 |
<?php foreach ($this->fields as $field_id => $field) { ?>
|
125 |
-
<td>
|
|
|
|
|
|
|
|
|
126 |
<?php if ($field['type'] == 'text') : ?>
|
127 |
<input type='text' data-name='<?php echo $field_id; ?>' value='' />
|
128 |
<?php endif; ?>
|
129 |
<?php if ($field['type'] == 'textarea') : ?>
|
130 |
<textarea data-name='<?php echo $field_id; ?>'></textarea>
|
131 |
<?php endif; ?>
|
|
|
|
|
|
|
132 |
<?php if ($field['type'] == 'hidden') : ?>
|
133 |
<span class='sap-infinite-table-hidden-value'></span>
|
134 |
<input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
|
@@ -150,7 +164,7 @@ class sapAdminPageSettingInfiniteTable_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
150 |
<td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
|
151 |
</tr>
|
152 |
<tr class='sap-infinite-table-add-row'>
|
153 |
-
<td colspan="
|
154 |
<a class="sap-new-admin-add-button"><?php echo $this->add_label; ?></a>
|
155 |
</td>
|
156 |
</tr>
|
24 |
* @package Simple Admin Pages
|
25 |
*/
|
26 |
|
27 |
+
class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
28 |
|
29 |
public $sanitize_callback = 'sanitize_textarea_field';
|
30 |
|
74 |
|
75 |
?>
|
76 |
|
77 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
78 |
<div class='sap-infinite-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>' data-fieldids='<?php echo $fields; ?>'>
|
79 |
<input type='hidden' id="sap-infinite-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo $this->value; ?>' />
|
80 |
<table>
|
90 |
<?php foreach ($values as $row) { ?>
|
91 |
<tr class='sap-infinite-table-row'>
|
92 |
<?php foreach ($this->fields as $field_id => $field) { ?>
|
93 |
+
<td data-field-type="<?php echo $field['type']; ?>" >
|
94 |
+
<?php if ($field['type'] == 'id') : ?>
|
95 |
+
<span class='sap-infinite-table-id-html'><?php echo $row->$field_id; ?></span>
|
96 |
+
<input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
97 |
+
<?php endif; ?>
|
98 |
<?php if ($field['type'] == 'text') : ?>
|
99 |
<input type='text' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
100 |
<?php endif; ?>
|
101 |
<?php if ($field['type'] == 'textarea') : ?>
|
102 |
<textarea data-name='<?php echo $field_id; ?>'><?php echo $row->$field_id; ?></textarea>
|
103 |
<?php endif; ?>
|
104 |
+
<?php if ($field['type'] == 'number') : ?>
|
105 |
+
<input type='number' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
106 |
+
<?php endif; ?>
|
107 |
<?php if ($field['type'] == 'hidden') : ?>
|
108 |
<span class='sap-infinite-table-hidden-value'><?php echo $row->$field_id; ?></span>
|
109 |
<input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
|
129 |
<tfoot>
|
130 |
<tr class='sap-infinite-table-row-template sap-hidden'>
|
131 |
<?php foreach ($this->fields as $field_id => $field) { ?>
|
132 |
+
<td data-field-type="<?php echo $field['type']; ?>" >
|
133 |
+
<?php if ($field['type'] == 'id') : ?>
|
134 |
+
<span class='sap-infinite-table-id-html'></span>
|
135 |
+
<input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
|
136 |
+
<?php endif; ?>
|
137 |
<?php if ($field['type'] == 'text') : ?>
|
138 |
<input type='text' data-name='<?php echo $field_id; ?>' value='' />
|
139 |
<?php endif; ?>
|
140 |
<?php if ($field['type'] == 'textarea') : ?>
|
141 |
<textarea data-name='<?php echo $field_id; ?>'></textarea>
|
142 |
<?php endif; ?>
|
143 |
+
<?php if ($field['type'] == 'number') : ?>
|
144 |
+
<input type='number' data-name='<?php echo $field_id; ?>' value='' />
|
145 |
+
<?php endif; ?>
|
146 |
<?php if ($field['type'] == 'hidden') : ?>
|
147 |
<span class='sap-infinite-table-hidden-value'></span>
|
148 |
<input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
|
164 |
<td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
|
165 |
</tr>
|
166 |
<tr class='sap-infinite-table-add-row'>
|
167 |
+
<td colspan="<?php echo count( $this->fields ) ?>">
|
168 |
<a class="sap-new-admin-add-button"><?php echo $this->add_label; ?></a>
|
169 |
</td>
|
170 |
</tr>
|
lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
*
|
15 |
*/
|
16 |
|
17 |
-
class
|
18 |
|
19 |
/**
|
20 |
* Scripts and styles to load for this component
|
@@ -124,6 +124,8 @@ class mcfrtbAdminPageSettingMcApiKey_2_5_3 {
|
|
124 |
public function display_setting() {
|
125 |
?>
|
126 |
|
|
|
|
|
127 |
<input name="<?php echo $this->get_input_name(); ?>[api_key]" type="text" id="<?php echo $this->get_input_name(); ?>[api_key]" value="<?php echo $this->value['api_key']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text">
|
128 |
|
129 |
<?php if ( !empty( $this->value['api_key'] ) && $this->value['status'] === true ) : ?>
|
@@ -134,6 +136,8 @@ class mcfrtbAdminPageSettingMcApiKey_2_5_3 {
|
|
134 |
|
135 |
<input name="<?php echo $this->get_input_name(); ?>[status]" type="hidden" id="<?php echo $this->get_input_name(); ?>[status]" value="<?php echo $this->value['status']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?>>
|
136 |
|
|
|
|
|
137 |
<?php
|
138 |
|
139 |
$this->display_description();
|
@@ -158,6 +162,52 @@ class mcfrtbAdminPageSettingMcApiKey_2_5_3 {
|
|
158 |
return esc_attr( $this->page ) . '[' . esc_attr( $this->id ) . ']';
|
159 |
}
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
/**
|
163 |
* Sanitize the array of text inputs for this setting
|
14 |
*
|
15 |
*/
|
16 |
|
17 |
+
class mcfrtbAdminPageSettingMcApiKey_2_6_1 {
|
18 |
|
19 |
/**
|
20 |
* Scripts and styles to load for this component
|
124 |
public function display_setting() {
|
125 |
?>
|
126 |
|
127 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
128 |
+
|
129 |
<input name="<?php echo $this->get_input_name(); ?>[api_key]" type="text" id="<?php echo $this->get_input_name(); ?>[api_key]" value="<?php echo $this->value['api_key']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text">
|
130 |
|
131 |
<?php if ( !empty( $this->value['api_key'] ) && $this->value['status'] === true ) : ?>
|
136 |
|
137 |
<input name="<?php echo $this->get_input_name(); ?>[status]" type="hidden" id="<?php echo $this->get_input_name(); ?>[status]" value="<?php echo $this->value['status']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?>>
|
138 |
|
139 |
+
</fieldset>
|
140 |
+
|
141 |
<?php
|
142 |
|
143 |
$this->display_description();
|
162 |
return esc_attr( $this->page ) . '[' . esc_attr( $this->id ) . ']';
|
163 |
}
|
164 |
|
165 |
+
/**
|
166 |
+
* Determines whether this setting should be displayed, based on its
|
167 |
+
* conditional conditions, if any.
|
168 |
+
*
|
169 |
+
* @since 2.6
|
170 |
+
*/
|
171 |
+
public function set_conditional_display() {
|
172 |
+
|
173 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
174 |
+
|
175 |
+
$option_group_value = get_option( $this->page );
|
176 |
+
|
177 |
+
$option_group_value[ $this->conditional_on ] = isset( $option_group_value[ $this->conditional_on ] ) ? $option_group_value[ $this->conditional_on ] : false;
|
178 |
+
|
179 |
+
if ( is_array( $option_group_value[ $this->conditional_on ] ) ) {
|
180 |
+
|
181 |
+
$this->conditional_display = in_array( $this->conditional_on_value, $option_group_value[ $this->conditional_on ] );
|
182 |
+
}
|
183 |
+
|
184 |
+
$this->conditional_display = $this->conditional_on_value == $option_group_value[ $this->conditional_on ] ? true : false;
|
185 |
+
|
186 |
+
if ( $this->conditional_display ) { return; }
|
187 |
+
|
188 |
+
if ( ! empty( $this->args['class'] ) ) {
|
189 |
+
|
190 |
+
$this->args['class'] .= ' sap-hidden';
|
191 |
+
}
|
192 |
+
else {
|
193 |
+
|
194 |
+
$this->args['class'] = 'sap-hidden';
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Prints conditional data tags within the input element if necessary
|
200 |
+
*
|
201 |
+
* @since 2.6
|
202 |
+
*/
|
203 |
+
public function print_conditional_data() {
|
204 |
+
|
205 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
206 |
+
|
207 |
+
echo 'data-conditional_on="' . esc_attr( $this->conditional_on ) . '"';
|
208 |
+
echo 'data-conditional_on_value="' . esc_attr( $this->conditional_on_value ) . '"';
|
209 |
+
}
|
210 |
+
|
211 |
|
212 |
/**
|
213 |
* Sanitize the array of text inputs for this setting
|
lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
*
|
15 |
*/
|
16 |
|
17 |
-
class
|
18 |
|
19 |
/**
|
20 |
* Scripts and styles to load for this component
|
@@ -153,6 +153,8 @@ class mcfrtbAdminPageSettingMcListMerge_2_5_3 {
|
|
153 |
|
154 |
?>
|
155 |
|
|
|
|
|
156 |
<span class="mcf-list-select"></span>
|
157 |
|
158 |
<span class="mcf-sap_loading">
|
@@ -164,6 +166,8 @@ class mcfrtbAdminPageSettingMcListMerge_2_5_3 {
|
|
164 |
|
165 |
<div id="mcfrtb-merge-controls" data-input-name="<?php echo $this->get_input_name(); ?>"></div>
|
166 |
|
|
|
|
|
167 |
<?php
|
168 |
}
|
169 |
|
@@ -179,6 +183,52 @@ class mcfrtbAdminPageSettingMcListMerge_2_5_3 {
|
|
179 |
<?php endif;
|
180 |
}
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
/**
|
183 |
* Generate an option input field name, using the grouped schema.
|
184 |
*/
|
14 |
*
|
15 |
*/
|
16 |
|
17 |
+
class mcfrtbAdminPageSettingMcListMerge_2_6_1 {
|
18 |
|
19 |
/**
|
20 |
* Scripts and styles to load for this component
|
153 |
|
154 |
?>
|
155 |
|
156 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
157 |
+
|
158 |
<span class="mcf-list-select"></span>
|
159 |
|
160 |
<span class="mcf-sap_loading">
|
166 |
|
167 |
<div id="mcfrtb-merge-controls" data-input-name="<?php echo $this->get_input_name(); ?>"></div>
|
168 |
|
169 |
+
</fieldset>
|
170 |
+
|
171 |
<?php
|
172 |
}
|
173 |
|
183 |
<?php endif;
|
184 |
}
|
185 |
|
186 |
+
/**
|
187 |
+
* Determines whether this setting should be displayed, based on its
|
188 |
+
* conditional conditions, if any.
|
189 |
+
*
|
190 |
+
* @since 2.6
|
191 |
+
*/
|
192 |
+
public function set_conditional_display() {
|
193 |
+
|
194 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
195 |
+
|
196 |
+
$option_group_value = get_option( $this->page );
|
197 |
+
|
198 |
+
$option_group_value[ $this->conditional_on ] = isset( $option_group_value[ $this->conditional_on ] ) ? $option_group_value[ $this->conditional_on ] : false;
|
199 |
+
|
200 |
+
if ( is_array( $option_group_value[ $this->conditional_on ] ) ) {
|
201 |
+
|
202 |
+
$this->conditional_display = in_array( $this->conditional_on_value, $option_group_value[ $this->conditional_on ] );
|
203 |
+
}
|
204 |
+
|
205 |
+
$this->conditional_display = $this->conditional_on_value == $option_group_value[ $this->conditional_on ] ? true : false;
|
206 |
+
|
207 |
+
if ( $this->conditional_display ) { return; }
|
208 |
+
|
209 |
+
if ( ! empty( $this->args['class'] ) ) {
|
210 |
+
|
211 |
+
$this->args['class'] .= ' sap-hidden';
|
212 |
+
}
|
213 |
+
else {
|
214 |
+
|
215 |
+
$this->args['class'] = 'sap-hidden';
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Prints conditional data tags within the input element if necessary
|
221 |
+
*
|
222 |
+
* @since 2.6
|
223 |
+
*/
|
224 |
+
public function print_conditional_data() {
|
225 |
+
|
226 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
227 |
+
|
228 |
+
echo 'data-conditional_on="' . esc_attr( $this->conditional_on ) . '"';
|
229 |
+
echo 'data-conditional_on_value="' . esc_attr( $this->conditional_on_value ) . '"';
|
230 |
+
}
|
231 |
+
|
232 |
/**
|
233 |
* Generate an option input field name, using the grouped schema.
|
234 |
*/
|
lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
@@ -24,9 +24,13 @@ class sapAdminPageSettingNumber_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
-
<
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
<?php
|
32 |
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingNumber_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
28 |
|
29 |
+
<input name="<?php echo $this->get_input_name(); ?>" type="number" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
30 |
+
|
31 |
+
<?php $this->display_disabled(); ?>
|
32 |
+
|
33 |
+
</fieldset>
|
34 |
|
35 |
<?php
|
36 |
|
lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
* @package Simple Admin Pages
|
26 |
*/
|
27 |
|
28 |
-
class
|
29 |
|
30 |
public $sanitize_callback = 'sanitize_text_field';
|
31 |
|
@@ -121,6 +121,8 @@ class sapAdminPageSettingOpeningHours_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
121 |
|
122 |
?>
|
123 |
|
|
|
|
|
124 |
<table class="sap-opening-hours <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
|
125 |
<tr>
|
126 |
<td>
|
@@ -146,6 +148,8 @@ class sapAdminPageSettingOpeningHours_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
146 |
|
147 |
<?php $this->display_disabled(); ?>
|
148 |
|
|
|
|
|
149 |
<?php
|
150 |
|
151 |
}
|
25 |
* @package Simple Admin Pages
|
26 |
*/
|
27 |
|
28 |
+
class sapAdminPageSettingOpeningHours_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
29 |
|
30 |
public $sanitize_callback = 'sanitize_text_field';
|
31 |
|
121 |
|
122 |
?>
|
123 |
|
124 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
125 |
+
|
126 |
<table class="sap-opening-hours <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
|
127 |
<tr>
|
128 |
<td>
|
148 |
|
149 |
<?php $this->display_disabled(); ?>
|
150 |
|
151 |
+
</fieldset>
|
152 |
+
|
153 |
<?php
|
154 |
|
155 |
}
|
lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
* @package Simple Admin Pages
|
19 |
*/
|
20 |
|
21 |
-
class
|
22 |
|
23 |
public $sanitize_callback = 'sanitize_text_field';
|
24 |
|
@@ -65,7 +65,7 @@ class sapAdminPageSettingOrdering_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
65 |
|
66 |
?>
|
67 |
|
68 |
-
<fieldset
|
69 |
<div class='sap-ordering-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>'>
|
70 |
<input type='hidden' id="sap-ordering-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo esc_attr( json_encode( $values ) ); ?>' />
|
71 |
<table>
|
18 |
* @package Simple Admin Pages
|
19 |
*/
|
20 |
|
21 |
+
class sapAdminPageSettingOrdering_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
22 |
|
23 |
public $sanitize_callback = 'sanitize_text_field';
|
24 |
|
65 |
|
66 |
?>
|
67 |
|
68 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
69 |
<div class='sap-ordering-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>'>
|
70 |
<input type='hidden' id="sap-ordering-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo esc_attr( json_encode( $values ) ); ?>' />
|
71 |
<table>
|
lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
-
class
|
23 |
|
24 |
public $sanitize_callback = 'sanitize_text_field';
|
25 |
|
@@ -34,7 +34,7 @@ class sapAdminPageSettingRadio_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
34 |
if ( empty( $this->value ) ) { $this->value = $this->get_default_setting(); }
|
35 |
|
36 |
?>
|
37 |
-
<fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?>>
|
38 |
<?php foreach ( $this->options as $id => $title ) : ?>
|
39 |
<label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
|
40 |
<input type="radio" name="<?php echo $input_name; ?>" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( $id == $this->value ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
+
class sapAdminPageSettingRadio_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
23 |
|
24 |
public $sanitize_callback = 'sanitize_text_field';
|
25 |
|
34 |
if ( empty( $this->value ) ) { $this->value = $this->get_default_setting(); }
|
35 |
|
36 |
?>
|
37 |
+
<fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
|
38 |
<?php foreach ( $this->options as $id => $title ) : ?>
|
39 |
<label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
|
40 |
<input type="radio" name="<?php echo $input_name; ?>" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( $id == $this->value ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* @package Simple Admin Pages
|
11 |
*/
|
12 |
|
13 |
-
class
|
14 |
|
15 |
public $sanitize_callback = 'sanitize_text_field';
|
16 |
|
@@ -289,6 +289,8 @@ class sapAdminPageSettingScheduler_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
289 |
|
290 |
?>
|
291 |
|
|
|
|
|
292 |
<div class="sap-scheduler <?php echo ( $this->disabled ? 'disabled' : ''); ?>" id="<?php echo $this->id; ?>">
|
293 |
<?php
|
294 |
foreach ( $this->value as $id => $rule ) {
|
@@ -305,6 +307,8 @@ class sapAdminPageSettingScheduler_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
305 |
|
306 |
<?php $this->display_disabled(); ?>
|
307 |
|
|
|
|
|
308 |
<?php
|
309 |
}
|
310 |
|
10 |
* @package Simple Admin Pages
|
11 |
*/
|
12 |
|
13 |
+
class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
14 |
|
15 |
public $sanitize_callback = 'sanitize_text_field';
|
16 |
|
289 |
|
290 |
?>
|
291 |
|
292 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
293 |
+
|
294 |
<div class="sap-scheduler <?php echo ( $this->disabled ? 'disabled' : ''); ?>" id="<?php echo $this->id; ?>">
|
295 |
<?php
|
296 |
foreach ( $this->value as $id => $rule ) {
|
307 |
|
308 |
<?php $this->display_disabled(); ?>
|
309 |
|
310 |
+
</fieldset>
|
311 |
+
|
312 |
<?php
|
313 |
}
|
314 |
|
lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
* @package Simple Admin Pages
|
22 |
*/
|
23 |
|
24 |
-
class
|
25 |
|
26 |
public $sanitize_callback = 'sanitize_text_field';
|
27 |
|
@@ -39,6 +39,8 @@ class sapAdminPageSettingSelect_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
39 |
|
40 |
?>
|
41 |
|
|
|
|
|
42 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->id; ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
43 |
|
44 |
<?php if ( $this->blank_option === true ) : ?>
|
@@ -52,6 +54,8 @@ class sapAdminPageSettingSelect_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
52 |
</select>
|
53 |
<?php $this->display_disabled(); ?>
|
54 |
|
|
|
|
|
55 |
<?php
|
56 |
|
57 |
$this->display_description();
|
21 |
* @package Simple Admin Pages
|
22 |
*/
|
23 |
|
24 |
+
class sapAdminPageSettingSelect_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
25 |
|
26 |
public $sanitize_callback = 'sanitize_text_field';
|
27 |
|
39 |
|
40 |
?>
|
41 |
|
42 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
43 |
+
|
44 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->id; ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
45 |
|
46 |
<?php if ( $this->blank_option === true ) : ?>
|
54 |
</select>
|
55 |
<?php $this->display_disabled(); ?>
|
56 |
|
57 |
+
</fieldset>
|
58 |
+
|
59 |
<?php
|
60 |
|
61 |
$this->display_description();
|
lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
-
class
|
21 |
|
22 |
public $sanitize_callback = 'intval';
|
23 |
|
@@ -38,17 +38,23 @@ class sapAdminPageSettingSelectMenu_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
38 |
|
39 |
$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
|
40 |
?>
|
41 |
-
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>">
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
<?php
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
<?php
|
53 |
$this->display_description();
|
54 |
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
+
class sapAdminPageSettingSelectMenu_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
21 |
|
22 |
public $sanitize_callback = 'intval';
|
23 |
|
38 |
|
39 |
$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );
|
40 |
?>
|
|
|
41 |
|
42 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
43 |
+
|
44 |
+
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>">
|
45 |
+
|
46 |
+
<?php if ( $this->blank_option === true ) : ?>
|
47 |
+
<option></option>
|
48 |
+
<?php endif; ?>
|
49 |
+
|
50 |
+
<?php foreach($menus as $menu){ ?>
|
51 |
+
<option value="<?php echo absint( $menu->term_id ); ?>" <?php selected( $this->value, $menu->term_id ); ?>><?php echo esc_attr( $menu->name ); ?></option>
|
52 |
+
<?php } ?>
|
53 |
+
|
54 |
+
</select>
|
55 |
+
|
56 |
+
</fieldset>
|
57 |
+
|
58 |
<?php
|
59 |
$this->display_description();
|
60 |
|
lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
-
class
|
21 |
|
22 |
public $sanitize_callback = 'intval';
|
23 |
|
@@ -40,6 +40,8 @@ class sapAdminPageSettingSelectPost_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
40 |
|
41 |
?>
|
42 |
|
|
|
|
|
43 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
44 |
|
45 |
<?php if ( $this->blank_option === true ) : ?>
|
@@ -54,6 +56,8 @@ class sapAdminPageSettingSelectPost_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
54 |
|
55 |
<?php $this->display_disabled(); ?>
|
56 |
|
|
|
|
|
57 |
<?php
|
58 |
|
59 |
wp_reset_postdata();
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
+
class sapAdminPageSettingSelectPost_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
21 |
|
22 |
public $sanitize_callback = 'intval';
|
23 |
|
40 |
|
41 |
?>
|
42 |
|
43 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
44 |
+
|
45 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
46 |
|
47 |
<?php if ( $this->blank_option === true ) : ?>
|
56 |
|
57 |
<?php $this->display_disabled(); ?>
|
58 |
|
59 |
+
</fieldset>
|
60 |
+
|
61 |
<?php
|
62 |
|
63 |
wp_reset_postdata();
|
lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php
CHANGED
@@ -19,7 +19,7 @@
|
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
-
class
|
23 |
|
24 |
public $sanitize_callback = 'intval';
|
25 |
|
@@ -45,6 +45,8 @@ class sapAdminPageSettingSelectTaxonomy_2_5_3 extends sapAdminPageSetting_2_5_3
|
|
45 |
|
46 |
?>
|
47 |
|
|
|
|
|
48 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
49 |
|
50 |
<?php if ( $this->blank_option === true ) : ?>
|
@@ -59,6 +61,8 @@ class sapAdminPageSettingSelectTaxonomy_2_5_3 extends sapAdminPageSetting_2_5_3
|
|
59 |
|
60 |
<?php $this->display_disabled(); ?>
|
61 |
|
|
|
|
|
62 |
<?php
|
63 |
|
64 |
$this->display_description();
|
19 |
* @package Simple Admin Pages
|
20 |
*/
|
21 |
|
22 |
+
class sapAdminPageSettingSelectTaxonomy_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
23 |
|
24 |
public $sanitize_callback = 'intval';
|
25 |
|
45 |
|
46 |
?>
|
47 |
|
48 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
49 |
+
|
50 |
<select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
51 |
|
52 |
<?php if ( $this->blank_option === true ) : ?>
|
61 |
|
62 |
<?php $this->display_disabled(); ?>
|
63 |
|
64 |
+
</fieldset>
|
65 |
+
|
66 |
<?php
|
67 |
|
68 |
$this->display_description();
|
lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
@@ -24,14 +24,15 @@ class sapAdminPageSettingText_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
-
<
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
<?php
|
32 |
|
33 |
-
|
34 |
|
|
|
35 |
}
|
36 |
|
37 |
}
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingText_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
28 |
+
<input name="<?php echo $this->get_input_name(); ?>" type="text" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text <?php echo ( $this->small ? 'sap-small-text-input' : '' ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
29 |
|
30 |
+
<?php $this->display_disabled(); ?>
|
31 |
+
</fieldset>
|
|
|
32 |
|
33 |
+
<?php
|
34 |
|
35 |
+
$this->display_description();
|
36 |
}
|
37 |
|
38 |
}
|
lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* @todo textareas should have an option to swap new lines for <br>s
|
10 |
*/
|
11 |
|
12 |
-
class
|
13 |
|
14 |
/*
|
15 |
* Size of this textarea
|
@@ -45,14 +45,14 @@ class sapAdminPageSettingTextarea_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
45 |
public function display_setting() {
|
46 |
?>
|
47 |
|
48 |
-
<
|
|
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
<?php
|
53 |
|
|
|
54 |
$this->display_description();
|
55 |
-
|
56 |
}
|
57 |
|
58 |
}
|
9 |
* @todo textareas should have an option to swap new lines for <br>s
|
10 |
*/
|
11 |
|
12 |
+
class sapAdminPageSettingTextarea_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
13 |
|
14 |
/*
|
15 |
* Size of this textarea
|
45 |
public function display_setting() {
|
46 |
?>
|
47 |
|
48 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
49 |
+
<textarea name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" class="<?php echo $this->size; ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>><?php echo $this->value; ?></textarea>
|
50 |
|
51 |
+
<?php $this->display_disabled(); ?>
|
52 |
+
</fieldset>
|
|
|
53 |
|
54 |
+
<?php
|
55 |
$this->display_description();
|
|
|
56 |
}
|
57 |
|
58 |
}
|
lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Register, display and save a text field setting in the admin menu
|
5 |
+
*
|
6 |
+
* @since 2.5.5
|
7 |
+
* @package Simple Admin Pages
|
8 |
+
*/
|
9 |
+
|
10 |
+
class sapAdminPageSettingTime_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
+
|
12 |
+
public $sanitize_callback = 'sanitize_text_field';
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Placeholder string for the input field
|
16 |
+
* @since 2.5.5
|
17 |
+
*/
|
18 |
+
public $placeholder = '';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Display this setting
|
22 |
+
* @since 2.5.5
|
23 |
+
*/
|
24 |
+
public function display_setting() {
|
25 |
+
?>
|
26 |
+
|
27 |
+
<input name="<?php echo $this->get_input_name(); ?>" type="time" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
|
28 |
+
|
29 |
+
<?php $this->display_disabled(); ?>
|
30 |
+
|
31 |
+
<?php
|
32 |
+
|
33 |
+
$this->display_description();
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
-
class
|
21 |
|
22 |
public $sanitize_callback = 'sanitize_text_field';
|
23 |
|
@@ -33,9 +33,9 @@ class sapAdminPageSettingToggle_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
33 |
|
34 |
?>
|
35 |
|
36 |
-
<fieldset
|
37 |
<div class="sap-admin-hide-radios">
|
38 |
-
<input type="checkbox" name="<?php echo $input_name; ?>" id="<?php echo $input_name; ?>" value="1"<?php if( $this->value == '1' ) : ?> checked="checked"<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
|
39 |
<label for="<?php echo $input_name; ?>"><?php echo $this->title; ?></label>
|
40 |
</div>
|
41 |
<label class="sap-admin-switch">
|
17 |
* @package Simple Admin Pages
|
18 |
*/
|
19 |
|
20 |
+
class sapAdminPageSettingToggle_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
21 |
|
22 |
public $sanitize_callback = 'sanitize_text_field';
|
23 |
|
33 |
|
34 |
?>
|
35 |
|
36 |
+
<fieldset <?php $this->print_conditional_data(); ?>>
|
37 |
<div class="sap-admin-hide-radios">
|
38 |
+
<input type="checkbox" name="<?php echo $input_name; ?>" id="<?php echo $input_name; ?>" value="1"<?php if( $this->value == '1' ) : ?> checked="checked"<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>>
|
39 |
<label for="<?php echo $input_name; ?>"><?php echo $this->title; ?></label>
|
40 |
</div>
|
41 |
<label class="sap-admin-switch">
|
lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
-
class
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
@@ -24,7 +24,7 @@ class sapAdminPageSettingWarningTip_2_5_3 extends sapAdminPageSetting_2_5_3 {
|
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
-
<fieldset class="fdm-warning-tip"
|
28 |
<div class="fdm-shortcode-reminder">
|
29 |
<?php echo '<strong>' . $this->title . '</strong> ' . $this->placeholder; ?>
|
30 |
</div>
|
7 |
* @package Simple Admin Pages
|
8 |
*/
|
9 |
|
10 |
+
class sapAdminPageSettingWarningTip_2_6_1 extends sapAdminPageSetting_2_6_1 {
|
11 |
|
12 |
public $sanitize_callback = 'sanitize_text_field';
|
13 |
|
24 |
public function display_setting() {
|
25 |
?>
|
26 |
|
27 |
+
<fieldset class="fdm-warning-tip" <?php $this->print_conditional_data(); ?>>
|
28 |
<div class="fdm-shortcode-reminder">
|
29 |
<?php echo '<strong>' . $this->title . '</strong> ' . $this->placeholder; ?>
|
30 |
</div>
|
lib/simple-admin-pages/classes/AdminPageSetting.class.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* @package Simple Admin Pages
|
17 |
*/
|
18 |
|
19 |
-
abstract class
|
20 |
|
21 |
// Page defaults
|
22 |
public $id; // used in form fields and database to track and store setting
|
@@ -26,6 +26,10 @@ abstract class sapAdminPageSetting_2_5_3 {
|
|
26 |
public $disabled = false; // whether a setting should be disabled
|
27 |
public $small = false; // whether a text input should use the small styling
|
28 |
public $columns; // to be used for the number of columns for settings, like radio and checkbox, with lots of options/values
|
|
|
|
|
|
|
|
|
29 |
|
30 |
/**
|
31 |
* An array of arguments accepted by add_settings_field.
|
@@ -134,6 +138,9 @@ abstract class sapAdminPageSetting_2_5_3 {
|
|
134 |
// Get any existing value
|
135 |
$this->set_value();
|
136 |
|
|
|
|
|
|
|
137 |
// Check for missing data
|
138 |
$this->missing_data();
|
139 |
}
|
@@ -227,6 +234,54 @@ abstract class sapAdminPageSetting_2_5_3 {
|
|
227 |
return esc_attr( $val );
|
228 |
}
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
/**
|
231 |
* Wrapper for the sanitization callback function.
|
232 |
*
|
@@ -250,15 +305,13 @@ abstract class sapAdminPageSetting_2_5_3 {
|
|
250 |
*/
|
251 |
public function display_description() {
|
252 |
|
253 |
-
if (
|
254 |
|
255 |
?>
|
256 |
|
257 |
-
|
258 |
|
259 |
<?php
|
260 |
-
|
261 |
-
}
|
262 |
}
|
263 |
|
264 |
/**
|
16 |
* @package Simple Admin Pages
|
17 |
*/
|
18 |
|
19 |
+
abstract class sapAdminPageSetting_2_6_1 {
|
20 |
|
21 |
// Page defaults
|
22 |
public $id; // used in form fields and database to track and store setting
|
26 |
public $disabled = false; // whether a setting should be disabled
|
27 |
public $small = false; // whether a text input should use the small styling
|
28 |
public $columns; // to be used for the number of columns for settings, like radio and checkbox, with lots of options/values
|
29 |
+
public $conditional_on; // optional setting that this one is dependent on to diplay (ex. payment enabled for payment settings)
|
30 |
+
public $conditional_on_value; // the required value of the dependent setting, if enabled
|
31 |
+
public $conditional_display = true; // whether this setting should be displayed based on its conditional settings
|
32 |
+
|
33 |
|
34 |
/**
|
35 |
* An array of arguments accepted by add_settings_field.
|
138 |
// Get any existing value
|
139 |
$this->set_value();
|
140 |
|
141 |
+
// Get any existing value
|
142 |
+
$this->set_conditional_display();
|
143 |
+
|
144 |
// Check for missing data
|
145 |
$this->missing_data();
|
146 |
}
|
234 |
return esc_attr( $val );
|
235 |
}
|
236 |
|
237 |
+
/**
|
238 |
+
* Determines whether this setting should be displayed, based on its
|
239 |
+
* conditional conditions, if any.
|
240 |
+
*
|
241 |
+
* @since 2.6
|
242 |
+
*/
|
243 |
+
public function set_conditional_display() {
|
244 |
+
|
245 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
246 |
+
|
247 |
+
$option_group_value = get_option( $this->page );
|
248 |
+
|
249 |
+
$option_group_value[ $this->conditional_on ] = isset( $option_group_value[ $this->conditional_on ] ) ? $option_group_value[ $this->conditional_on ] : false;
|
250 |
+
|
251 |
+
if ( is_array( $option_group_value[ $this->conditional_on ] ) ) {
|
252 |
+
|
253 |
+
$this->conditional_display = in_array( $this->conditional_on_value, $option_group_value[ $this->conditional_on ] );
|
254 |
+
}
|
255 |
+
else {
|
256 |
+
|
257 |
+
$this->conditional_display = $this->conditional_on_value == $option_group_value[ $this->conditional_on ] ? true : false;
|
258 |
+
}
|
259 |
+
|
260 |
+
if ( ! empty( $this->conditional_display ) ) { return; }
|
261 |
+
|
262 |
+
if ( ! empty( $this->args['class'] ) ) {
|
263 |
+
|
264 |
+
$this->args['class'] .= ' sap-hidden';
|
265 |
+
}
|
266 |
+
else {
|
267 |
+
|
268 |
+
$this->args['class'] = 'sap-hidden';
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Prints conditional data tags within the input element if necessary
|
274 |
+
*
|
275 |
+
* @since 2.6
|
276 |
+
*/
|
277 |
+
public function print_conditional_data() {
|
278 |
+
|
279 |
+
if ( empty( $this->conditional_on ) ) { return; }
|
280 |
+
|
281 |
+
echo 'data-conditional_on="' . esc_attr( $this->conditional_on ) . '"';
|
282 |
+
echo 'data-conditional_on_value="' . esc_attr( $this->conditional_on_value ) . '"';
|
283 |
+
}
|
284 |
+
|
285 |
/**
|
286 |
* Wrapper for the sanitization callback function.
|
287 |
*
|
305 |
*/
|
306 |
public function display_description() {
|
307 |
|
308 |
+
if ( empty( $this->description ) ) { return; }
|
309 |
|
310 |
?>
|
311 |
|
312 |
+
<p class="description<?php echo ( $this->disabled ? ' disabled' : ''); ?>"><?php echo $this->description; ?></p>
|
313 |
|
314 |
<?php
|
|
|
|
|
315 |
}
|
316 |
|
317 |
/**
|
lib/simple-admin-pages/classes/Library.class.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
if ( !class_exists( '
|
3 |
/**
|
4 |
* This library class loads and provides access to the correct version of the
|
5 |
* Simple Admin Pages library.
|
@@ -7,10 +7,10 @@ if ( !class_exists( 'sapLibrary_2_5_3' ) ) {
|
|
7 |
* @since 1.0
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
-
class
|
11 |
|
12 |
// Version of the library
|
13 |
-
private $version = '2.
|
14 |
|
15 |
// A full URL to the library which is used to correctly link scripts and
|
16 |
// stylesheets.
|
@@ -35,6 +35,13 @@ class sapLibrary_2_5_3 {
|
|
35 |
// during development.
|
36 |
public $debug_mode = false;
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* Initialize the library with the appropriate version
|
40 |
* @since 1.0
|
@@ -42,7 +49,7 @@ class sapLibrary_2_5_3 {
|
|
42 |
public function __construct( $args ) {
|
43 |
|
44 |
if ( ! defined( 'SAP_VERSION' ) ) {
|
45 |
-
define( 'SAP_VERSION', '2.
|
46 |
}
|
47 |
|
48 |
// If no URL path to the library is passed, we won't be able to add the
|
@@ -71,6 +78,11 @@ class sapLibrary_2_5_3 {
|
|
71 |
$this->debug_mode = true;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
74 |
// Ensure we have access to WordPress' plugin functions
|
75 |
require_once(ABSPATH . '/wp-admin/includes/plugin.php');
|
76 |
|
@@ -440,6 +452,28 @@ class sapLibrary_2_5_3 {
|
|
440 |
|
441 |
// Only enqueue assets for the current page
|
442 |
if ( strpos( $screen->base, $page_id ) !== false ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
wp_enqueue_style( 'sap-admin-style-' . $this->version, $this->lib_url . 'css/admin.css', array(), $this->version );
|
444 |
wp_enqueue_style( 'sap-spectrum-css-' . $this->version, $this->lib_url . 'css/spectrum.css', array(), $this->version );
|
445 |
wp_enqueue_style( 'sap-admin-settings-css-' . $this->version, $this->lib_url . 'css/admin-settings.css', array(), $this->version );
|
1 |
<?php
|
2 |
+
if ( !class_exists( 'sapLibrary_2_6_1' ) ) {
|
3 |
/**
|
4 |
* This library class loads and provides access to the correct version of the
|
5 |
* Simple Admin Pages library.
|
7 |
* @since 1.0
|
8 |
* @package Simple Admin Pages
|
9 |
*/
|
10 |
+
class sapLibrary_2_6_1 {
|
11 |
|
12 |
// Version of the library
|
13 |
+
private $version = '2.6.1';
|
14 |
|
15 |
// A full URL to the library which is used to correctly link scripts and
|
16 |
// stylesheets.
|
35 |
// during development.
|
36 |
public $debug_mode = false;
|
37 |
|
38 |
+
public $available_themes = [
|
39 |
+
'purple',
|
40 |
+
'blue'
|
41 |
+
];
|
42 |
+
|
43 |
+
public $current_theme = 'blue';
|
44 |
+
|
45 |
/**
|
46 |
* Initialize the library with the appropriate version
|
47 |
* @since 1.0
|
49 |
public function __construct( $args ) {
|
50 |
|
51 |
if ( ! defined( 'SAP_VERSION' ) ) {
|
52 |
+
define( 'SAP_VERSION', '2.6.1' );
|
53 |
}
|
54 |
|
55 |
// If no URL path to the library is passed, we won't be able to add the
|
78 |
$this->debug_mode = true;
|
79 |
}
|
80 |
|
81 |
+
// Set the current theme
|
82 |
+
if ( isset( $args['theme'] ) && in_array( $args['theme'], $this->available_themes ) ) {
|
83 |
+
$this->current_theme = $args['theme'];
|
84 |
+
}
|
85 |
+
|
86 |
// Ensure we have access to WordPress' plugin functions
|
87 |
require_once(ABSPATH . '/wp-admin/includes/plugin.php');
|
88 |
|
452 |
|
453 |
// Only enqueue assets for the current page
|
454 |
if ( strpos( $screen->base, $page_id ) !== false ) {
|
455 |
+
|
456 |
+
// Theme specifc files
|
457 |
+
switch ($this->current_theme) {
|
458 |
+
case 'blue':
|
459 |
+
wp_enqueue_style(
|
460 |
+
'sap-admin-settings-css-blue-' . $this->version,
|
461 |
+
$this->lib_url . 'css/admin-settings-blue.css',
|
462 |
+
array(),
|
463 |
+
$this->version
|
464 |
+
);
|
465 |
+
break;
|
466 |
+
|
467 |
+
case 'purple':
|
468 |
+
wp_enqueue_style(
|
469 |
+
'sap-admin-settings-css-purple-' . $this->version,
|
470 |
+
$this->lib_url . 'css/admin-settings-purple.css',
|
471 |
+
array(),
|
472 |
+
$this->version
|
473 |
+
);
|
474 |
+
break;
|
475 |
+
}
|
476 |
+
|
477 |
wp_enqueue_style( 'sap-admin-style-' . $this->version, $this->lib_url . 'css/admin.css', array(), $this->version );
|
478 |
wp_enqueue_style( 'sap-spectrum-css-' . $this->version, $this->lib_url . 'css/spectrum.css', array(), $this->version );
|
479 |
wp_enqueue_style( 'sap-admin-settings-css-' . $this->version, $this->lib_url . 'css/admin-settings.css', array(), $this->version );
|
lib/simple-admin-pages/css/admin-settings-blue.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
:root {
|
2 |
+
--main-color: #1b335f;
|
3 |
+
--main-color-border: #1b335f;
|
4 |
+
}
|
lib/simple-admin-pages/css/admin-settings-purple.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
:root {
|
2 |
+
--main-color: #6026B4;
|
3 |
+
--main-color-border: #854DD6;
|
4 |
+
}
|
lib/simple-admin-pages/css/admin-settings.css
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
/************************/
|
2 |
/***** OPTIONS PAGE *****/
|
3 |
/************************/
|
@@ -41,19 +45,19 @@
|
|
41 |
.wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active {
|
42 |
box-shadow: none;
|
43 |
background-color: #fff !important;
|
44 |
-
color:
|
45 |
-
border-left: 4px solid
|
46 |
}
|
47 |
.wrap.sap-settings-page h2.nav-tab-wrapper a:hover {
|
48 |
-
color:
|
49 |
background-color: rgba(199,199,199, 0.5);
|
50 |
box-shadow: none;
|
51 |
-
border-left: 4px solid
|
52 |
}
|
53 |
.wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active:hover {
|
54 |
-
color:
|
55 |
background-color: #fff;
|
56 |
-
border-left: 4px solid
|
57 |
}
|
58 |
|
59 |
/* Right side */
|
@@ -72,14 +76,14 @@
|
|
72 |
|
73 |
.wrap.sap-settings-page form h2:first-of-type {
|
74 |
font-size: 18px;
|
75 |
-
color:
|
76 |
margin: 0 0 32px !important;
|
77 |
}
|
78 |
|
79 |
.wrap.sap-settings-page form h2:nth-of-type(1n+2) {
|
80 |
position: relative;
|
81 |
float: left;
|
82 |
-
background:
|
83 |
margin: 8px 0 0;
|
84 |
font-size: 15px;
|
85 |
font-weight: bold;
|
@@ -168,11 +172,11 @@ TOGGLE SWITCHES
|
|
168 |
}
|
169 |
|
170 |
input:checked + .sap-admin-switch-slider {
|
171 |
-
background-color:
|
172 |
}
|
173 |
|
174 |
input:focus + .sap-admin-switch-slider {
|
175 |
-
box-shadow: 0 0 1px
|
176 |
}
|
177 |
|
178 |
input:checked + .sap-admin-switch-slider:before {
|
@@ -216,10 +220,10 @@ input:checked + .sap-admin-switch-slider:before {
|
|
216 |
}
|
217 |
.sap-admin-input-container:hover input ~ .sap-admin-radio-button {
|
218 |
background-color: #E6FFFB;
|
219 |
-
border-color:
|
220 |
}
|
221 |
.sap-admin-input-container input:checked ~ .sap-admin-radio-button {
|
222 |
-
border-color:
|
223 |
background-color: #fff;
|
224 |
}
|
225 |
.sap-admin-radio-button:after {
|
@@ -236,7 +240,7 @@ input:checked + .sap-admin-switch-slider:before {
|
|
236 |
width: 8px;
|
237 |
height: 8px;
|
238 |
border-radius: 50%;
|
239 |
-
background:
|
240 |
}
|
241 |
|
242 |
.sap-admin-checkbox {
|
@@ -251,10 +255,10 @@ input:checked + .sap-admin-switch-slider:before {
|
|
251 |
}
|
252 |
.sap-admin-input-container:hover input ~ .sap-admin-checkbox {
|
253 |
background-color: #E6FFFB;
|
254 |
-
border-color:
|
255 |
}
|
256 |
.sap-admin-input-container input:checked ~ .sap-admin-checkbox {
|
257 |
-
border-color:
|
258 |
background-color: #fff;
|
259 |
}
|
260 |
.sap-admin-checkbox:after {
|
@@ -270,7 +274,7 @@ input:checked + .sap-admin-switch-slider:before {
|
|
270 |
top: 1px;
|
271 |
width: 4px;
|
272 |
height: 8px;
|
273 |
-
border: solid
|
274 |
border-width: 0 2px 2px 0;
|
275 |
-webkit-transform: rotate(45deg);
|
276 |
-ms-transform: rotate(45deg);
|
@@ -423,8 +427,8 @@ fieldset.sap-colorpicker {
|
|
423 |
float: left;
|
424 |
width: calc(100% - 20px);
|
425 |
margin: 16px 8px;
|
426 |
-
border: 2px solid
|
427 |
-
background-color:
|
428 |
color: #fff;
|
429 |
padding: 6px 0;
|
430 |
font-size: 12px;
|
@@ -434,8 +438,8 @@ fieldset.sap-colorpicker {
|
|
434 |
border-radius: 2px;
|
435 |
}
|
436 |
.section-disabled .sap-dashboard-get-premium-widget-button:hover {
|
437 |
-
background-color: #
|
438 |
-
border-color: #
|
439 |
color: #fff;
|
440 |
}
|
441 |
|
@@ -552,7 +556,7 @@ fieldset.sap-colorpicker {
|
|
552 |
.sap-infinite-table-row-delete,
|
553 |
.sap-custom-fields-add-nutrional-information {
|
554 |
cursor: pointer;
|
555 |
-
color:
|
556 |
}
|
557 |
.sap-infinite-table-row-delete:hover,
|
558 |
.sap-custom-fields-add-nutrional-information:hover {
|
1 |
+
.sap-hidden {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
|
5 |
/************************/
|
6 |
/***** OPTIONS PAGE *****/
|
7 |
/************************/
|
45 |
.wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active {
|
46 |
box-shadow: none;
|
47 |
background-color: #fff !important;
|
48 |
+
color: var(--main-color);
|
49 |
+
border-left: 4px solid var(--main-color-border);
|
50 |
}
|
51 |
.wrap.sap-settings-page h2.nav-tab-wrapper a:hover {
|
52 |
+
color: var(--main-color);
|
53 |
background-color: rgba(199,199,199, 0.5);
|
54 |
box-shadow: none;
|
55 |
+
border-left: 4px solid var(--main-color-border);
|
56 |
}
|
57 |
.wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active:hover {
|
58 |
+
color: var(--main-color);
|
59 |
background-color: #fff;
|
60 |
+
border-left: 4px solid var(--main-color-border);
|
61 |
}
|
62 |
|
63 |
/* Right side */
|
76 |
|
77 |
.wrap.sap-settings-page form h2:first-of-type {
|
78 |
font-size: 18px;
|
79 |
+
color: var(--main-color);
|
80 |
margin: 0 0 32px !important;
|
81 |
}
|
82 |
|
83 |
.wrap.sap-settings-page form h2:nth-of-type(1n+2) {
|
84 |
position: relative;
|
85 |
float: left;
|
86 |
+
background: var(--main-color);
|
87 |
margin: 8px 0 0;
|
88 |
font-size: 15px;
|
89 |
font-weight: bold;
|
172 |
}
|
173 |
|
174 |
input:checked + .sap-admin-switch-slider {
|
175 |
+
background-color: var(--main-color);
|
176 |
}
|
177 |
|
178 |
input:focus + .sap-admin-switch-slider {
|
179 |
+
box-shadow: 0 0 1px var(--main-color);
|
180 |
}
|
181 |
|
182 |
input:checked + .sap-admin-switch-slider:before {
|
220 |
}
|
221 |
.sap-admin-input-container:hover input ~ .sap-admin-radio-button {
|
222 |
background-color: #E6FFFB;
|
223 |
+
border-color: var(--main-color-border);
|
224 |
}
|
225 |
.sap-admin-input-container input:checked ~ .sap-admin-radio-button {
|
226 |
+
border-color: var(--main-color-border);
|
227 |
background-color: #fff;
|
228 |
}
|
229 |
.sap-admin-radio-button:after {
|
240 |
width: 8px;
|
241 |
height: 8px;
|
242 |
border-radius: 50%;
|
243 |
+
background: var(--main-color);
|
244 |
}
|
245 |
|
246 |
.sap-admin-checkbox {
|
255 |
}
|
256 |
.sap-admin-input-container:hover input ~ .sap-admin-checkbox {
|
257 |
background-color: #E6FFFB;
|
258 |
+
border-color: var(--main-color-border);
|
259 |
}
|
260 |
.sap-admin-input-container input:checked ~ .sap-admin-checkbox {
|
261 |
+
border-color: var(--main-color-border);
|
262 |
background-color: #fff;
|
263 |
}
|
264 |
.sap-admin-checkbox:after {
|
274 |
top: 1px;
|
275 |
width: 4px;
|
276 |
height: 8px;
|
277 |
+
border: solid var(--main-color-border);
|
278 |
border-width: 0 2px 2px 0;
|
279 |
-webkit-transform: rotate(45deg);
|
280 |
-ms-transform: rotate(45deg);
|
427 |
float: left;
|
428 |
width: calc(100% - 20px);
|
429 |
margin: 16px 8px;
|
430 |
+
border: 2px solid var(--main-color-border);
|
431 |
+
background-color: var(--main-color);
|
432 |
color: #fff;
|
433 |
padding: 6px 0;
|
434 |
font-size: 12px;
|
438 |
border-radius: 2px;
|
439 |
}
|
440 |
.section-disabled .sap-dashboard-get-premium-widget-button:hover {
|
441 |
+
background-color: #5477b7;
|
442 |
+
border-color: #5477b7;
|
443 |
color: #fff;
|
444 |
}
|
445 |
|
556 |
.sap-infinite-table-row-delete,
|
557 |
.sap-custom-fields-add-nutrional-information {
|
558 |
cursor: pointer;
|
559 |
+
color: var(--main-color);
|
560 |
}
|
561 |
.sap-infinite-table-row-delete:hover,
|
562 |
.sap-custom-fields-add-nutrional-information:hover {
|
lib/simple-admin-pages/css/infinite_table.css
CHANGED
@@ -1,3 +0,0 @@
|
|
1 |
-
.sap-hidden {
|
2 |
-
display: none;
|
3 |
-
}
|
|
|
|
|
|
lib/simple-admin-pages/js/admin-settings.js
CHANGED
@@ -33,6 +33,28 @@ jQuery(document).ready(function() {
|
|
33 |
else {jQuery(this).css('color', '#000000');}
|
34 |
}
|
35 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
});
|
37 |
|
38 |
function EWD_SAP_hexToRgb(hex) {
|
@@ -47,7 +69,7 @@ function EWD_SAP_hexToRgb(hex) {
|
|
47 |
//OPTIONS PAGE YES/NO TOGGLE SWITCHES
|
48 |
jQuery(document).ready(function($){
|
49 |
$('.sap-admin-option-toggle').on('change', function() {
|
50 |
-
var Input_Name = $(this).data('inputname');
|
51 |
if ($(this).is(':checked')) {
|
52 |
$('input[name="' + Input_Name + '"][value="1"]').prop('checked', true).trigger('change');
|
53 |
$('input[name="' + Input_Name + '"][value=""]').prop('checked', false);
|
@@ -61,21 +83,22 @@ jQuery(document).ready(function($){
|
|
61 |
|
62 |
/*LOCK BOXES*/
|
63 |
jQuery( document ).ready( function() {
|
64 |
-
setTimeout( resizeLockdownBoxes, 750 );
|
65 |
-
jQuery( window ).on( 'resize', resizeLockdownBoxes );
|
66 |
-
});
|
67 |
|
68 |
-
function resizeLockdownBoxes() {
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
}
|
|
|
|
|
|
|
|
33 |
else {jQuery(this).css('color', '#000000');}
|
34 |
}
|
35 |
});
|
36 |
+
|
37 |
+
jQuery( 'fieldset[data-conditional_on]' ).each( function() {
|
38 |
+
|
39 |
+
var option = jQuery( this );
|
40 |
+
var option_name = jQuery( 'input[name="option_page"]' ).val() + '[' + option.data( 'conditional_on' ) + ']';
|
41 |
+
|
42 |
+
jQuery( '[name="' + option_name + '"], [name="' + option_name + '[]"]' ).on( 'change', function() {
|
43 |
+
|
44 |
+
var option_value = jQuery( this ).attr( 'type' ) != 'checkbox' ? jQuery( this ).val() :
|
45 |
+
( ( option.data( 'conditional_on_value' ) == 1 || option.data( 'conditional_on_value' ) == '' ) ? jQuery( this ).is( ':checked' ) :
|
46 |
+
( jQuery( this ).is( ':checked' ) ? option.data( 'conditional_on_value' ) : false ) );
|
47 |
+
|
48 |
+
if ( option_value == option.data( 'conditional_on_value' ) ) {
|
49 |
+
|
50 |
+
option.parent().parent().removeClass( 'sap-hidden' );
|
51 |
+
}
|
52 |
+
else {
|
53 |
+
|
54 |
+
option.parent().parent().addClass( 'sap-hidden' );
|
55 |
+
}
|
56 |
+
});
|
57 |
+
});
|
58 |
});
|
59 |
|
60 |
function EWD_SAP_hexToRgb(hex) {
|
69 |
//OPTIONS PAGE YES/NO TOGGLE SWITCHES
|
70 |
jQuery(document).ready(function($){
|
71 |
$('.sap-admin-option-toggle').on('change', function() {
|
72 |
+
var Input_Name = $(this).data('inputname');
|
73 |
if ($(this).is(':checked')) {
|
74 |
$('input[name="' + Input_Name + '"][value="1"]').prop('checked', true).trigger('change');
|
75 |
$('input[name="' + Input_Name + '"][value=""]').prop('checked', false);
|
83 |
|
84 |
/*LOCK BOXES*/
|
85 |
jQuery( document ).ready( function() {
|
|
|
|
|
|
|
86 |
|
87 |
+
function resizeLockdownBoxes() {
|
88 |
+
jQuery('.sap-premium-options-table-overlay').each(function(){
|
89 |
+
|
90 |
+
var eachProTableOverlay = jQuery( this );
|
91 |
+
var associatedTable = eachProTableOverlay.next();
|
92 |
+
associatedTable.css('min-height', '260px');
|
93 |
+
var tablePosition = associatedTable.position();
|
94 |
|
95 |
+
eachProTableOverlay.css( 'width', associatedTable.outerWidth(true) + 'px' );
|
96 |
+
eachProTableOverlay.css( 'height', associatedTable.outerHeight() + 'px' );
|
97 |
+
eachProTableOverlay.css( 'left', tablePosition.left + 'px' );
|
98 |
+
eachProTableOverlay.css( 'top', tablePosition.top + 'px' );
|
99 |
+
});
|
100 |
+
}
|
101 |
+
|
102 |
+
setTimeout( resizeLockdownBoxes, 750 );
|
103 |
+
jQuery( window ).on( 'resize', resizeLockdownBoxes );
|
104 |
+
});
|
lib/simple-admin-pages/js/count.js
CHANGED
@@ -1,10 +1,14 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
-
jQuery('.sap-count-count, .sap-count-unit').on('change', function() {
|
3 |
-
var id = jQuery(this).data('id');
|
4 |
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
jQuery('#' + id).val(
|
9 |
})
|
10 |
})
|
1 |
jQuery(document).ready(function() {
|
|
|
|
|
2 |
|
3 |
+
jQuery( '.sap-count-count, .sap-count-unit' ).on( 'change', function() {
|
4 |
+
|
5 |
+
var id = jQuery( this ).data( 'id' );
|
6 |
+
|
7 |
+
var count = jQuery( '#' + id + '_count' ).val();
|
8 |
+
var unit = jQuery( '#' + id + '_unit' ).length ? jQuery( '#' + id + '_unit' ).val() : '';
|
9 |
+
|
10 |
+
var value = count + ( unit ? '_' : '' ) + unit;
|
11 |
|
12 |
+
jQuery( '#' + id ).val( value );
|
13 |
})
|
14 |
})
|
lib/simple-admin-pages/js/infinite_table.js
CHANGED
@@ -50,14 +50,31 @@ jQuery(document).ready(function ($) {
|
|
50 |
|
51 |
// Add new field
|
52 |
$('.sap-infinite-table-add-row .sap-new-admin-add-button').on('click', function (ev) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
let _template_tr = $( this ).parents( 'tfoot' ).find( '.sap-infinite-table-row-template' ).clone();
|
54 |
_template_tr
|
55 |
.hide()
|
56 |
.removeClass()
|
57 |
-
.addClass('sap-infinite-table-row');
|
58 |
-
|
59 |
-
|
60 |
-
_template_tr.find('
|
|
|
|
|
|
|
61 |
});
|
62 |
|
63 |
// update options field
|
50 |
|
51 |
// Add new field
|
52 |
$('.sap-infinite-table-add-row .sap-new-admin-add-button').on('click', function (ev) {
|
53 |
+
let rowid = 1;
|
54 |
+
let _list = [];
|
55 |
+
$( this ).parents( 'tfoot' ).siblings( 'tbody' ).find( 'tr td' ).each((i, x) => {
|
56 |
+
let f_type = $(x).data( 'field-type' );
|
57 |
+
if( 'id' == f_type ) {
|
58 |
+
_list.push( parseInt( $(x).find( '.sap-infinite-table-id-html' ).eq(0).html() ) );
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
_list.sort();
|
63 |
+
if( 0 < _list.length ) {
|
64 |
+
rowid = _list[ _list.length - 1 ] + 1;
|
65 |
+
}
|
66 |
+
|
67 |
let _template_tr = $( this ).parents( 'tfoot' ).find( '.sap-infinite-table-row-template' ).clone();
|
68 |
_template_tr
|
69 |
.hide()
|
70 |
.removeClass()
|
71 |
+
.addClass( 'sap-infinite-table-row' );
|
72 |
+
|
73 |
+
$( this ).parents( 'table' ).first().find( 'tbody' ).append( _template_tr );
|
74 |
+
_template_tr.find( '.sap-infinite-table-id-html' ).eq(0).siblings( 'input' ).val( rowid );
|
75 |
+
_template_tr.find( '.sap-infinite-table-id-html' ).eq(0).html( rowid );
|
76 |
+
_template_tr.fadeIn( 'fast' );
|
77 |
+
_template_tr.find( '[data-name="cf_options"]' ).prop( 'readonly' , true );
|
78 |
});
|
79 |
|
80 |
// update options field
|
readme.txt
CHANGED
@@ -266,6 +266,11 @@ Video 3 - FAQs Ordering
|
|
266 |
|
267 |
== Changelog ==
|
268 |
|
|
|
|
|
|
|
|
|
|
|
269 |
= 2.0.24 (2021-10-07) =
|
270 |
- Adds in error handling for when the display_faq isn't defined
|
271 |
- Adds in additional checks to prevent a console errors when the plugin JS files are loaded without the default localization data being defined.
|
266 |
|
267 |
== Changelog ==
|
268 |
|
269 |
+
= 2.0.25 (2021-11-03) =
|
270 |
+
- Updates the SAP library to version 2.6.1
|
271 |
+
- Updates setting's so that a number display only conditionally on other settings' values
|
272 |
+
- Fix for the 'X' in the search box not re-triggering the AJAX search
|
273 |
+
|
274 |
= 2.0.24 (2021-10-07) =
|
275 |
- Adds in error handling for when the display_faq isn't defined
|
276 |
- Adds in additional checks to prevent a console errors when the plugin JS files are loaded without the default localization data being defined.
|
ultimate-faqs.php
CHANGED
@@ -6,7 +6,7 @@ Description: FAQ and accordion plugin with easy to use Gutenberg blocks, shortco
|
|
6 |
Author URI: https://www.etoilewebdesign.com/plugins/ultimate-faqs/
|
7 |
Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
8 |
Text Domain: ultimate-faqs
|
9 |
-
Version: 2.0.
|
10 |
WC requires at least: 3.0
|
11 |
WC tested up to: 5.6
|
12 |
*/
|
@@ -43,7 +43,7 @@ class ewdufaqInit {
|
|
43 |
define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
44 |
define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
45 |
define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
|
46 |
-
define( 'EWD_UFAQ_VERSION', '2.0.
|
47 |
|
48 |
define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
|
49 |
define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
|
6 |
Author URI: https://www.etoilewebdesign.com/plugins/ultimate-faqs/
|
7 |
Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
|
8 |
Text Domain: ultimate-faqs
|
9 |
+
Version: 2.0.25
|
10 |
WC requires at least: 3.0
|
11 |
WC tested up to: 5.6
|
12 |
*/
|
43 |
define( 'EWD_UFAQ_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
|
44 |
define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
|
45 |
define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
|
46 |
+
define( 'EWD_UFAQ_VERSION', '2.0.25' );
|
47 |
|
48 |
define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
|
49 |
define( 'EWD_UFAQ_FAQ_CATEGORY_TAXONOMY', 'ufaq-category' );
|
views/View.FAQ.class.php
CHANGED
@@ -457,6 +457,17 @@ class ewdufaqViewFAQ extends ewdufaqView {
|
|
457 |
return $this->display_all_answers ? $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol' ) : strtolower( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol' ) );
|
458 |
}
|
459 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
/**
|
461 |
* Returns an array of the custom fields that exist for this site
|
462 |
*
|
@@ -647,7 +658,7 @@ class ewdufaqViewFAQ extends ewdufaqView {
|
|
647 |
)
|
648 |
);
|
649 |
|
650 |
-
if (
|
651 |
$classes[] = 'ewd-ufaq-can-be-toggled';
|
652 |
}
|
653 |
|
457 |
return $this->display_all_answers ? $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol' ) : strtolower( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol' ) );
|
458 |
}
|
459 |
|
460 |
+
/**
|
461 |
+
* Returns the permalink for the main anchor tag (either the FAQ permalink or #)
|
462 |
+
*
|
463 |
+
* @since 2.0.25
|
464 |
+
*/
|
465 |
+
public function get_anchor_permalink() {
|
466 |
+
global $ewd_ufaq_controller;
|
467 |
+
|
468 |
+
return $ewd_ufaq_controller->settings->get_setting( 'disable-faq-toggle' ) ? get_permalink( $this->post->ID ) : '#';
|
469 |
+
}
|
470 |
+
|
471 |
/**
|
472 |
* Returns an array of the custom fields that exist for this site
|
473 |
*
|
658 |
)
|
659 |
);
|
660 |
|
661 |
+
if ( empty( $ewd_ufaq_controller->settings->get_setting( 'disable-faq-toggle' ) ) ) {
|
662 |
$classes[] = 'ewd-ufaq-can-be-toggled';
|
663 |
}
|
664 |
|