Correct, if you are duplicating a post in WordPress, you do not need to use wp_slash()
to escape the data.
The purpose of wp_slash()
is to add slashes to the data to prepare it for storage in the database. When you are duplicating a post, you are not directly inserting or updating data in the database, so wp_slash()
is not necessary.
The caution against using wp_slash()
to escape data going directly into an SQL query is because it is not a secure way to protect against SQL injection attacks. Instead, you should use prepared statements or other techniques to properly escape data before including it in an SQL query.
Related Posts:
- What’s the difference between get_home_path() and ABSPATH?
- Modifying WordPress core files
- Why do some core functions get wp_ while others do not? What’s the rule?
- $GLOBALS array for WordPress
- What are custom_css and customize_changeset used for?
- IP address whitelist to update WordPress core and plugins
- What are some reasons why you should not hack WordPress core files?
- How To/What triggers a WordPress auto update?
- Rewriting a core function?
- What is the purpose of this line of code in wp_trim_excerpt? [closed]
- What CSS minifier does WP core use?
- What’s $GLOBALS[‘wp_settings’][‘media’][’embeds’]?
- Function to change a label (Username) in a core WordPress File (wp-includes/general-template.php)
- How do I set a custom WordPress update repository?
- WordPress classes explained
- No longer able to attach S3 bucket files to emails being sent by WordPress due to PHPMailer security update
- What problems maybe happen if I remove “wp-” prefix from wordpress folders and files?
- WP Core: Where are terms populated for the admin edit screen?
- What is the WP_Internal_Pointers core class?
- How to contribute to WordPress Core using Tortoise SVN?
- Create a patch using TortoiseSVN
- Loading WP core Thickbox through frontend
- Isn’t requiring a file before it’s loaded by WordPress itself a symptom of bad code? [closed]
- How to find out where the data.model is?
- Why WordPress Core Functions Not Using function_exists()?
- how does the rendering works?
- When is the wp-mail.php in the WP root requested?
- Is the information returned by get_bloginfo( ‘version’ ) always the same as the one in version.php?
- How to add a forward slash to the end of wordpress home?
- Using native wp image support instead of timthumb
- Should /wp-includes/js/* folder be blocked in robots.txt file for a WordPress website?
- Can mediaelement-and-play core JS be dequeued?
- WordPress auto update for core but use local package
- WordPress 4.8 – Can’t find variable: wp
- What is responsible for triggering “robots-template.php” file or “wp_robots_noindex()” core function out of it?
- Add image or video tags to WP Sitemap
- Where can I find the definitive list of core blocks in html form
- Difference between core and processor
- How to disable core and plugin updates
- Looking for WordPress System Diagrams
- Clarification on filters and hooks
- WP_Site_Query vs. WP_Network_Query in WordPress 4.6
- How Does WordPress Uninclude/Deactivate A Plugin?
- How to disable `SQL_CALC_FOUND_ROWS` [duplicate]
- Why are double-periods (“..”) invalid in a WordPress image filename?
- Does anyone have a visual breakdown of core hooks and when they are fired?
- Loading template files from a subfolder in my theme?
- How to listen to color changes on the color picker?
- How do I fix this error: Warning: invalid argument supplied for foreach()?
- Why does my hand-written plugin installer fail to find `request_filesystem_credentials`?
- Script dependencies for post.js
- Why use while over if in single wordpress posts?
- Headers already sent – WordPress core
- How long do users stay logged in if they DON’T check remember me?
- Changing a WordPress core function without hacking core
- remove rel=next on home page but not others
- Replacing the default content created while the site creation
- Gutenberg List Extension Block
- WP_Remote_Get Not working
- How to Dequeue All WordPress Assets
- PHP notice coming from the WordPress core?
- Changing the comments link produced by the get_comments_link() and get_comments_pagenum_link() functions
- Attachment Page Permalink/URL Rewrite Issue. How to change the actual rewriting?
- Extending WP_Widget throws error when Monster Widget used
- Changing WordPress core without hacking core
- Least expensive way to get table prefix in multisite installation
- Spammers attacking my WordPress Site – Removing URL field from core? [closed]
- How to override wp_insert_comment()
- Can I hook into wp_update_core outside of the admin?
- Is the root index.php file part of the Core?
- Is there a wp-config.php option or constant that I can set to allow me to download nightly / beta builds?
- Update a core option from plugin settings page
- Do I need to use jQuery for my template?
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Who updates the wp-admin/core file?
- getting notifications about updates only in the “core” page
- Best way to salvage a very old WP site
- Create a Page template selector page
- Usage of var keyword in the core
- How to remove a settings section from the Theme Customization API preview pane?
- Does WordPress do any internal caching if no plugin installed?
- wordpress wp-admin/includes/shema.php file has been modify alone
- Notice on core function
- wp_insert_post always returns 0 on one site, extensive testing done, can’t get to the bottom
- Updating wordpress from my Linux distro’s repository
- Error while localizing communityEventsData in script-loader.php
- Internal Redirections?
- How to change current category to another in wordpress
- WP-CLI: detect altered core files and restore them automatically
- wp-cli core install unknown: fatal: file /etc/postfix/main.cf: parameter mail_owner: user postfix has same user ID as _postfix
- “Conditional query tags do not work before the query is run. Before > then, they always return false. “
- How does WordPress get the upgrade URL?
- WordPress core update fails – no issues with plugin updates
- Display Custom Column in CPT Taxonomy
- Upacking the package… stalls, but installs plugin
- Hook or function to check if performing a WP Core update?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Does wp_safe_redirect() no longer works?