ftpwp
Forum Replies Created
-
Did you also accidentally integrate the signature?
What do you mean?
Ok, so what I’ve done is:
- I did not remove the Asgaros Mention setting on the WP user profile form
- I just added the same setting in the UM user profile form and did not communicate on the one on the WP form
And to add the Mention setting on the UM user profile form, the solution I’ve used is the following:
- I’ve created a custom checkbox field on the UM Profile form with “profile_new_mention_notification” as Meta Key and “Enabled” as Edit Choices
- And I’ve added the following code in my child theme Functions.php…
// When a new user registers, enable the Mention notification setting on the UM profile as it's enabled by default on Asgaros add_action('um_after_register_fields', 'add_a_hidden_field_to_register'); function add_a_hidden_field_to_register( $args ) { echo '<input type="hidden" name="Profile_new_mention_notification[]" value="Enabled" />'; } // Check if the WP and the UM Mention settings are aligned. If not, align the UM one on the WP one prior to open the UM user profile form add_action( 'um_access_profile', 'align_mention_settings', 10, 1 ); function align_mention_settings( $user_id ) { // Check if the WP and the UM Mention settings are aligned $mention_wp_settings = get_user_meta($user_id, 'asgarosforum_mention_notify', true); // yes, no or Empty = yes $mention_wp_settings = ( $mention_wp_settings == "" ) ? "yes" : $mention_wp_settings; $mention_um_settings = get_user_meta($user_id, 'profile_new_mention_notification', true);; // array() or Empty = no $mention_um_settings = ( $mention_um_settings == "" ) ? "no" : "yes"; // If different, align the UM one on the WP one if ( $mention_wp_settings <> $mention_um_settings ) { if ( $mention_um_settings == "no" ) { update_user_meta($user_id, 'profile_new_mention_notification', array (0 => 'Enabled')); } else { delete_user_meta($user_id, 'profile_new_mention_notification', array (0 => 'Enabled')); } // Empty the user's cache to force the user_meta update to be immediately applied UM()->user()->remove_cache( $user_id ); } } // Update the WP user Mention setting if the UM user profile is updated/saved add_action('um_user_after_updating_profile', 'apply_email_notification_settings', 10, 2); function apply_email_notification_settings( $submitted, $user_id ) { // Check if 'profile_new_mention_notification' is ticked if ( isset($submitted['profile_new_mention_notification']) ) { // If ticked, tick the Asgaros field in the user WP profile update_user_meta($user_id, 'asgarosforum_mention_notify', 'yes'); } else { // If unticked, untick the Asgaros field in the user WP profile update_user_meta($user_id, 'asgarosforum_mention_notify', 'no'); } }
That’s all! ??
Yes, I have the solution.
I’ve centralized the notifications for new blog posts, new comments on the user’s blog posts and new mentions of the user on the Asgaros forum in the UM user’s profile.
But I’m not at home this week so I’ll give u the solution this WE ??
The issue is indeed fixed for me, but the documentation has still not been updated…
https://docs.ultimatemember.com/article/270-how-to-change-default-ultimate-member-blue-color-using-cssIn real it has been fixed only on the version 2.1.0!
https://github.com/ultimatemember/ultimatemember/issues/453Fixed in version 2.1.0!
Closed
Fixed!
$user_id
variable added in theum_user_after_updating_profile
hook in version 2.1.0…
https://github.com/ultimatemember/ultimatemember/issues/579
…and then I just needed to use theadd_role()
&remove_role()
functions.Forum: Fixing WordPress
In reply to: Blank page and error 500 after auto update to 5.3.1Any idea how to remove this message?
Forum: Fixing WordPress
In reply to: Blank page and error 500 after auto update to 5.3.1I followed the detailed instructions…
Like I said, that’s what I did.
I strictly followed those instructions…But the message is still there.
I guess it’s an issue with the WordPress upgrade program.
When I ran it it said I already had the last version of WP.
Not sure it did anything, even the very last steps to confirm the update was completed :-/Forum: Fixing WordPress
In reply to: Blank page and error 500 after auto update to 5.3.1Thanks @t-p!
I followed the detailed instructions and everything is back to normal now.
Except, that I have this message that’s not going away…
An automated WordPress update has failed to complete – please attempt the update again now.
…even when I click on “please attempt the update again now” :-/
What does it mean?
How can we remove it?Forum: Plugins
In reply to: [RSSImport] Date first, before title?Hi,
Thanks but I’m currently not interested in developing, maintaining and supporting a WP plugin. I was just trying to help. Sorry.
It’s sad though cause this plugin is simple but allows to do whatever we want without being forced to use not suitable designs imposed by most other plugins.
I’ll keep using it as long as it’s still compliant with the last WP version.
Thanks.
Forum: Plugins
In reply to: [RSSImport] Date first, before title?Hi @bueltge,
I really don’t know why this topic is tagged “Resolved” as obviously, so far it was not.
Anyway…Maybe you should change this order via CSS, so that the visual result is like your goal.
Are you sure this is even possible?
Once again, I really don’t know how CSS can help split a string in smaller sub strings and re-order them. I would have appreciated a bit more support if you think it’s possible. I’ve asked my question 6 months ago now ??So I had no other option than to look into the code.
Fortunately this plug-in is quite simple. Only 1 file. And I straight away found an easy solution :Search for those lines…
$echo .= '<a' . $target . $rel . ' href="' . $href . '" title="' . $atitle . '">' . $title . '</a>'; if ( isset( $pubDate ) && $date && '' !== $pubDate ) { $echo .= $before_date . $pubDate . $after_date; }
And replace them by those ones (to just move the date before the title)…
if ( isset( $pubDate ) && $date && '' !== $pubDate ) { $echo .= $before_date . $pubDate . $after_date; } $echo .= '<a' . $target . $rel . ' href="' . $href . '" title="' . $atitle . '">' . $title . '</a>';
Then use the
before_date
&after_date
parameters to adjust the design.That’s it. Done!
It was really easy.Now, it’s a modification I have to do in the code of the plug-in. So it’s a pity as if a new update comes, it will be removed.
So why not adding in the core of the plugin the possibility to order the 4 items that can be displayed?
– Title
– Date
– Creator
– DescriptionBeing able to get such combination or few others makes sense…
2019-06-20 – Saft équipera l’avion régional MA700 du chinois AVIC
2019-06-20 – Bpifrance entre au capital de Sabena technics
2019-06-18 – International Airlines Group annonce son intention…
2019-06-18 – Global Space, le nouveau rendez-vous de référence…
2019-06-17 – Siemens lance sa solution IPP&E pour le secteur…It could just be one additional parameter, for example called “order”, with settings like this:
–order="date,title,creator,description"
–order="title,date,description,creator"
– or even thisorder="date,description"
with only 2 items to displayThen in the code you just need to:
– explode the value of “order” in an array…
$order_array = explode(",", $order);
– and for each value, run the appropriate code to build you HTML code in the right order…foreach ($order_array as $items) { switch ($items) { case "title": // Code to add the title $echo .= '<a' . $target . $rel . ' href="' . $href . '" title="' . $atitle . '">' . $title . '</a>'; break; case "date": // Code to add the date if ( isset( $pubDate ) && $date && '' !== $pubDate ) { $echo .= $before_date . $pubDate . $after_date; } break; case "creator": // Code to add the creator if ( isset( $creator ) && $creator && '' !== $creator ) { $echo .= $before_creator . $creator . $after_creator; } break; case "description": // Code to add the description if ( isset( $desc ) && $displaydescriptions && '' !== $desc ) { ... } break; } }
That’s it. Done!
As simple as that.What do you think about this possible enhancement?
Thanks.Forum: Themes and Templates
In reply to: [OceanWP] Navigation arrows and close button show as square..4. After updating the user meta, you can clear the user cache with the following code:
UM()->user()->remove_cache( $user_id );
Great, that’s exactly what I needed! ??
Thanks.And from this starting point, the whole processes started to work so I could investigate a bit more the hook issue. In fact…
–template_redirect
is definitively not the one to use (for my case). It’s called constantly, for ALL WP pages.
–um_before_form_is_loaded
is much better. It’s limited to UM pages but still, it’s also called too often, for ALL UM forms.
– So I think I found the one I was looking for:um_access_profile
. This one is only called before loading the UM profile page (either in view or edit mode). It’s not even called before loading the UM account page, only the profile page, so it’s exactly what I was looking for. And… cherry on top of the cake, it’s providing the $user_id of the profile we’re about to open, no need to look for it and it’s early enough to still allow updating the user meta and see the changes in the profile once opened. The perfect hook I was looking for!3. Role field is a pre-defined field that you can add to the Register & Profile forms. This allows users to change their role.
Ok.
1. To retrieve the ID of current viewing profile, you can use this function
um_profile_id()
.That’s returning the current user id. I was looking for the id of the profile we were about to open.
Anyway, once again, in 2 messages you gave me all the solutions or right directions.
Unless you see an issue usingum_access_profile
, my issue is solved.Thanks very much @champsupertramp ! ??