Skip to content

Instantly share code, notes, and snippets.

Clifford cliffordp

  • Oklahoma
Block or report user

Report or block cliffordp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cliffordp
cliffordp / functions.php
Last active Apr 14, 2019
WP All Import - set uploads folder to the Import ID
View functions.php
<?php
/**
* WP All Import: Upload media to a directory named after the Import ID.
*
* @link https://gist.github.com/cliffordp/fc0fa5686d6a127246224f1565b60128 This snippet.
* @link https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/wp_all_import_images_uploads_dir.php
*
* @see PMXI_Import_Record::process()
* @see wp_upload_dir()
*
@cliffordp
cliffordp / functions.php
Last active Jan 10, 2019
The Events Calendar: Display WordPress custom fields in the Item Details part of the List Venues Organizers Shortcode extension.
View functions.php
<?php
/**
* The Events Calendar: Display WordPress custom fields in the Item Details part of the
* List Venues Organizers Shortcode extension.
*
* Excludes hidden fields (beginning with `_`) and Elegant Theme's hidden fields (beginning with `et_`).
* Authored by Richard of memberwise.org.uk and Clifford (Tribe Support).
*
* @link https://gist.github.com/cliffordp/a6cff51ed56276641c4d4ea0a82b25b9 This snippet.
* @link https://theeventscalendar.com/extensions/list-venues-and-organizers-shortcodes/ Extends this extension.
@cliffordp
cliffordp / functions.php
Last active Jan 10, 2019
The Events Calendar: Remove the month, day, and datetime separator from an event's start time display.
View functions.php
<?php
/**
* The Events Calendar: Remove the month, day, and datetime separator from an event's start time display.
*
* Example:
* Before: <span class="tribe-event-date-start">January 31 @ 10:30 pm</span> - <span ...
* After: <span class="tribe-event-date-start">10:30 pm</span> - <span ...
* DOES NOT APPLY WHEN USING WordPress 5's BLOCK EDITOR. For block editor, just use this CSS:
* .tribe-events-schedule__datetime > .tribe-events-schedule__date--start,
* .tribe-events-schedule__datetime > .tribe-events-schedule__separator--date {
@cliffordp
cliffordp / functions.php
Last active Jan 8, 2019
Divi: Disable Open Sans Google Font.
View functions.php
<?php
/**
* Divi: Disable Open Sans Google Font.
*
* @link https://gist.github.com/cliffordp/6c4bad206828ce559cdee290bfcec020 This snippet.
* @link https://designsbytierney.com/2017/06/optimize-google-font-delivery-wordpress-divi-theme/ Related advice for Elegant Themes users.
*/
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'divi-fonts' );
}, 20 );
@cliffordp
cliffordp / functions.php
Last active Jan 6, 2019
Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
View functions.php
<?php
/**
* Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
*
* @link https://gist.github.com/cliffordp/e6dfd8c9533ae4b31d4c3b8ffb6dce8d This snippet.
*/
add_action( 'wp_footer', function () {
if ( ! class_exists( 'ET_Builder_Module_Filterable_Portfolio' ) ) {
return;
@cliffordp
cliffordp / functions.php
Created Dec 28, 2018
The Events Calendar: Remove the `tribe-event-featured` class from Mini Calendar widgets.
View functions.php
<?php
/**
* The Events Calendar: Remove the `tribe-event-featured` class from Mini Calendar widgets.
*
* @link https://gist.github.com/cliffordp/822336f011df7d8106a1e13f6f7d7226 This snippet.
*/
function cliff_tribe_remove_featured_class_from_mini_widget() {
wp_enqueue_script( 'jquery' );
?>
<script>
@cliffordp
cliffordp / functions.php
Last active Dec 16, 2018
Event Tickets: Set the maximum quantity allowed per ticket.
View functions.php
<?php
/**
* Event Tickets: Set the maximum quantity allowed per ticket.
*
* !!! Change the maximum to your own !!! Needs to be higher than priority 10 because of
* Tribe__Tickets_Plus__Commerce__WooCommerce__Main::filter_ticket_max_purchase()
* Does not work for unlimited stock WooCommerce Tickets until https://central.tri.be/issues/119822 is fixed.
*
* @param int $available Max Purchase number
@cliffordp
cliffordp / functions.php
Created Dec 3, 2018
The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
View functions.php
<?php
/**
* The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
*
* !!! Change the prefix to your own !!!
*
* @link https://gist.github.com/cliffordp/ac4a68769787352369ab0c5e41dc28ab This snippet.
*/
function cliff_prefix_venue_slugs( $data ) {
// TODO: Change this to what you want!!!
@cliffordp
cliffordp / functions.php
Last active Nov 21, 2018
Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)" option only on certain page/post IDs.
View functions.php
<?php
/**
* Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)"
* option only on certain page/post IDs.
*
* Useful if you are embedding a List View within a specific page, such as via shortcode or widget, and you want to hide
* the recurrences ONLY in this context.
* !!! CHANGE TO YOUR OWN POST IDs WITHIN THIS SNIPPET'S CODE !!!
*
* @link https://gist.github.com/cliffordp/69d00ce54929393410e27a319762d241 This snippet.
@cliffordp
cliffordp / style.css
Last active Nov 19, 2018
TEC Month View: blackout all July Fourths, since the library is closed. Screenshot: https://cl.ly/ad0626fcb03e
View style.css
/**
* TEC Month View: blackout all July Fourths, since the library is closed.
* Screenshot: https://cl.ly/ad0626fcb03e
* From: https://gist.github.com/cliffordp/90757a9fccc5b19431be12fa49839b49
*/
#tribe-events .tribe-events-month td[data-day$="07-04"],
#tribe-events .tribe-events-month td[data-day$="07-04"]:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] a,
#tribe-events .tribe-events-month td[data-day$="07-04"] a:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] h3,
You can’t perform that action at this time.