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 | |
/* | |
Handles URL Rewriting in WordPress 3.0 like this: | |
fastigheter-spanien/X -> property/X&lang=sv | |
fastigheter-usa/X -> property/X&lang=sv | |
properties-spain/X -> property/X&lang=en | |
properties-usa/X -> property/X&lang=en |
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 | |
/** | |
* Does the grunt work | |
*/ | |
function bbg_test_groupblog_idea2() { | |
global $wpdb, $bp, $current_blog; | |
// Never do this on the root blog | |
if ( bp_is_root_blog() ) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<code_scheme name="Sunrise for WordPress"> | |
<option name="USE_SAME_INDENTS" value="true" /> | |
<option name="OTHER_INDENT_OPTIONS"> | |
<value> | |
<option name="INDENT_SIZE" value="2" /> | |
<option name="CONTINUATION_INDENT_SIZE" value="4" /> | |
<option name="TAB_SIZE" value="2" /> | |
<option name="USE_TAB_CHARACTER" value="true" /> | |
<option name="SMART_TABS" value="false" /> |
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
Array | |
( | |
[category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] | |
[category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] | |
[category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2] | |
[category/(.+?)/?$] => index.php?category_name=$matches[1] | |
[tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] | |
[tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] | |
[tag/([^/]+)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2] | |
[tag/([^/]+)/?$] => index.php?tag=$matches[1] |
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 | |
/** | |
* This is a hypothetical example showing how to add two columns to a 'person' post type using | |
* WordPress' way vs. the a potential future Sunrise Way: | |
*/ | |
/** | |
* Here is how you might do it in the WordPress way. | |
*/ |
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 | |
/* | |
* @param int $id Image attachment ID | |
* @param string $size_name Name of custom image size as added with add_image_size() | |
* return bool True if intermediate image exists or was created. False if failed to create. | |
*/ | |
function maybe_create_missing_intermediate_images( $id, $size_name ) { |
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
Here's a list of Mac OS X Apps I've found indispensable coming from Windows. | |
It's not the complete list of apps I used or cannot live without as it doesn't | |
include ones Windows users would already know about. | |
-Mike Schinkel | |
http://about.me/mikeschinkel | |
Last Updated: Feb 21, 2012 | |
Must Have |
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: Root-based Taxonomy URLs for WordPress | |
* Description: Enables root-based Taxonomy URLs, i.e. Makes /taxonomy/my-taxonomy/ URLs route as /my-taxonomy/ | |
* Author: Mike Schinkel | |
* Author URI: http://about.me/mikeschinkel | |
* Plugin URI: https://gist.github.com/1421235 | |
* Version: 0.1 | |
* License: GPL 2+ | |
* Notes: Must use register_root_based_taxonomy_url( $taxonomy[, $priority] ) in an 'init' hook to specify root_based 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
# SVN override to prevent commits that try to implicitly commit more than one file. | |
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci, | |
# which usually results in me writing longer and more helpful commit messages. | |
# Also, it prevents me from committing unrelated code, so there's that. | |
# | |
# Also checks for error_log, var_dump, and console.log, and rejects these commits. | |
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]' |
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 | |
/** | |
* Text Field | |
* | |
* A simple text field callback to use with the Settings API. Don't forget to pass in | |
* the arguments array. Here's an example call to add_settings_field() : | |
* | |
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array( | |
* 'name' => 'my_theme_options[my_option]', | |
* 'value' => $options['my_option'], // assuming $options is declared |
OlderNewer