Created
February 22, 2017 03:17
-
-
Save brandondove/d560fa7012a535b4f845cb85880a1fb8 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Adds new responsive ad unit sizes to the selectable options when creating an ad | |
*/ | |
function example_adsanity_ads_posts_sortable_by_clicks( $vars = array() ) { | |
$vars = array_merge( | |
$vars, | |
array( | |
'meta_key' => sprintf( '_clicks-%s', mktime( 0,0,0, date( 'n' ), date( 'j' ), date( 'Y' ) ) ), | |
'orderby' => 'meta_value_num' | |
) | |
); | |
return $vars; | |
} | |
add_filter( 'adsanity_ads_posts_sortable_by_clicks', 'example_adsanity_ads_posts_sortable_by_clicks' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment