short code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1286967
    Mark Metz
    Participant

    I have this function
    $events = tribe_get_events( array(
    ‘author’ => $user_id,
    ‘order’ => ‘ASC’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_EventStartDate’,
    ‘value’ => date( ‘Y-m-d H:i:s’ ),
    ‘type’ => ‘DATETIME’,
    ‘compare’ => ‘>’,
    ),
    array(
    ‘key’ => ‘_EventRecurrence’,
    ‘compare’ => ‘EXISTS’,
    ),
    ),
    ) );
    when i am using this function inside the short code you have provided me for user event count
    function tribe_do_user_events ( $atts ) {

    if ( $user_id = get_current_user_id() && function_exists(‘tribe_get_events’) ) {

    $events = tribe_get_events( array(
    ‘author’ => $user_id,
    ‘order’ => ‘ASC’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_EventStartDate’,
    ‘value’ => date( ‘Y-m-d H:i:s’ ),
    ‘type’ => ‘DATETIME’,
    ‘compare’ => ‘>’,
    ),
    array(
    ‘key’ => ‘_EventRecurrence’,
    ‘compare’ => ‘EXISTS’,
    ),
    ),
    ) );

    if ( empty ($events) ) return ‘No events for this user’;

    $return_events = ”;

    foreach ( $events as $post ) {
    setup_postdata( $post );

    $return_events .= ” . $post->post_title . ‘ – ‘ . tribe_get_start_date( $post ) . ”;
    }

    $return_events .= ”;

    return $return_events;
    }

    }
    add_shortcode( ‘tribe_user_events’, ‘tribe_do_user_events’ );
    /*
    it is returning all the events not only future and recurring events.
    Please indly help me out

    #1287423
    Cliff
    Member

    Hi again, Mark.

    I provided you a similar code snippet, here. I assume your developer customized it from there.

    I already provided that custom code, which is above and beyond our Scope of Support / Terms (which we like to do from time-to-time).

    However, additional customizations, especially to your own version of it, isn’t available from our support.

    Thank you very much for your understanding.

    If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.

    #1287508
    Mark Metz
    Participant

    Hi,

    I think he handled it based on your help.

    Really appreciate it, great product and support!

    M+

    #1287723
    Cliff
    Member

    Glad to hear it. Have a great day!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘short code’ is closed to new replies.