Plugin Directory

Changeset 2640189


Ignore:
Timestamp:
12/06/2021 06:44:44 PM (4 years ago)
Author:
J4cob
Message:
  • New - Hide menu for non-logged in users. Check it 'WP Bottom Menu > Settings > Hide for visitors'.
Location:
wp-bottom-menu
Files:
31 added
2 edited

Legend:

Unmodified
Added
Removed
  • wp-bottom-menu/trunk/readme.txt

    r2612060 r2640189  
    55Requires at least: 5.0
    66Tested up to: 5.8.1
    7 Stable tag: 1.4.2
     7Stable tag: 1.4.3
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    5959== Changelog ==
    6060
     61== 1.4.3 ==
     62* New - Hide menu for non-logged in users. Check it 'WP Bottom Menu > Settings > Hide for visitors'.
     63
    6164= 1.4.2 =
    6265* Fix - Customizer PHP8 conflict.
  • wp-bottom-menu/trunk/wp-bottom-menu.php

    r2612060 r2640189  
    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: 1.4.2
     5 * Version: 1.4.3
    66 * Author: J4
    77 * Author URI: https://j4cob.net
     
    2424if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    2525
    26 define( 'WP_BOTTOM_MENU_VERSION', '1.4.2' );
     26define( 'WP_BOTTOM_MENU_VERSION', '1.4.3' );
    2727define( 'WP_BOTTOM_MENU_DIR_URL', plugin_dir_url( __FILE__ ) );
    2828define( 'WP_BOTTOM_MENU_DIR_PATH', plugin_dir_path( __FILE__ ) );
     
    6767    function wp_bottom_menu() {
    6868
    69        
     69        // Check login to hide
     70        if ( get_option('wpbottommenu_hide_for_visitor', false) && !is_user_logged_in() ){
     71            return;
     72        }
     73
    7074        // Check pages to hide 
    7175        if ( is_array( get_option( 'wpbottommenu_hide_pages' ) ) ){
     
    290294                    )
    291295                );
     296
     297                $wp_customize->add_setting( 'wpbottommenu_hide_for_visitor' , array(
     298                    'default'     => false,
     299                    'type'        => 'option',
     300                ));
     301               
     302                $wp_customize->add_control('wpbottommenu_hide_for_visitor', array(
     303                    'label'    => __( 'Hide for visitors?', 'wp-bottom-menu' ),
     304                    'description'    => __( 'Hide menu for non-logged in visitors', 'wp-bottom-menu' ),
     305                    'section'  => 'wpbottommenu_section_settings',
     306                    'settings' => 'wpbottommenu_hide_for_visitor',
     307                    'type' => 'checkbox',
     308                ));
    292309               
    293310        //
Note: See TracChangeset for help on using the changeset viewer.