Skip to content

Instantly share code, notes, and snippets.

View stephanieleary's full-sized avatar

Stephanie Leary stephanieleary

View GitHub Profile
@stephanieleary
stephanieleary / wp_private_page_filters.php
Last active March 7, 2018 12:41
Private page filters for WordPress. Related to ticket #8592.
<?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
*/
@stephanieleary
stephanieleary / shortlink-all-the-things.php
Created November 5, 2012 22:35
Shortlink All the Things
@stephanieleary
stephanieleary / add-plugins-link.php
Created November 2, 2012 15:50
Adds plugin and theme links to the Network Admin section of the admin menu bar
@stephanieleary
stephanieleary / buddypress-spam-link.php
Created October 2, 2012 01:50
BuddyPress Spam Link plugin. Adds the "Mark as spammer" link back to the admin bar and adds a "Spammer" button to the activity stream entry meta row.
@stephanieleary
stephanieleary / tagged-galleries.php
Created August 1, 2012 21:31
Multiple WordPress galleries per page using attachment tags
<?php
/*
Plugin Name: Tagged Galleries
Description: Lets you add multiple [gallery] tags in a single WordPress page. Specify the images to be included in each gallery using tags: [gallery tag="foo"] (assuming you have tagged the images).
Version: 1.0
Author: Stephanie Leary
Author URI: http://sillybean.net/
*/
add_action('admin_init', 'register_attachment_tags');
@stephanieleary
stephanieleary / comment-quicktags-p2mod
Created June 28, 2012 19:20
Basic Comment Quicktags mod for P2
// quicktags.js
quicktags({
id: "comment",
buttons: "link,em,strong"
});
quicktags({
id: "posttext",
buttons: "link,em,strong"
});
@stephanieleary
stephanieleary / gist:2965797
Created June 21, 2012 13:44
Hide a custom taxonomy's input box while leaving the other admin UI alone
function remove_my_taxonomy_boxes()
{
$tax_name = 'my_taxonomy';
$content_type = 'post';
// presumably there is some condition you want to check, like current_user_can('something')
$remove = true;
if ($remove)
remove_meta_box( $tax_name.'div', $content_type, 'side' );
}
@stephanieleary
stephanieleary / proxy.php
Created June 19, 2012 14:47
Bad bad bad theme
<?php
header('Content-Type: text/xml');
$url = $_GET['url'];
$data = file_get_contents($url);
echo $data;
?>
@stephanieleary
stephanieleary / 404.php
Created May 18, 2012 04:06
Better 404 Error Page
<?php get_header(); ?>
<div id="content" class="section">
<h2>I'm sorry. I couldn't find the page you requested.</h2>
<p>You can try searching for it or looking for it in the <a href="/sitemap">site map</a>.</p>
<?php get_template_part( 'searchform' ); ?>
<?php
@stephanieleary
stephanieleary / remove-dashboard-widgets.php
Created May 18, 2012 01:56
Remove Dashboard Widgets
function remove_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
// unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); // WordPress Blog
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); // Other WordPress News