This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Filter WP Basic HTTP Authentication Environments | |
* Description: Filter WP Basic HTTP Authentication Environments to use environment variables | |
* Author: James Morrison | |
* Version: 1.0.0 | |
* Author URI: https://www.jamesmorrison.me | |
**/ | |
// Filter the environments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Display Git Branch | |
* Version: 1.0.0 | |
* Description: Shows which Git branch you're working on. Highlights restricted branches in red. | |
* Author: James Morrison | |
* Author URI: https://www.jamesmorrison.me/ | |
**/ | |
// Namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'site_option_active_sitewide_plugins', | |
function( $value ) { | |
// Lookup the current site object global | |
$current_blog; | |
// This would disable the plugins on sites with ID's 2, 3 and 5 | |
if ( in_array( $current_blog->blog_id, [ 2, 3, 5 ] ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Admin Bar Site ID | |
* Description: Add the current site ID to the Admin Bar | |
* Version: 1.0.3 | |
* Author: James Morrison | |
* Author URI: https://www.jamesmorrison.me/ | |
**/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands: | |
"01": | |
command: curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /usr/local/bin/wp | |
"02": | |
command: chmod +x /usr/local/bin/wp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name apollo; | |
listen 80 default_server; | |
listen 443 ssl default_server; | |
ssl_certificate ssl/selfsigned.crt; | |
ssl_certificate_key ssl/selfsigned.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Obviously, add this to a function that hooks into wp_enqueue_scripts() (or admin_enqueue_scripts()) */ | |
wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/style.css', false, filemtime( get_stylesheet_directory() . '/style.css' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Improve WP Signup - redirect to the main network URL with referral parameters | |
* @author James Morrison | |
* | |
* The WP core /wp-signup.php file calls "get_header( 'wp-signup' );" we can hook into this to force a redirect | |
* Add this as a MU Plugin, make sure NOBLOGREDIRECT is *not* defined as it'll override this | |
* | |
* Notes: | |
* Whilst you can set up a redirect from the NOBLOGREDIRECT constant, the advantage of using this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Header for WP Signup | |
* @author James Morrison | |
* @link https://gist.github.com/jamesmorrison/5f8a3108b2a773cd07db430b73992e9d/edit | |
* | |
* This file is called by the WP core /wp-signup.php file; we can force a redirect from here | |
* | |
* Whilst you can do this from the NOBLOGREDIRECT constant, the advantage of using this header | |
* file is that you can capture the path that triggered the call to signup; as seen in the example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Plugin Name: Rewrite Search URL's | |
* Description: Rewrite search URL's to "pretty" permalinks. A custom permalink structure must be set. | |
* Version: 1.0.1 | |
* Author: James Morrison | |
* Author URI: https://www.jamesmorrison.me/ | |
* | |
**/ |