Skip to content

Instantly share code, notes, and snippets.

View chikaibeneme's full-sized avatar
:atom:
Focusing

Chika Ibeneme chikaibeneme

:atom:
Focusing
  • iKaDigital
  • Jamaica
View GitHub Profile
/*The Tribe Events Calendar plugin for WordPress provides several functions to retrieve information about events and their tickets. While there isn't a specific function to differentiate between paid/free tickets and RSVPs, you can use a combination of functions to achieve the desired result.
To determine if an event has tickets or is only based on RSVP, you can use the following approach:
Use the tribe_get_event_meta() function to retrieve the event's ticketing meta information. This function returns an array containing various details about the event, including ticketing information.
Check if the event has any tickets by accessing the 'tribe_tickets' key in the returned array. If it exists and is not empty, it indicates that the event has tickets.
If the event has tickets, you can further examine the ticket types to determine if they are paid or free. You can use the tribe_get_ticket_types() function to retrieve an array of ticket types for the event.
Iterate through the ticket types array and check the
/**
* Automatically set event categories as post categories for the Events Calendar.
*/
function set_event_categories_as_post_categories( $post_id ) {
// Check if the post is an event post type
if ( 'tribe_events' === get_post_type( $post_id ) ) {
// Get the event categories
$event_categories = wp_get_post_terms( $post_id, 'tribe_events_cat', array( 'fields' => 'names' ) );
// Set event categories as post categories
@chikaibeneme
chikaibeneme / functions.php
Created August 4, 2021 04:21
functions.php
function tec_1163154_dequeue_gmaps_script() {
if ( ! class_exists( 'Tribe__Events__Main' ) ) {
return false;
}
$tecmain = Tribe__Events__Main::instance();
if (
// https://developer.wordpress.org/reference/functions/is_post_type_archive/
function tribe_exclude_events_category( $wp_query ) {
// only filter the query if the user cannot edit pages (< editor)
if (!current_user_can('edit_pages')) {
$exclude_cats = array('exclude-me');
// Join with current tax query if set
if (is_array($wp_query->get( 'tax_query')))
{$tax_query =$wp_query->get( 'tax_query');}
else
{$tax_query = array();}
function cmdm_private_event( $content )
{
global $post;
$cmdm_content = '';
$cmdm_private = false;
$cmdmc_post_types = array( 'tribe_events' );
if ( function_exists( 'tribe_get_custom_fields' ) )
{
<div class="page-wrapper ">
<div class="container">
<div class="row">
<div class="col-md-3">
<div class="mobile-hidden-sm">
<ul class="theme-features_nav" role="tablist">
<li role="presentation" class=""><a href="#link1" aria-controls="overview" role="tab" data-toggle="tab" aria-expanded="false">Link 1</a></li>
<li role="presentation" class=""><a href="#link2" aria-controls="general" role="tab" data-toggle="tab" aria-expanded="false">Link 2</a></li>
<li role="presentation" class="active"><a href="#link3" aria-controls="homePage" role="tab" data-toggle="tab" aria-expanded="true">Link 3</a></li>
</ul>
var s = `@font-face {
font-family: 'Proxima Nova Lt';
src: url('ProximaNova-Semibold.eot');
src: url('ProximaNova-Semibold.eot?#iefix') format('embedded-opentype'),
url('ProximaNova-Semibold.woff2') format('woff2'),
url('ProximaNova-Semibold.woff') format('woff'),
url('ProximaNova-Semibold.ttf') format('truetype'),
url('ProximaNova-Semibold.svg#ProximaNova-Semibold') format('svg');
font-weight: 600;
@font-face {
font-family: 'Proxima Nova Lt';
src: url('ProximaNova-Semibold.eot');
src: url('ProximaNova-Semibold.eot?#iefix') format('embedded-opentype'),
url('ProximaNova-Semibold.woff2') format('woff2'),
url('ProximaNova-Semibold.woff') format('woff'),
url('ProximaNova-Semibold.ttf') format('truetype'),
url('ProximaNova-Semibold.svg#ProximaNova-Semibold') format('svg');
font-weight: 600;
font-style: normal;
{% if section.settings.frontpage_grid_style == false %}
<div class="container">
<div class="sixteen columns">
{% endif %}
<div class="image-with-text
featured_collections
clearfix across-{{section.settings.featured_links_per_row}} image-align--{{ section.settings.frontpage_image_position }}
full-width--{{ section.settings.frontpage_grid_style }}">
{% if section.blocks.size > 0 %}
{% for block in section.blocks %}