Plugin Directory

Changeset 2805704


Ignore:
Timestamp:
10/27/2022 10:38:28 AM (3 years ago)
Author:
J4cob
Message:

v2.1

Location:
wp-bottom-menu
Files:
53 added
6 edited

Legend:

Unmodified
Added
Removed
  • wp-bottom-menu/trunk/assets/css/style.css

    r2763355 r2805704  
    9999}
    100100
     101.wp-bottom-menu-search-form-wrapper form{
     102    position: relative;
     103}
     104
    101105.wp-bottom-menu-search-form input[type="search"]{
    102106    border: 1px solid #eee;
     
    105109    font-size: 14px;
    106110    height: 40px;
    107     padding-left: 40px;
     111    padding-left: 50px;
    108112    padding-right: 30px;
    109113}
     
    127131    box-shadow: none;
    128132}
     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  
    44var wpbmsf = false;
    55
    6 if(wp_bottom_menu_sft !== null){
     6if ( wp_bottom_menu_sft !== null ){
    77    wp_bottom_menu_sft.addEventListener("click" ,function(){
    88        wp_bottom_menu_sfw.classList.toggle("sf-active");
     
    2121    document.body.style.paddingBottom = wp_bottom_menu_class.clientHeight + "px";
    2222});
     23
     24// Nav trigger
     25const wp_bottom_menu_nav_wrapper = document.querySelector(".wp-bottom-menu-nav-wrapper");
     26const wp_bottom_menu_nav_trigger = document.querySelector(".wp-bottom-menu-nav-trigger");
     27const wp_bottom_menu_nav_close = document.querySelector(".wpbm-nav-close");
     28var wpbm_nav = false;
     29
     30if ( 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
     36if ( 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  
    508508            <option value="wpbm-woo-search" <?php if($value == "wpbm-woo-search") echo "selected"; ?> ><?php esc_html_e('Search for product','wp-bottom-menu'); ?></option>
    509509            <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>
    511512        </select>
    512513        <?php
  • wp-bottom-menu/trunk/inc/customizer/customizer.php

    r2763763 r2805704  
    107107                    'settings' => 'wpbottommenu_zindex',
    108108                    '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                      ),
    109125                ));
    110126
  • wp-bottom-menu/trunk/readme.txt

    r2764439 r2805704  
    44Tags: bottom menu,mobile menu
    55Requires at least: 5.0
    6 Tested up to: 6.0.1
    7 Stable tag: 2.0.1
     6Tested up to: 6.1
     7Stable tag: 2.1
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    2323* Woocommerce Account Support
    2424* 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)
    2627* Customizable Style
    27 
    2828
    2929== Installation ==
    3030
    31311. 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 WordPress
    33 1. Use the Appearance->Customize->WP Bottom Menu screen to configure the plugin.
     322. Activate the plugin through the **Plugins** screen in WordPress
     333. Use the Appearance->Customize->WP Bottom Menu screen to configure the plugin.
    3434
    3535== Frequently Asked Questions ==
     
    3737= How can I customize colors & size? =
    3838
    39 Use the Appearance->Customize->WP Bottom Menu->Customize screen to configure the plugin.
     39Use the **Appearance->Customize->WP Bottom Menu->Customize** screen to configure the plugin.
    4040
    4141= How can I customize menu items? =
    4242
    43 Use the Appearance->Customize->WP Bottom Menu->Menu Items screen to configure the plugin.
     43Use the **Appearance->Customize->WP Bottom Menu->Menu** Items screen to configure the plugin.
    4444
    4545= How can I show cart count or cart total? =
    4646
    47 Use the Appearance->Customize->WP Bottom Menu->Customize screen and find 'Customize Cart Item', configure the plugin.
     47Use the **Appearance->Customize->WP Bottom Menu->Customize** screen and find **Customize Cart Item**, configure the plugin.
    4848
    4949= How can I show the menu on the desired page? =
    5050
    51 Use the Appearance->Customize->WP Bottom Menu->Conditions screen and configure the plugin.
     51Use the **Appearance->Customize->WP Bottom Menu->Conditions** screen and configure the plugin.
    5252
    5353= How can I show the menu for user roles? =
    5454
    55 Use the Appearance->Customize->WP Bottom Menu->Conditions screen and find 'Select User Roles Condition' configure the plugin.
     55Use 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
     591. Add a menu in **WP Dashboard->Appearance->Menus** and select Display location **WP Bottom Menu**
     602. Add a WPBM menu item and select menu type **Custom Menu**
     61
     62= How can I search for custom post types? =
     63
     641. Add a WPBM menu item and select menu type **Search for custom post types**
     652. Define post types in **WP Bottom Menu->Settings** screen and find **Custom search post types** configure the plugin.
     66
     67Examples:
     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`.
    5674
    5775
     
    6785
    6886== 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
    6991
    7092= 2.0.1 =
  • wp-bottom-menu/trunk/wp-bottom-menu.php

    r2763763 r2805704  
    33 * Plugin Name: WP Bottom Menu
    44 * Description: WP Bottom Menu allows you to add a woocommerce supported bottom menu to your site.
    5  * Version: 2.0.1
     5 * Version: 2.1
    66 * Author: J4
    77 * Author URI: https://hub.liquid-themes.com/
     
    2424if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    2525
    26 define( 'WP_BOTTOM_MENU_VERSION', '2.0.1' );
     26define( 'WP_BOTTOM_MENU_VERSION', '2.1' );
    2727define( 'WP_BOTTOM_MENU_DIR_URL', plugin_dir_url( __FILE__ ) );
    2828define( 'WP_BOTTOM_MENU_DIR_PATH', plugin_dir_path( __FILE__ ) );
     
    131131            add_filter( 'woocommerce_add_to_cart_fragments', array($this, 'wp_bottom_menu_add_to_cart_fragment'), 10, 1 );
    132132        }
     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        } );
    133140    }
    134141   
     
    223230
    224231        $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';
    227234        $wpbm_link_target = get_option( 'wpbottommenu_target' ) ? 'target=_blank' : '';
    228235        foreach($customizer_repeater_wpbm_decoded as $repeater_item){
    229236
    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            ?>
    231240                <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">
    232243            <?php else: ?>
    233244                <?php
     
    297308            if ( $repeater_item->choice == "wpbm-post-search" && !$wpbm_post_search )
    298309                $wpbm_post_search = true;
    299            
     310
     311            if ( $repeater_item->choice == "wpbm-custom-search" && !$wpbm_custom_search )
     312                $wpbm_custom_search = true;
     313
    300314        }
    301315        ?>
    302316    </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">&times;</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;
    303335   
    304     <?php if ( $wpbm_woo_search || $wpbm_post_search ): ?>
     336    if ( $wpbm_woo_search || $wpbm_post_search || $wpbm_custom_search ): ?>
    305337        <div class="wp-bottom-menu-search-form-wrapper" id="wp-bottom-menu-search-form-wrapper">
    306338        <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            } ?>
    309357            <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" />
    310358        </form>
Note: See TracChangeset for help on using the changeset viewer.