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?
- Reload part of checkout on changed shipping method
- Trying to build simple deposit code that hooks into woocommerce
- 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?
- Add a product to checkout via form
- How can I save unique user data on my site? [closed]
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Why ajax doesn’t work on certain wordpress hooks?
- Remove a div from RSS feed
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Set meta field to publish date + 2 weeks
- How to add an arrow to menu items has submenus
- WordPress Gravatar filter is removing my custom attributes
- Error in custom php function doesn’t exist
- Don’t insert if permalink is the same?
- Return a numerical function value in Customizer controls
- Adding widgets to my plugin page instead of WordPress dashboard
- Cannot execute php files in wp-content
- edit_comment_link is not showing for comment author
- Paypal form integration with wordpress registration form without plugin [closed]
- Adding function to Genesis genesis_header [closed]
- Custom Front End Registration – How Does the Key work in the Password Set Request?
- Modify custom field input data before creating a new post
- how to make custom ajax handler?
- Are all hooks/functions tied to Kses meant for sanitization?
- Styling my own password protected page, how to deal with wrong password?
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- Security: blocking direct access of php files
- How to know where this function definition is declared?
- Why does wp_head hook my functions to the beginning of my source code?
- Pass argument to event hook
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- Should `wp_login` be used since it’s deprecated?
- Correct and safe way to include php content in my page
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- User register hook is not working in woocomerce register form
- How to add API security keys into JS of wordpress securely
- How to use a custom hook
- Is it best to avoid using $wpdb for security issues?
- Hardening uploads folder in IIS breaks images
- Theme activation hook in php class
- Troll the hackers by redirecting them
- Fatal error: Call to undefined function register_new_user()
- Theme not calling Jquery properly
- How Can I Edit the Registration Code?
- Security updates to 3.3.2
- How do you create two separate Register pages?
- 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
- How to catch wordpress post ID when it’s published
- WordPress redirect redirecting too many times or not at all
- how to prevent wordpress admin from logging in via woocommerce my-account page
- Why does the post_type_link hook everything twice?
- malware undetectable by multiple scans
- Redirecting to a custom forgot password page
- Decoded malware code [closed]
- How to have different site identity logos on each page on Astra Theme [closed]
- How can I hook into the wp_mail function used by BackWPup?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- How do I create a function that modifies a message in the wp-login.php file?
- WordPress produces identical hash all the time
- Get user custom field value on function.php
- 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
- Custom User Registration script only allowing usernames with 16 characters
- Add a custom class to the body tag using custom fields
- Updating From Mobile App – Exposing Site to Hacking
- Must filter functions receive all arguments passed to them?
- Why doesn’t global $wp_query not get hooked?
- Creating customized php files in theme folder
- Dynamically Generate Functions and Hooks
- How to pass hook variable to function?
- Remove password protection from all posts
- security concerns if using html data-* attribute for l10n?
- save_post trigerred twice
- Password protect URLs
- How to correctly escape an echo
- How to sort WooCommerce products page by latest in-stock items first?
- Reject all malicious URL requests functions.php
- Generate a QR code when creating a new WordPress user
- Replace a single variable with add_filter
- Filter wordpress posts without searching the keywords in the post content
- portfolio site – about this site section – is it safe to post some code
- Variation prices breakdown only for single product page
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- How do I add a function to parent theme
- Display custom field value in woocommerce variable product via jQurey
- Prevent header and footer from loading on specific pages with template or plugin
- Add custom field on admin dashboard comments / reviews
- echo cutom css code to WordPress page template file ? is this safe?