Skip to content

Instantly share code, notes, and snippets.

@danielbachhuber
danielbachhuber / gist:9508957
Created March 12, 2014 15:13
Helpful P2 comment settings
<?php
/**
* Permit anyone to post HTML in the comments
* Because ThunderP2 is only accessible by qualified users,
* this is just fine.
*/
add_action( 'init', function() {
remove_filter( 'pre_comment_content', 'wp_filter_kses' );
add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
@franz-josef-kaiser
franz-josef-kaiser / upgdate.php
Created March 15, 2011 19:25
Update/Upgrade class for WordPress plugins in repos outside wp.org (Original Class: March 8, 2011 by Ronald Huereca)
<?php
//Plugin Upgrade Class
if ( !class_exists( 'PluginUpgrade' ) )
{
class PluginUpgrade
{
private $plugin_url = false;
private $remote_url = false;
@markjaquith
markjaquith / moderation-buddy.php
Created January 17, 2012 10:12
Moderation Buddy
<?php
/*
Plugin Name: Moderation Buddy
Description: A friendly assistent to make sure you don't get behind on your comment moderation tasks.
Version: 0.1
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
class CWS_Moderation_Buddy_Plugin {
@GaryJones
GaryJones / functions.php
Created February 7, 2012 01:36
Add pinterest link after each post, only on singles.
<?php
add_action( 'genesis_post_content', 'child_add_pinterest_link', 15 );
/**
* Add pinterest link after post.
*
* Conditionally limited to single post. Remove the first conditional
* to make it show up on archive pages too.
*
* @since 1.0.0
@GaryJones
GaryJones / functions.php
Created February 12, 2012 04:01 — forked from billerickson/functions.php
Genesis Grid Loop Advanced
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
@benhuson
benhuson / Post_Taxonomy_Columns_And_Filter
Created February 17, 2012 11:21
Framework for adding taxonomy filter and column to WordPress manage post admin pages.
<?php
class Post_Taxonomy_Columns_And_Filter {
/**
* Constructor
*/
function Post_Taxonomy_Columns_And_Filter() {
add_filter( 'manage_edit-mycustomposttype_columns', array( $this, 'manage_mycustomposttype_columns' ) );
add_action( 'manage_mycustomposttype_posts_custom_column', array( $this, 'show_mycustomposttype_columns' ) );
@GaryJones
GaryJones / functions.php
Created March 1, 2012 14:56
Fix category query tweak + sticky posts + is_home issue.
<?php
add_filter( 'posts_results','child_query_is_home' );
/**
* Fixes an issue where a query that targets a taxonomy stops sticky posts from working
* on is_home.
*
* The code suggests that sticky posts should only be on the blog archive (is_home) page.
* However, if that query is amended with an inclusive cat, tag or tax restriction, then
* WP doesn't count the query as being the blog archive page anymore.
@billerickson
billerickson / functions.php
Created April 11, 2012 17:36
oEmbed Transparency
<?php
/**
* oEmbed Transparency
*
* Used so that menus can appear on top of videos
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/oembed-transparency
*
<?php
/**
* Blog Archive
*
* @package BE_Genesis_Child
* @since 1.0.0
* @link https://github.com/billerickson/BE-Genesis-Child
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@paulgibbs
paulgibbs / gist:3104460
Created July 13, 2012 11:40
Show page comments in BuddyPress' activity stream
<?php
/*
Plugin Name: Plugin Name
Plugin URI: http://example.com/
Description: Description
Version: 0.1
Author: Your Name
Author URI: http://example.com/
*/