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( 'set_url_scheme', 'lc_force_secure_scheme', 10, 3 ); | |
/** | |
* Force all URLs run through the set_url_scheme to always be https if they're | |
* being accessed through our reverse proxy. | |
* | |
* @param string $url The complete URL including scheme and path. | |
* @param string $scheme Scheme applied to the URL. One of 'http', 'https', or 'relative'. | |
* @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login', | |
* 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. |
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 | |
/** | |
* Conditional to check if we're being served via the Reverse Proxy. | |
* The URL for the Forwarded Server below (example.com) should be the final | |
* URL for the site using the Reverse Proxy. | |
*/ | |
function lc_is_reverse_proxy() { | |
if ( 'www.example.com' === $_SERVER['HTTP_X_FORWARDED_SERVER'] ) { | |
return true; |
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( 'register_post_type_args', 'lc_change_registered_post_type_slug', 10, 2 ); | |
/** | |
* Change the slug for a registered post type. | |
* | |
* @param array $args Array of arguments for registering a post type. | |
* @param string $post_type Post type key. | |
*/ | |
function lc_change_registered_post_type_slug( $args, $post_type ) { |
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: Reverse Proxy for WordPress Multisite | |
* Plugin URI: https://limecuda.com/ | |
* Description: Reverse proxy setup for a WordPress multisite in subdirectory mode | |
* Version: 1.0.0 | |
* Author: Josh Mallard | |
* Author URI: https://limecuda.com | |
* | |
* @package reverse-proxy-wp-multisite |
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 | |
/** | |
* WooCommerce Template | |
* | |
* Template used for all WooCommerce views for your site | |
* | |
*/ | |
//* Remove standard post content output | |
remove_action( 'genesis_loop', 'genesis_do_loop'); |
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_action( 'toplevel_page_genesis_settings_page_boxes', 'lc_remove_unwanted_genesis_metaboxes' ); | |
/** | |
* Remove the blog page settings metabox from the Genesis Theme Settings | |
* Desired if following the suggestion by Bill Erickson to not use the Blog page template | |
* that comes standard in the Genesis Theme | |
* | |
* @link http://www.billerickson.net/dont-use-genesis-blog-template/ | |
*/ | |
function lc_remove_unwanted_genesis_metaboxes() { |
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( 'tribe_events_list_widget_query_args', 'jm_filter_list_widget_query_args' ); | |
/** | |
* Filter the query used for the Event List Widget to show only events starting | |
* in the future | |
*/ | |
function jm_filter_list_widget_query_args( $args ) { | |
$offset = 86400 * 30; | |
$date = date( 'U' ) + $offset; |
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 | |
function is_child( $page_id ) { | |
$child_check = get_post_ancestors( $page_id ); | |
if($child_check) { | |
return true; | |
} | |
} |
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
//* Set the default WooCommerce front-end styles | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) { | |
add_action( 'admin_init', 'woocommerce_default_frontend_styles' ); | |
} | |
/** | |
* Define default WooCommerce frontend styles | |
*/ |