Skip to content

Instantly share code, notes, and snippets.

View shortlink-all-the-things.php
@sillybean
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
<?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: http://stephanieleary.com
License: GPL2
*/
View gist:7735574
#post-1110 .wp-caption.alignleft { margin-right: 68px; }
#post-1110 .wp-caption.alignleft:nth-child(3n) { margin-right: 0; }
@sillybean
sillybean / gist:8718496
Last active Aug 29, 2015
Achievements 2.4 plugin for LetterMo
View gist:8718496
<?
/*
Plugin Name: LetterMo Post Types
Plugin URI: http://stephanieleary.com/
Version: 1.5
Author: Stephanie Leary
Author URI: http://stephanieleary.com/
Description: Setting up the post types and achievements for Month of Letters.
License: GPL2
*/
@sillybean
sillybean / gist:8718584
Last active Aug 29, 2015
Achievements 3.5 plugin for LetterMo
View gist:8718584
<?php
/*
Plugin Name: LetterMo Post Types
Plugin URI: http://stephanieleary.com/
Version: 1.6
Author: Stephanie Leary
Author URI: http://stephanieleary.com/
Description: Setting up the post types and achievements for Month of Letters.
License: GPL2
*/
@sillybean
sillybean / showmimes.php
Last active Aug 29, 2015
Add filters for PDF, Word, and Excel files in the media library
View showmimes.php
<?php
/*
Plugin Name: Show MIMEs
Description: A tiny plugin to add more file type filters in the media library screens.
Author: Stephanie Leary
Version: 1.1
Author URI: http://sillybean.net/
*/
@sillybean
sillybean / category.php
Last active Aug 29, 2015
category.php or taxonomy.php for deep hierarchies
View category.php
<?php get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
<?php the_archive_description( '<div class="term-description">', '</div>' ); ?>
<?php
// Find out if this term has child terms
$object = get_queried_object();
$termchildren = get_term_children( $object->term_id, $object->taxonomy );
View ao3-share-bookmarklet.js
var words = $('dd.words').text();
var length = 'under1';
if ( words > 999 ) {
var kwords = Math.round(words / 1000);
if (kwords >= 100)
length = '100';
else if (kwords >= 50)
length = '50to100';
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';
View sf-pro-filters.php
<?php
// * Search & Filter Pro filters
// Limit taxonomy term dropdowns to terms associated with the form's specified post type(s)
// cf https://gist.github.com/rmorse/7b59b45a14b1ca179868#file-sf-pro-filter-input-object-php
function example_filter_input_object( $input_object, $sfid ) {
if ( ( !in_array( $input_object['name'], array( '_sft_one', '_sft_two', '_sft_three' ) ) ) )
return $input_object;
// make sure the options variable actually exists (it's only available to certain field types)
You can’t perform that action at this time.