This file contains hidden or 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
add_filter( 'http_request_args', 'dm_prevent_update_check', 10, 2 ); | |
function dm_prevent_update_check( $r, $url ) { | |
if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) { | |
$my_plugin = plugin_basename( __FILE__ ); | |
$plugins = unserialize( $r['body']['plugins'] ); | |
unset( $plugins->plugins[$my_plugin] ); | |
unset( $plugins->active[array_search( $my_plugin, $plugins->active )] ); | |
$r['body']['plugins'] = serialize( $plugins ); | |
} | |
return $r; |
This file contains hidden or 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( 'woocommerce_email_styles', 'patricks_woocommerce_email_styles' ); | |
function patricks_woocommerce_email_styles( $css ) { | |
$css .= "#template_header { background-color: #231f20; }"; | |
return $css; | |
} |
This file contains hidden or 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 | |
$user_id = get_current_user_id(); | |
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) { | |
get_template_part( 'template', 'gold' ); | |
} else { | |
echo "You are not allowed to view this content"; | |
} | |
?> |
This file contains hidden or 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 | |
/* | |
* Send visitors who submit events to a different page after submission. | |
* | |
* This actually does the redirect. If an event was submitted, and we're about | |
* to reload the submission page (with a message instead of a form), this will | |
* redirect the user. | |
* | |
* @param WP $wp | |
* @return void |
This file contains hidden or 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 add_helpful_user_classes() { | |
if ( is_user_logged_in() ) { | |
add_filter('body_class','class_to_body'); | |
add_filter('admin_body_class', 'class_to_body_admin'); | |
} | |
} | |
add_action('init', 'add_helpful_user_classes'); | |
/// Add user role class to front-end body tag | |
function class_to_body($classes) { |
NewerOlder