Skip to content

Instantly share code, notes, and snippets.

Stephanie Leary sillybean

Block or report user

Report or block sillybean

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sillybean / wp_private_page_filters.php
Last active Mar 7, 2018
Private page filters for WordPress. Related to ticket #8592.
View wp_private_page_filters.php
Plugin Name: Unpublished Hierarchies
Description: A tiny plugin to allow draft, private, scheduled, and password-protected pages to be selected as parents.
Author: Stephanie Leary
Version: 1.0
Author URI:
License: GPL2
sillybean / bad-slugs.php
Created Sep 1, 2017
prevent users from saving pages with reserved rewrite rules as slugs
View bad-slugs.php
// prevent users from saving pages with reserved rewrite rules as slugs
// includes post types, feeds, and search
function my_reserved_slugs() {
return array(
sillybean / blockquote-cite-tinymce.php
Last active Aug 1, 2017
Blockquote + Cite TinyMCE button PHP
View blockquote-cite-tinymce.php
function scl_pullquote_mce_button() {
// check if WYSIWYG is enabled
if ( 'true' == get_user_option( 'rich_editing' ) ) {
add_filter( 'mce_external_plugins', 'scl_pullquote_add_tinymce_plugin' );
add_filter( 'mce_buttons', 'scl_pullquote_register_mce_button' );
// enforce Dashicon font
echo '<style>
.dashicons-testimonial::before {
sillybean / functions.php
Last active Aug 1, 2017
Change post excerpt meta box title and contents
View functions.php
remove_meta_box( 'postexcerpt', 'post', 'side' );
// use original box:
// add_meta_box('postexcerpt', __( 'Plain Text Summary' ), 'post_excerpt_meta_box', 'post', 'normal', 'high');
// replace box altogether:
add_meta_box( 'postexcerpt', __( 'Plain Text Summary' ), 'custom_post_excerpt_meta_box', 'post', 'normal', 'high' );
function custom_post_excerpt_meta_box( $post ) {
View ao3-tumblr-share.js
(function(){function callback(){(function($){var jQuery=$;
var words = $('dd.words').text();
var length = 'under1';
if ( words > 999 ) {
var kwords = Math.round(words / 1000);
if (kwords >= 100)
length = '100';
sillybean / dashboard-my-sites.php
Created Jan 23, 2017
My Sites Dashboard widget to show all user's sites on network
View dashboard-my-sites.php
function mysites_network_dashboard_widget_setup() {
'My Sites',
sillybean / posts-page-warning.php
Last active Oct 18, 2016
Warn users not to edit the post container
View posts-page-warning.php
// Add to functions.php or place in mu-plugins
// Admin Notice on Posts Page
add_action( 'admin_notices', 'scl_postspage_print_notices' );
function scl_postspage_print_notices() {
$screen = get_current_screen();
if ( $screen->parent_base != 'edit' || $screen->base != 'post' || $_REQUEST['action'] != 'edit' )
View livewhale-calendar-widget.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:
// initialize all custom widgets
sillybean / termlink-filters.php
Last active Oct 17, 2016
add post_type arg to term links (narrow down the query)
View termlink-filters.php
sillybean / dashboard-login-redirect.php
Created Oct 17, 2016
Redirect to top-level dashboard (instead of profile) if not superadmin or not allowed on this blog
View dashboard-login-redirect.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;
You can’t perform that action at this time.