widgets.php
63 lines
| 1 | <?php |
| 2 | |
| 3 | $login_global_settings = get_option('xs_global_setting_data', []); |
| 4 | $share_share_settings = get_option('xs_share_global_setting_data', []); |
| 5 | |
| 6 | ?> |
| 7 | |
| 8 | <div class="wslu-admin-fields-container <?php echo esc_attr(isset($_GET['wp-social-met-onboard-steps']) && sanitize_text_field($_GET['wp-social-met-onboard-steps']) == 'loaded' ? 'wslu-admin-widgets-container' : 'wslu-admin-widget-list'); ?>"> |
| 9 | <span class="wslu-admin-fields-container-description"><?php esc_html_e('You can disable the elements you are not using on your site. That will disable all associated assets of those widgets to improve your site loading speed.', 'wp-social');?></span> |
| 10 | |
| 11 | <div class="wslu-admin-fields-container-fieldset"> |
| 12 | <?php foreach (\WP_Social\Lib\Onboard\Onboard::settings() as $page_key => $pages): ?> |
| 13 | <h2 class="wslu-widget-group-title"><?php echo esc_html(ucwords(str_replace('_', ' ', $page_key))); ?></h2> |
| 14 | <div class="attr-row"> |
| 15 | <?php foreach ($pages as $key => $value): ?> |
| 16 | <div class="attr-col-md-6 attr-col-lg-5"> |
| 17 | <?php |
| 18 | $checked = false; |
| 19 | if ('login' === $page_key) { |
| 20 | |
| 21 | if (isset($login_global_settings[$key]['enable']) && $login_global_settings[$key]['enable'] == 1) { |
| 22 | $checked = true; |
| 23 | } |
| 24 | |
| 25 | } elseif('share' === $page_key) { |
| 26 | |
| 27 | if ('show_font_from_theme' === $key) { |
| 28 | $xs_share_global_settings = get_option('xs_share_global_setting_data', []); |
| 29 | if (isset($xs_share_global_settings['show_font_from_theme']) && $xs_share_global_settings['show_font_from_theme'] == 1) { |
| 30 | $checked = true; |
| 31 | } |
| 32 | } elseif ('show_social_count_share' === $key) { |
| 33 | $style_setting_data_share = get_option('xs_style_setting_data_share', []); |
| 34 | if (isset($style_setting_data_share['main_content']['show_social_count_share']) && $style_setting_data_share['main_content']['show_social_count_share'] == 1) { |
| 35 | $checked = true; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | } elseif('counter' === $page_key) { |
| 40 | |
| 41 | $xs_counter_global_setting_data = get_option('xs_counter_global_setting_data', []); |
| 42 | if (isset($xs_counter_global_setting_data['show_font_from_theme']) && $xs_counter_global_setting_data['show_font_from_theme'] == 1) { |
| 43 | $checked = true; |
| 44 | } |
| 45 | } |
| 46 | \WP_Social\Lib\Onboard\Attr::instance()->utils->input([ |
| 47 | 'type' => 'switch', |
| 48 | 'name' => $page_key . '[' . $key . ']', |
| 49 | 'label' => esc_html($value['title']), |
| 50 | 'value' => $value['value'], |
| 51 | 'options' => [ |
| 52 | 'checked' => $checked, |
| 53 | ], |
| 54 | ]); |
| 55 | ?> |
| 56 | </div> |
| 57 | <?php endforeach;?> |
| 58 | </div> |
| 59 | <?php endforeach;?> |
| 60 | </div> |
| 61 | </div> |
| 62 | |
| 63 |