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