Skip to content

Instantly share code, notes, and snippets.

View danielbachhuber's full-sized avatar

Daniel Bachhuber danielbachhuber

View GitHub Profile
@danielbachhuber
danielbachhuber / p2-resolved-posts.php
Created November 10, 2011 01:03 — forked from nacin/p2-resolved-posts.php
P2 Resolved Posts
<?php
/* Plugin Name: P2 Resolved Posts
* Description: Allows you to mark P2 posts for resolution.
* Author: Andrew Nacin
* Author URI: http://andrewnacin.com/
*/
/* WARNING about studying and copying this code:
*
* P2 is not currently an ideal platform for developing extensions. Some of this
@danielbachhuber
danielbachhuber / acm-dfp-setup.ml
Created February 9, 2012 19:40
ACM readme rough draft
=== Ad Code Manager ===
Contributors: danielbachhuber, rinatkhaziev, automattic
Tags: advertising, ad codes
Requires at least: 3.1
Tested up to: 3.3.1
Stable tag: 0.1
Manage your ad codes through the WordPress admin in a safe and easy way.
== Description ==
<?php
//Quick and dirty for the sake of initial testing
require_once('wp-load.php');
function create_coauthors_from_users() {
global $wpdb;
global $coauthors_plus;
@danielbachhuber
danielbachhuber / guest_authors_extend
Created June 7, 2012 13:17 — forked from jp1971/guest_authors_extend
Extending guest author profiles
//From functions_thought_catalog.php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Let's add a meta box for author links to the guest authors profile pages
*
*/
add_action( 'add_meta_boxes', 'coauthors_add_on_the_web_box' );
function coauthors_add_on_the_web_box() {
add_meta_box(
<?php
add_action( 'admin_init', 'x_allow_ids_on_tags' );
function x_allow_ids_on_tags() {
global $allowedposttags;
$tags = array( 'div' );
$new_attributes = array( 'contenteditable' => array() );
foreach ( $tags as $tag ) {
if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) )