Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m potentially having a similar issue with WP Rocket – would you be able to share the fix here, as well?

    Also wanted to say thanks for bringing back the old functionality. It is, once again, one of the most useful plugins I use.

    Wanted to chime in and say I also preferred the hackery. ?? Don’t mess with perfection!

    I’ll probably be removing the plugin as well, or reverting back to the old version. The new/current version isn’t convenient at all and I can’t justify keeping it.

    Thread Starter jirvin

    (@jrvin)

    So this is probably my fault, but I think I asked this right before I updated the plugin (or maybe the update came shortly after my question? I’m not sure?), but things seem to be working how I want them to without creating the custom scope and just using the default “future” for scope.

    That said, I still wanted to try playing with the custom scope thing, so thank you angelo, for providing the tutorial link! I think I could really fine tune with that should the need arise in the future!

    tse11, here’s something I was trying based on the tutorial above. It seemed to work, though I honestly didn’t test much beyond “Yay, I seemed to get the expected results.”
    You’ll probably have to make a few edits to the MySQL bits to fit your needs. You can put it in your theme’s functions.php file:

    //custom scope conditions
    add_filter( ’em_events_build_sql_conditions’, ‘my_em_scope_conditions’,1,2);
    function my_em_scope_conditions($conditions, $args){
    //scope “future-hours”
    if( !empty($args[‘scope’]) && $args[‘scope’]==’future-hours’ ){
    //get the current date
    $start_date = date(‘Y-m-d’,current_time(‘timestamp’));

    //get the current time
    $start_time = date(‘H:i:s’,current_time(‘timestamp’));

    //find all events starting >= to the current date with an end time > than the current time
    $conditions[‘scope’] = ” (event_start_date >= CAST(‘$start_date’ AS DATE) AND event_end_time > CAST(‘$start_time’ AS TIME))”;
    }
    return $conditions;
    }

    //add custom scope “future-hours” to list of available scopes
    add_filter( ’em_get_scopes’,’my_em_scopes’,1,1);
    function my_em_scopes($scopes){
    $my_scopes = array(
    ‘future-hours’ => ‘Future by Hours’
    );
    return $scopes + $my_scopes;
    }

    Thread Starter jirvin

    (@jrvin)

    Ah, I didn’t even realize that was in there. D’oh. Thanks so much!!

Viewing 5 replies - 1 through 5 (of 5 total)