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 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 Jun 3, 2019
Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
View functions.php
<?php
/**
* Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
*
* By Matt B and Cliff P
*
* From https://gist.github.com/cliffordp/66bf05df61ee269c60ff20d6f39e2cab
*/
function cliff_etplus_woo_cart_quantity_readonly() {
@cliffordp
cliffordp / functions.php
Last active May 1, 2019
For https://theeventscalendar.com/support/forums/topic/number-of-tickets-available/ The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining quantity unless it is less than 4 (to create a sense of urgency) NOTE: Would need .each loop logic to work properly for more than just the first WooCommerce ticket if more than 1 WooCommerce t…
View functions.php
<?php
/**
* The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining
* quantity unless it is less than 4 (to create a sense of urgency).
*
* NOTE: We would need .each loop logic to work properly for more than just the
* first WooCommerce ticket if more than 1 WooCommerce ticket is available
* per event!
*
* If you want to ALWAYS hide (no sense of urgency logic), do not use this
@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 Apr 13, 2019
Shortcode to display render Tribe Bar anywhere on site (e.g. website header) * Notes: It's not pretty or perfect, but it's a start if you want to pull something like this off on your site. FYI: You're in unsupported / custom coding territory. * Example: [tribe_bar_anywhere] * Screenshot: https://cl.ly/3h1S3d3a3T30
View functions.php
<?php
/*
* By Barry and Cliff
* From https://gist.github.com/cliffordp/04b7bbe6e7d9009aec12acc0b9bd5bdd
*
* Shortcode to display render Tribe Bar anywhere on site (e.g. website header)
* For https://theeventscalendar.com/support/forums/topic/insert-search-bar-on-top-of-a-page/ which also links to http://gregorypearcey.com/blog/add-tribe-events-search-bar-home-page/
*
* Notes: It's not pretty or perfect, but it's a start if you want to pull something like this off on your site. FYI: You're in unsupported / custom coding territory.
@cliffordp
cliffordp / functions.php
Last active Apr 8, 2019
Set default quantity of 1 and READONLY for all tickets: Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
View functions.php
<?php
/**
* Set default quantity of 1 and READONLY for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf
*
* Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
@cliffordp
cliffordp / wp-auto-login-single-user.php
Created Jun 24, 2014
Automatically login a single WordPress user upon arrival to a specific page. Redirect to home page once logged in. Prevent viewing the login page. Tested with WP 3.9.1. Used in functions.php
View wp-auto-login-single-user.php
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page
@cliffordp
cliffordp / functions.php
Last active Mar 22, 2019
Open Event Website, Organizer, and Venue links in new window
View functions.php
<?php
/**
* The Events Calendar: Open event website, organizer, and venue links in new window.
*
* Filters are found in these files:
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/link.php
* /wp-content/plugins/events-calendar-pro/src/functions/template-tags/general.php
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/organizer.php
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/venue.php
*
@cliffordp
cliffordp / functions.php
Last active Mar 12, 2019
The Events Calendar - Redirect single event view page to its Event Website
View functions.php
<?php
/**
* The Events Calendar - Redirect single event view page to its Event Website
*
* The regular single event view page will be loaded if the event does not have a valid Event Website URL.
*
* From https://gist.github.com/cliffordp/2e5c53412171363b66864087b6a75bad
*
* For https://theeventscalendar.com/support/forums/topic/recurring-event-custom-event-link-behind-events-calendar/
*/
@cliffordp
cliffordp / functions.php
Last active Feb 26, 2019
WooCommerce: Remove unnecessary billing fields from Checkout page.
View functions.php
<?php
/**
* WooCommerce: Remove unnecessary billing fields from Checkout page.
*
* Billing fields will display if cart total is greater than zero at time of
* loading the Checkout page. If coupon is added to bring total down to zero,
* billing fields will remain displayed unless page is also refreshed by user.
*
* Billing fields will always display if the order needs shipping information
You can’t perform that action at this time.