Detecting whenever a user types – in the Gutenberg editor, and checking if there is a preceding or succeeding – then converting both to an em dash

I managed to find an answer to this. Instead of adding an event listener to the editor, I hooked some additional functionality onto Gutenberg’s Autocompleter instead: I wrote a post here detailing how I did this, if anyone is looking to do the same thing: https://blog.terresquall.com/2023/06/how-i-made-double-dashes-automatically-convert-to-em-dashes-in-wordpress-gutenberg-editor/

website not indexed

If you go to example.com/robots.txt, that will show you the directives for search engine bots. You can also check the meta tags on individual pages to see if they’re being blocked. Best option would be Google Search Console’s URL Inspection Tool. If the URL Inspection tool does not explain why the page is not being … Read more

How do I create a shortcode that returns a logged in users’ email?

Need to move wp_get_current_user() inside of the shortcode’s callback (untested): function current_user_email_address() { if ( ! is_user_logged_in() ) { return ”; } $user = wp_get_current_user(); if ( empty( $user->user_email ) ) { return ”; } return esc_html( $user->user_email ); } add_shortcode( ‘current_user_email_address’, ‘current_user_email_address’ );

Why Does get_page_by_path Return The Sample Post?

If the page doesn’t exist, then get_page_by_title() returns null, which when passed into get_page_link() still returns a URL, which could conceivably redirect to the sample post. Check the value of get_page_by_title() is valid before using.