Skip to content

Instantly share code, notes, and snippets.

@coreymcollins
Last active October 10, 2018 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreymcollins/d30dda8a40695098e35292ac5b5885f9 to your computer and use it in GitHub Desktop.
Save coreymcollins/d30dda8a40695098e35292ac5b5885f9 to your computer and use it in GitHub Desktop.
VS Code Snippets
"wp_die": {
"prefix": "die",
"body": [
"wp_die( '<pre>'. htmlentities( print_r( ${1:foo}, true ) ) .'</pre>' );",
],
"description": "invoke wp_die()"
},
"wp_debug": {
"prefix": "debug",
"body": [
"define('WP_DEBUG', true);",
"if (WP_DEBUG) {",
" define('SCRIPT_DEBUG', true);",
" define('JETPACK_DEV_DEBUG', true);",
" define('WP_DEBUG_LOG', false);",
" define('WP_DEBUG_DISPLAY', true);",
"}",
],
"description": "add WP_DEBUG constant"
},
"XMP an array or object": {
"prefix": "xmp",
"body": [
"echo '<xmp>$1: '. print_r( $2, true ) .'</xmp>';",
],
"description": "Display an array or object in an XMP wrapper"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment