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 | |
// prevent users from saving pages with reserved rewrite rules as slugs | |
// includes post types, feeds, and search | |
function my_reserved_slugs() { | |
return array( | |
'post', | |
'attachment', | |
'category', |
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 mysites_network_dashboard_widget_setup() { | |
add_meta_box( | |
'dashboard_mysites_widget', | |
'My Sites', | |
'dashboard_mysites_widget', | |
'dashboard', | |
'side', | |
'high' |
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 | |
/* | |
Plugin Name: LiveWhale Calendar Widget (TAMU) | |
Description: WordPress widget to display events from a LiveWhale calendar feed. | |
Author: Stephanie Leary | |
Version: 1.0 | |
Author URI: http://stephanieleary.com | |
*/ | |
// initialize all custom widgets |
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 | |
// output function extracted from a custom term list widget | |
function scl_list_terms( $taxonomy ) { | |
$labels = get_taxonomy_labels( $taxonomy ); | |
$tax_args = array( | |
'taxonomy' => $taxonomy, | |
'title_li' => '', |
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( 'login_redirect', 'scl_network_dashboard_login_redirect', 100, 3 ); | |
function scl_network_dashboard_login_redirect( $redirect_to, $request_redirect_to, $user ) { | |
if ( !is_user_member_of_blog() || ( is_main_site() && !is_super_admin() ) ) | |
return network_admin_url(); | |
return $redirect_to; | |
} |
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( 'genesis_loop', 'scl_people_types_loop', 10 ); | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
function scl_people_types_loop( $parent = 0 ) { | |
$terms = get_terms( array( | |
'taxonomy' => 'people_type', | |
'hide_empty' => true, | |
'parent' => $parent, | |
) ); |
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 | |
// Display titles of all terms in combined term archive breadcrumbs (tag1+tag2 or tag1,tag2) | |
function scl_multiple_tax_breadcrumbs( $crumbs, $args ) { | |
if ( !is_tax() ) | |
return $crumbs; | |
$taxonomy = get_query_var( 'taxonomy' ); | |
$topics = get_query_var( $taxonomy ); | |
if ( empty( $topics ) ) |
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 | |
// Have to unhook the original function early | |
add_action( 'init', 'scl_fix_taxonomy_archive_titles' ); | |
function scl_fix_taxonomy_archive_titles() { | |
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); | |
add_action( 'genesis_before_loop', 'scl_do_taxonomy_title_description', 14 ); | |
} |
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 | |
// replace the usual post listing with directory table | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'scl_course_table_loop', 10 ); | |
function scl_course_table_loop() { | |
if ( have_posts() ) : |
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( 'genesis_meta', 'scl_taxonomy_loop_switch' ); | |
function scl_taxonomy_loop_switch() { | |
if ( function_exists( 'scl_find_post_type' ) ) | |
$type = tees_find_post_type(); | |
else | |
$type = get_query_var( 'post_type' ); | |