This file contains hidden or 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 | |
/* | |
* | |
* Uses: get_tagged_post() or get_tagged_post( AN ARRAY OF BLOG IDs ) | |
* | |
*/ | |
function get_tagged_post($blogs = array(), $tag) { | |
if( count( $blogs ) < 1 ){ | |
$blog_list = wp_get_sites(); |
This file contains hidden or 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( 'show_user_profile', 'extra_fields' ); | |
add_action( 'edit_user_profile', 'extra_fields' ); | |
add_action( 'personal_options_update', 'save_fields' ); | |
add_action( 'edit_user_profile_update', 'save_fields' ); | |
add_action( 'pre_get_posts', 'exclude_category' ); | |
function extra_fields($user) { | |
$pref_cat = explode( ',', get_user_meta( $user->ID, 'pref_cat', true ) ); |
This file contains hidden or 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_filter( 'eab-collection-upcoming-start_timestamp', '__all_events_start' ); | |
add_filter( 'eab-collection-upcoming-end_timestamp', '__all_events_end' ); | |
function __all_events_start() { | |
return date('Y-m-d') . ' 00:01'; | |
} | |
function __all_events_end() { |
This file contains hidden or 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 | |
function my_change_profile_tab_order() { | |
global $bp; | |
$bp->bp_nav['settings']['position'] = 10; | |
$bp->bp_nav['activity']['position'] = 20; | |
$bp->bp_nav['friends']['position'] = 30; | |
$bp->bp_nav['groups']['position'] = 40; | |
$bp->bp_nav['blogs']['position'] = 50; | |
$bp->bp_nav['messages']['position'] = 60; |
This file contains hidden or 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_filter( 'eab-event-post_type-supports', 'adding_excerpt_support' ); | |
function adding_excerpt_support($supports) { | |
$supports[] = 'excerpt'; | |
return $supports; | |
} |
This file contains hidden or 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 | |
// Replace the code of /members/single/messages/single.php with this | |
?> | |
<div id="message-thread" role="main"> | |
<?php do_action( 'bp_before_message_thread_content' ); ?> | |
<?php if ( bp_thread_has_messages(array('order'=>'DESC')) ) : ?> |
This file contains hidden or 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
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.js"></script> | |
<script type="text/javascript"> | |
jQuery(function($){ | |
$('#main_imag').load(function() { | |
setTimeout(function() { | |
$('#text1').animate({ | |
left: 0 | |
}) | |
}, 1000); | |
setTimeout(function() { |
This file contains hidden or 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( 'admin_bar_menu', 'add_extension', 999 ); | |
function add_extension($wp_admin_bar) { | |
if( !is_main_site() ) { | |
$id = get_current_blog_id(); | |
$expire = ProSites::get_expire($id); | |
$diff = $expire - time(); | |
$years = floor($diff / (365*60*60*24)); | |
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); |
This file contains hidden or 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 dirty script by Ashok | |
/* | |
* adding action when user profile is updated | |
*/ | |
add_action('personal_options_update', 'check_display_name'); | |
add_action('edit_user_profile_update', 'check_display_name'); | |
function check_display_name($user_id) { | |
global $wpdb; | |
// Getting user data and user meta data |
This file contains hidden or 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('personal_options_update', 'check_display_name'); | |
add_action('edit_user_profile_update', 'check_display_name'); | |
function check_display_name($user_id) { | |
global $wpdb; | |
$err['display'] = $wpdb->get_var($wpdb->prepare("SELECT COUNT(ID) FROM $wpdb->users WHERE display_name = %s AND ID <> %d", $_POST['display_name'], $_POST['user_id'])); | |
$err['nick'] = $wpdb->get_var($wpdb->prepare("SELECT COUNT(ID) FROM $wpdb->users as users, $wpdb->usermeta as meta WHERE users.ID = meta.user_id AND meta.meta_key = 'nickname' AND meta.meta_value = %s AND users.ID <> %d", $_POST['nickname'], $_POST['user_id'])); | |
foreach($err as $key => $e) { | |
if($e >= 1) { | |
$err[$key] = $_POST['username']; |
OlderNewer