Rewrite standard $errors messages output via function.php

Try this on function.php <?php add_filter(‘login_errors’, ‘custom_login_error_messages’); function custom_login_error_messages($error) { if (strpos($error, ‘Invalid email address’) !== false) { return ‘The email address you entered is not valid. Please try again.’; } elseif (strpos($error, ‘Lost your password?’) !== false) { return ‘Please click the “Forgot Password” link to reset your password.’; } return ‘Login failed. Please … Read more

Is it possible to automatically set the publication time to 8am on new posts?

you can automate this hour selection with the following code. take into account that this code also affect the date of a post created trough the API. add_filter(“wp_insert_post_data”, function ($data, $postarr, $unsanitized_postarr, $update) { if ( !$update && (“post” === $data[“post_type”]) && (“auto-draft” === $data[“post_status”]) ) { $date = current_datetime() ->modify(“tomorrow 08:00:00”) ->format(“Y-m-d H:i:s”) ; … Read more

Custom function wordpress php

You must be thinking something like this: In this URL: https://myawesomewebsite.com/page?custom_id=456 function check_parameter_in_url() { if ( isset( $_GET[‘custom_id’] ) { //do something } }

Function to filter numbers from string

You could use PHP’s preg_replace() to wrap all the numbers (ie, any successive combination of 0 through 9) in a <span> tag. add_filter( ‘the_content’, ‘wpse426625_number_wrapper’ ); /** * Wraps any number in the content in a <span> tag. * * @param string $content The post content. * @return string The content with the numbers wrapped … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)