Snippets Collections
// RECOMMENDED WAY
// Install plugin Query Monitor

// In your code call:
do_action( 'qm/debug', 'This happened!' );

$my_user = get_userdata(1);
do_action( 'qm/debug', $my_user );

$my_post = get_post(9);
do_action('qm/debug', $my_post);


// OFFICIAL WAY
// This should go into wp-config.php 

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
// for compile error
#[derive(Debug)]
struct Rectangle {
    width: u32,
    height: u32,
    sqr_rec: () => {}
}

fn main() {
    let rect1 = Rectangle {
        width: 30,
        height: 50,
    };
    // ? tells compiler to output to console
    println!("rect1 is {:#?}", rect1);
      
    println!(
        "The area of the rectangle is {} square pixels.",
        area(&rect1)
    );
}


fn area(rectangle: &Rectangle) -> u32 {
    rectangle.width * rectangle.height
}
  
// 'Class' Method and Constructor (associated method (doesn't have self as fitst arg))
// Self = Struct Name ( Rectangle in this case)
impl Rectangle {
  fn new() -> Self {
    Self {
      width: 100,
      height: 100,
      fn sqr_rec(&self)
      fn sqr_rec(mut &self)
    }
  }
}
  
let rec1 = Rectangle::new();
let width = rec1.width;
let height = rect.height;
define('FS_METHOD', 'direct');
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true);
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      // "processId": "${command:PickProcess}",
      "protocol": "inspector",
      "restart": true,
      "name": "Launch Programa",
      "skipFiles": ["<node_internals>/**"]
    }
  ]
}
star

Sat Feb 11 2023 11:39:16 GMT+0000 (Coordinated Universal Time)

#wordpress #debug
star

Wed Jul 20 2022 22:37:05 GMT+0000 (Coordinated Universal Time) https://doc.rust-lang.org/book/ch05-02-example-structs.html

#println #customtypes #debug
star

Wed Feb 09 2022 07:22:18 GMT+0000 (Coordinated Universal Time) https://faq.o2switch.fr/gestion-site/debug-page-blanche-erreur-500

#php #wordpress #debug
star

Wed Nov 11 2020 12:56:36 GMT+0000 (Coordinated Universal Time)

#json #nodejs #debug

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension