Closed sambrodie closed 8 years ago
Hi,
Currently it seems as though the required capabilities are automatically set at each level as manage_options
You can change it by passing a capability in the third parameter in the constructor when you instantiate the class.
new APF_Demo(
null, // option key
APFDEMO_FILE, // caller script path.
'manage_options' // <-- this one
);
it would be better if Setting Fields inherited their default from the Setting Section, and Setting Sections inherited their default from the Sub Menu. Also, in the absence of a Setting Section, the Setting Field should inherit from the Sub Menu.
Interesting idea.
To be clear, the elements that accept the capability
argument including admin pages, in-page tabs, form sections, and form fields inherit the value set to the class mentioned above, manage_options
as default.
To adopt your idea, setting sections should inherit the value from the in-page tab if exists; otherwise, the page. The page inherits the value from the value set to the class.
Thanks for the suggestion.
This is now available in the development branch. Download
Let me know if it works or not.
Currently it seems as though the required capabilities are automatically set at each level as manage_options. However, it would be better if Setting Fields inherited their default from the Setting Section, and Setting Sections inherited their default from the Sub Menu. Also, in the absence of a Setting Section, the Setting Field should inherit from the Sub Menu.