Search Results for 'code'
-
Search Results
-
Hello,
I added the follwoing code to functions.php
add_action( ‘init’, ‘blockusers_init’ );
function blockusers_init() {
if ( is_admin() && ! current_user_can( ‘administrator’ ) &&
! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
wp_redirect( bbp_user_profile_link( bbp_get_current_user_id() ) );
exit;
}
}This redirects users to http://www.mydomainame.org/wp-admin/profile.php
and displays a link to their BBPress Profile.
Question is, how do I redirect users directly to to their BBPress profile?This is probably something very simple, but I am not a developer unfortunately.
Thanks for your help.
So I know people will facepalm at the question, but I am just really confused on this and I don’t wanna edit and mess the little bit of work I have done up lol. So anywho, how can I change the font color on the topics and posts? They are pretty difficult to see: http://i.imgur.com/8ZOOaef.png But yeah, I really dunno much (If anything) about code or website stuff so, surprised I got this far! Thanks for the help!
Hi,
Here’s my situation. I have a site with several forums. Let’s call them Forum A, B and C. All users to the site can view Forum A. Through other actions that happen on the site users collect points. At a certain point total Forum B becomes available. At another point total Forum C becomes available. There is an external webservice I can call to see if the user has the appropriate number of points for the relevant Forum.
As far as I can tell, bbPress doesn’t have the built in capability to handle that particular permissions scenario so I’m building a plugin. My plugin is hooking on the “user_has_cap” filter to determine whether a user can see a particular forum. I don’t want to make an external webservice call on every single current_user_can() call that gets made during a page load, so in my hook function I want to immediately check to see if the current request is a Forum page.
For example, if the requested page was “http://localhost/wordpress/forums/forum/forum-b/” then being able to get the pagename “forums” it would allow me to jump out of my hook function immediately if the request wasn’t for a forum page or topic. Below is a copy of code/pseudocode for what I’m doing in the plugin.
function forum_lock_check($allcaps, $cap) { if (pagename != "forums") return $allcaps; if (webservice says I can) { $allcaps["can-view-forum"] = true; } return $allcaps; } add_filter("user_has_cap", "forum_lock_check", 10, 3);Is there a wordpress or bbpress function that gives me the pagename the forum is attached to? Of course, if there is an easier way to do what I want, I’m all ears for that as well. Thanks for any help you can give me.
Topic: Redirect User Profile Link
Hello,
I have looked everywhere and could not find an answer.
I found other things like putting the link in a menu item.
But, what I wanna do is redirect the user profile page. I do not want to use bbPress´.
So, to be specific. I am using UPME, a premium wordpress theme from Codecanyon.
And the profile link for this plugin (User Profiles Made Easy) is:
http://codeboy.co/profile/username
So I want to get rid of the bbPress user profile that appears in the forums and when a user creates a debate/post it will automatically link there, link:
http://codeboy.co/forums/users/Codeboy/
I want it to link here instead:
http://codeboy.co/profile/username
So from plain view it looks like I would just need to change this link in some php file of bbPress, yet I have not had any luck after many hours of headaches.
Could somebody please help me?
Thanks!