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 | |
if ( ! function_exists( 'ucc_pre_get_posts_filter' ) ) { | |
function ucc_pre_get_posts_filter( $query ) { | |
if ( ! is_preview() && ! is_admin() && ! is_singular() && ! is_404() ) { | |
if ( $query->is_feed ) { | |
// As always, handle your feed post types here. | |
} else { | |
$my_post_type = get_query_var( 'post_type' ); | |
if ( empty( $my_post_type ) ) { |
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 | |
if ( ! function_exists( 'ucc_add_cpts_to_pre_get_posts' ) ) { | |
function ucc_add_cpts_to_pre_get_posts( $query ) { | |
if ( $query->is_main_query() && ! is_post_type_archive() && ! is_singular() && ! is_404() ) { | |
$my_post_type = get_query_var( 'post_type' ); | |
if ( empty( $my_post_type ) ) { | |
$args = array( | |
'exclude_from_search' => false, | |
'public' => true, |
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 | |
/* | |
A few words about the setup here: WordPress 3.3, BuddyPress 1.5.2, bbPress 2.0.2 | |
The current WordPress theme is a child theme of bp-default, bp-child. | |
The following directories (and their contents) have been copied into the bp-child directory and are where edits are | |
performed: | |
/wp-content/plugins/bbpress/bbp-themes/bbp-twentyten/bbpress | |
/wp-content/plugins/bbpress/bbp-themes/bbp-twentyten/css | |
/wp-content/plugins/bbpress/bbp-themes/bbp-twentyten/js |
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 | |
if ( ! function_exists( 'ucc_post_format_feedwordpress_syndicated_post' ) ) { | |
function ucc_post_format_feedwordpress_syndicated_post ( $data ) { | |
$feed = $data['meta']['syndication_feed']; | |
// Adjust stripos contents as needed. | |
if ( stripos( 'delicious.com', $feed ) !== false ) { | |
$data['tax_input']['post_format'] = 'post-format-link'; | |
} elseif ( stripos( 'tumblr.com', $feed ) !== 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
<?php | |
if ( ! function_exists( 'ucc_cpt_get_object_terms_list' ) ) { | |
function ucc_cpt_get_object_terms_list( $id = '', $echo = true ) { | |
global $post; | |
$id = absint( $id ); | |
if ( empty( $id ) ) | |
$id = $post->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 | |
if ( ! function_exists( 'ucc_cpt_feedwordpress_syndicated_post' ) ) { | |
function ucc_cpt_feedwordpress_syndicated_post ( $data ) { | |
$feed = $data['meta']['syndication_feed']; | |
// Adjust stripos contents as needed. | |
if ( stripos( 'colourlovers.com/rss/lover/username/palettes/favorites', $feed ) !== false ) { | |
$data['post_type'] = 'colourlovers-palette'; | |
} elseif ( stripos( 'colourlovers.com/rss/lover/username/colors/favorites', $feed ) !== 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
<?php | |
// BuddyPress Sitewide Notice Widget is available from the WordPress.org Plugin Directory: | |
// http://wordpress.org/extend/plugins/buddypress-sitewide-notice-widget/ | |
if ( ! class_exists( 'UCC_BP_Message_Notices_Widget' ) ) { | |
class UCC_BP_Message_Notices_Widget extends WP_Widget { | |
function __construct() { | |
parent::WP_Widget( 'ucc_bp_message_notices', 'BP Message Notices Widget', array( 'description' => 'The BuddyPress notice to all users' ) ); | |
} |
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 | |
// Move the bp_blogs_record_post action to the later wp_insert_post, so that in_category will return the correct result. | |
if ( ! function_exists( 'ucc_wp_insert_post_bp_blogs_record_post' ) ) { | |
function ucc_wp_insert_post_bp_blogs_record_post() { | |
remove_action( 'save_post', 'bp_blogs_record_post', 10, 2 ); | |
add_action( 'wp_insert_post', 'bp_blogs_record_post', 10, 2 ); | |
} } | |
add_action( 'init', 'ucc_wp_insert_post_bp_blogs_record_post' ); |
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 | |
if ( ! function_exists( 'ucc_taxonomy_columns' ) ) { | |
function ucc_taxonomy_columns( $columns ) { | |
if ( post_type_exists( $_REQUEST['post_type'] ) ) | |
$post_type = $_REQUEST['post_type']; | |
else | |
$post_type = 'post'; | |
$args = array( |
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 | |
if ( ! function_exists( 'ucc_ozh_ta_insert_tweets_post' ) ) { | |
function ucc_ozh_ta_insert_tweets_post( $data ) { | |
// Replace values of [tax_input][category] and [post_type] with appropriate values. | |
$data['tax_input']['category'] = '1,2'; | |
$data['post_type'] = 'tweet'; | |
return $data; | |
} } | |
add_filter( 'ozh_ta_insert_tweets_post' , 'ucc_ozh_ta_insert_tweets_post' ); |