Home Forums WoodMart support forum Allow access to Woodmart Header Builder to Non-admins

Allow access to Woodmart Header Builder to Non-admins

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #215182

    theo_gk
    Participant

    Hello, I want to give access to a custom role to change the header. This is only possible through your “Woodmart” menu item and then clicking “Header Builder”.

    Unfortunately, I can’t give access to them because you request that the user is administrator only, which is kind of problematic. In your file /woodmart/inc/admin/dashboard/dashboard.php line 38 (version 4.6) in the start of the menu_page function, you check if the user is an administrator

    if ( ! current_user_can( 'administrator' ) ) {
    				return;
    			}

    Could you change the ‘administrator’ to ‘manage_options’ so that we can assign that capability to a custom role?

    Is this possible? Can you give me an answer if you are going to change this or not?

    Thank you very much

    #215233

    Hello,

    Thank you very much for choosing our theme and for contacting us.

    Have you tried to add this code it to the functions.php of the child theme?

    Best Regards

    #215293

    theo_gk
    Participant

    I don’t understand. What code to add in my functions.php ???

    This code is just 3 lines from a class method, inside a core woodmart file. I can’t override this file and you don’t provide any filter. Am I wrong? How can I override this using my child theme?

    Thanks

    #215375

    Hello,

    We do not plan to implement this option in the theme. We add new features when it is very often requested. This feature is not most frequently requested. You can change the theme code as per your needs on your own.

    Best Regards

    #215396

    theo_gk
    Participant

    Hi it’s not a feature request. It’s a problem in my opinion. Why allow only an administrator to change something simple as the header? This is problematic. Thanks for understanding

    Secondly, can you help me how to change this using my child theme? You probably didn’t see my previous response.

    Thanks

    #215406

    Hello,

    I saw your previous post. Usually, one can change or customize the functionality adding the changed code to the functions.php of the child theme. I have checked with the developers, in this case, unfortunately, it would not work.

    I would suggest trying a role management plugin, perhaps you would solve the problem. Alternatively, you can try to change the ‘administrator’ to ‘manage_options’

    Best Regards

    #215489

    theo_gk
    Participant

    Anyone who knows a little bit about wp development knows that adding this code to my child theme would not work.

    Your first suggestion will not solve my problem (admin is a role, not a capability to add it) and the second is just a waste of time as updating the theme will erase my changes.

    Could you please ask someone who can really answer my question? How can I allow a user who is not admin to edit the site header?

    #215567

    Artem Temos
    Keymaster

    Hello,

    Unfortunately, the PHP class can’t be overridden in the child theme. That is why it possible to customize it in the parent theme only, unfortunately.

    Kind Regards

    #215579

    theo_gk
    Participant

    I got this. Is there any other way to allow a non-admin (editor, shop manager or whatever) to edit the site header?

    Thanks for your time, I really appreciate it. Sorry for insisting but I really have a problem with this.

    #215580

    Artem Temos
    Keymaster

    Unfortunately, there is no other way to do this as you can see from the code. It has a condition to show theme settings and all our pages to administrators users.

    #215583

    theo_gk
    Participant

    This is unfortunate indeed. I hope this changes in the future. Allowing a shop manager edit the header (an html text with shipping info for example) is not much to ask from a theme.

    Thank you for your time and your assistance

    #215586

    Artem Temos
    Keymaster

    We will add WordPress filter to it in our next theme update allowing to override this in the child theme.

    #215660

    theo_gk
    Participant

    I’m really grateful about this. Thank you very much, you’re the best

    #215670

    Artem Temos
    Keymaster

    Thank you for your feedback.

    #220059

    csy
    Participant

    Latest Build

    #220062

    Artem Temos
    Keymaster

    Hi,

    Yes, you can use the following example and put it into the functions.php file in your child theme

    add_filter(
    	'woodmart_dashboard_theme_links_access',
    	function() {
    		return 'shop_manager';
    	}
    );

    Regards

    #220076

    csy
    Participant

    Perfect.. thank you

    #220078

    Artem Temos
    Keymaster

    You are welcome!

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘Allow access to Woodmart Header Builder to Non-admins’ is closed to new replies.