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 | |
/* | |
$Id: sitemap-builder.php 420059 2011-08-06 14:31:30Z arnee $ | |
*/ | |
/** | |
* Default sitemap builder | |
* | |
* @author Arne Brachhold |
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('publish_post', 'schedule_glossary_index', 10, 1); | |
function schedule_glossary_index($post_id) { | |
wp_schedule_single_event(time(), 'update_glossary_index', array( $post_id )); | |
} | |
add_action('update_glossary_index', 'do_update_glossary_index', 10, 1); | |
function do_update_glossary_index($post_id) { | |
global $wpdb; |
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
global $wpdb; | |
$rows = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id FROM wp_blogs where blog_id > 1" ) ); | |
foreach( $rows as $row ) { | |
print_r( "siteid ".$row->blog_id ); | |
} |
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 | |
/** | |
* @package Admin | |
*/ | |
/** | |
* This class handles the pointers used in the introduction tour. | |
* | |
* @todo Add an introdutory pointer on the edit post page too. | |
*/ |
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 | |
/** | |
* Customize TinyMCE -- Add styles dropdown and add some custom styles. Selecting the style will add a class to the element. | |
* | |
**/ | |
function my_tinymce_styles( $init ) { | |
$init['theme_advanced_buttons2_add_before'] = 'styleselect'; | |
$init['theme_advanced_styles'] = 'Top Right Inset=insettop,Left Inset=insetleft,Right Inset=insetright'; | |
return $init; |
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
c_purp=`tput setaf 4` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then | |
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') |
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 | |
/** | |
* Cycle/alternate unlimited values of a given array. | |
* | |
* For instance, if you call this function five times with | |
* `wp_cycle( 'three', 'two', 'one' )`, you will in return get: three two one | |
* three two. This is useful for loops and allows you to do things like cycle | |
* HTML classes. | |
* |
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
<!DOCTYPE html> | |
<!--[if IE 6]> | |
<html id="ie6" lang="en-US"> | |
<![endif]--> | |
<!--[if IE 7]> | |
<html id="ie7" lang="en-US"> | |
<![endif]--> | |
<!--[if IE 8]> | |
<html id="ie8" lang="en-US"> |
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 | |
/** | |
* Get terms from one taxonomy that relate to terms from another taxonomy through published posts. | |
* For instance, get all tags that are set on posts in the category "WordPress". | |
* | |
* @param array $args An array of options. Must contain at least 'term_ids' OR 'term_names'. Options are: | |
* string 'get_taxonomy' => the taxonomy whose terms you want to retrieve. Default is post_tag | |
* string 'through_taxonomy' => the taxonomy whose term(s) you're providing. Default is category | |
* array 'term_ids' => an array of term IDs through which to find overlapping terms |
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 | |
# Prerequisite post type and meta fields for Recipe 3: Creating Post "Sections" | |
function recipe_3_prereq() { | |
register_post_type( 'wordcamp', array( | |
'public' => true, | |
'label' => 'WordCamps' | |
) ); | |
# See http://fieldmanager.org | |
if ( class_exists( 'Fieldmanager_Field' ) ) { |
OlderNewer