This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Events Calendar: Include Legacy (v1) List View at the end of each post's output unless it's a TEC post or archive. | |
* | |
* Tested working with TEC v5.1.1. | |
* | |
* @link https://gist.github.com/cliffordp/98d438e52a1a95a9fea3e862c426b399 This snippet. | |
* | |
* @see \tribe_include_view_list() The same function used by Organizer and Venue archives in Events Calendar Pro (v1 views). | |
* | |
* @param string $content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Events Calendar: v2 Views: Include the next 3 upcoming events after each post unless it's a TEC post or archive. | |
* | |
* Tested working with TEC v5.1.1. | |
* Outputs a portion of v2's List View's HTML rendering without full styles/scripts. | |
* But this isn't the best way to use v2's views. For a lot of scenarios, it's better to just create your own new view. | |
* | |
* @link https://gist.github.com/cliffordp/9994cf05f6475922f451eaeacef2cd3c This snippet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* GeneratePress: Remove all Google Fonts loading and options. | |
* | |
* @link https://gist.github.com/cliffordp/640ff4586c9a7c9ffe6656ff65326a5e This snippet. | |
* @link https://share.getcloudapp.com/NQuDXKJm 1min demo that this code works. | |
* @link https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/?aid=5336&affiliate_key=Lsvk04DjJOhq I'm using Toolset to add custom snippets. | |
*/ | |
toolset_snippet_security_check() or die( 'Direct access is not allowed' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Insert the Bill's Date as the Bill Number, since we usually don't care what the Bill Number is but Zoho Books needs it, yet when a bill is created via recurring profile, it doesn't generate one. | |
* | |
* If it's already set, it won't be modified. | |
* Example result if Bill Date is December 10, 2019 (DueDate is disregarded): "Auto: 2019-12-10" | |
* | |
* Created 2019-12-10. Confirmed still working 2020-04-30. | |
* Will NOT work on VOID bills. | |
* WARNING: The user that CREATES the custom button is the only user that can EDIT the custom button. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Events Calendar: Change the Event Website plain text link to a button, including shortening the anchor text to | |
* avoid a really long button. | |
* | |
* @link https://gist.github.com/cliffordp/e19775ce3eb7a66fb72ba38a24959546 This snippet. | |
* @link https://theeventscalendar.com/knowledgebase/k/make-the-event-website-url-a-linked-word-or-button/ KB article with this and other snippets. | |
* Screenshots with Twenty Twenty theme: | |
* @link https://share.getcloudapp.com/X6uz7NNZ without this snippet (before). | |
* @link https://share.getcloudapp.com/geu2PzzE with this snippet (after). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Community Events: Disable the "Venue Details" linked post type box from the "Add New Event" and "Edit Event" forms. | |
* | |
* @link https://gist.github.com/cliffordp/2b9369b9c2911fcef05ad10620d954e7 This snippet. | |
* | |
* @param array $templates | |
* @param string $slug | |
* | |
* @return array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Event Tickets (v4.11.5+): Override the maximum quantity allowed to be purchased in a single Add To Cart action. | |
* | |
* @link https://gist.github.com/cliffordp/d5254fa306fa0c4ec1a27e73a083755e This snippet. | |
* @link https://theeventscalendar.com/knowledgebase/k/settings-overview-event-tickets-and-event-tickets-plus/#Ticket_settings Help article. | |
* | |
* @param Tribe__Tickets__Ticket_Object $ticket Ticket object. | |
* @param WP_Post $event Event post. | |
* @param int $ticket_id Raw ticket ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Events Calendar (TEC) and Event Tickets (ET): Get the total number of unique events for which a user has | |
* obtained tickets (of any kind, including RSVP) within the specified Event Category. | |
* | |
* Could be turned into a shortcode. Could be used in a way to output a friendly message like, | |
* "Thanks for attending *14* events in the *Sports* category." | |
* This function currently gives you the *14* part of this message but could easily be extended. | |
* | |
* @link https://gist.github.com/cliffordp/ddb9e11015c193afd1eea78a54afdf79 This snippet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Events Calendar Pro: Photo View (v2 views): Insert venue details below event title. | |
* | |
* @link https://gist.github.com/cliffordp/d442b6ef4b1ba5530d4c30dea0314b40 This snippet. | |
* @link https://share.getcloudapp.com/9ZuAAEyB Screenshot. | |
* @link https://theeventscalendar.com/knowledgebase/k/using-template-filters-and-actions/ Helpful reference. | |
*/ | |
function cliff_photo_view_insert_venue_details() { | |
$address = tribe_get_venue_single_line_address( get_the_ID() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Quick hack to preview WooCommerce e-mails. | |
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136 | |
* | |
* Add this to <yourtheme>/functions.php and then visit a url like: | |
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail | |
* | |
* @return null | |
*/ |