Forum Replies Created
-
AuthorPosts
-
Jon
ParticipantSo I took what you provided and it helped out get my client to a halfway mark. While it doesn’t solve the ticket issue itself. I can at least generate a group of events and then convert them now into single events. Instead of the mundane task of copying and pasting everything. I have provided my solution below. It takes a few steps.
Step One – Prepping your website to break the event series. I took the information and created a query that is executed to break the series based on a LIKE value for all event recurrences. These are two separate queries. One deletes the recurring instance for any and all events in the post meta table. And the second one updates the post_parent in the wp_posts table for all events. I am not sure if this will be useful for others. I used the following plugin to insert the php code as a shortcode. You would copy the entire code into a new php shortcode provided by the plugin. https://wordpress.org/plugins/custom-css-js-php/. Please enter all your wordpress config information which can be found in the config file for the wordpress website. After you add this php code it generates a shortcode. You can add it to a page called break or any page you want to use. Just remember that it needs to have that same page in the custom function listed on step 2.
<?php
$conn = mysqli_connect(“localhost or Server Name”, “DB User”, “DB Password”, “Database Name”);
$eventBreak = “DELETE
FROMEnter Database Name Here.wp_postmeta
WHEREmeta_keyLIKE ‘_eventrecurrence'”;$eventUpdate = “UPDATE
Enter Database Name Here.wp_postsSETpost_parent= ‘0’WHEREpost_typeLIKE ‘tribe_events'”;$deleteResult = mysqli_query($conn , $eventBreak);
$updateResult = mysqli_query($conn , $eventUpdate);echo “All done. Please remember to add your tickets!”;
?>Step 2 – Create a button or custom function to allow easy execution of the queries. I accomplished this using this plugin to write a custom function and create a button.
https://wordpress.org/plugins/my-custom-functions/. This will allow you to add the custom function and button to the top admin bar. I just labeled it accordingly and pointed it to a page that executes the php shortcode and queries./* Adding Button For Breaking Event Series */
function break_event_series($wp_admin_bar){
$args = array(
‘id’ => ‘event-series-break’,
‘title’ => ‘Convert Event Series’,
‘href’ => ‘http://trachmasters.com/break’,
‘meta’ => array(
‘class’ => ‘event-series-break’
)
);
$wp_admin_bar->add_node($args);
}
add_action(‘admin_bar_menu’, ‘break_event_series’, 50);I know this may not solve all of it. But I hope it helps. Please let me know if this seems like something that could help others.
Thanks,
Jon
-
AuthorPosts
