• @bungeshea thanks for this plugin it’s a relief to find a well behaved plugin not awash with advertising.

    I wonder if you can help me ..?

    I am noticing this difference between using your plugin and the Toolset Custom code feature while using the KINT debugger and debug bar

    Code Snippets

    WP_User(8)
    →Called from <ROOT>/wp-content/plugins/code-snippets/php/snippet-ops.php(361) : eval()'d code:3 [get_email_with_code_snippet()]

    Toolset custom code

    →$email_from_toolset_custom_code WP_User(8)
    →Called from <ROOT>/wp-content/toolset-customizations/get-email-with-toolset-custom-code.php:12 [get_email_with_toolset_custom_code()]

    for some reason Code Snippets is losing the variable name… any idea ?

    thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ImageShea Bunge

    (@bungeshea)

    Hi @keniry,

    I’ve tried this out and I receive the same result as you. I believe that this is because of how Code Snippets executes the snippet code in a different way to if it was included in a plugin file.

    I’ll do some more digging and see if I can find a way around this.

    Plugin Author ImageShea Bunge

    (@bungeshea)

    I’ve taken a look at the source code of the Kint debugger library, and unfortunately it looks like this might not be possible with how Code Snippets works. Kint looks at the actual PHP files themselves to determine variable names, as this is not provided by PHP, and snippets run directly instead of being saved in PHP files.

    At some point in the future I’m hoping to transition to a system where snippets are saved to files, so this should allow them to work with Kint much more naturally. This is probably a little while off though, as I am wary about making such a large change that could potentially not work on some hosts, but it’s definitely something I am hoping to introduce.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘variable name missing in kint debugger’ is closed to new replies.