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
free-share-buttons|simple-share-buttons|Get-Free-Traffic-Now|buy-cheap-online|googlsucks|theguardlan|hulfingtonpost|darodar |
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 filter_acf_selection_by_ownership( $args, $field, $post ) { | |
$user = get_current_user_id(); | |
if(get_current_user_role() != 'administrator' || get_current_user_role() != 'editor'): | |
$args['author'] = $user; | |
endif; | |
return $args; |
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_current_user_role(){ | |
if( is_user_logged_in() ): | |
global $current_user; | |
$user_role = $current_user->roles[0]; | |
return $user_role; | |
else: | |
return FALSE; | |
endif; | |
} |
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
// Blockquote | |
// ------------------------------------------------------------- | |
function my_shortcode_blockquote( $atts, $content ) { | |
// extract and set defaults | |
extract( shortcode_atts( array( | |
'line1' => '', | |
'line2' => '' | |
), $atts ) ); | |
$output_string = '<blockquote>'; |
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 Events to date order (in admin), either future or past | |
// ------------------------------------------------------------- | |
function set_events_admin_order($wp_query) { | |
if (is_admin()) : | |
$post_type_req = 'events'; // change this | |
$filter_by = 'event_date'; // change this | |
$now = date('Ymd'); |
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
// is_child_term() | |
// ------------------------------------------------------------- | |
function is_child_term($taxonomy, $parent_id){ | |
$child_terms = get_term_children( $parent_id, $taxonomy ); | |
$response = false; | |
foreach ( $child_terms as $term ): | |
if(is_tax($taxonomy, $term)): | |
$response = true; | |
endif; |
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
// the rest of your $args array | |
$now = date('Ymd'); | |
$date_key = 'date'; | |
$args['meta_query'] = array( | |
array( | |
'key' => $date_key, | |
'value' => $now, | |
'compare' => '>=', | |
), |
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
// Video Shortcode | |
// ------------------------------------------------------------- | |
function my_shortcode_video( $atts, $content = null ) { | |
// extract and set defaults | |
extract( shortcode_atts( array( | |
'url' => '', | |
'autoplay' => 'false', | |
'image' => 'false' | |
), $atts ) ); | |
NewerOlder