This file contains hidden or 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
add_role('school_admin', 'School Administrator', array( | |
'read' => true, | |
'edit_school' => true, | |
'edit_pages' => true, | |
'edit_posts' => true) | |
); |
This file contains hidden or 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 (!class_exists("MZAXMLRPC")){ | |
abstract class MZAXMLRPC { | |
protected $calls = Array(); | |
protected $namespace = "myxmlrpc"; | |
function __construct($namespace){ |
This file contains hidden or 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_action( 'pre_get_posts', 'query_for_recipe_search' ); | |
function query_for_recipe_search( $query ) { | |
if ( is_recipe_search() && is_main_query() ) { | |
$ingredients = isset( $_GET["search_ingredients"] ) ? $_GET["search_ingredients"] : NULL; | |
if ( is_array( $ingredients ) ) { | |
global $wpdb; |
This file contains hidden or 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 | |
public function maybeAddEventTitle( $title, $sep = NULL ) { | |
if ( get_query_var( 'eventDisplay' ) == 'upcoming' ) { | |
$new_title = apply_filters( 'tribe_upcoming_events_title', __( "Upcoming Events", 'tribe-events-calendar' ) . ' ' . $sep . ' ' . $title, $sep ); | |
} elseif ( get_query_var( 'eventDisplay' ) == 'past' ) { | |
$new_title = apply_filters( 'tribe_past_events_title', __( "Past Events", 'tribe-events-calendar' ) . ' ' . $sep . ' ' . $title, $sep ); | |
} elseif ( get_query_var( 'eventDisplay' ) == 'month' ) { | |
if ( get_query_var( 'eventDate' ) ) { | |
$title_date = date_i18n( "F, Y", strtotime( get_query_var( 'eventDate' ) ) ); |
This file contains hidden or 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 | |
/* | |
* Parameters: | |
* $title: the original title (ie: Events for July, 2012) | |
* $separator: I believe it will be always null for this filter | |
* $date: The selected month in string format (ie: July, 2012) | |
*/ | |
function richard_modify_calendar_title( $title, $separator, $date ) { | |
$new_title = 'Here goes your custom title for the date: ' . $date; |
This file contains hidden or 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 my_tribe_meta_event_cats() { | |
$tribe_ecp = TribeEvents::instance(); | |
$terms = get_the_terms( get_the_ID(), $tribe_ecp->get_event_taxonomy() ); | |
if ( $terms ) { | |
$term_names = wp_list_pluck( $terms, 'name' ); | |
$label = "Category"; | |
if ( count( $term_names ) > 1 ) { |
This file contains hidden or 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( 'parse_tribe_event_query', 'hide_my_private_category', 999 ); | |
function hide_my_private_category( $query ) { | |
/* | |
* First we create the tax_query for excluding | |
* all the events that have the term 'hidden'. | |
* Change that 'hidden' for the slug of the term | |
* you want to hide from the Front End. |
This file contains hidden or 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
#if HAVE_STRING_H | |
#include <string.h> | |
#else | |
#include <strings.h> | |
#endif |
This file contains hidden or 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 my_array_compare( $val1, $val2 ) { | |
return ( $val1["parent_entry_id"] == $val2["parent_entry_id"] ); | |
} | |
$first = array( array( "parent_entry_id" => 123 ), array( "parent_entry_id" => 987 ), ); | |
$second = array( array( "parent_entry_id" => 123 ), |
This file contains hidden or 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 | |
$expert_parents = array( array( "parent_entry_id" => "1758" ), array( "parent_entry_id" => "151" ), ); | |
$topic_parents = array( array( "parent_entry_id" => "151" ), | |
array( "parent_entry_id" => "1815" ), | |
array( "parent_entry_id" => "2548" ), | |
array( "parent_entry_id" => "2550" ), ); | |
function find_matches( $val1, $val2 ) { | |
return ( intval( $val1["parent_entry_id"] ) - intval( $val2["parent_entry_id"] ) ); |
OlderNewer