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: Urdu Formatter - Shamil | |
Plugin URI: http://www.mbilalm.com/blog/ | |
Description: This Plugin automatically detects Urdu posts, comments and posts summery (Excerpt), and If Urdu is found then it sets the proper direction, size and font of text according to Urdu. With this plugin you can carry blogging in both languages (Urdu and English). Find more detail in Settings page or visit plugin site. | |
Author: M Bilal M | |
Author URI: http://www.mbilalm.com/ | |
Version: 0.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 | |
function bptt_init() { | |
// ======================================= GROUP FEATURES ================================== | |
// This is inspired by the external-group-blogs BP plugin | |
/** Group blog extension using the BuddyPress group extension API **/ |
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
function bp_get_activities($atts, $content = null ){ | |
extract(shortcode_atts(array( | |
'max' => '10', | |
'per_page' => '10' | |
), $atts)); | |
$activities = '<ul class="activity-list item-list">'; | |
if ( bp_has_activities( 'activity&per_page='. $per_page .'max='. $max ) ) : | |
ob_start(); |
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 | |
function bp_get_user_domain_with_id( $domain, $user_id, $user_nicename = false, $user_login = false ) { | |
if ( empty( $user_id ) ) | |
return; | |
if( isset($user_nicename) ) | |
$user_nicename = bp_core_get_username($user_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
add_action( 'bp_legacy_theme_ajax_querystring','bprm_exclude_members',20 , 2 ); | |
add_action( 'bp_ajax_querystring','bprm_exclude_members',20 , 2 ); | |
function bprm_exclude_members( $qs=false, $object = false ){ | |
global $bp; | |
//list of users to exclude | |
//comma separated ids of users whom you want to exclude | |
// for example '0,1,54' |
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
add_action( 'after_setup_theme','bp_remove_custom_image_header', 100 ); | |
function bp_remove_custom_image_header() { | |
if ( bp_is_user_activity() || bp_is_activity_component() || bp_is_group_home() ) { | |
//remove_custom_background(); | |
remove_custom_image_header(); | |
} | |
} |
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
/** | |
* bp_like_button() | |
* | |
* Outputs the Facebook 'Like/Unlike' . | |
* | |
*/ | |
function bp_like_button( $id = '', $type = '' ) { | |
$activity_permalink = bp_get_activity_thread_permalink(); | |
; | |
?> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function get_user_ids_by_role($role){ | |
$users=array(); | |
$founded_users = get_users( array( 'role' => $role ) ); | |
if(!empty($founded_users)){ | |
foreach((array)$founded_users as $user) | |
$users[]=$user->ID; | |
} | |
return $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
/** | |
* Add the code to functions.php of your current theme. | |
* this code hide comments for no logged in users | |
*/ | |
add_filter( 'bp_activity_get_comment_count' , 'bp_only_loggedin_can_see_comments', 10,1 ); | |
function bp_only_loggedin_can_see_comments( $count ){ | |
if ( !is_user_logged_in() ) | |
$count = 0; |
OlderNewer