acf.php
4 years ago
alignment.php
4 years ago
animation.php
4 years ago
beaver_builder.php
4 years ago
cache.php
4 years ago
classes.php
4 years ago
classic-widgets-screen.php
4 years ago
clone.php
4 years ago
columns.php
4 years ago
dates.php
4 years ago
devices.php
4 years ago
disable_widgets.php
4 years ago
elementor.php
4 years ago
fixed.php
4 years ago
import-export.php
4 years ago
links.php
4 years ago
logic.php
4 years ago
move.php
4 years ago
permission.php
4 years ago
roles.php
4 years ago
search.php
4 years ago
shortcodes.php
4 years ago
sidebar-more_plugins.php
4 years ago
sidebar-opt_in.php
4 years ago
sidebar-support_box.php
4 years ago
sidebar-upsell_pro.php
4 years ago
siteorigin.php
4 years ago
sliding.php
4 years ago
state.php
4 years ago
styling.php
4 years ago
taxonomies.php
4 years ago
title.php
4 years ago
urls.php
4 years ago
visibility.php
4 years ago
widget-area.php
4 years ago
logic.php
74 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Widget Logic Settings Module |
| 4 | * Settings > Widget Options :: Display Logic |
| 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 Display Logic Options |
| 15 | * |
| 16 | * @since 3.0 |
| 17 | * @global $widget_options |
| 18 | * @return void |
| 19 | */ |
| 20 | if( !function_exists( 'widgetopts_settings_logic' ) ): |
| 21 | function widgetopts_settings_logic(){ |
| 22 | global $widget_options; ?> |
| 23 | <li class="widgetopts-module-card <?php echo ( isset( $widget_options['logic'] ) && $widget_options['logic'] == 'activate' ) ? 'widgetopts-module-type-enabled' : 'widgetopts-module-type-disabled'; ?>" id="widgetopts-module-card-logic" data-module-id="logic"> |
| 24 | <div class="widgetopts-module-card-content"> |
| 25 | <h2><?php _e( 'Display Logic', 'widget-options' );?></h2> |
| 26 | <p class="widgetopts-module-desc"> |
| 27 | <?php _e( 'Use WordPress PHP conditional tags to assign each widgets visibility.', 'widget-options' );?> |
| 28 | </p> |
| 29 | |
| 30 | <div class="widgetopts-module-actions hide-if-no-js"> |
| 31 | <?php if( $widget_options['logic'] == 'activate' ){ ?> |
| 32 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Configure Settings', 'widget-options' );?></button> |
| 33 | <button class="button button-secondary widgetopts-toggle-activation"><?php _e( 'Disable', 'widget-options' );?></button> |
| 34 | <?php }else{ ?> |
| 35 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Learn More', 'widget-options' );?></button> |
| 36 | <button class="button button-primary widgetopts-toggle-activation"><?php _e( 'Enable', 'widget-options' );?></button> |
| 37 | <?php } ?> |
| 38 | |
| 39 | </div> |
| 40 | |
| 41 | </div> |
| 42 | |
| 43 | <?php widgetopts_modal_start( $widget_options['logic'] ); ?> |
| 44 | <span class="dashicons widgetopts-dashicons widgetopts-no-top dashicons-admin-generic"></span> |
| 45 | <h3 class="widgetopts-modal-header"><?php _e( 'Display Logic', 'widget-options' );?></h3> |
| 46 | <p> |
| 47 | <?php _e( 'Display Widget Logic will let you control where you want the widgets to appear using WordPress conditional tags.', 'widget-options' );?> |
| 48 | </p> |
| 49 | <p> |
| 50 | <?php _e( "<strong>Please note</strong> that the display logic you introduce is EVAL'd directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. There is an optional filter <code>widget_options_logic_override</code> which you can use to bypass the EVAL with your own code if needed.", 'widget-options' )?> |
| 51 | </p> |
| 52 | <table class="form-table widgetopts-settings-section"> |
| 53 | <tr> |
| 54 | <th scope="row"> |
| 55 | <label for="widgetopts-logic-notice"><?php _e( 'Hide Notice', 'widget-options' );?></label> |
| 56 | </th> |
| 57 | <td> |
| 58 | <input type="checkbox" id="widgetopts-logic-notice" name="logic[notice]" <?php echo ( isset( $widget_options['settings']['logic'] ) ) ? widgetopts_is_checked( $widget_options['settings']['logic'], 'notice' ) : ''; ?> value="1" /> |
| 59 | <label for="widgetopts-logic-notice"><?php _e( 'Disable Notice Toggler', 'widget-options' );?></label> |
| 60 | <p class="description"> |
| 61 | <?php _e( 'Hide similar filter notice above on each widget display logic feature.', 'widget-options' );?> |
| 62 | </p> |
| 63 | </td> |
| 64 | </tr> |
| 65 | </table> |
| 66 | <?php widgetopts_modal_end( $widget_options['logic'] ); ?> |
| 67 | |
| 68 | </li> |
| 69 | <?php |
| 70 | } |
| 71 | add_action( 'widgetopts_module_cards', 'widgetopts_settings_logic', 60 ); |
| 72 | endif; |
| 73 | ?> |
| 74 |