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 | |
/** | |
* Bail out if running an autosave, ajax or a cron | |
* or user does not have proper capabilities | |
* | |
* @return bool|int True if should bail, post ID if lacking cap | |
*/ | |
function wps_bail( $post_id = '', $cap = 'edit_post' ) { | |
/** Bail out if running an autosave */ |
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 | |
/* | |
* Truncates (trims) the Event Website URL label when its too lengthy | |
*/ | |
function tribe_event_website_truncator ( $label ) { | |
// Change this to adjust when the truncator starts trimming characters | |
$max_length = 25; | |
if( strlen($label) > $max_length ) { |
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 | |
/* | |
* This adds a fancy one-click scan QR link tie-in to the native zxing Barcode scanner app | |
* Android: https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en | |
* iOS: https://itunes.apple.com/us/app/barcodes-scanner/id417257150?mt=8 | |
*/ | |
function tribe_qr_scan_link_notice () { | |
if ( isset($_GET['page']) && $_GET['page'] === 'tickets-attendees' ) { | |
$qr_url = urlencode( site_url().'?event_qr_code={CODE}' ); |
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 | |
add_filter( 'pl_opt-textbox_title', 'hack_title' ); | |
function hack_title( $opt ) { | |
global $post; | |
if( 4125 == $post->ID ) | |
return 'Hello World!'; | |
else | |
return $opt; | |
} |
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
-- Delete expired events. | |
-- | |
-- Use at own risk and consider running on a test set of data first of all! | |
-- As is, should remove all events that have expired by more than one week, | |
-- with the exception of parent events for recurring events which will be | |
-- left in place. | |
-- | |
-- Assumes a standard table prefix of "wp_" - adjust as required to match | |
-- your installation. | |
DELETE FROM wp_posts |
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
/** | |
* | |
* Paste image class / identifier in IIFE parenthesis at end of function | |
* | |
* */ | |
(function(i){"use strict";var img=$(i),sizes=[];window.addEventListener("resize",()=>{var vw=Math.round(((img.offsetWidth*100)/window.innerWidth))+"vw",mq="(min-width: "+window.innerWidth+"px)",value=vw;vw!=="0vw"&&sizes.indexOf(vw)===-1&&(sizes.push(value),console.log(mq,vw))})})("PASTE CLASS OR IDENTIFIER HERE"); |
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 | |
/* | |
* Entfernt das Gravatar aus der Toolbar. | |
* @link: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch | |
*/ | |
/* < PHP 5.3 */ | |
function ds_add_hide_avatar_filter() { | |
add_filter( 'pre_option_show_avatars', '__return_zero' ); | |
} |
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 | |
class Section_Overide { | |
function __construct() { | |
add_filter( 'pagelines_render_section', array( $this, 'section_overide' ), 10, 2 ); | |
} | |
function section_overide( $s, $class ) { | |
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 | |
wp_oembed_add_provider( 'http://*.houzz.com/*', 'http://www.houzz.com/oembed' ); | |
function do_houzz_shortcode($atts, $content=null) { | |
$url = substr( $atts[0], 1 ); | |
$args = array(); | |
if ( isset( $atts['w'] ) && is_numeric( $atts['w'] ) ) { | |
$args['width'] = $atts['w']; | |
} |