salubritas
Forum Replies Created
-
Forum: Plugins
In reply to: [Cloudflare] Automatic cache purge API errorsI found that I needed to customize the URLs to purge quite heavily anyway, due to custom post types, hierarchical taxonomies etc. so I fixed this error while I was doing it. Think it was due to comment feeds being turned off or similar.
All via the provided filter cloudflare_purge_by_url.
Forum: Plugins
In reply to: [Disable New User Notification Emails] There’s an easier way to do thisWe use the remove action/add action above with the function provided. It needs the remove/add actions or it won’t do anything.
It does exactly what we want which is not send a notification to admin but sends a notification to the user if the box is ticked.
If you are not a developer it’s best to get one to integrate the code for you. I don’t recommend simply copying and pasting code you find without first understanding what it is doing.
Forum: Plugins
In reply to: [Disable New User Notification Emails] There’s an easier way to do thisI think we discovered that as well and changed it a little.
function mytheme_wp_send_new_user_notifications( $user_id, $notify = 'user' ) { switch($notify) { case 'admin': $notify = 'none'; break; case 'both': $notify = 'user'; break; } wp_new_user_notification($user_id, null, $notify); }Forum: Plugins
In reply to: [Disable New User Notification Emails] There’s an easier way to do thisRemove “public static” from the function declaration. That’s for when it is inside a class.
Forum: Plugins
In reply to: [LuckyWP Table of Contents] TOC links scroll to wrong location on FirefoxOK great.
Forum: Plugins
In reply to: [LuckyWP Table of Contents] TOC links scroll to wrong location on FirefoxOK, I have disabled smooth scrolling for a short time on version 1.9.11.
It looks bad because the scroll offset is needed to stop the headings from going under the nav bar.
I’ll turn it back on soon.
Forum: Plugins
In reply to: [LuckyWP Table of Contents] TOC links scroll to wrong location on FirefoxNo, it’s too serious a bug to allow on a live site.
Are you saying you testing it fully on Firefox with no problem?
Forum: Plugins
In reply to: [LuckyWP Table of Contents] TOC links scroll to wrong location on FirefoxThis is so bad I’ve gone back to v1.9.11 and turned off auto updates.
No problem, thanks for explaining. It was confusing!
Forum: Plugins
In reply to: [Custom Icons for Elementor] Disable Elementor default iconsA while ago the Elementor page with code to dequeue the icon styles was updated, and the new code worked for me:
I wanted to do exactly the same thing, due to using a plugin which for some reason reinvents the wheel and has its own media library.
I found that adding the following attributes to an img tag causes Jetpack lazy load to take effect:
class="jetpack-lazy-image" data-lazy-src="{YOUR IMAGE SRC}?is-pending-load=1" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"There are some downsides to this:
1. Doesn’t add the noscript tag
2. Risk of breaking if Jetpack changes their implementation
3. Doesn’t work if you have images in HTML added to the page dynamically e.g. using an AJAX “load more” type of functionalityThe last point was a problem for me. Jetpack lazy load used in the normal way doesn’t kick in for HTML loaded with AJAX, but I couldn’t see how it does that by inspecting the Jetpack code.
So I came up with an alternative of using the standard WordPress get_image_tag function to get the HTML for a placeholder image of the same size as the actual image, then replacing the src of the resulting HTML. All the images I wanted to use this method for are the same size so it works nicely.
Forum: Plugins
In reply to: [Disable New User Notification Emails] There’s an easier way to do thisIf you are doing it via functions.php it should work with something like:
remove_action( 'register_new_user', 'wp_send_new_user_notifications' ); remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10 ); add_action( 'register_new_user', 'mytheme_wp_send_new_user_notifications', 10, 2 ); add_action( 'edit_user_created_user', 'mytheme_wp_send_new_user_notifications', 10, 2 ); public static function mytheme_wp_send_new_user_notifications( $user_id, $notify = 'both' ) { wp_new_user_notification( $user_id, null, 'user' ); }Untested!
Forum: Plugins
In reply to: [W3 Total Cache] 301 redirect status code changed to 404Yes but thank you for replying. I suppose the only thing I would say is there should never be a situation where it is possible to get a 404 status and a location header (AFAIK). Maybe some sort of validity check needs adding (don’t know if in Yoast or W3TC) to prevent that situation.
Forum: Plugins
In reply to: [W3 Total Cache] 301 redirect status code changed to 404Somehow the redirect URLs were wrong in Yoast SEO. Changing them has fixed this.
Some very obscure symptoms for a simple underlying cause!
Apologies, this is fixed in 2.5.5