2012-09-22, 06:35:37
Version 1.8.2 Added To Extend
I have added the ability for other plugins to add custom permissions checkboxes into the manage users area.
I created a function, which other plugins can use, that will add a permissions checkbox onto the manage users page. Example below:
The above code (placed in my GS Blog plugin) will add a checkbox on the manage users page with the label of Blog Settings. It will save it to the users xml file in the node "blogsettings".
Below is a screenshot of the effect of adding that function and a few other permissions:
Now that the data is stored in the users xml file, the plugin author can access that by manually loading the xml file or by using a function the multi user plugin provides. Example Below:
The above (check_user_permission()) will return false if the page is blocked or true if the page is not blocked or the node is missing from the users xml file.
The above (check_user_permissions()) function will return an array of all permissions in the following format: 'permissionname' => bool
- Added check_user_permissions() function - This function returns all
permissions in an array for the provided user
- Fixed issue with custom permissions being reset if admin settings form
is submitted
I have added the ability for other plugins to add custom permissions checkboxes into the manage users area.
I created a function, which other plugins can use, that will add a permissions checkbox onto the manage users page. Example below:
Code:
<?php add_mu_permission('blogsettings', 'Blog Settings'); ?>
Below is a screenshot of the effect of adding that function and a few other permissions:
Now that the data is stored in the users xml file, the plugin author can access that by manually loading the xml file or by using a function the multi user plugin provides. Example Below:
Code:
<?php check_user_permission($username, $permission_node); ?>
<?php check_user_permissions($username); ?>
The above (check_user_permissions()) function will return an array of all permissions in the following format: 'permissionname' => bool