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 | |
/** | |
* Given an array of members looks for $width_param and tries to figure out the columns widths for all members | |
* will return equal parts if all members do not have $width_param set | |
* will fill in the blank if one is set and another is not | |
* returns false if $members is not an array or is empty | |
* | |
* @param [array] $members | |
* @param [string] $breakpoint | |
* @param [string] $width_param |
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 | |
/** | |
* If this file is called directly, abort. | |
*/ | |
if ( !defined( 'ABSPATH' ) ) { | |
die( 'Direct access is forbidden.' ); | |
} | |
class SearchIQ{ |
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 | |
function filter_send_tickets($send){ | |
$dont_send_tickets = ["70"]; //the event IDs that you don't want to send tickets for | |
global $post; | |
$order = wc_get_order( $post->ID ); | |
$items = $order->get_items(); | |
$wootix = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
$events = []; | |
foreach( $items as $item ){ | |
$event = $wootix->get_event_for_ticket( $item->get_product_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 | |
//add this to wootickets/tickets.php | |
//add after the big foreach ( $tickets as $ticket ) | |
//requires ACF to set a custom field that pulls the product you want to add with a post object field | |
//requires WooComerce Name Your Price plugin | |
if( 0 < count( get_field( 'add_products_to_tickets' ) ) ): | |
foreach( get_field( 'add_products_to_tickets' ) as $extra_product ): | |
$product = wc_get_product( $extra_product ); | |
if( class_exists('WC_Name_Your_Price')){ |
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
/* | |
*create a new ease Easing ease | |
*instasiate the new ease ease = new Ease(start, end, steps, type) | |
*get the value from in draw from ease.step(); | |
* | |
*ease types are in the switch case starting on line 29 | |
*/ | |
class Easing { |
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 | |
$search = new WP_Query( array( | |
's' => $qv, | |
'posts_per_page' => 30, | |
'paged' => $paged, | |
'post_status' => array( 'publish', 'future' ) | |
)); | |
$search->query_vars['searchblogs'] = '1,8,9,16,18'; | |
relevanssi_do_query($search); |
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 wp_native_inline_diffing{ | |
public function diffcheck($oldValue, $newValue){ | |
if ( ! class_exists( 'WP_Text_Diff_Renderer_inline', false ) ) | |
require( ABSPATH . WPINC . '/wp-diff.php' ); | |
$renderer = new WP_Text_Diff_Renderer_inline(); | |
$old_lines = explode( "\n", $oldValue ); | |
$new_lines = explode( "\n", $newValue ); | |
$text_diff = new Text_Diff( 'auto', array( $old_lines, $new_lines ) ); |
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 | |
$moreargs = ['one','two'] | |
add_filter('filtername',function($args) use($moreargs){ | |
//do stuff with more args | |
}) |
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 | |
/* | |
*a wordpress funtion for dumping in a <pre> and dying | |
* | |
*param any $thing the thing you want to var_dump | |
*param bool $die = should we wp_die or just echo | |
*/ | |
function wp_predump($thing,$die=true){ | |
$output = '<pre>'; | |
ob_start(); |
NewerOlder