Intercept invalid email during lost_password

Try this: add_action( ‘lost_password’, ‘wpse316932_redirect_wrong_email’ ); function wpse316932_redirect_wrong_email() { global $errors; if ( $error = $errors->get_error_code() ) { wp_safe_redirect( ‘lost-password/?error=” . $error ); } else { wp_safe_redirect( “lost-password/’ ); } } This is utilizing the lost_password action hook that fires right before the lost password form. You were experiencing this because WP will only redirect … Read more

Add a containing DIV to core Gutenberg blocks

I’m sure there are other ways e.g. with CSS only or Add custom class to core blocks in Gutenberg, but regarding: Add a containing DIV to core Gutenberg blocks one way could be with the render_block filter: add_filter( ‘render_block’, function( $block_content, $block ) { // Target core/* and core-embed/* blocks. if ( preg_match( ‘~^core/|core-embed/~’, $block[‘blockName’] … Read more

Stopping People Viewing Draft Posts

Yes, you (read: the logged in user) will be able to see the drafted post. But, a guest will not be able to read it. To test it, login to one browser and create a draft. See its URL in another browser where you don’t login (no cookie, etc).