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 | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) { | |
if ( isset( $_SERVER['HTTP_X_FORWARDED_PORT'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_PORT'] ) ) { | |
$ports = explode(',', $_SERVER['HTTP_X_FORWARDED_PORT']); | |
error_log( 'The forwarded Port var is set to: ' . $ports[0] ); | |
} else if ( isset( $_SERVER['SERVER_PORT'] ) && ! empty( $_SERVER['SERVER_PORT'] ) ) { | |
error_log( 'The server Port var is set to: ' . $_SERVER['SERVER_PORT'] ); | |
$_SERVER['SERVER_PORT'] = 443; | |
} | |
} |
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 | |
/*** | |
* ____ _____ _____ _____ _____ _ _ _ | |
* / __ \| __ \|_ _/ ____|_ _| \ | | /\ | | | |
* | | | | |__) | | || | __ | | | \| | / \ | | | |
* | | | | _ / | || | |_ | | | | . ` | / /\ \ | | | |
* | |__| | | \ \ _| || |__| |_| |_| |\ |/ ____ \| |____ | |
* \____/|_|__\_\_____\_____|_____|_| \_/_/ \_\______| | |
* /\ | __ \| __ \ /\\ \ / / | |
* / \ | |__) | |__) | / \\ \_/ / |
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 | |
// This is the meat of the plugin and should go in mu-plugins/0-env-url-override.php | |
// Only load these filters if we're not in the production environment | |
if ( defined( 'ENV_NOT_PRODUCTION' ) && ENV_NOT_PRODUCTION ) { | |
// This always needs to be filtered | |
add_filter( 'site_url', 'env_filter_site_url', 0 ); | |
// We don't filter home_url in the admin so that we get production URLs for posts. | |
// This does break certain links like "Preview/View Post", however. |
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 dap_responsive_img_caption_filter( $val, $attr, $content = null ) { | |
extract( shortcode_atts( array( | |
'id' => '', | |
'align' => '', | |
'width' => '', | |
'caption' => '' | |
), $attr | |
) ); | |
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 | |
/** | |
* Text Field | |
* | |
* A simple text field callback to use with the Settings API. Don't forget to pass in | |
* the arguments array. Here's an example call to add_settings_field() : | |
* | |
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array( | |
* 'name' => 'my_theme_options[my_option]', | |
* 'value' => $options['my_option'], // assuming $options is declared |
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
function remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
// unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress Blog | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // Other WordPress News |
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 | |
/** | |
* Favorite Widget | |
* | |
* @package Core_Functionality | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/Core-Functionality | |
* @author Bill Erickson <bill@billerickson.net> | |
* @copyright Copyright (c) 2011, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
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 Facebook Button to Display Posts Shortcode plugin | |
* @author Bill Erickson | |
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/ | |
* @link http://wordpress.org/support/topic/facebook-likeshare-button-at-the-end-of-excerpt | |
* | |
* @param $output string, the original markup for an individual post | |
* @param $atts array, all the attributes passed to the shortcode | |
* @param $image string, the image part of the output |
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 | |
/* | |
* Disable plugin updates | |
* | |
* @param array $r Response header | |
* @param string $url The update URL | |
*/ | |
function slug_hidden_plugin( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) ) | |
return $r; // Not a plugin update request. Bail immediately. |
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: Mini Admin Bar | |
* Plugin URI: | |
* Description: Makes the admin bar a small button on the left and expands on hover. | |
* Version: 1.0 | |
* Author: Shea Bunge | |
* Author URI: http://bungeshea.com | |
* License: MIT | |
*/ |
OlderNewer