Skip to content

Instantly share code, notes, and snippets.

View williamsba's full-sized avatar

Brad Williams williamsba

View GitHub Profile
array
0 =>
object(stdClass)[226]
public 'ID' => int 85
public 'title' => string 'Reward with Inventory' (length=21)
public 'excerpt' => string '' (length=0)
public 'content' => string '' (length=0)
public 'thumbnail' => string '' (length=0)
public 'points' => string '500' (length=3)
public 'start_date' => string '' (length=0)
$rewards = dma_get_available_rewards_for_user();
foreach ( $rewards as $reward ) {
echo '<p>' .$reward->title .'</p>';
}
$args = array(
'author' => $current_user->ID,
'post_type' => 'gws-idea-entries',
'meta-key' => 'idea-entry-post-id',
'meta_value' => absint( $idea_board_id ),
'posts_per_page' => '-1'
);
javascript:(function(){var total=0,count=0;jQuery('p.downloads').each(function(i,e){count++;total+=parseInt(jQuery(e).text().replace(/,/g,''));});total=total.toString().replace(/\B(?=(\d{3})+(?!\d))/g,',');alert(count+' plugins and '+total+' downloads');})();
javascript:var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);
@williamsba
williamsba / gist:8851321
Created February 6, 2014 19:50
Return only the latest product version on the front-end in Easy Digital Downloads
add_filter( 'edd_download_files', 'appp_show_latest_product_version' );
function appp_show_latest_product_version( $files ) {
//only show the latest version of a product everywhere except the admin dashboard
if ( is_array( $files ) && ! is_admin() ) {
//count the file array size
$arr_count = count( $files );