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
// blocks changing group type on edit screen | |
function bp_block_private_groups_edit( $status ) { | |
//no restriction to site admin | |
if ( !is_super_admin() ) { | |
$status = array( 'public' ); | |
} | |
return $status; | |
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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Oauth</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<div class="response"></div> |
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_filter_groups_from_activity( $a, $activities ) { | |
if ( bp_is_current_component( 'activity' ) ) { | |
foreach ( $activities->activities as $key => $activity ) { | |
if ( $activity->component =='groups') { | |
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 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 apppresser_limit_access_app() { | |
$agents = $_SERVER['HTTP_USER_AGENT'] ; | |
$app = false; | |
$useragents = array ( | |
"iPhone", | |
"iPod", | |
"iPad", |
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
if( $spoonful_of_sugar >= 1 ) | |
return $medicine; |
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 wds_google_url( $url ){ | |
$parsed_url = parse_url( $url ); | |
$url = explode( '/', $parsed_url ); | |
return $parsed_url['scheme'] . '://' . $parsed_url['host'] . '.../' . end( $url ); | |
} |
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
When linking to BP content it's best to use BP functions. This method is good because it shows somebody else that it's BP content that the link is going to. | |
bp_loggedin_user_domain() // url to logged in user profile | |
bp_loggedin_user_username() | |
bp_loggedin_user_id() | |
bp_displayed_user_username() // use displayed for when you are on a profile instead of loggedin | |
or you can use this to display a complete anchor link to logged in user | |
bp_core_get_userlink( bp_loggedin_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
function custom_json_api_prepare_post( $post_response, $post, $context ) { | |
$post_response['do_api_action']['above_title'] = 'this is above the title'; | |
$post_response['do_api_action']['below_title'] = 'this is below the title'; | |
$post_response['do_api_action']['above_content'] = 'this is above the content'; | |
$post_response['do_api_action']['below_content'] = 'this is below the content'; | |
if( 1842 === $post['ID'] ) { | |
$post_response['do_api_action']['above_title'] = 'this is above the title on post 1842'; |
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 custom_json_api_prepare_post( $post_response, $post, $context ) { | |
$post_response['do_api_action']['default']['above_title'] = 'this is above the title'; | |
$post_response['do_api_action']['default']['below_title'] = 'this is below the title'; | |
$post_response['do_api_action']['default']['above_content'] = 'this is above the content'; | |
$post_response['do_api_action']['default']['below_content'] = 'this is below the content'; | |
return $post_response; | |
} | |
add_filter( 'json_prepare_post', 'custom_json_api_prepare_post', 10, 3 ); |
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( 'init', function() { | |
global $wp_post_types; | |
$wp_post_type['type_name']->show_in_json = false; | |
}, 99 ); |
OlderNewer