This article is from this link : https://devpress.csdn.net/cms/62f0cae57e668234661830d2.html

Install the package using this command :
$ composer require symfony/var-dumper –dev

After that add these functions to functions.php

if ( ! function_exists('d') ) {

    function d() {
        call_user_func_array( 'dump' , func_get_args() );
    }

}

/**
 * Dump variables and die.
 */
if ( ! function_exists('dd') ) {

    function dd() {
        call_user_func_array( 'dump' , func_get_args() );
        die();
    }

}

After that you can use both d and dd functions to debug in wordpress

Leave a Comment