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
@chikaibeneme
chikaibeneme / publish all events.php
Last active February 22, 2025 04:07
publish all events
function forcefully_publish_all_events() {
global $wpdb;
// Get all event IDs directly from the database
$event_ids = $wpdb->get_col("
SELECT ID
FROM {$wpdb->posts}
WHERE post_type = 'tribe_events'
AND post_status NOT IN ('publish')
");
@chikaibeneme
chikaibeneme / delete-events-by-title.php
Created January 21, 2025 22:15
Delete Events by Title in The Events Calendar (WordPress)
<?php
add_action('init', function() {
global $wpdb;
// Title of the events to delete
$event_title = 'Scrabble 1';
// Query to find events with the specified title
$events = $wpdb->get_results(
$wpdb->prepare(
@chikaibeneme
chikaibeneme / change-organizer-slug-to.php
Created January 21, 2025 23:16
Change Organizer Slug to 'Ponent' in The Events Calendar (WordPress)
<?php
function modify_organizer_type_properties( $properties ) {
// Change the slug to "ponent"
$properties['rewrite']['slug'] = 'ponent';
return $properties;
}
// Hook into the organizer type registration for Events Calendar Pro
add_filter( 'tribe_events_register_organizer_type_args', 'modify_organizer_type_properties' );
@chikaibeneme
chikaibeneme / optimize-events-calendar-recurrence.php
Created January 25, 2025 06:25
Optimize Recurrence Period for Better Performance
function custom_recurrence_max_months( $value ) {
return 12; // Change to 6 or 12 for better performance
}
add_filter( 'tribe_get_option_recurrenceMaxMonthsAfter', 'custom_recurrence_max_months' );
@chikaibeneme
chikaibeneme / replace_organizer_slug_in_urls.php
Created January 31, 2025 21:50
replace_organizer_slug_in_urls
// Force organizer post type slug to "ponent"
function modify_organizer_type_properties( $properties ) {
$properties['rewrite'] = array(
'slug' => 'ponent',
'with_front' => false, // Optional: depends on your permalink settings
);
return $properties;
}
add_filter( 'tribe_events_register_organizer_type_args', 'modify_organizer_type_properties' );
@chikaibeneme
chikaibeneme / attendee-info-sortable-column.php
Created February 6, 2025 14:14
attendee-info-sortable-column.php
/**
* Adjust the query to sort by "Attendee Information" on the tickets attendees page.
*
* Assumes attendee information is stored as post meta under 'attendee_info'.
*
* @param WP_Query $query The current WP_Query instance.
*/
function optimized_sort_attendee_column( $query ) {
if (
is_admin() &&
@chikaibeneme
chikaibeneme / replace_organizer_slug_in_urls.php
Last active April 3, 2025 13:35
replace_organizer_slug_in_urls
<?php
// Force organizer post type slug to "ponent"
function modify_organizer_type_properties($properties)
{
$properties["rewrite"] = [
"slug" => "ponent",
"with_front" => false, // Optional: depends on your permalink settings
];
return $properties;
@chikaibeneme
chikaibeneme / Event Featured image to product thumbnail.php
Created February 17, 2025 20:36
Event Featured image to product thumbnail.php
@chikaibeneme
chikaibeneme / PayPal Client request.php
Created February 27, 2025 04:18
* Patch the PayPal Client request() method to capture arguments once * and avoid re-capturing them on retry.
<?php
/**
* Patch the PayPal Client request() method to capture arguments once
* and avoid re-capturing them on retry.
*
* Requires the runkit or runkit7 extension.
*/
add_action( 'plugins_loaded', function() {
if ( ! function_exists( 'runkit_method_redefine' ) ) {
error_log( 'Runkit extension is not available; PayPal Client patch was not applied.' );
@chikaibeneme
chikaibeneme / date.php
Created February 28, 2025 06:23
date.php override.
<?php
/**
* View: List View - Single Event Date
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/events/v2/list/event/date.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy