wp_unslash() WordPress Function
The wp_unslash() function is a handy little function that helps to clean up data that has been entered into a WordPress form. This function strips slashes from a string of text, which can be useful when dealing with data that has been entered into a WordPress form. The wp_unslash() function can be used to clean up data before it is inserted into the database, or it can be used to clean up data that has been retrieved from the database.
wp_unslash( string|array $value ) #
Removes slashes from a string or recursively removes slashes from strings within an array.
Description
This should be used to remove slashes from data passed to core API that expects data to be unslashed.
Parameters
- $value
(string|array)(Required)String or array of data to unslash.
Return
(string|array) Unslashed $value
.
Source
File: wp-includes/formatting.php
function wp_unslash( $value ) { return stripslashes_deep( $value ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Related
Uses
Uses | Description |
---|---|
wp-includes/formatting.php:stripslashes_deep() | Navigates through an array, object, or scalar, and removes slashes from the values. |
Used By
Used By | Description |
---|---|
wp-includes/kses.php:wp_filter_global_styles_post() | Sanitizes global styles user content removing unsafe rules. |
wp-includes/feed.php:get_self_link() | Returns the link for the currently displayed feed. |
wp-admin/includes/class-wp-ms-sites-list-table.php:WP_MS_Sites_List_Table::site_states() | Maybe output comma-separated site states. |
wp-admin/includes/class-wp-ms-sites-list-table.php:WP_MS_Sites_List_Table::get_views() | Gets links to filter sites by status. |
wp-admin/includes/class-wp-site-health.php:WP_Site_Health::get_test_rest_availability() | Test if the REST API is accessible. |
wp-admin/includes/class-wp-site-health.php:WP_Site_Health::can_perform_loopback() | Run a loopback test on our site. |
wp-includes/ms-site.php:wp_initialize_site() | Runs the initialization routine for a given site. |
wp-admin/includes/class-wp-privacy-requests-table.php:WP_Privacy_Requests_Table::process_bulk_action() | Process bulk actions. |
wp-admin/includes/privacy-tools.php:_wp_personal_data_handle_actions() | Handle list table actions. |
wp-includes/class-wp-xmlrpc-server.php:wp_xmlrpc_server::set_term_custom_fields() | Set custom fields for a term. |
wp-includes/load.php:wp_start_scraping_edited_file_errors() | Start scraping edited file errors. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::handle_load_themes_request() | Loads themes into the theme browsing/installation UI. |
wp-admin/includes/ajax-actions.php:wp_ajax_edit_theme_plugin_file() | Ajax handler for editing a theme or plugin file. |
wp-admin/includes/file.php:wp_edit_theme_plugin_file() | Attempts to edit a file for a theme or plugin. |
wp-admin/includes/ajax-actions.php:wp_ajax_get_community_events() | Handles Ajax requests for community events |
wp-includes/class-wp-customize-nav-menus.php:WP_Customize_Nav_Menus::ajax_insert_auto_draft_post() | Ajax handler for adding a new auto-draft post. |
wp-admin/includes/ajax-actions.php:wp_ajax_delete_plugin() | Ajax handler for deleting a plugin. |
wp-admin/includes/ajax-actions.php:wp_ajax_search_plugins() | Ajax handler for searching plugins. |
wp-admin/includes/ajax-actions.php:wp_ajax_install_theme() | Ajax handler for installing a theme. |
wp-admin/includes/ajax-actions.php:wp_ajax_update_theme() | Ajax handler for updating a theme. |
wp-admin/includes/ajax-actions.php:wp_ajax_delete_theme() | Ajax handler for deleting a theme. |
wp-admin/includes/ajax-actions.php:wp_ajax_install_plugin() | Ajax handler for installing a plugin. |
wp-includes/functions.php:wp_get_raw_referer() | Retrieves unvalidated referer from ‘_wp_http_referer’ or HTTP referer. |
wp-includes/customize/class-wp-customize-selective-refresh.php:WP_Customize_Selective_Refresh::handle_render_partials_request() | Handles the Ajax request to return the rendered partials for the requested placements. |
wp-includes/rest-api/class-wp-rest-server.php:WP_REST_Server::serve_request() | Handles serving a REST API request. |
wp-admin/includes/ajax-actions.php:wp_ajax_save_wporg_username() | Ajax handler for saving the user’s WordPress.org username. |
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:WP_Customize_Nav_Menu_Item_Setting::sanitize() | Sanitize an input. |
wp-includes/class-wp-customize-nav-menus.php:WP_Customize_Nav_Menus::ajax_load_available_items() | Ajax handler for loading available menu items. |
wp-includes/class-wp-customize-nav-menus.php:WP_Customize_Nav_Menus::ajax_search_available_items() | Ajax handler for searching available menu items. |
wp-admin/includes/class-wp-terms-list-table.php:WP_Terms_List_Table::handle_row_actions() | Generates and displays row action links. |
wp-admin/includes/class-wp-ms-users-list-table.php:WP_MS_Users_List_Table::handle_row_actions() | Generates and displays row action links. |
wp-admin/includes/class-wp-ms-users-list-table.php:WP_MS_Users_List_Table::column_username() | Handles the username column output. |
wp-admin/includes/deprecated.php:WP_User_Search::__construct() | PHP5 Constructor – Sets up the object properties. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::unsanitized_post_values() | Gets dirty pre-sanitized setting values in the current customized state. |
wp-includes/class-wp-customize-widgets.php:WP_Customize_Widgets::register_settings() | Inspects the incoming customized data for any widget settings, and dynamically adds them up-front so widgets will be initialized properly. |
wp-admin/includes/ajax-actions.php:wp_ajax_update_plugin() | Ajax handler for updating a plugin. |
wp-includes/class-wp-session-tokens.php:WP_Session_Tokens::create() | Generates a session token and attaches session information to it. |
wp-admin/includes/ajax-actions.php:wp_ajax_parse_embed() | Apply [embed] Ajax handlers to a string. |
wp-admin/includes/ajax-actions.php:wp_ajax_parse_media_shortcode() | |
wp-includes/user.php:retrieve_password() | Handles sending a password retrieval email to a user. |
wp-signup.php:validate_another_blog_signup() | Validates a new site sign-up for an existing user. |
wp-signup.php:validate_blog_signup() | Validates new site signup. |
wp-admin/install.php:display_setup_form() | Display installer setup form. |
wp-admin/includes/class-wp-ms-users-list-table.php:WP_MS_Users_List_Table::prepare_items() | |
wp-admin/includes/theme.php:wp_prepare_themes_for_js() | Prepares themes for JavaScript. |
wp-admin/includes/class-wp-plugins-list-table.php:WP_Plugins_List_Table::__construct() | Constructor. |
wp-admin/includes/class-wp-plugins-list-table.php:WP_Plugins_List_Table::no_items() | |
wp-admin/includes/theme-install.php:install_theme_search_form() | Displays search form for searching themes. |
wp-admin/includes/theme-install.php:install_theme_information() | Displays theme information in dialog box form. |
wp-admin/includes/class-plugin-installer-skin.php:Plugin_Installer_Skin::after() | Action to perform following a plugin install. |
wp-admin/includes/image-edit.php:stream_preview_image() | Streams image in post to browser, along with enqueued changes in |
wp-admin/includes/image-edit.php:wp_save_image() | Saves image to post, along with enqueued changes in |
wp-admin/includes/class-wp-ms-themes-list-table.php:WP_MS_Themes_List_Table::_search_callback() | |
wp-admin/includes/class-wp-theme-install-list-table.php:WP_Theme_Install_List_Table::prepare_items() | |
wp-admin/includes/plugin-install.php:install_search_form() | Displays a search form for searching plugins. |
wp-admin/includes/plugin-install.php:install_plugin_install_status() | Determines the status we can perform on a plugin. |
wp-admin/includes/plugin-install.php:install_plugin_information() | Displays plugin information in dialog box form. |
wp-admin/includes/dashboard.php:wp_dashboard_rss_control() | The RSS dashboard widget control. |
wp-admin/includes/user.php:edit_user() | Edit user settings based on contents of $_POST |
wp-admin/includes/class-wp-plugin-install-list-table.php:WP_Plugin_Install_List_Table::prepare_items() | |
wp-admin/includes/template.php:_admin_search_query() | Displays the search query. |
wp-admin/includes/class-wp-themes-list-table.php:WP_Themes_List_Table::prepare_items() | |
wp-admin/includes/class-wp-themes-list-table.php:WP_Themes_List_Table::_js_vars() | Send required variables to JavaScript land |
wp-admin/includes/class-wp-ms-sites-list-table.php:WP_MS_Sites_List_Table::prepare_items() | Prepares the list of sites for display. |
wp-admin/includes/class-wp-users-list-table.php:WP_Users_List_Table::single_row() | Generate HTML for a single row on the users.php admin panel. |
wp-admin/includes/class-wp-users-list-table.php:WP_Users_List_Table::prepare_items() | Prepare the users list for display. |
wp-admin/includes/media.php:media_upload_form_handler() | Handles form submissions for the legacy media uploader. |
wp-admin/includes/media.php:wp_media_upload_handler() | Handles the process of uploading media. |
wp-admin/includes/post.php:wp_create_post_autosave() | Creates autosave data for the specified post from |
wp-admin/includes/post.php:add_meta() | Adds post meta data defined in the |
wp-admin/includes/post.php:update_meta() | Updates post meta data by meta ID. |
wp-admin/includes/post.php:edit_post() | Updates an existing post with values provided in |
wp-admin/includes/post.php:get_default_post_to_edit() | Returns default post information to use when populating the “Write Post” form. |
wp-admin/includes/post.php:post_exists() | Determines if a post exists based on title, content, date and type. |
wp-admin/includes/ajax-actions.php:wp_ajax_send_attachment_to_editor() | Ajax handler for sending an attachment to the editor. |
wp-admin/includes/ajax-actions.php:wp_ajax_send_link_to_editor() | Ajax handler for sending a link to the editor. |
wp-admin/includes/ajax-actions.php:wp_ajax_heartbeat() | Ajax handler for the Heartbeat API. |
wp-admin/includes/ajax-actions.php:wp_ajax_query_themes() | Ajax handler for getting themes from themes_api(). |
wp-admin/includes/ajax-actions.php:wp_ajax_save_widget() | Ajax handler for saving a widget. |
wp-admin/includes/ajax-actions.php:wp_ajax_date_format() | Ajax handler for date formatting. |
wp-admin/includes/ajax-actions.php:wp_ajax_time_format() | Ajax handler for time formatting. |
wp-admin/includes/ajax-actions.php:wp_ajax_save_attachment() | Ajax handler for updating attachment attributes. |
wp-admin/includes/ajax-actions.php:wp_ajax_add_meta() | Ajax handler for adding meta. |
wp-admin/includes/ajax-actions.php:wp_ajax_wp_link_ajax() | Ajax handler for internal linking. |
wp-admin/includes/ajax-actions.php:wp_ajax_find_posts() | Ajax handler for querying posts for the Find Posts modal. |
wp-admin/includes/ajax-actions.php:wp_ajax_widgets_order() | Ajax handler for saving the widgets order. |
wp-admin/includes/ajax-actions.php:wp_ajax_add_link_category() | Ajax handler for adding a link category. |
wp-admin/includes/ajax-actions.php:wp_ajax_nopriv_heartbeat() | Ajax handler for the Heartbeat API in the no-privilege context. |
wp-admin/includes/ajax-actions.php:wp_ajax_ajax_tag_search() | Ajax handler for tag search. |
wp-admin/includes/bookmark.php:wp_insert_link() | Inserts a link into the database, or updates an existing link. |
wp-admin/includes/bookmark.php:get_default_link_to_edit() | Retrieves the default link for editing. |
wp-admin/includes/class-wp-terms-list-table.php:WP_Terms_List_Table::column_name() | |
wp-admin/includes/class-wp-terms-list-table.php:WP_Terms_List_Table::prepare_items() | |
wp-admin/includes/file.php:request_filesystem_credentials() | Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::customize_preview_settings() | Prints JavaScript settings for preview frame. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::save() | Handles customize_save WP Ajax request to save/update a changeset. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::__construct() | Constructor. |
wp-includes/class-wp-customize-manager.php:WP_Customize_Manager::doing_ajax() | Returns true if it’s an Ajax request. |
wp-includes/cron.php:spawn_cron() | Sends a request to run cron through HTTP request that doesn’t halt page loading. |
wp-includes/theme.php:_wp_customize_include() | Includes and instantiates the WP_Customize_Manager class. |
wp-includes/class-wp.php:WP::send_headers() | Sends additional HTTP headers for caching, content type, etc. |
wp-includes/functions.php:wp_referer_field() | Retrieve or display referer hidden field for forms. |
wp-includes/functions.php:wp_original_referer_field() | Retrieve or display original referer hidden field for forms. |
wp-includes/functions.php:wp_get_referer() | Retrieve referer from ‘_wp_http_referer’ or HTTP referer. |
wp-includes/functions.php:wp_get_original_referer() | Retrieve original referer that was posted, if it exists. |
wp-includes/taxonomy.php:wp_update_term() | Updates term based on arguments provided. |
wp-includes/taxonomy.php:wp_insert_term() | Adds a new term to the database. |
wp-includes/taxonomy.php:term_exists() | Determines whether a taxonomy term exists. |
wp-includes/user.php:wp_insert_user() | Inserts a user into the database. |
wp-includes/user.php:wp_signon() | Authenticates and logs a user in with ‘remember’ capability. |
wp-includes/post-template.php:post_password_required() | Determines whether the post requires password and whether a correct password has been provided. |
wp-includes/post-template.php:_wp_link_page() | Helper function for wp_link_pages(). |
wp-includes/post.php:trackback_url_list() | Do trackbacks for a list of URLs. |
wp-includes/post.php:get_pages() | Retrieve an array of pages (or hierarchical post type items). |
wp-includes/post.php:wp_insert_post() | Insert or update a post. |
wp-includes/ms-functions.php:wpmu_log_new_registrations() | Logs the user email, IP, and registration date of a new site. |
wp-includes/ms-deprecated.php:install_blog() | Install an empty blog. |
wp-includes/ms-functions.php:newblog_notify_siteadmin() | Notifies the network admin that a new site has been activated. |
wp-includes/ms-functions.php:newuser_notify_siteadmin() | Notifies the network admin that a new user has been activated. |
wp-includes/ms-functions.php:wpmu_welcome_notification() | Notifies the site administrator that their site activation was successful. |
wp-includes/ms-functions.php:wpmu_validate_blog_signup() | Processes new site registrations. |
wp-includes/nav-menu.php:wp_update_nav_menu_item() | Saves the properties of a menu item or create a new one. |
wp-includes/class-wp-xmlrpc-server.php:wp_xmlrpc_server::blogger_getPost() | Retrieve post. |
wp-includes/class-wp-xmlrpc-server.php:wp_xmlrpc_server::blogger_getRecentPosts() | Retrieve list of recent posts. |
wp-includes/class-wp-xmlrpc-server.php:wp_xmlrpc_server::wp_setOptions() | Update blog options. |
wp-includes/class-wp-xmlrpc-server.php:wp_xmlrpc_server::set_custom_fields() | Set custom fields for post. |
wp-includes/class-wp-customize-widgets.php:WP_Customize_Widgets::get_post_value() | Retrieves an unslashed post value or return a default. |
wp-includes/comment.php:wp_update_comment() | Updates an existing comment in the database. |
wp-includes/comment.php:wp_insert_comment() | Inserts a comment into the database. |
wp-includes/comment.php:sanitize_comment_cookies() | Sanitizes the cookies sent to the user already. |
wp-includes/comment.php:wp_allow_comment() | Validates whether this comment is allowed to be made. |
wp-includes/comment.php:check_comment() | Checks whether a comment passes internal checks to be allowed to add. |
wp-includes/meta.php:delete_metadata() | Deletes metadata for the specified object. |
wp-includes/meta.php:add_metadata() | Adds metadata for the specified object. |
wp-includes/meta.php:update_metadata() | Updates metadata for the specified object. If no value already exists for the specified object ID and metadata key, the metadata will be added. |
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |