current user inside wordpress menu hyperlink - wordpress

I have created a custom menu for buddypress in wordpress.
The links always contain the current user.
In this example the user "admin
/members/admin/profile/
What do i have to do so that the link always points to the current user?

In a link to members, me will be handled as the current user.
For example: https://yoursite.com/members/me/ will take you to your profile.

Related

Disable Order item link

Limit User Access
I'm trying to limit user access to not let him edit product data, such as weight, price, measurements...
I installed the Ultimate Dashboard Plugin and even managed to remove this direct access, letting him see only the orders page, because that's what I want him to have access to.
But when you open the order, he can still access the product through the order link.
Please is there any way I can disable this possibility?
You can achieve that by using the User Role Editor plugin. You can create a custom role there and uncheck the "Edit Product" capability.
Once you created the new custom role, you should go to the "All Users" page from the left admin sidebar, then find the user that you want to prevent editing the products and change its role to the new role that you created with the plugin.
Here is the documentation and examples:
http://shinephp.com/user-role-editor-wordpress-plugin/

Create a "Change Avatar" button with buddypress

I'm trying to find the code within the buddypress plugin that links directly to the "Change Profile Photo" page of the user that is logged in. I'm sure this requires php but I can not find it anywhere.
This way I can add link/button on the home page of my site that says "Change Your Avatar!" and it will go to that section of the users profile. Thanks
The following link should work: http://example.com/members/MEMBERNAME/profile/change-avatar/ The "MEMBERNAME" is the username of a user. To get the url for a users profile you can use bp_loggedin_user_domain(). Adding the following to the top of your site will show a link to allow the users change their profile image.
Change Your Avatar!

Wordpress backend design

I have to build an "admin only" page where an admin user can input 3 objects - a person's "name", "description" and a photo. this way they can add/edit/delete people from the website.
I have tried adding "add_menu_page()" to the admin navigation menu and that worked, but I'm kind of lost as to what to do next, or even if I'm on the right track.
I'm assuming I will load the people into the WP database and query the database when i need to display each person.
Yes you are on the right track. Just create a form for the admin where he/she can enter the name, description and photo of a person.
You should make another page using the same method i.e. add_menu_page() and load your WP DB there and provide the option to the admin to delete, edit or add from there.

wordpress user management, how to assign specific page to each user?

I want to create pages in WordPress, which should show to a specific user only not for specific role.
if a page is created for a specific user like "john". it should be viewed by only john, no other users could not see that page.
My Questions are:
How to create a page for a specific user? (from admin).
Note: while creating page we should assign that page to specific user like "john".
Is there any plugins for this?
Is there any way to do this.
-Srikanth.
I know that it is a bit late but still want to answer in case you need. Try to use http://wordpress.org/extend/plugins/user-specific-content/ plugin. You can customize your pages.
Just an idea:
Why not make a page template for that page? get current user id in the template then show the details depends on the user id? You can check is_user_logged_in() and pull all contents under the if statement and under the else statement you can redirect the user to the login page or just show the message to logged in.
Let me know if everything is clear. Thanks!
This can be done with ease using nav menu plugin and roles creator plugin.you can create roles with names of your clients and show menu items of user pages to specific roles/person

Restrict access to page for anonymous users in Drupal

Very simple question that i'm stuck with.
I'm making a very simple 'classifieds' website; i have a content-type of type 'classified' i'd like to give access to that content-type for registered users only; i edited the permissions so only 'authenticated' users can 'create classified' and also created a menu link to 'node/add/classified'.
The problem is that when anonymous, i don't see the 'create classified' menu link (right, because the user doesn't have the right to 'create' one) but I still want this menu item to appear and i'm redirecting to my custom 403 page that says 'hey, you have to create an account first before posting a classified'.
What's the best 'elegant' way to achieve this ?
My solution would be to create a new page (via hook_menu) at, say "classified/add". In this page, check the user's id = if it's 0, then display your friendly message about joining the site.
If they aren't 0, then append/return node_add('classified'). (Note that node_add is in node.pages.inc, so you'll want to include that when needed.)
I have actually done the same thing for a classified ad system. Creating absolute URLs as menu items works for me and is quite simple.
For example, instead of making the menu item path 'node/add/classified', set the path to 'http://example.com/node/add/classified'. When you click the menu item when logged out (as anonymous), Drupal will try to go to the create classified page, but will fail the permissions check and redirect to your custom 403 page.
Try creating a new menu item manually (Admin > Site building > Menus > Menu name > Add item), to point to the node/add/classified URL.
Update: You could try linking to /node/403?destination=node/add/classified (where node/403 is your custom 403 error page).

Resources