#Mac OS X
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
add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); | |
function bpdev_exclude_users($qs=false,$object=false){ | |
//list of users to exclude | |
$excluded_user=join(',', bpdev_get_subscriber_admin_user_ids());//comma separated ids of users whom you want to exclude | |
if($object!='members')//hide for members only | |
return $qs; | |
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 All Custom Post Types to search | |
* | |
* Returns the main $query. | |
* | |
* @access public | |
* @since 1.0 | |
* @return $query |
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
/** | |
* | |
* Force http/s for images in WordPress | |
* | |
* Source: | |
* https://core.trac.wordpress.org/ticket/15928#comment:63 | |
* | |
* @param $url | |
* @param $post_id | |
* |
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
<!doctype html> | |
<html lang="en"> | |
<body> | |
<article class="gallery" role="main"> | |
<section class="photos"> | |
{% for image in page.image %} <!-- Loop through the photos from the YAML frontmatter from an empty Jekyll post --> | |
<figure> | |
<img src="{{ page.image[forloop.index0] }}" alt="{{ page.image-alt[forloop.index0] }}"> <!-- Insert the src, the alt text for each image, using the forloop.index0 liquid helper --> | |
</figure> | |
<figcaption>{{ page.image-caption[forloop.index0] }}</figcaption> <!-- and the figcaption too --> |
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( 'init', 'wc_tax_exempt_user_roles' ); | |
function wc_tax_exempt_user_roles() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
if ( current_user_can('wholesaler') || current_user_can('distributor') ) { | |
$woocommerce->customer->set_is_vat_exempt(true); | |
} else { | |
$woocommerce->customer->set_is_vat_exempt(false); | |
} |
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 get_user_ids_by_role($role){ | |
$users=array(); | |
$founded_users = get_users( array( 'role' => $role ) ); | |
if(!empty($founded_users)){ | |
foreach((array)$founded_users as $user) | |
$users[]=$user->ID; | |
} | |
return $users; | |
} |
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
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> |
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: Debug Hooks | |
* Author: J.D. Grimes & Some other guy on the net | |
* Version: $ver$ | |
* Description: Adds some functions you can use to debug actions and filters. | |
*/ | |
/** |
OlderNewer