You need to use strlen()
to determine the length of a variable, so your second if
condition is invalid.
As it is, this question is not really related to WordPress, so likely off-topic.
Related Posts:
- Enforcing password complexity
- user_profile_update_errors hook not executing
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Run a code only on theme activation only during first activation
- Help hooking into user_register
- Hook into all password resets in WordPress and get password before hashing?
- Sending the reset password link programatically
- WordPress and event-driven programming – what is it about?
- Change the footer text on the login page
- How to remove a metabox from menu editor page?
- How to disable wordpress confirmation email for new users
- How do I create a WP user outside of WordPress and auto login?
- wordpress separate registration for different roles
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Is it unsafe to put php in the /wp-content/uploads directory?
- Hooking new functions to actions + passing parameters
- Replace existing content from specific WooCommerce admin orders list column
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- items_wrap not working
- Is this code malidcous
- WordPress shows registration link for non logged users
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- action hook wp_head higher priority as all other plugins/hooks
- using add_action for a header hook that has an additional parameter
- How to call function at the bottom of post using plugin?
- Admin username and password
- Evaluations of two wordpress security plans against php code injection attack
- What’s the best user registration library to integrate WordPress?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- WordPress custom login form using Ajax
- Remove an action hook within a Class
- How to pass arguments to add_action() or retrieve return value of called function?
- SQL Injection blocked by firewall
- Edit incorrect password message WordPress
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Remove metabox from WordPress menu editor page?
- How to add an arrow to menu items has submenus
- Don’t insert if permalink is the same?
- Custom Front End Registration – How Does the Key work in the Password Set Request?
- how to make custom ajax handler?
- Why does wp_head hook my functions to the beginning of my source code?
- Pass argument to event hook
- Correct and safe way to include php content in my page
- How to add API security keys into JS of wordpress securely
- Hardening uploads folder in IIS breaks images
- Troll the hackers by redirecting them
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- Get access to variable from previous pageview, excluding ajax-calls
- Why does the post_type_link hook everything twice?
- How to have different site identity logos on each page on Astra Theme [closed]
- How do I create a function that modifies a message in the wp-login.php file?
- WordPress produces identical hash all the time
- Change page password every day (predictable password ;) )
- Send notification email to admin for every new post published
- Adding function to child theme’s function.php
- Custom Registration username_exists / email_exists
- Comapare get_user_meta value
- Add a custom class to the body tag using custom fields
- Updating From Mobile App – Exposing Site to Hacking
- Why doesn’t global $wp_query not get hooked?
- Creating customized php files in theme folder
- Remove password protection from all posts
- security concerns if using html data-* attribute for l10n?
- How to sort WooCommerce products page by latest in-stock items first?
- Replace a single variable with add_filter
- How do I add a function to parent theme
- Prevent header and footer from loading on specific pages with template or plugin
- echo cutom css code to WordPress page template file ? is this safe?
- Contain multiple page templates in one PHP custom template file in WordPress?
- Show full post instead of excerpt
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- Custom meta box is not displaying value showing tag as empty
- using filter and hook inside class
- $.ajax results in 403 forbidden
- Site infected by link
- Register/enqueue scripts only on certain admin pages
- Issues adding Recaptcha v3 to WordPress Registration
- How do I get the value of a current user’s custom field?
- add_filter() inside another add_filter()
- Redirecting the lost password page request when using a custon login page
- Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
- Getting page / post URL on publish and / or update
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- How can I move the posted-on date above the post and below the entry-header?
- What is the best practice for restricting a section to logged in users?
- Post formating on Home page
- calling a function from a class in your template
- how to register a second page-template
- Cannot modify header information – headers already sent
- How to quickly/easily make an analysis (reverse engineering) of WordPress?
- Send a custom notification to customer on WooCommerce cancelled order status
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- understanding wp_next_scheduled
- transition_post_status hook, works – but not if the post is new
- Guests comment form – prevent duplicate email addresses
- Change password reqts with NO plugin without breaking resetpass link?
- Woocommerce – add tracking code to another email template