acf.php
2 months ago
alignment.php
2 months ago
animation.php
2 months ago
beaver_builder.php
2 months ago
cache.php
2 months ago
classes.php
2 months ago
classic-widgets-screen.php
2 months ago
clone.php
2 months ago
columns.php
2 months ago
custom-sidebar.php
2 months ago
dates.php
2 months ago
devices.php
2 months ago
disable_widgets.php
2 months ago
elementor.php
2 months ago
fixed.php
2 months ago
import-export.php
2 months ago
links.php
2 months ago
logic.php
2 months ago
move.php
2 months ago
page-and-post-block.php
2 months ago
permission.php
2 months ago
roles.php
2 months ago
search.php
2 months ago
shortcodes.php
2 months ago
sidebar-more_plugins.php
2 months ago
sidebar-opt_in.php
2 months ago
sidebar-support_box.php
2 months ago
sidebar-upsell_pro.php
2 months ago
siteorigin.php
2 months ago
sliding.php
2 months ago
state.php
2 months ago
styling.php
2 months ago
taxonomies.php
2 months ago
title.php
2 months ago
urls.php
2 months ago
visibility.php
2 months ago
widget-area.php
2 months ago
visibility.php
94 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Visibility Settings Module |
| 5 | * Settings > Widget Options :: Pages Visibility |
| 6 | * |
| 7 | * @copyright Copyright (c) 2016, Jeffrey Carandang |
| 8 | * @since 3.0 |
| 9 | */ |
| 10 | |
| 11 | // Exit if accessed directly |
| 12 | if (!defined('ABSPATH')) exit; |
| 13 | |
| 14 | /** |
| 15 | * Create Card Module for Pages Visibility Options |
| 16 | * |
| 17 | * @since 3.0 |
| 18 | * @global $widget_options |
| 19 | * @return void |
| 20 | */ |
| 21 | if (!function_exists('widgetopts_settings_visibility')) : |
| 22 | function widgetopts_settings_visibility() |
| 23 | { |
| 24 | global $widget_options; ?> |
| 25 | <li class="widgetopts-module-card <?php echo ($widget_options['visibility'] == 'activate') ? 'widgetopts-module-type-enabled' : 'widgetopts-module-type-disabled'; ?>" id="widgetopts-module-card-visibility" data-module-id="visibility"> |
| 26 | <div class="widgetopts-module-card-content"> |
| 27 | <h2><?php _e('Pages Visibility', 'widget-options'); ?></h2> |
| 28 | <p class="widgetopts-module-desc"> |
| 29 | <?php _e('Easily restrict any widgets visibility on specific WordPress pages.', 'widget-options'); ?> |
| 30 | </p> |
| 31 | <div class="widgetopts-module-actions hide-if-no-js"> |
| 32 | <?php if ($widget_options['visibility'] == 'activate') { ?> |
| 33 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e('Configure Settings', 'widget-options'); ?></button> |
| 34 | <button class="button button-secondary widgetopts-toggle-activation"><?php _e('Disable', 'widget-options'); ?></button> |
| 35 | <?php } else { ?> |
| 36 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e('Learn More', 'widget-options'); ?></button> |
| 37 | <button class="button button-primary widgetopts-toggle-activation"><?php _e('Enable', 'widget-options'); ?></button> |
| 38 | <?php } ?> |
| 39 | |
| 40 | </div> |
| 41 | </div> |
| 42 | |
| 43 | <?php widgetopts_modal_start($widget_options['visibility']); ?> |
| 44 | <span class="dashicons widgetopts-dashicons dashicons-visibility"></span> |
| 45 | <h3 class="widgetopts-modal-header"><?php _e('Pages Visibility', 'widget-options'); ?></h3> |
| 46 | <p> |
| 47 | <?php _e('Visibility tab allows you to completely control each widgets visibility and restrict them on any WordPress pages. You can turn on/off the underlying tabs for post types, taxonomies and miscellanous options using the options below when this feature is enabled.', 'widget-options'); ?> |
| 48 | </p> |
| 49 | <table class="form-table widgetopts-settings-section"> |
| 50 | <tr> |
| 51 | <th scope="row"> |
| 52 | <label for="widgetopts-visibility-misc"><?php _e('Pages Tab', 'widget-options'); ?></label> |
| 53 | </th> |
| 54 | <td> |
| 55 | <input type="checkbox" id="widgetopts-visibility-misc" name="visibility[misc]" <?php echo (isset($widget_options['settings']['visibility'])) ? widgetopts_is_checked($widget_options['settings']['visibility'], 'misc') : ''; ?> value="1" /> |
| 56 | <label for="widgetopts-visibility-misc"><?php _e('Enable Miscellaneous Options', 'widget-options'); ?></label> |
| 57 | <p class="description"> |
| 58 | <?php _e('Restrict widgets or blocks visibility on WordPress new added page as well as default pages such as home page, blog page, 404, search, etc.', 'widget-options'); ?> |
| 59 | </p> |
| 60 | </td> |
| 61 | </tr> |
| 62 | <tr> |
| 63 | <th scope="row"> |
| 64 | <label for="widgetopts-visibility-post_types"><?php _e('Post Types Tab', 'widget-options'); ?></label> |
| 65 | </th> |
| 66 | <td> |
| 67 | <input type="checkbox" id="widgetopts-visibility-post_types" name="visibility[post_type]" <?php echo (isset($widget_options['settings']['visibility'])) ? widgetopts_is_checked($widget_options['settings']['visibility'], 'post_type') : ''; ?> value="1" /> |
| 68 | <label for="widgetopts-visibility-post_types"><?php _e('Enable Post Types Restriction', 'widget-options'); ?></label> |
| 69 | <p class="description"> |
| 70 | <?php _e('This feature will allow visibility restriction of every widgets or blocks per post types and per pages.', 'widget-options'); ?> |
| 71 | </p> |
| 72 | </td> |
| 73 | </tr> |
| 74 | <tr> |
| 75 | <th scope="row"> |
| 76 | <label for="widgetopts-visibility-taxonomies"><?php _e('Taxonomies Tab', 'widget-options'); ?></label> |
| 77 | </th> |
| 78 | <td> |
| 79 | <input type="checkbox" id="widgetopts-visibility-taxonomies" name="visibility[taxonomies]" <?php echo (isset($widget_options['settings']['visibility'])) ? widgetopts_is_checked($widget_options['settings']['visibility'], 'taxonomies') : ''; ?> value="1" /> |
| 80 | <label for="widgetopts-visibility-taxonomies"><?php _e('Enable Taxonomies Restriction', 'widget-options'); ?></label> |
| 81 | <p class="description"> |
| 82 | <?php _e('This tab option will allow you to control visibility via taxonomy and terms archive pages.', 'widget-options'); ?> |
| 83 | </p> |
| 84 | </td> |
| 85 | </tr> |
| 86 | |
| 87 | </table> |
| 88 | <?php widgetopts_modal_end($widget_options['visibility']); ?> |
| 89 | </li> |
| 90 | <?php |
| 91 | } |
| 92 | add_action('widgetopts_module_cards', 'widgetopts_settings_visibility', 12); |
| 93 | endif; |
| 94 | ?> |