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
search.php
69 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Live Search Settings Module |
| 4 | * Settings > Widget Options :: Live Widget Search |
| 5 | * |
| 6 | * @copyright Copyright (c) 2017, Jeffrey Carandang |
| 7 | * @since 3.3 |
| 8 | */ |
| 9 | |
| 10 | // Exit if accessed directly |
| 11 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 | |
| 13 | /** |
| 14 | * Create Card Module for Live Widget Search |
| 15 | * |
| 16 | * @since 3.3 |
| 17 | * @global $widget_options |
| 18 | * @return void |
| 19 | */ |
| 20 | |
| 21 | /* |
| 22 | * Note: Please add a class "no-settings" in the <li> card if the card has no additional configuration, if there are configuration please remove the class |
| 23 | */ |
| 24 | |
| 25 | if( !function_exists( 'widgetopts_settings_search' ) ): |
| 26 | function widgetopts_settings_search(){ |
| 27 | global $widget_options; |
| 28 | //prevent undefined index error on upgrade |
| 29 | if( !isset( $widget_options['search'] ) ){ |
| 30 | $widget_options['search'] = ''; |
| 31 | } |
| 32 | ?> |
| 33 | <li class="widgetopts-module-card widgetopts-module-card-no-settings no-settings <?php echo ( $widget_options['search'] == 'activate' ) ? 'widgetopts-module-type-enabled' : 'widgetopts-module-type-disabled'; ?>" id="widgetopts-module-card-search" data-module-id="search"> |
| 34 | <div class="widgetopts-module-card-content"> |
| 35 | <h2><?php _e( 'Live Widget Search', 'widget-options' );?></h2> |
| 36 | <p class="widgetopts-module-desc"> |
| 37 | <?php _e( 'Add live widget and sidebar search option on widgets.php admin dashboard.', 'widget-options' );?> |
| 38 | </p> |
| 39 | |
| 40 | <div class="widgetopts-module-actions hide-if-no-js"> |
| 41 | <?php if( $widget_options['search'] == 'activate' ){ ?> |
| 42 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Learn More', 'widget-options' );?></button> |
| 43 | <button class="button button-secondary widgetopts-toggle-activation"><?php _e( 'Disable', 'widget-options' );?></button> |
| 44 | <?php }else{ ?> |
| 45 | <button class="button button-secondary widgetopts-toggle-settings"><?php _e( 'Learn More', 'widget-options' );?></button> |
| 46 | <button class="button button-primary widgetopts-toggle-activation"><?php _e( 'Enable', 'widget-options' );?></button> |
| 47 | <?php } ?> |
| 48 | |
| 49 | </div> |
| 50 | </div> |
| 51 | |
| 52 | <?php widgetopts_modal_start( $widget_options['search'] ); ?> |
| 53 | <span class="dashicons widgetopts-dashicons widgetopts-no-top dashicons-search"></span> |
| 54 | <h3 class="widgetopts-modal-header"><?php _e( 'Live Widget & Sidebar Search', 'widget-options' );?></h3> |
| 55 | <p> |
| 56 | <?php _e( 'This feature will add search box before available widgets area that will let you filter the widgets for better widget handling. This will also add search box above the sidebar chooser when you click each widgets for you to assign them easily.', 'widget-options' );?> |
| 57 | </p> |
| 58 | <p class="widgetopts-settings-section"> |
| 59 | <?php _e( 'No additional settings available.', 'widget-options' );?> |
| 60 | </p> |
| 61 | <?php widgetopts_modal_end( $widget_options['search'] ); ?> |
| 62 | |
| 63 | </li> |
| 64 | <?php |
| 65 | } |
| 66 | add_action( 'widgetopts_module_cards', 'widgetopts_settings_search', 64 ); |
| 67 | endif; |
| 68 | ?> |
| 69 |