I hereby claim:
- I am cgrymala on github.
- I am cgrymala (https://keybase.io/cgrymala) on keybase.
- I have a public key whose fingerprint is CD74 D412 8F46 B475 3502 596F 907D 518E 88AF 87A1
To claim this, I am signing this object:
<?php | |
if ( ! class_exists( 'Sample_Plugin' ) ) { | |
class Sample_Plugin { | |
var $text_domain = 'sample_plugin'; | |
var $options_page_slug = 'sample-options-page'; /* Because you will use this in a lot of places, we'll define it here */ | |
function __construct() { | |
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); | |
} | |
function admin_menu() { |
<?php | |
if ( ! class_exists( 'Sample_Plugin' ) ) { | |
class Sample_Plugin { | |
var $text_domain = 'sample_plugin'; | |
var $options_page_slug = 'sample-options-page'; /* Because you will use this in a lot of places, we'll define it here */ | |
function __construct() { | |
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); | |
add_action( 'admin_init', array( $this, 'admin_init' ) ); | |
} | |
body { | |
background: url(my-main-image.png); | |
} | |
.site-container { | |
width: 100%; | |
max-width: 100%; | |
background: url(my-secondary-image.png); | |
} | |
.site-header, | |
.site-inner, |
/** | |
* Check to see if an element exists in the page | |
* Avoids potential XSS attack outlined in https://eamann.com/tech/jquery-xss/ | |
* @see https://eamann.com/tech/jquery-xss/ | |
*/ | |
function doesElementExist( el ) { | |
try { | |
var tmpLen = document.querySelectorAll( el ).length; | |
if ( 0 < tmpLen ) { | |
return true; |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* The 'genesis_pre_load_favicon' filter runs at the beginning of the genesis_load_favicon() function. | |
* If the value returned by that filter ends up as anything except boolean false, Genesis bails on the | |
* genesis_load_favicon() process. | |
*/ | |
add_filter( 'genesis_pre_load_favicon', 'check_jetpack_site_icon_status' ); | |
function check_jetpack_site_icon_status() { | |
/** | |
* If the JetPack module is active and a JetPack Site Icon has been set, |
<?php | |
/** | |
* Sets the heightStyle argument for all accordion widget areas | |
* @see http://api.jqueryui.com/accordion/#option-heightStyle | |
*/ | |
add_filter( 'collapsible-widget-javascript-arguments', 'my_theme_modify_cwa_js_args' ); | |
function my_theme_modify_cwa_js_args( $args = array() ) { | |
/** | |
* Loop through all of the existing Collapsible Widget Areas | |
*/ |
<?php | |
/** | |
* Example usage of the collapsible-widget-ui-theme filter | |
* We set the priority to 10, and tell WordPress that the callback function should receive 2 arguments | |
* @see http://codex.wordpress.org/Function_Reference/add_filter | |
*/ | |
add_filter( 'collapsible-widget-ui-theme', 'my_theme_cwa_ui_theme', 10, 2 ); | |
function my_theme_cwa_ui_theme( $theme, $opt=null ) { | |
/** | |
* Set a custom jQueryUI theme specifically for use with our WordPress theme |
<?php | |
/** | |
* Filter the list of JetPack shortcodes to remove the YouTube and | |
* Vimeo shortcodes from the list | |
* @param array $shortcodes a numerically-indexed array of the absolute | |
* paths to the shortcode definition files | |
* @return array the filtered array | |
*/ | |
function jetpack_allow_native_youtube_vimeo_oembeds( $shortcodes ) { | |
$good_shortcodes = array(); |
<?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; | |
} | |
} |