features
4 years ago
roles
4 years ago
admin-load.php
4 years ago
admin.php
4 years ago
backup-handler.php
4 years ago
backup.php
4 years ago
cap-helper.php
4 years ago
filters-admin.php
4 years ago
filters-woocommerce.php
4 years ago
filters-wp_rest_workarounds.php
5 years ago
filters.php
4 years ago
functions-admin.php
4 years ago
functions.php
4 years ago
handler.php
4 years ago
inflect-cme.php
7 years ago
manager.php
4 years ago
network.php
4 years ago
pp-handler.php
4 years ago
pp-ui.php
4 years ago
publishpress-roles.php
4 years ago
settings-handler.php
4 years ago
settings.php
4 years ago
settings-handler.php
27 lines
| 1 | <?php |
| 2 | /* |
| 3 | * PublishPress Capabilities [Free] |
| 4 | * |
| 5 | * Process updates to plugin settings |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | add_action('init', function() { |
| 10 | if (check_admin_referer('pp-capabilities-settings') && current_user_can('manage_capabilities')) { |
| 11 | if (!empty($_POST['all_options'])) { |
| 12 | foreach(array_map('sanitize_key', explode(',', sanitize_text_field($_POST['all_options']))) as $option_name) { |
| 13 | foreach (['cme_', 'capsman', 'pp_capabilities'] as $prefix) { |
| 14 | if (0 === strpos($option_name, $prefix)) { |
| 15 | |
| 16 | // Free plugin doesn't currently have any settings, so disable this code for now to avoid sanitization concerns. |
| 17 | |
| 18 | // Leave upstream conditionals in place to ensure access is properly regulated in any future implementation. |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | do_action('pp-capabilities-update-settings'); |
| 25 | } |
| 26 | }); |
| 27 |