Support » Plugin: Login or Logout Menu Item » PHP 7.2 Function create_function() is deprecated

  • Since updating to PHP 7.2, seeing:
    Function create_function() is deprecated for baw-login-logout-menu/bawllm.php:13

    It’s minor, but with 7.3 around the corner, this should get cleaned up. I’m sure you can do that in minutes, but if there is a public repo I can send you a PR.

    <?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
    */

    define( ‘BAWLLM_VERSION’, ‘1.3.4’ );

    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;
    }
    }
    );

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 7.2 Function create_function() is deprecated’ is closed to new replies.