buddypress

Disable the admin bar for all users except admin

南楼画角 提交于 2019-12-19 11:48:13
问题 I have installed WordPress and BudyPress. I want to disable the admin bar which appears on the top for all users. Can somebody tell me how to do that correctly? 回答1: function sushil_return_false() { global $current_user; // return "false" for all users that do not have the "administrator" role if( !in_array('administrator',$current_user->roles) ) { return false; } else { return true; } } add_filter( 'show_admin_bar', 'sushil_return_false' ); 回答2: In your functions.php file, you can add one of

How To Get URL To Post Author's User BuddyPress Avatar Inside Wordpress Post Loop

帅比萌擦擦* 提交于 2019-12-19 09:56:37
问题 The Question How to get just the URL to a post author's avatar? The Requirements I want the url to the image that is hosted on my website. Image will be called in the loop of a post. The author of the post is the person whose avatar image I wish to display. What I've Tried A bunch of things, but mainly <?php echo get_avatar_url('user_email'); ?> It returns a url to the default 'mystery man' image hosted by Gravatar despite their being an avatar uploaded to my site for this test user.

Turning a spreadsheet into array and loop and call a function

一曲冷凌霜 提交于 2019-12-13 18:31:44
问题 This is related to generate groups in BuddyPress. I have a spreadsheet with (in this case) a group name, group description and slug. I need to grab the information from the file, turn it into an array, then loop through it and call groups_create_group() every time. I can find that function in bp-groups.php (http://www.nomorepasting.com/getpaste.php?pasteid=35217). It tells me all the parameters you need to fill in. I'm quite new to this and looking for how I can do this. Do you know how I can

PHP concatenate to variable

≯℡__Kan透↙ 提交于 2019-12-13 03:30:03
问题 I have the following function that sends a message to selected users function send_msg($user_id, $title, $message){ $args = array( 'recipients' => $user_id, 'sender_id' => bp_loggedin_user_id(), 'subject' => $title, 'content' => $message ); $thread_id = messages_new_message1( $args ); messages_delete_thread($thread_id,bp_loggedin_user_id()); } This is invoked by the following code that posts the form // Get data from form $body_input=isset($_POST['body_input'])?$_POST['body_input']:'';

Clone a demo website when new blog is created using Wordpress Multisite

强颜欢笑 提交于 2019-12-13 02:57:50
问题 I am presently working on a Wordpress multisite. Users can create a website by themselves, so there's no assistance from the admin on doing that. When the user signs up, after they login, they can create a new website. Now, when they click the create button, I already have a demo website named demo.mywebsite.com . I want this website to be cloned for the new site created. So, when the user names the website fabrics, the site URL would be fabrics.mywebsite.com My question is, how do I set-up

Wordpress wp_update_comment function not working

浪尽此生 提交于 2019-12-12 04:58:26
问题 I've created a custom comment editor and for some reason, wp_update_comment is not working. It returns 1, which means it should have been successful but it's not actually updating anything. Listed below is my update code. It's important to note that I've double checked that the proper data is being added to $commentarr from the form POST. $commentarr = array(); $commentarr['comment_ID'] = $comment_ID; $commentarr['comment_content'] = $commentContent; $update_success = wp_update_comment(

How to edit the registration email sent by buddypress for activating users

ぃ、小莉子 提交于 2019-12-12 02:19:55
问题 I have this message when users register on my site, this is an excerpt of what is sent to the user and the email header message was incomplete. Take a look at what is sent when a user register Email Subject = "[WWW Sites] Activate \http://1/" And the email body message reads as below "Thanks for registering! To complete the activation of your account and blog, please click the following link: http://www.com/activate/?key=8b9c059db8ae9a5b After you activate, you can visit your blog here: \http

JSON parsing issue between Sencha Touch and WordPress BuddyPress API

房东的猫 提交于 2019-12-12 00:23:31
问题 I am new to Sencha Touch and I am trying to figure out the JSON call to WordPress. I am using the JSON-API-for-BuddyPress plug-in on WordPress on the server side. http://www.erefer.me/api/buddypressread/groups_get_groups/?username=troy {"status":"ok","groups":{"149":{"name":"Barakah Biz Network Referrals","description":"This group is for B.B.N members to send and receive their referrals online. This way all members have an online record of their referrals and no worries of losing pieces of

How to get username/display name in Buddypress?

一曲冷凌霜 提交于 2019-12-10 05:10:35
问题 In buddypress default tempalte, username who has posted a certain activity is displayed like this: bp_activity_action(); But that brings much more than just the username. Is there a simpler way to get the user object/name ? Wordpess get userdata function doesn't work, as it displays the page author, not the comment or activity author name. 回答1: You have Display name use below function: bp_get_displayed_user_fullname() OR Display User Name: bp_core_get_username($user_id) 回答2: Display name for

Creating a Social Networking Website in PHP [closed]

最后都变了- 提交于 2019-12-06 16:00:32
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . What's the fastest, open-source PHP social networking framework that can help me get a working prototype in four hours? I'm looking at something that can handle profiles, where each profile can make multiple