Skip to content

Instantly share code, notes, and snippets.

@azamatx
Last active November 9, 2021 09:02
Show Gist options
  • Save azamatx/7614e0e9f02ad5197cd824fa51b859cd to your computer and use it in GitHub Desktop.
Save azamatx/7614e0e9f02ad5197cd824fa51b859cd to your computer and use it in GitHub Desktop.
VS Code WordPress add_action print_r debug
"add_action_print": {
"prefix": "add",
"body": [
"add_action('init', function() {",
"\tif (isset(\\$_GET['devpre'])) {",
"\t\t\\$templates = get_option('wpb_js_templates');",
"\t\techo '<pre>';",
"\t\tprint_r(\\$templates);",
"\t\techo '</pre>';",
"\t\texit;",
"\t}",
"});",
],
"description": "WP add action with pre"
},
"print": {
"prefix": "pr",
"body": [
"echo '<pre>';",
"print_r(\\$templates);",
"echo '</pre>';",
],
"description": "Print R"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment