Plugin Author
Paolo
(@paoltaia)
hi @alexzaragoza21,
I’m sorry for the late reply and also to tell you that’s not possible out of the box.
I asked to the developers if a plugin like the user role editor could help with this. We will let you know asap.
Thanks for your patience 🙏
I really appreciate your help. Please let me know if this is possible. Hope there is a way.
My client wants to delegate tasks to his editor and he doesn’t want to just give an admin account.
More power to your team! Thank you so much. 🙂
Plugin Author
Paolo
(@paoltaia)
Hi Alex,
with the current version, it is not possible.
That said, we added a hook that will be available from the next update. A code snippet will make it possible to enable other roles to edit those fields.
This would be an example of the code needed for fields “for_staff” & “covid_note” for the editor role:
/**
* Extend "Admin Only" field edit to user with Editor role.
*/
function gd_snippet_add_listing_custom_field_is_hidden( $is_hidden, $field, $package_id, $default ) {
if ( $is_hidden && ! empty( $field['for_admin_use'] ) && is_user_logged_in() && ( $roles = (array) wp_get_current_user()->roles ) ) {
if ( in_array( 'editor', $roles ) && in_array( $field['name'], array( 'for_staff', 'covid_note' ) ) ) {
$is_hidden = false;
}
}
return $is_hidden;
}
add_filter( 'geodir_add_listing_custom_field_is_hidden', 'gd_snippet_add_listing_custom_field_is_hidden', 11, 4 );
If you wish, you can test this by downloading the development version of the plugin from Github.
Let us know how it goes.
-
This reply was modified 5 years, 2 months ago by
Paolo.
This is great! Thank you so much! 🙂
Plugin Author
Paolo
(@paoltaia)
You are welcome, if you are enjoying GeoDirectory and the service we provide, please consider posting a review… Thanks!
I did a review and I am really thankful I found your plugin. I hope your next update will happen this month?
Thank you so much. 🙂