PHP code example of wp-spaghetti / wp-boot

1. Go to this page and download the library: Download wp-spaghetti/wp-boot library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wp-spaghetti / wp-boot example snippets


// BEGIN WP Boot - Do not remove this block
// @see https://github.com/wp-spaghetti/wp-boot
use function Env\env;

efine('DB_PASSWORD', env('DB_PASSWORD'));
define('DB_HOST', env('DB_HOST'));


/**
 * Plugin Name: Disallow Indexing (Non-Production)
 * Description: Automatically disallows search engine indexing in non-production environments
 */

if (wp_get_environment_type() !== 'production' && !is_admin()) {
    add_action('pre_option_blog_public', '__return_zero');
}