This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin Name: P2 Q&A Comments | |
* Description: Allows you to mark P2 comments as +1/-1 and as answered. Ideal for live Q&A sessions. | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin Name: P2 Privately Published Posts | |
* Description: Allows you to publish private posts to a P2. | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In a theme: | |
add_action( 'after_setup_theme', function() { | |
add_theme_support( 'title-tag', array( 'option' => true ) ); | |
} ); | |
// In core: | |
add_action( 'wp_head', '_wp_render_title_tag' ); | |
function _wp_render_title_tag() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'tweets_init' ); | |
function tweets_init() { | |
register_post_type( 'tweets', array( | |
'public' => true, | |
'labels' => array( | |
'name' => 'Tweets', | |
'singular_name' => 'Tweet', | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Plugin Name: Blocking Attachments from Editing/Deletion | |
/* | |
* The map_meta_cap_ filter runs on a meta capability, such as edit_post and delete_post. | |
* When these caps are caught by WordPress, it converts this to the required caps. For example, | |
* the edit_post meta capability, checked against a published post, requires the edit_published_posts | |
* capability. If the user isn't the same as the author, it also requires the edit_others_posts | |
* capability. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WordCamp Philly 2011 Admin | |
Plugin URI: http://localhost/whitelabel | |
Description: Some swanky stuff to make your admin look GOOD | |
Author: Andrew Norcross | |
Version: 0.1 | |
Requires at least: 3.0 | |
Author URI: http://andrewnorcross.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function() { | |
register_taxonomy( 'some-taxonomy', 'post', array( | |
'show_ui' => true, | |
'rewrite' => false, | |
'public' => true, | |
'labels' => array( | |
'name' => 'Some Taxonomy', | |
'singular_name' => 'Some Taxonomy', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path_to_file = '...'; | |
$file = explode( "\n", file_get_contents( $path_to_file ) ); | |
// Finds local variables that are undeclared. | |
// | |
// Doesn't understand foreach() variables, dockblocks, sprintf arguments, | |
// variables returned by reference from a function like preg_match() or parse_str(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function svn() { | |
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then | |
svn stat --ignore-externals | grep '^[^?X]' | |
echo "" | |
echo $3 | |
echo "" | |
echo "Unbounded commit... What are you doing, man?" | |
else | |
/usr/bin/svn "$@" |
OlderNewer