Vladimir Garagulya
Forum Replies Created
-
Forum: Plugins
In reply to: [User Role Editor] Contact Form 7 ConflictCF7 protects admin menu with these meta capabilities:
Contact wpcf7_read_contact_forms
Contact Forms wpcf7_read_contact_forms
Add New wpcf7_edit_contact_forms
Integration wpcf7_manage_integrationand defines its custom post type ‘wpcf7_contact_form’ with the similar list of user capabilities:
'capabilities' => array( 'edit_post' => 'wpcf7_edit_contact_form', 'read_post' => 'wpcf7_read_contact_form', 'delete_post' => 'wpcf7_delete_contact_form', 'edit_posts' => 'wpcf7_edit_contact_forms', 'edit_others_posts' => 'wpcf7_edit_contact_forms', 'publish_posts' => 'wpcf7_edit_contact_forms', 'read_private_posts' => 'wpcf7_edit_contact_forms', )You don’t see these capabilities at User Role Editor as they are not exist and not added automatically. CF7 maps them to the existing user capabilities this way:
add_filter( 'map_meta_cap', 'wpcf7_map_meta_cap', 10, 4 ); function wpcf7_map_meta_cap( $caps, $cap, $user_id, $args ) { $meta_caps = array( 'wpcf7_edit_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, 'wpcf7_edit_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, 'wpcf7_read_contact_form' => WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7_read_contact_forms' => WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7_delete_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, 'wpcf7_delete_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY, 'wpcf7_manage_integration' => 'manage_options', 'wpcf7_submit' => 'read', ); $meta_caps = apply_filters( 'wpcf7_map_meta_cap', $meta_caps ); $caps = array_diff( $caps, array_keys( $meta_caps ) ); if ( isset( $meta_caps[$cap] ) ) { $caps[] = $meta_caps[$cap]; } return $caps; }Constants definition contains the answer why you can not use CF7 and posts/pages editing separately:
define( 'WPCF7_ADMIN_READ_CAPABILITY', 'edit_posts' ); define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'publish_pages' );But you can redefine CF7 meta caps using CF7 own filter ‘wpcf7_map_meta_cap’ (applied at the wpcf7_map_meta_cap() showed above) and solve your task.
Forum: Plugins
In reply to: [User Role Editor] PHP v8.0Thank you. I will include the fix into the next update.
Forum: Plugins
In reply to: [User Role Editor] Other default roles for new registered userHi,
Try development version 4.58 (download it from “Advanced View”). It includes the requested update.
Hello David,
Take into account that ‘edit_products’ capability belongs to the WooCommerce plugin. User Role Editor (URE) is just the tool, which allows to see existing user capabilities and grant/revoke them to/from the user roles. URE does not grant itself ‘edit_products’ capability to any role. URE does not manage itself what is shown to users in WooCommerce, but what is hidden. WooCommerce and WordPress are fully responsible for this according to capabilities/permissions granted to the user roles.
Forum: Plugins
In reply to: [User Role Editor] Discount coupons ProblemHello!
Try to add edit_posts capability. Will it help?
Forum: Plugins
In reply to: [User Role Editor] Other default roles for new registered userHi,
I reviewed the related code and confirm. Current version adds other (additional) default roles to the new user only in case if new user is added/registered by authorized user who has permissions to edit this user. Yes, it works only from the backend creation.
Forum: Plugins
In reply to: [User Role Editor] Administrator role missingIf this issue is still actual, look at this article.
Forum: Plugins
In reply to: [User Role Editor] Other default roles for new registered userUnfortunately, I can not repeat the issue. Recently made test showed that additional roles, set a default were added to the new registered user as expected.
You wrote “It’s just assigning only default role…”. Clarify, how new user is created. Do you use “Users->Add New” (/wp-admin/user-new.php) page for this?
If ‘Yes’, do you see the pre-selected other default roles at the “Other Roles” field under the “Role” one?If you answer Yes, on all questions above, try to deactivate all plugins except URE. Will it help?
Forum: Plugins
In reply to: [User Role Editor] Limit capabilities of other adminsCreate new role as a copy of administrator role, revoke unneeded capabilities, use it to grant for the restricted admin users.
Forum: Plugins
In reply to: [User Role Editor] Assign user role by text fieldLook if this hook
woocommerce_new_customer_datawill work for you. You can realize own logic to change new registered user role, what one you wish.Example of its usage is available here.
Forum: Plugins
In reply to: [User Role Editor] Other default roles for new registered userHi,
Default role(s) are assigned to a new user automatically only in case role ID is not sent to the WordPress user insertion API. Also default roles are pre-selected at the new user registration page at wp-admin. In case new user record is sent to the WordPress (by some plugin for example) with apparently pointed role ID, default role(s) settings are ignored.
Forum: Plugins
In reply to: [User Role Editor] Limit post creation by user roleHi,
User Role Editor (including Pro) does not include such feature.
Forum: Plugins
In reply to: [User Role Editor] Capabilities do not updateThanks for the information that it’s not a new installation, but updated one. Try to force a browser page refresh – Ctrl+F5 – in order page loads the newest version of JavaScript files. As a final step try to clear a browser cache.
Forum: Plugins
In reply to: [User Role Editor] Capabilities do not updateHi,
There is no need in a special fix. Something is going wrong. Is it the singular JavaScript error message for this page? Or is there some other, upper in the console?
Generally, when some other plugin produces JavaScript error, URE can not use its own.Hi,
Generally, WordPress shows similar message when other user has the post opened for editing at the same time. Look if it’s not your case.