In the documentation page for get_magic_quotes_gpc you can read:
Returns 0 if magic_quotes_gpc is off, 1 otherwise. Or always returns FALSE as of PHP 5.4.0.
I guess this can cause the first problem (that your code not works).
Next stripslashes_deep
You can use code like this:
$_POST = stripslashes_deep( $_POST );
But just check the WordPress docs for the function because you can break functions of the core or other plugins that expect their values slashed.
So it is probably better to work only on your own input vars:
$my_value = stripslashes( $_POST['value'] );
Related Posts:
- Get list of scripts / styles and show file which enqueued them
- How to avoid loading same script twice?
- Correct check for any admin page with editor
- How to load library scripts in admin from plugins in noConflict wrapper?
- Completely isolate a plugin view so it doesn’t load the theme
- Integrating a Gutenberg custom block within a larger plugin
- Can’t load a script in my plugin page
- Enqueue Script in custom plugin before other
- Correct usage of scripts with shortcodes
- WP_Query leaking absurd amounts of memory
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Symbolic Links on dev box with plugins and stylesheets
- Custom collection in media manager?
- Standard location for plugin to save/cache files?
- Unit testing to simulate the loop
- What is the correct way for plugins to create tables with special charset/collation considerations?
- Cancel post save
- How to add a link to WordPress Plugin install Listing
- How to ensure “the_content” filter runs only for the main displayed content?
- Get file headers in custom file
- Hourly WP schedule, do I need at least 1 visitor hourly?
- wp_query (and post_id) is empty in admin_init
- When to check if a function exists
- Utilize TinyMCE hyperlink chooser outside of TinyMCE
- Set first image (external) as featured image / thumbnail
- add_theme_support using a plugin
- get all products of one category
- Settings API – Undefined Index when unchecking checkbox
- Really simple query giving error in SQL syntax
- Can’t echo get_delete_post_link
- Why is my shortcode not working
- Is there a naming convention for database tables created by a plugin?
- WordPress plugin options and jQuery
- Inserting JS snippet in the footer if there is no wp_footer?
- How do I add a javascript file to all admin pages via a plugin?
- unable to stop loop when using wp_insert_post with publish_post hook
- How to add a secondary button to a settings page with a custom action?
- How to update an existing table while updating plugin?
- Some strings from a .mo file do not load
- Add a row on clicking each post featured image
- How can I gracefully escape an error condition?
- Plugin development: can’t update settings with multiple settings sections
- How to implement filesystem cache in WordPress
- How to integrate CLEditor to comment system?
- How can I add a custom “Text” widget to Appearance manager from functions.php?
- Filtering SelectControl items according the input from another SelectControl in Gutenberg Block (ES5, no JSX)
- what are the checksums surrounding keywords in the SQL generated by WP_Query and do I need to use them too?
- How to do POST request with WP REST API v2 to custom table?
- Gutenberg table block with Bootstrap .table class
- Translate MCE button text/tooltip in custom plugin
- Do blocks replace plugins in WordPress 5?
- Can’t change the style of a submit input type? [closed]
- Show dynamic list of products from custom api of another database under same host
- Hide custom post type by user roles
- Using OOP inside a Plugin – Is it allowed?
- why isn’t require_once working with my path names
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- why update option is not working?
- How to call a function using a shortcode [closed]
- How to add template colors to custom block options in WordPress Gutenberg editor sidebar?
- WP: Search and replace in DB programmatically
- How to silent ‘Attempting a database schema change is discouraged.’?
- Update a user profile via frontend
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- How to get the number of pages when paginating comments?
- Add code to template dynamically
- How Can I Add Code To A Preexisting Function Without Editing it
- can members have multiple registration using the same password?
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- Creating posts with links from a txt file
- Change the behaviour of a button
- Get API auth_token token to renew weekly
- escape html in jQuery for WordPress
- Progress bar in plugin within admin
- Detect if requested page is PWA on server side
- WordPress admin panel not working
- Redirection from a specific page for users logged in but not with membership
- how to add security questions on wp-registration page and validate it
- Can’t get wpColorPicker to work in a widget
- Allow user to add the php code in wp_mail()
- Hiding WordPress REST endpoints from public viewing using Basic Authentication
- Plugin setting page – update_option problem
- WordPress Plugin Update Process
- Rewriting URLs with a query string
- Registration form Plugin… Email confirmation
- Forcing ALL plugin Admin menus into a separate menu
- How to display posts list on my plugin page?
- Can’t add images in wordpress to my page – button isn’t clickable
- WordPress pre-build slider
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- I don’t understand how symlinks in plugin work
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Calling get_header() with installed FSE theme
- Reinitiate Gutenburg’s blocks using javascript
- Add Datepicker field choice to Event Tickets Plus plugin
- Access DOM Element in Gutenberg Block on WP Admin Post Edit Screen