elnoi
Forum Replies Created
-
Forum: Plugins
In reply to: [Activity Log - Monitor & Record User Changes] administrator userThanks Ariel,
I encourage you to implement this option, since, when there is a lot of activity from the main administrator, some user’s records are lost in the middle of the administrator’s activity.
Beyond perhaps detecting an intruder who has logged in as an administrator, one’s own records are more annoying than anything else.
I’m sure you will find a viable solution for a next update.
Thanks
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationI do not understand very well your question.
In any case, as I explained from the beginning, the idea was to apply the visibility limitation, according to one or two user roles created, on many pages or posts at once.
But I thought this had already been clear from the first consultation contact.
I apologize if I have not expressed myself well or if the translation has not been adequate.
In any case, for some strange reason, perhaps because I haven’t been able to explain myself well, none of the proposals have worked. I have tried them all.
Although it would be nice if this option were a little easier to do
I insist! I encourage you to implement this option in new versions, since there are other plugins, which do more or less the same as yours, and already have this capability implemented. For some reason it will be
Thanks to the lack of working solutions, we can close the topic.
Regards,
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationIt hasn’t worked for me either
I’m probably doing something wrong, although I’ve tried everything.
I have already wasted more time on proofs than perhaps what it would have taken to point out the 300 pages one by one.
In the end I will have no choice but to entertain myself by doing it manually.I encourage you to implement this massive application option.
If it existed, in cases like mine, it is easier to apply it to all the pages and then manually modify the few that vary.Maybe I’ll get by using a competitor’s plugin that does have a massive application system, even though I liked yours better.
Thank you for your patience and help even though it didn’t work in the end.
Regards,Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive application$pages = array(1297, 14); // The list of pages IDs that need to be protected
foreach($pages as $page) {
update_post_meta($page, '_members_access_role', 'user_nivel_1'); // Replace administrator to different role
}Seeing that it didn’t work, I also tried it with a proposed code by IA ChatGPT
function assign_roles_to_pages() {
// Llista d'IDs de les pàgines a protegir
$pages = array(1297, 14); // Afegeix aquí els IDs de les pàgines que vols protegir
// El rol que vols assignar (modifica'l segons necessitis)
$roles = array('user_nivel_1'); // Afegeix aquí els rols que vols assignar
foreach($pages as $page) {
// Comprova si la pàgina existeix
if (get_post($page)) {
// Obtenir els rols actuals
$current_roles = get_post_meta($page, '_members_access_role', true);
if (!is_array($current_roles)) {
$current_roles = array();
}
// Afegir els rols nous als existents
foreach ($roles as $role) {
if (!in_array($role, $current_roles)) {
$current_roles[] = $role;
}
}
// Actualitza la metadada de la pàgina per assignar-li els rols
update_post_meta($page, '_members_access_role', $current_roles);
}
}
}
// Executa la funció una vegada
assign_roles_to_pages();IA GPT has also proposed a solution using SQL
(“If the code does not work, you can try fer-ho directly to the database with an SQL query.”)
But at the moment I don’t dare to tryUPDATE wp_postmeta
SET meta_value = 'a:1:{s:13:"administrator";b:1;}'
WHERE meta_key = '_members_access_role' AND post_id IN (1297, 14);GPT points me to review the code to make sure the _members_access_role key is correct. But I don’t know how to do it.
Anyway, I’m sorry for the inconvenience, but it would have to be something simpler, which I encourage you to implement in the plugin.Regards
- This reply was modified 8 months, 1 week ago by elnoi.
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationIt doesn’t work, I tried 10 times
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationSorry! I have already found how to execute a code with Code Snippets
Still, it doesn’t work for me.
Surely I do something wrong.
I will continue experimenting
Thanks and sorryForum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationHello Omar,
Until now I haven’t had time to try your solution.
I have already installed your code with Snippets and I have replaced ‘administrator’ with a new role created, to activate it on all pages.
I have activated the code.
And nothing happens. I don’t know how to run it or where to run it from.
I would appreciate any help on this.
Thanks!
Note: Because I do not master the English language, I use Google Translate, both to write and to read, so I apologize if, for this reason, I have not understood your explanation well.
Forum: Plugins
In reply to: [Login Logout Menu] AvatarThank you very much for your quick help and contribution.
I’m sorry I can’t share the url because I’m still working on it on local host before buying a domain.
I have modified your code to be able to use dashicons.
But first you have to enter the following code in the functions.php file of the child theme so that the theme can display the dashicons:
//Worpress dashicons are compatible with the theme
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}Below is the modified code that you have provided me:
/**
* Customize HTML for login/logout menu avatar.
*
* @param string $avatar_html The avatar HTML.
* @param string $username The username.
* @param string $avatar_url The URL of the avatar image.
* @return string Modified avatar HTML.
*/
function custom_login_logout_avatar_html( $complete_img, $avatar_html, $username, $avatar_url ) {
// Create an <img> tag with the provided information
$avatar_html = '<span class="dashicons dashicons-admin-users"></span>' . esc_attr( $username );
return $avatar_html;
}
add_filter( 'login_logout_menu_avatar_html', 'custom_login_logout_avatar_html', 10, 4 );Note: I am not fluent in the English language. My writing is a translation made with Google Translate. I apologize if anything is not clear.
Thank you so much
- This reply was modified 8 months, 2 weeks ago by elnoi.
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationThank you very much, I will try it and tell you
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Massive applicationCan you tell me some SQL code to do it through the database with phpMyAdmin?
Thank you!
- This reply was modified 8 months, 2 weeks ago by elnoi.
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Will the updates continue?Thank you
Forum: Plugins
In reply to: [Osom Modal Login] Access with urlperfect! It has worked. Thank you!!
Forum: Plugins
In reply to: [Osom Modal Login] Display Lost Password optionok, I encourage you to implement it