Changeset 2805704
- Timestamp:
- 10/27/2022 10:38:28 AM (3 years ago)
- Location:
- wp-bottom-menu
- Files:
-
- 53 added
- 6 edited
-
tags/2.1 (added)
-
tags/2.1/assets (added)
-
tags/2.1/assets/css (added)
-
tags/2.1/assets/css/style.css (added)
-
tags/2.1/assets/js (added)
-
tags/2.1/assets/js/customizer.js (added)
-
tags/2.1/assets/js/main.js (added)
-
tags/2.1/assets/vendors (added)
-
tags/2.1/assets/vendors/fontawesome (added)
-
tags/2.1/assets/vendors/fontawesome/all.min.css (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-brands-400.ttf (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-brands-400.woff2 (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-regular-400.ttf (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-regular-400.woff2 (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-solid-900.ttf (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-solid-900.woff2 (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-v4compatibility.ttf (added)
-
tags/2.1/assets/vendors/fontawesome/webfonts/fa-v4compatibility.woff2 (added)
-
tags/2.1/assets/vendors/select2 (added)
-
tags/2.1/assets/vendors/select2/select2.min.css (added)
-
tags/2.1/assets/vendors/select2/select2.min.js (added)
-
tags/2.1/inc (added)
-
tags/2.1/inc/customizer (added)
-
tags/2.1/inc/customizer/condition.php (added)
-
tags/2.1/inc/customizer/customizer-repeater (added)
-
tags/2.1/inc/customizer/customizer-repeater/class (added)
-
tags/2.1/inc/customizer/customizer-repeater/class/customizer-repeater-control.php (added)
-
tags/2.1/inc/customizer/customizer-repeater/css (added)
-
tags/2.1/inc/customizer/customizer-repeater/css/admin-style.css (added)
-
tags/2.1/inc/customizer/customizer-repeater/css/font-awesome.css (added)
-
tags/2.1/inc/customizer/customizer-repeater/css/font-awesome.min.css (added)
-
tags/2.1/inc/customizer/customizer-repeater/css/fontawesome-iconpicker.min.css (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/FontAwesome.otf (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/fontawesome-webfont.eot (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/fontawesome-webfont.svg (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/fontawesome-webfont.ttf (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/fontawesome-webfont.woff (added)
-
tags/2.1/inc/customizer/customizer-repeater/fonts/fontawesome-webfont.woff2 (added)
-
tags/2.1/inc/customizer/customizer-repeater/functions.php (added)
-
tags/2.1/inc/customizer/customizer-repeater/inc (added)
-
tags/2.1/inc/customizer/customizer-repeater/inc/customizer.php (added)
-
tags/2.1/inc/customizer/customizer-repeater/inc/icons.php (added)
-
tags/2.1/inc/customizer/customizer-repeater/js (added)
-
tags/2.1/inc/customizer/customizer-repeater/js/customizer_repeater.js (added)
-
tags/2.1/inc/customizer/customizer-repeater/js/fontawesome-iconpicker.js (added)
-
tags/2.1/inc/customizer/customizer-repeater/js/fontawesome-iconpicker.min.js (added)
-
tags/2.1/inc/customizer/customizer.php (added)
-
tags/2.1/inc/multiple-select (added)
-
tags/2.1/inc/multiple-select/multiple-select.php (added)
-
tags/2.1/readme.txt (added)
-
tags/2.1/wp-bottom-menu.php (added)
-
trunk/assets/css/style.css (modified) (3 diffs)
-
trunk/assets/js/main.js (modified) (2 diffs)
-
trunk/inc/customizer/customizer-repeater/class/customizer-repeater-control.php (modified) (1 diff)
-
trunk/inc/customizer/customizer.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/wp-bottom-menu.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-bottom-menu/trunk/assets/css/style.css
r2763355 r2805704 99 99 } 100 100 101 .wp-bottom-menu-search-form-wrapper form{ 102 position: relative; 103 } 104 101 105 .wp-bottom-menu-search-form input[type="search"]{ 102 106 border: 1px solid #eee; … … 105 109 font-size: 14px; 106 110 height: 40px; 107 padding-left: 40px;111 padding-left: 50px; 108 112 padding-right: 30px; 109 113 } … … 127 131 box-shadow: none; 128 132 } 133 134 /* Nav */ 135 136 .wp-bottom-menu-nav-wrapper{ 137 display: none; 138 width: 100%; 139 height: 100%; 140 z-index: calc(var(--wpbottommenu-zindex) + 2 ); 141 position: fixed; 142 left: 0; 143 top: 0; 144 background: var(--wpbottommenu-bgcolor); 145 color: var(--wpbottommenu-text-color); 146 } 147 148 .wp-bottom-menu-nav-wrapper.active{ 149 display: grid; 150 place-items: center; 151 text-align: center; 152 } 153 154 .wpbm-nav-items{ 155 position: relative; 156 list-style-type: none; 157 margin: 0; 158 padding: 1em; 159 } 160 161 .wpbm-nav-items li:not(:last-child){ 162 margin-bottom: 1em; 163 } 164 165 .wpbm-nav-items li a{ 166 color: inherit; 167 } 168 169 .wpbm-nav-items li.current-menu-item a, 170 .wpbm-nav-items li a:hover{ 171 color: var(--wpbottommenu-h-text-color); 172 } 173 174 .wpbm-nav-close{ 175 position: absolute; 176 right: 10%; 177 top: 10%; 178 font-size: var(--wpbottommenu-icon-size); 179 color: inherit; 180 } -
wp-bottom-menu/trunk/assets/js/main.js
r2763355 r2805704 4 4 var wpbmsf = false; 5 5 6 if (wp_bottom_menu_sft !== null){6 if ( wp_bottom_menu_sft !== null ){ 7 7 wp_bottom_menu_sft.addEventListener("click" ,function(){ 8 8 wp_bottom_menu_sfw.classList.toggle("sf-active"); … … 21 21 document.body.style.paddingBottom = wp_bottom_menu_class.clientHeight + "px"; 22 22 }); 23 24 // Nav trigger 25 const wp_bottom_menu_nav_wrapper = document.querySelector(".wp-bottom-menu-nav-wrapper"); 26 const wp_bottom_menu_nav_trigger = document.querySelector(".wp-bottom-menu-nav-trigger"); 27 const wp_bottom_menu_nav_close = document.querySelector(".wpbm-nav-close"); 28 var wpbm_nav = false; 29 30 if ( wp_bottom_menu_nav_trigger !== null ){ 31 wp_bottom_menu_nav_trigger.addEventListener("click" ,function(){ 32 wp_bottom_menu_nav_wrapper.classList.toggle("active"); 33 }); 34 } 35 36 if ( wp_bottom_menu_nav_close !== null ){ 37 wp_bottom_menu_nav_close.addEventListener("click" ,function(){ 38 wp_bottom_menu_nav_wrapper.classList.toggle("active"); 39 }); 40 } -
wp-bottom-menu/trunk/inc/customizer/customizer-repeater/class/customizer-repeater-control.php
r2763355 r2805704 508 508 <option value="wpbm-woo-search" <?php if($value == "wpbm-woo-search") echo "selected"; ?> ><?php esc_html_e('Search for product','wp-bottom-menu'); ?></option> 509 509 <option value="wpbm-post-search" <?php if($value == "wpbm-post-search") echo "selected"; ?> ><?php esc_html_e('Search for post','wp-bottom-menu'); ?></option> 510 510 <option value="wpbm-custom-search" <?php if($value == "wpbm-custom-search") echo "selected"; ?> ><?php esc_html_e('Search for custom post types','wp-bottom-menu'); ?></option> 511 <option value="wpbm-menu" <?php if($value == "wpbm-menu") echo "selected"; ?> ><?php esc_html_e('Custom Menu','wp-bottom-menu'); ?></option> 511 512 </select> 512 513 <?php -
wp-bottom-menu/trunk/inc/customizer/customizer.php
r2763763 r2805704 107 107 'settings' => 'wpbottommenu_zindex', 108 108 'type' => 'number', 109 )); 110 111 $wp_customize->add_setting( 'wpbottommenu_search_cpt' , array( 112 'default' => 'all', 113 'type' => 'option', 114 )); 115 116 $wp_customize->add_control('wpbottommenu_search_cpt', array( 117 'label' => __( 'Custom search post types', 'wp-bottom-menu' ), 118 'description' => esc_html__( 'Add your post type with a comma. Example: post,product,my-post-type', 'wp-bottom-menu' ), 119 'section' => 'wpbottommenu_section_settings', 120 'settings' => 'wpbottommenu_search_cpt', 121 'type' => 'text', 122 'input_attrs' => array( 123 'placeholder' => 'all', 124 ), 109 125 )); 110 126 -
wp-bottom-menu/trunk/readme.txt
r2764439 r2805704 4 4 Tags: bottom menu,mobile menu 5 5 Requires at least: 5.0 6 Tested up to: 6. 0.17 Stable tag: 2. 0.16 Tested up to: 6.1 7 Stable tag: 2.1 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 23 23 * Woocommerce Account Support 24 24 * Hide/Show Menu Condition Manager 25 * Search (Woocommerce Product or Post) 25 * Search (Woocommerce Product, Post or Custom Post Types) 26 * Custom Fullscreen Menu (Compatible with WordPress Menus) 26 27 * Customizable Style 27 28 28 29 29 == Installation == 30 30 31 31 1. Upload the plugin files to the `/wp-content/plugins/wp-bottom-menu` directory, or install the plugin through the WordPress plugins screen directly. 32 1. Activate the plugin through the 'Plugins'screen in WordPress33 1. Use the Appearance->Customize->WP Bottom Menu screen to configure the plugin.32 2. Activate the plugin through the **Plugins** screen in WordPress 33 3. Use the Appearance->Customize->WP Bottom Menu screen to configure the plugin. 34 34 35 35 == Frequently Asked Questions == … … 37 37 = How can I customize colors & size? = 38 38 39 Use the Appearance->Customize->WP Bottom Menu->Customizescreen to configure the plugin.39 Use the **Appearance->Customize->WP Bottom Menu->Customize** screen to configure the plugin. 40 40 41 41 = How can I customize menu items? = 42 42 43 Use the Appearance->Customize->WP Bottom Menu->MenuItems screen to configure the plugin.43 Use the **Appearance->Customize->WP Bottom Menu->Menu** Items screen to configure the plugin. 44 44 45 45 = How can I show cart count or cart total? = 46 46 47 Use the Appearance->Customize->WP Bottom Menu->Customize screen and find 'Customize Cart Item', configure the plugin.47 Use the **Appearance->Customize->WP Bottom Menu->Customize** screen and find **Customize Cart Item**, configure the plugin. 48 48 49 49 = How can I show the menu on the desired page? = 50 50 51 Use the Appearance->Customize->WP Bottom Menu->Conditionsscreen and configure the plugin.51 Use the **Appearance->Customize->WP Bottom Menu->Conditions** screen and configure the plugin. 52 52 53 53 = How can I show the menu for user roles? = 54 54 55 Use the Appearance->Customize->WP Bottom Menu->Conditions screen and find 'Select User Roles Condition' configure the plugin. 55 Use the **Appearance->Customize->WP Bottom Menu->Conditions** screen and find **Select User Roles Condition** configure the plugin. 56 57 = How can I add Fullscreen menu? = 58 59 1. Add a menu in **WP Dashboard->Appearance->Menus** and select Display location **WP Bottom Menu** 60 2. Add a WPBM menu item and select menu type **Custom Menu** 61 62 = How can I search for custom post types? = 63 64 1. Add a WPBM menu item and select menu type **Search for custom post types** 65 2. Define post types in **WP Bottom Menu->Settings** screen and find **Custom search post types** configure the plugin. 66 67 Examples: 68 * `all` : Search by all post types 69 * `product`: Search by products 70 * `post`: Search by post 71 * `my-custom-post-type`: Search by my-custom-post-type 72 73 > Also, you can use multiple custom post type with a comma. Example: `post,product,my-custom-post-type`. 56 74 57 75 … … 67 85 68 86 == Changelog == 87 88 = 2.1 = 89 * New - Custom Fullscreen Menu - See here for usage: Frequently Asked Questions 90 * New - Search by Custom post types - See here for usage: Frequently Asked Questions 69 91 70 92 = 2.0.1 = -
wp-bottom-menu/trunk/wp-bottom-menu.php
r2763763 r2805704 3 3 * Plugin Name: WP Bottom Menu 4 4 * Description: WP Bottom Menu allows you to add a woocommerce supported bottom menu to your site. 5 * Version: 2. 0.15 * Version: 2.1 6 6 * Author: J4 7 7 * Author URI: https://hub.liquid-themes.com/ … … 24 24 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 25 25 26 define( 'WP_BOTTOM_MENU_VERSION', '2. 0.1' );26 define( 'WP_BOTTOM_MENU_VERSION', '2.1' ); 27 27 define( 'WP_BOTTOM_MENU_DIR_URL', plugin_dir_url( __FILE__ ) ); 28 28 define( 'WP_BOTTOM_MENU_DIR_PATH', plugin_dir_path( __FILE__ ) ); … … 131 131 add_filter( 'woocommerce_add_to_cart_fragments', array($this, 'wp_bottom_menu_add_to_cart_fragment'), 10, 1 ); 132 132 } 133 134 // Register Nav Menus 135 add_action( 'after_setup_theme', function() { 136 register_nav_menus( array( 137 'wpbm_custom' => __( 'WP Bottom Menu', 'wp-bottom-menu' ), 138 ) ); 139 } ); 133 140 } 134 141 … … 223 230 224 231 $customizer_repeater_wpbm_decoded = json_decode($customizer_repeater_wpbm); 225 $wpbm_woo_search = false;226 $ wpbm_post_search = false;232 $wpbm_woo_search = $wpbm_post_search = $wpbm_custom_search = false; 233 $search_icon = 'fa-search'; 227 234 $wpbm_link_target = get_option( 'wpbottommenu_target' ) ? 'target=_blank' : ''; 228 235 foreach($customizer_repeater_wpbm_decoded as $repeater_item){ 229 236 230 if($repeater_item->choice == "wpbm-woo-search" or $repeater_item->choice == "wpbm-post-search"):?> 237 if ( $repeater_item->choice == "wpbm-woo-search" || $repeater_item->choice == "wpbm-post-search" || $repeater_item->choice == "wpbm-custom-search" ): 238 $search_icon = $repeater_item->subtitle; 239 ?> 231 240 <a href="javascript:void(0);" title="<?php echo esc_attr( $repeater_item->title ); ?>" class="wp-bottom-menu-item wp-bottom-menu-search-form-trigger"> 241 <?php elseif ( $repeater_item->choice == "wpbm-menu" ): ?> 242 <a href="javascript:void(0);" title="<?php echo esc_attr( $repeater_item->title ); ?>" class="wp-bottom-menu-item wp-bottom-menu-nav-trigger"> 232 243 <?php else: ?> 233 244 <?php … … 297 308 if ( $repeater_item->choice == "wpbm-post-search" && !$wpbm_post_search ) 298 309 $wpbm_post_search = true; 299 310 311 if ( $repeater_item->choice == "wpbm-custom-search" && !$wpbm_custom_search ) 312 $wpbm_custom_search = true; 313 300 314 } 301 315 ?> 302 316 </div> 317 318 <?php if ( $repeater_item->choice == "wpbm-menu" ) : ?> 319 320 <div class="wp-bottom-menu-nav-wrapper"> 321 <a href="javascript:void(0)" class="wpbm-nav-close">×</a> 322 <?php 323 324 wp_nav_menu( array( 325 'menu' => 'wpbm_custom', 326 'container' => 'ul', 327 'menu_id' => 'wpbm-nav', 328 'menu_class' => 'wpbm-nav-items', 329 ) ); 330 331 ?> 332 </div> 333 334 <?php endif; 303 335 304 <?php if ( $wpbm_woo_search || $wpbm_post_search ): ?>336 if ( $wpbm_woo_search || $wpbm_post_search || $wpbm_custom_search ): ?> 305 337 <div class="wp-bottom-menu-search-form-wrapper" id="wp-bottom-menu-search-form-wrapper"> 306 338 <form role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="wp-bottom-menu-search-form"> 307 <i class="fa fa-search"></i> 308 <input type="hidden" name="post_type" value="<?php if( $wpbm_woo_search && class_exists( 'WooCommerce' ) ) echo esc_attr("product"); else echo esc_attr("post"); ?>" /> 339 <i class="fa <?php echo esc_attr( $search_icon ); ?>"></i> 340 <?php if ( $wpbm_woo_search && class_exists( 'WooCommerce' ) ) { ?> 341 <input type="hidden" name="post_type" value="product" /> 342 <?php } elseif ( $wpbm_post_search ) { ?> 343 <input type="hidden" name="post_type" value="post" /> 344 <?php } else { 345 $search_cpt = get_option( 'wpbottommenu_search_cpt', 'all' ); 346 if ( $search_cpt === 'all' || empty( $search_cpt ) ){ 347 ?><input type="hidden" name="post_type" value="all" /><?php 348 } else { 349 $search_cpt = explode(',', $search_cpt); 350 foreach( $search_cpt as $cpt ){ 351 if ( !empty( $cpt ) ){ 352 ?><input type="hidden" name="post_type[]" value="<?php echo esc_attr( $cpt ); ?>" /><?php 353 } 354 } 355 } 356 } ?> 309 357 <input type="search" class="search-field" placeholder="<?php if( get_option( 'wpbottommenu_placeholder_text', 'Search' ) ) echo get_option( 'wpbottommenu_placeholder_text', 'Search' ); else echo esc_attr_x( 'Search', 'wp-bottom-menu' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> 310 358 </form>
Note: See TracChangeset
for help on using the changeset viewer.