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 Jun 28, 2019
The Events Calendar and related plugins: Add your own location for template file loading.
View functions.php
<?php
/**
* The Events Calendar and related plugins: Add your own location for template file loading.
*
* Example "Single Event within List View" for Avada theme (which has theme overrides).
* Now tries to load in this order:
* This plugin: /app/public/wp-content/plugins/my-plugin/tribe-events/list/single-event.php
* Theme root so it stays even if switch themes: /app/public/wp-content/themes/tribe-events/list/single-event.php
* Child theme with theme overrides: /app/public/wp-content/themes/Avada-Child-Theme/tribe-events/list/single-event.php
@cliffordp
cliffordp / functions.php
Last active Jun 21, 2019
Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
View functions.php
<?php
/**
* Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
*
* Irrelevant if default post status in CE settings is Published or Anonymous Submissions are not allowed.
*
* @link https://support.theeventscalendar.com/420384-Auto-publish-events-submitted-by-logged-in-users Relevant help article.
* @link https://gist.github.com/cliffordp/9b4dff692829ce5d9ddd46d849689dbb This snippet.
*
* @param mixed $option The option value.
@cliffordp
cliffordp / functions.php
Last active Jun 5, 2019
Get your WordPress.org favorite plugins
View functions.php
<?php
/**
* Get your WordPress.org favorite plugins.
*
* Set a breakpoint or var_dump() within plugins_api() at `if ( is_wp_error( $request ) ) {` to see the URL. Example:
* https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[user]=cliffpaulick&request[per_page]=250&request[fields][description]=0&request[fields][tested]=0&request[fields][requires]=0&request[fields][rating]=0&request[fields][ratings]=0&request[fields][downloaded]=0&request[fields][downloadlink]=0&request[fields][added]=0&request[fields][donate_link]=0&request[fields][icons]=0&request[locale]=en_US&request[wp_version]=5.2
*
* @link https://developer.wordpress.org/reference/functions/plugins_api/
*
* @see \plugins_api()
@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 Jul 11, 2019
Event Tickets: Set the maximum quantity allowed per ticket.
View functions.php
<?php
/**
* Event Tickets Plus (ET+): Limit to purchasing 4 WooCommerce tickets at a time for a specific event and/or ticket.
*
* !!! Change the maximum and Event ID to your own values!!!
* Requires ET+ version 4.10.7 or later to also work for tickets with an unlimited stock/quantity (value of "-1").
*
* @link https://gist.github.com/cliffordp/61cd8374a80d1b2bc76a6650e9304a63 This snippet.
*
You can’t perform that action at this time.