Skip to content

Instantly share code, notes, and snippets.

@davidperezgar
Created August 15, 2025 09:35
Show Gist options
  • Select an option

  • Save davidperezgar/4908a8095a7b1f8e971353c967c4be06 to your computer and use it in GitHub Desktop.

Select an option

Save davidperezgar/4908a8095a7b1f8e971353c967c4be06 to your computer and use it in GitHub Desktop.

Revisions

  1. davidperezgar created this gist Aug 15, 2025.
    11 changes: 11 additions & 0 deletions add-bootstrap.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    define( 'TESTS_PLUGIN_DIR', dirname( __DIR__ ) );
    define( 'UNIT_TESTS_DATA_PLUGIN_DIR', TESTS_PLUGIN_DIR . '/tests/Data/' );

    // Define WP_CORE_DIR if not already defined
    if ( ! defined( 'WP_CORE_DIR' ) ) {
    $_wp_core_dir = getenv( 'WP_CORE_DIR' );
    if ( ! $_wp_core_dir ) {
    $_wp_core_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress';
    }
    define( 'WP_CORE_DIR', $_wp_core_dir );
    }