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 | |
// Capability based | |
/** | |
* Set different default background images based on user roles | |
* | |
* @param array $settings | |
* | |
* @return 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 | |
/** | |
* Plugin Name: Post List Shortcode | |
* Plugin URI: https://buddydev.com/ | |
* Description: List posts from a category. | |
* Version: 1.0.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* Author: BuddyDev | |
* Author URI: https://buddydev.com/ |
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 | |
/** | |
* Modify profile visibility | |
* | |
* @param bool $can_see Weather can see or not. | |
* @param int $user_id Displayed user id. | |
* @param int $visitor_id Visitor id. | |
* | |
* @return bool |
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 | |
/** | |
* Class BuddyCircles_Affiliate_Users | |
*/ | |
class BuddyCircles_Affiliate_Users { | |
/** | |
* Affiliate user list. | |
* | |
* @var 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 | |
<?php if ( buddyblog_user_has_posted() ): ?> | |
<?php | |
//let us build the post query | |
if ( bp_is_my_profile() || is_super_admin() ) { | |
$status = 'any'; | |
} else { | |
$status = 'publish'; | |
} |
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 | |
/** | |
* Get excluded forum ids. | |
* | |
* @return array | |
*/ | |
function buddydev_get_excluded_forum_ids() { | |
return array( 552, 554 ); // Replace by yours forum ids. | |
} |
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 | |
add_action( 'bp_template_redirect', function() { | |
if ( bp_is_user() && is_user_logged_in() && ! bp_is_my_profile() ) { | |
$user = wp_get_current_user(); | |
$restricted_roles = array( 'editor' ); // Replace by your roles. | |
$has_restricted_role = array_intersect( $restricted_roles, $user->roles ); | |
if ( ! empty( $has_restricted_role ) ) { | |
$message = sprintf( 'You are not allowed to view %s profile', bp_core_get_user_displayname( bp_displayed_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
<?php | |
add_action( 'groups_create_group', function( $group_id ) { | |
// Get users of certain roles. | |
$user_ids = get_users( | |
array( | |
'role' => array( 'subscriber' ), | |
'fields' => 'ID', | |
) |
NewerOlder