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
widget-area.php
89 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Widget Area Options Settings Module |
| 4 | * Settings > Widget Options :: Widget Area Options |
| 5 | * |
| 6 | * @copyright Copyright (c) 2017, Jeffrey Carandang |
| 7 | * @since 3.5 |
| 8 | */ |
| 9 | |
| 10 | // Exit if accessed directly |
| 11 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 | |
| 13 | /** |
| 14 | * Create Card Module for Widget Area Options |
| 15 | * |
| 16 | * @since 3.5 |
| 17 | * @global $widget_options |
| 18 | * @return void |
| 19 | */ |
| 20 | if( !function_exists( 'widgetopts_settings_widget_area' ) ): |
| 21 | function widgetopts_settings_widget_area(){ |
| 22 | global $widget_options; |
| 23 | //avoid issue after update |
| 24 | if( !isset( $widget_options['widget_area'] ) ){ |
| 25 | $widget_options['widget_area'] = ''; |
| 26 | } |
| 27 | |
| 28 | $widget_area = ( isset( $widget_options['settings']['widget_area'] ) ) ? $widget_options['settings']['widget_area'] : array();?> |
| 29 | <li class="widgetopts-module-card <?php echo ( $widget_options['widget_area'] == 'activate' ) ? 'widgetopts-module-type-enabled' : 'widgetopts-module-type-disabled'; ?>" id="widgetopts-module-card-widget_area" data-module-id="widget_area"> |
| 30 | <div class="widgetopts-module-card-content"> |
| 31 | <h2><?php _e( 'Widget Area Options', 'widget-options' );?></h2> |
| 32 | <p class="widgetopts-module-desc"> |
| 33 | <?php _e( 'Extra helpful management options below each sidebar widget areas.', 'widget-options' );?> |
| 34 | </p> |
| 35 | |
| 36 | <div class="widgetopts-module-actions hide-if-no-js"> |
| 37 | <?php if( $widget_options['widget_area'] == 'activate' ){ ?> |
| 38 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Configure Settings', 'widget-options' );?></button> |
| 39 | <button class="button button-secondary widgetopts-toggle-activation"><?php _e( 'Disable', 'widget-options' );?></button> |
| 40 | <?php }else{ ?> |
| 41 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Learn More', 'widget-options' );?></button> |
| 42 | <button class="button button-primary widgetopts-toggle-activation"><?php _e( 'Enable', 'widget-options' );?></button> |
| 43 | <?php } ?> |
| 44 | |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <?php widgetopts_modal_start( $widget_options['widget_area'] ); ?> |
| 49 | <span class="dashicons widgetopts-dashicons widgetopts-no-top dashicons-art"></span> |
| 50 | <h3 class="widgetopts-modal-header"><?php _e( 'Widget Area Options', 'widget-options' );?></h3> |
| 51 | <p> |
| 52 | <?php _e( 'Enable <strong>Remove All Widgets</strong> and/or <strong>Download Backup</strong> link options below each sidebar widget areas. This will help you manage your widgets better as always.', 'widget-options' );?> |
| 53 | </p> |
| 54 | |
| 55 | <table class="form-table widgetopts-settings-section"> |
| 56 | <tr> |
| 57 | <th scope="row"> |
| 58 | <label for="widgetopts-widget-area-remove"><?php _e( 'Remove Widgets Link', 'widget-options' );?></label> |
| 59 | </th> |
| 60 | <td> |
| 61 | <input type="checkbox" id="widgetopts-widget-area-remove" name="widget_area[remove]" <?php echo widgetopts_is_checked( $widget_area, 'remove' ) ?> value="1" /> |
| 62 | <label for="widgetopts-widget-area-remove"><?php _e( 'Remove Widgets Link', 'widget-options' );?></label> |
| 63 | <p class="description"> |
| 64 | <?php _e( 'Show "Remove All Widgets" link below each widget areas.', 'widget-options' );?> |
| 65 | </p> |
| 66 | </td> |
| 67 | </tr> |
| 68 | <tr> |
| 69 | <th scope="row"> |
| 70 | <label for="widgetopts-widget-area-backup"><?php _e( 'Download Backup', 'widget-options' );?></label> |
| 71 | </th> |
| 72 | <td> |
| 73 | <input type="checkbox" id="widgetopts-widget-area-backup" name="widget_area[backup]" <?php echo widgetopts_is_checked( $widget_area, 'backup' ) ?> value="1" /> |
| 74 | <label for="widgetopts-widget-area-backup"><?php _e( 'Enable Download Backup', 'widget-options' );?></label> |
| 75 | <p class="description"> |
| 76 | <?php _e( 'Show "Download Backup" link below each sidebar widget area.', 'widget-options' );?> |
| 77 | </p> |
| 78 | </td> |
| 79 | </tr> |
| 80 | </table> |
| 81 | <?php widgetopts_modal_end( $widget_options['widget_area'] ); ?> |
| 82 | |
| 83 | </li> |
| 84 | <?php |
| 85 | } |
| 86 | add_action( 'widgetopts_module_cards', 'widgetopts_settings_widget_area', 64 ); |
| 87 | endif; |
| 88 | ?> |
| 89 |