Home › Forums › Calendar Products › Events Calendar PRO › short code
- This topic has 4 replies, 2 voices, and was last updated 9 years ago by
Mark Metz.
-
AuthorPosts
-
May 21, 2017 at 11:59 pm #1286967
Mark Metz
ParticipantI 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 outMay 22, 2017 at 7:16 pm #1287423Cliff
MemberHi 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.
May 22, 2017 at 10:38 pm #1287508Mark Metz
ParticipantHi,
I think he handled it based on your help.
Really appreciate it, great product and support!
M+
May 23, 2017 at 9:15 am #1287723Cliff
MemberGlad to hear it. Have a great day!
-
AuthorPosts
- The topic ‘short code’ is closed to new replies.
