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 change_order_received_title($title,$id=null){ | |
if ( is_wc_endpoint_url( 'order-received' ) ) { | |
$title = 'WooTang Clan Commin atcha!'; | |
} | |
return $title; | |
} | |
add_filter( 'the_title', 'change_order_received_title', 10, 2 ); | |
//more on all the endpoints here | |
//http://wordpress.stackexchange.com/questions/193643/how-to-override-the-title-tag-for-woocommerce-endpoints |
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
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<?php twentyfifteen_post_thumbnail(); ?> | |
<header class="entry-header"> | |
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> | |
</header><!-- .entry-header --> | |
<div class="entry-content"> | |
<?php //the_content(); | |
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 | |
/* takes the user id | |
returns an array of groups the user belongs to*/ | |
function get_user_section_groups($user_id){ | |
global $wpdb; | |
$table = $wpdb->prefix.'postmeta'; | |
$groupsQuery = "SELECT * FROM $table where meta_key = '_bu_section_group_users'"; | |
$groupsResults = $wpdb->get_results($groupsQuery,OBJECT); | |
if($groupsResults){ | |
$memberGroupArray = []; |
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 | |
require_once 'google-api-php-client/autoload.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/ListEntry.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/ListFeed.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/Exception.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/WorksheetFeed.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/Worksheet.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/Util.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/UnauthorizedException.php'; | |
require_once 'php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php'; |
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
{ | |
"events":[ | |
{ | |
"name":"Concert - Eliza Ladd and New College Students: Selfie of the Ancients", | |
"when":"Thu Apr 28 2016 5:00pm to 6:00pm", | |
"where":"Mildred Sainer Pavilion, 5313 Bay Shore Road, Sarasota, FL 34243", | |
"description":"New Music New College presents Chicago\u2019s Third Coast Percussion in a program in advance of their April 30 performance featuring a movement from Augusta Read Thomas\u2019s acclaimed Resounding Earth, composed for bells from around the world; Glenn Kotche\u2019s Wild Sound; and works by Owen Clayton Condon, Thierry De Mey, Isaac Schankler, and Third Coast\u2019s own David Skidmore.", | |
"startTimeStamp":1455411600, | |
"endTimeStamp":1455418800, | |
}, |
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 your theme's function.php | |
add_action( 'add_meta_boxes', 'register_meta_boxes'); | |
function register_meta_boxes($post_type){ | |
add_meta_box( | |
'some_id',//identifyer | |
'Some Title',//title | |
'render_metabox',//callback | |
'post',//screen this will be on |
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(); |
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 | |
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 ) ); |
OlderNewer