How to debug

Use debugger panel log for PHP and JS

Add an entry to the debugger panel log in PHP and JS custom files code:

dct_debug(text, variable, level, advanced);

Use this function to debug any variable type with a custom level when debug mode is enabled. In JS, also logs to the browser console.
  • text: Text to debug. Default: empty.
  • var: Variable to debug (any type). Default: empty.
  • level: Level of log entry, allows filtering. Options: "log" (default), "info", "success", "warning", "error".
  • advanced: Only log when debug mode advanced is enabled. Default: false.
  • var_table: Only for JS. Log variable to console in table format. Default: false.

How to use dct_debug function with custom files code:

Use $dct object in PHP and JS

Object $dct contains information about your child theme, environment and current page that can be used in custom JS and PHP code.


How to use global $dct object with custom files code:

Current $dct object contents:
{
    "debug": {
        "enabled": true,
        "advanced": false,
        "maintenance": false
    },
    "scss_compiler": {
        "minify": false,
        "autocompile": true
    },
    "colors": {
        "primary": "#3fa6a5",
        "primary-dark": "#2a6e6d",
        "primary-darker": "#153736",
        "primary-light": "#6bc6c5",
        "primary-lighter": "#a2dbda",
        "primary-comp": "#a63f40"
    },
    "fonts": [],
    "sizes": [],
    "assets": {
        "css": [
            "dct-style-admin",
            "dct-style"
        ],
        "js": [
            "dct-base-js",
            "dct-admin-js",
            "gsap-min-js",
            "ScrollTrigger-min-js",
            "Draggable-min-js",
            "InertiaPlugin-min-js",
            "custom-js"
        ]
    },
    "customizer": {
        "preloader": true,
        "admin_panel": true,
        "login_page": true
    },
    "theme": {
        "Name": "DCT for WP",
        "Version": "1.1.5",
        "Description": "Dynamic Child Theme for WordPress v1.1.5",
        "ThemeURI": "https://www.dctforwp.com",
        "Author": "Estudi FGH.net",
        "AuthorURI": "https://www.estudifgh.net",
        "Template": "Divi",
        "TextDomain": "dct",
        "DomainPath": "",
        "Status": "publish",
        "Stylesheet": "dct-child-theme",
        "StylesheetURI": "https://www.dctforwp.com/wp-content/themes/dct-child-theme"
    },
    "post": {
        "post_title": "How to debug",
        "post_id": 227,
        "post_type": "docs",
        "post_status": "publish",
        "post_date": "18/07/2026",
        "post_author": ""
    },
    "user": {
        "user_login": false,
        "user_id": 0,
        "user_name": false,
        "user_email": false,
        "user_roles": null
    },
    "conditionals": {
        "is_admin": false,
        "is_blog_admin": false,
        "is_login": false,
        "is_front_page": false,
        "is_home": false,
        "is_singular": true,
        "is_single": true,
        "is_page": false,
        "is_archive": false,
        "is_category": false,
        "is_tag": false,
        "is_date": false,
        "is_attachment": false,
        "is_author": false,
        "is_page_template": false,
        "is_paged": false,
        "is_post_type_archive": false,
        "is_search": false,
        "is_404": false,
        "is_ssl": true
    },
    "environment": {
        "Site URL": "https://www.dctforwp.com",
        "Theme basepath": "https://www.dctforwp.com/wp-content/themes/dct-child-theme",
        "Theme name": "DCT for WP",
        "Theme version": "1.1.5",
        "Wordpress version": "7.0.2",
        "PHP version": "8.2.31"
    },
    "language": {
        "locale": "en_US",
        "user_locale": "en_US"
    }
}