PHP code example of mimosafa / wp-theme-exchanger

1. Go to this page and download the library: Download mimosafa/wp-theme-exchanger 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/ */

    

mimosafa / wp-theme-exchanger example snippets




// In your plugin file

 function() {

    /**
     * Theme slug
     *
     * @var string $extra_theme
     */
    $extra_theme = 'awesome-theme';
    $exchanger = new WP_Theme_Exchanger\Exchanger( $extra_theme );

    if ( $_SERVER['REQUEST_URI'] === '/awesome' ) {
        $exchanger->on();
    }

} );