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('bp_has_activities','my_denied_activity_new_member', 999, 2 ); | |
function my_denied_activity_new_member( $a, $activities ){ | |
foreach( $activities->activities as $key => $activity ){ | |
if ( $activity->type =='joined_group') { | |
unset( $activities->activities[$key] ); | |
$activities->activity_count = $activities->activity_count-1; | |
$activities->total_activity_count = $activities->total_activity_count-1; | |
$activities->pag_num = $activities->pag_num -1; |
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 current_page_url() { | |
$url = 'http'; | |
if ($_SERVER["HTTPS"] == "on") | |
$url .= "s"; | |
$url .= "://"; | |
if ($_SERVER["SERVER_PORT"] != "80") | |
$url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; | |
else |
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 hex2rgb($hex) { | |
$hex = str_replace("#", "", $hex); | |
if(strlen($hex) == 3) { | |
$r = hexdec(substr($hex,0,1).substr($hex,0,1)); | |
$g = hexdec(substr($hex,1,1).substr($hex,1,1)); | |
$b = hexdec(substr($hex,2,1).substr($hex,2,1)); | |
} else { |
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 defer_parsing_of_js ( $url ) { | |
if ( FALSE === strpos( $url, '.js' ) ) return $url; | |
if ( strpos( $url, 'jquery.js' ) ) return $url; | |
return "$url' defer "; | |
} | |
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 ); |
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 show_my_sites_cb( ) { | |
if( ! is_user_logged_in() ){ | |
return ''; | |
} | |
else{ | |
$blogs = '<ul>'; | |
$user_ID = get_current_user_id(); | |
$user_blogs = get_blogs_of_user( $user_id ); |
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 | |
/* | |
* use [get_all_instructors] | |
* Change wp-content/plugins/ to correct plugins folder if you use a separate folder for plugins at line 9 | |
*/ | |
add_shortcode( 'get_all_instructors', 'get_all_instructors_cb' ); | |
function get_all_instructors_cb() { | |
include ABSPATH . 'wp-content/plugins/coursepress/includes/classes/class.instructorsearch.php'; | |
if ( isset( $_GET['page_num'] ) ) { |
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 | |
/* | |
Plugin Name: Share across network | |
Plugin URI: http://premium.wpmudev.org/ | |
Description: A very simple widget plugin to share info across the network | |
Version: 1.0.1 | |
Author: Ashok (Incsub) | |
Author URI: http://bappi-d-great.com | |
License: GNU General Public License (Version 2 - GPLv2) | |
Network: 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 | |
function my_app_email_on_appointment_cancelled ($app_id) { | |
global $appointments; | |
$to = $appointments->get_admin_email(); | |
wp_mail($to, 'An appointment has been cancelled', "An appointment with ID {$app_id} has just been cancelled."); | |
} | |
add_action('app-appointments-appointment_cancelled', 'my_app_email_on_appointment_cancelled'); |
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 | |
/* | |
* | |
* [dr_list_categories_with_exclude style="list" exclude="14"] where 14 is the listing category ID | |
* | |
*/ | |
function list_categories_sc_custom($atts, $content = null) | |
{ |