How to see if event is featured in PHP? [closed]

I believe you would want to use this function (from the-events-calendar/src/Tribe/Featured_Events.php:45): /** * Confirms if an event is featured. * @param int|WP_Post $event * * @return bool */ public function is_featured( $event = null ) { $event_id = Tribe__Main::post_id_helper( $event ); if ( ! $event_id ) { return false; } return (bool) get_post_meta( $event_id, self::FEATURED_EVENT_KEY, … Read more

Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts

For any poor soul out there that stumbles on the same, niche problem, the answer was frustratingly simple. Instead of trying to reinvent the wheel and build my own query, I should’ve been using the tribe_get_events function that I’m sure the Modern Tribe devs already worked hard to write. Anyway, here’s the final solution for … Read more

tribe_get_start_time displays the current date and time on other post types than tribe_events

There are various ways to solve this. First coming to mind are checking via is_singular() or get_post_type(). Using the latter you could write foreach( $posts as $p ): setup_postdata( $p ); $post_type = get_post_type($p); if ($post_type === Tribe__Events__Main::POSTTYPE) { //or: if ($post_type === ‘tribe_events’) { // Display the date of the event $p_event = tribe_get_start_time … Read more

WP_Query for custom post type and category_id not working

category__in is used for built-in post categories, not for custom taxonomies. You can try something like this: $args = array( ‘post_type’ => ‘tribe_events’, ‘meta_query’ => array( array( ‘key’ => ‘_EventStartDate’, ‘value’ => array( $start_date, $end_date ), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘DATE’ ) ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘tribe_events_cat’, ‘field’ => ‘term_id’, ‘terms’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)