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
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- How to create an API for my plugin?
- Plugins in symlinked directories?
- How to use PanelColorSettings in custom Gutenberg block?
- Is there a way for a plug-in to get it’s own version number?
- How to add tab which is visible only in admin side of product in woocommerce? [closed]
- How do I print a notice only on certain admin pages?
- Hook the Keydown Event in the TinyMCE Post Editor
- Elementor Fatal error: Class ‘Elementor\Widget_Base’ not found
- Headers already sent error with CSV export plugin
- How to add HTML / Form to an Admin Bar Menu
- Unable to write test cases for a WordPress plugin using PHPUnit and WP-CLI
- WordPress Settings API: saving multiple rows of similar data
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- How to use is_multisite() in a must-use-plugin?
- why creating tables using $wpdb is not being executed while installing plugins?
- How to update the language used by wordpress from a plugin
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- Woocommerce how to update variable product price programitically?
- DataBase connection problem with PHPUnit and WordPress
- Using $wpdb object in a widget
- Modify a Free Plugin available on wordpress.org & include with my Premium Theme? [closed]
- Using wp_filesystem in Plugins to store customizer settings
- Can I use the different settings sections over different pages using the save options group?
- WYSIWYG editor in WP 3.2 plugin
- How do I write a shortcode that opens and closes?
- What is minimum time interval for which a cron be scheduled?
- Registering and using actions which return results in a Plugin class
- Plugin developement and SVN
- WooCommerce Conditional Tag inside plugin
- Plugin writing: access file that was just uploaded
- Conditional hook based on the core function that is calling it
- Using WPDB to output raw XML fails because of wp-blog-header.php
- How to change the hover content of a specific menu item on WordPress?
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- Amending REST API function without deactivate/activate plugin every time changes is made
- How can I listen to events in Gutenberg block?
- It’s possible to passing a ref to FormTokenField from parent component using forwardRef?
- How to show filters on table when using WP_List_Table
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Unable to change footer using wp_footer action hook
- Add a default WP comment form to forum template
- Admin Posts List (edit.php) by post IDs
- wp_localize_script is not adding a global variable for javascript
- wp_get_theme Warning: Illegal offset type
- wordpress is adding a second backslash when I use addslashes
- Silently register plugin pages
- Plugin: database creation
- How to add a hyperlink to the email content in WordPress?
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- Replace first occurence of a word with link [closed]
- Converting core modification to a plugin
- How to replace settings in WordPress plugin from a theme
- Adding filter to the title without affecting the menu title
- How to validate inputs with filter in register_setting callback
- How to show multiple instances of the WP125 Widget?
- How can the_excerpt (or equivalent) be called on a category description?
- Plugin Creation: Overriding upload_max_size and post_max_size
- Problems with wierd characters and my plugin
- How to call a function from a shortcode function in an oop plugin
- How to access index file in Block Themes?
- wp_new_user_notifications to notify user and admin about new user registration
- Is it possible to use the MySQL’s ORDER BY FIELD() clause as part of the pre_get_posts hook?
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- How to create a custom post-new.php page for plugin , no wp menu
- How to create a custom WordPress page with my plugin?
- Where to add functions and code snippets in wordpress
- How to re-render inspector controls?
- Why User_login key doesn’t work with wp_update_user()
- How to limit number of category term display in home page grids?
- A question on init and activation hooks
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- Is it possible to replace MySQL with JSON files for WordPress
- Add custom html classes to gutenberg wrapper
- Plugin Development – Call to undefined function comment_exists()
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- WordPress doesn’t create table on plugin activation
- Create Customization panel for Plugins not for theme
- How is construct function working even when variable is assigned null value?
- Custom signature appears twice on page
- Declaring a new woo commerce product type i get this error
- wp_mail links are dead
- List Available Templates for Current Theme in a Plugin
- Do a summary based on sections in a post
- Plugin as custom page
- Adding Third Post Box Column: postbox-container-3
- WooCommerce custom payment gateway
- What’s wrong in the WordPress Meta Box Generator code?
- add category id to option name when adding an option on edit_category