Support » Plugin: Login Logout Menu » Correction for WordPress 4.9.X + PHP 7.X

  • Bligivi

    (@bligivi)


    Hello,

    This plugin don’t work on my WordPress 4.9.8 with PHP 7.2, I fix it by doing this on the file “baw-login-logout-menu/bawllm.php” :

    Because “create_function” is deprecated, I modified :

    add_action( ‘plugins_loaded’, create_function( ”, ‘
    $filename = “inc/”;
    $filename .= is_admin() ? “backend-” : “frontend-“;
    $filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
    $filename .= “ajax.inc.php”;
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    $filename = “inc/”;
    $filename .= “bothend-“;
    $filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
    $filename .= “ajax.inc.php”;
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    ‘ )
    );

    By :

    add_action( ‘plugins_loaded’, function() {
    $filename = “inc/”;
    $filename .= is_admin() ? “backend-” : “frontend-“;
    $filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
    $filename .= “ajax.inc.php”;
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    $filename = “inc/”;
    $filename .= “bothend-“;
    $filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
    $filename .= “ajax.inc.php”;
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    });

    <3 for you !

Viewing 1 replies (of 1 total)
  • Fantastic work @bligivi.

    wp-content/plugins/baw-login-logout-menu/bawllm.php

    <?php
    /*
    Plugin Name: BAW Login/Logout menu
    Plugin URI: http://www.boiteaweb.fr/?p=3337
    Description: You can now add a correct login & logout link in your WP menus.
    Author: Juliobox
    Author URI: http://wp-rocket.me
    Version: 1.3.3.1
    */
    
    define( 'BAWLLM_VERSION', '1.3.3' );
    
    add_action( 'plugins_loaded', function() {
    $filename = "inc/";
    $filename .= is_admin() ? "backend-" : "frontend-";
    $filename .= defined( "DOING_AJAX" ) && DOING_AJAX ? "" : "no";
    $filename .= "ajax.inc.php";
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    $filename = "inc/";
    $filename .= "bothend-";
    $filename .= defined( "DOING_AJAX" ) && DOING_AJAX ? "" : "no";
    $filename .= "ajax.inc.php";
    if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
    include( plugin_dir_path( __FILE__ ) . $filename );
    });

    I just put the code in code tags to make it easier to copy.

    • This reply was modified 3 months ago by  a4jp . com.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.