You’re not closing the first if tag.
/* Update user information. */
if ( !empty( $_POST['url'] ) ){
update_user_meta( $current_user->id, 'user_url', esc_url( $_POST['url'] ) );
} else{
delete_user_meta( $current_user->id, 'user_url');
}
Also, you should use esc_url_raw
on a raw url and then if you’re echoing into the html use esc_url
. You also shouldn’t save esc_attr
values. This is to be used when echoing as an html attribute value. Instead, try wp_filter_kses()
.
Related Posts:
- Unable to locate WordPress Content directory (wp-content)
- Update wordpress fail – There has been a critical error on your website
- 418 header status, I’m a teapot [closed]
- Recommend a guide to catching plugin errors, please?
- File available but giving 404 in wordpress
- is_wp_error() and handling errors
- After upgrading Debian Buster to Bullseye, WordPress sites no longer updating
- How to Fix “Are You Sure You Want to Do This”, while uploading my theme?
- Error on moving WordPress site to Host from Local installation
- 500 error after update
- Unable to locate WordPress content directory
- WP Core Update Issue
- styles/default.css in markup, where does it come from? [closed]
- Internal Server Error only on frontend and certain admin pages
- Critical error but refresh fixes it
- CSS and JS not loading after uploading onto server
- Crawl Errors in Search console
- A SINGLE Post Giving an “Under Maintenance” Message
- Seeing “error” as text on white when accessing admin
- WordPress installation self deleted in server restart. SQL Tables gone too!
- Error updating WordPress, does not ask for FTP password, just error
- Error establishing a database connection in godaddy.com
- Can (slow) Internet speed get you a 500 server error? [closed]
- Critical error after updating my wordpress
- Importing content but it displays that it already exists
- How to display a custom page for 400 error message for WordPress website hosted on a NGINX server?
- Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error
- What is your best practice to execute one-time scripts?
- Add validation and error handling when saving custom fields?
- Showing errors with $wpdb update
- Change login error messages
- Customizing a WordPress theme without changing it?
- WP_DEBUG is not set, but I’m still getting warnings
- An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration
- How to disable the fatal error (WSOD) protection?
- No Error Log File, no debug info
- Plugin SVN & update API – how are plugins identified?
- What are the best practices for updating?
- WordPress local development environment [closed]
- Why do I get the timeout warning?
- Could not create directory /wp-content/upgrade/
- Getting the warning: Missing argument 2 for manage_posts_custom_column()?
- What log files does a WordPress installation write to?
- How to display admin error notice if settings saved succesfully?
- HTTPS leads to Sorry, you are not allowed to access this page
- How to fix “There has been a critical error on your website. Please check your site admin email inbox for instructions”?
- Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445
- What is the best way to monitor PHP functions/executions?
- Notice: Use of undefined constant SCRIPT_DEBUG
- Notice: Constant WP_POST_REVISIONS already defined
- Uncaught ReferenceError:switchEditors is not defined
- How to stop certain warning logging in error.log?
- WordPress Redirecting to wp-admin/install.php
- WP_Widget deprecated error in WordPress V4.3
- Error 404 Page Not Found When Updating a Post or Page
- Debug mode shows Strict Standards
- Upgrading WordPress and Plugins; any Tips to Avoid Trouble?
- How to use WP_Error $data argument?
- Is it possible to disable caching of an option when using w3 total cache?
- Why is Google Webmaster Tools telling me to update WordPress
- Update, add, remove plugins, themes or wordpress behind load balancer
- How to force function to run as the last one when saving the post?
- Why on Earth am I getting “undefined_index” errors?
- How to log plugin errors to plugin error_log file
- Showing error “Function create_function() is deprecated”
- strange characters in wordpress website displayed for visitors [closed]
- How to disable automated E-Mail on PHP error/exception?
- How to override wp-login.php
- Debugging ‘Object of class WP_Query could not be converted to int’ error
- How to fix ob_end_flush() error?
- When does remove_filter not work?
- wp_remote_get() not retrieving pages properly
- error_log over 70GB. How to stop this? [closed]
- $wpdb->insert Database Error Duplicate Entry Error Logging
- WordPress error – PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata()
- This webpage is not available ERR_NAME_NOT_RESOLVED
- Displaying oEmbed errors?
- Getting headers already sent error from plugin
- “Apache HTTP Service has stopped working” with WP Query in WordPress 2.9.2
- Error 310 too many redirects after switching domains
- How do I set up Debugging?
- get_terms return errors
- WordPress plugin search does not work and updates are not shown, VPS install
- Error Logs to Diagnose Error 500 in LAMP
- Add image only in first post
- Error messages when adding code to function.php or trying to delete inactive plugin files
- “Notice: Undefined index:” error when adding new content?
- Make page template that is just an “include” of another?
- Showing “ Notice: Undefined variable:” and “ Notice: Trying to get property of non-object”
- Publishing Time – WordPress Plain White Screen with No Error
- Object of class WP_Error could not be converted to string
- Problem : deletion failed, the theme requested does not exist
- New WordPress Error Message – Not seen this before
- What is causing this error? “Warning: Invalid argument”
- Does wordpress have an error log?
- woocommerce_before_calculate_totals in woocommerce 3.0
- WP_DISABLE_FATAL_ERROR_HANDLER vs WP_DEBUG ? What to use and when to use to see errors?
- How Can I setup WP CLI on Windows development machine running AMPPS?
- Handling duplicates with wp_insert_term()
- How to handle core code throwing notice on valid input?