Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin to call wp_slash on wp5.5+ and wp_slash_strings_only on older versions #83

Open
garretthyder opened this issue Oct 18, 2020 · 1 comment

Comments

@garretthyder
Copy link

Coming from core#50635 "the plugin could probably be updated to call wp_slash() on WP 5.5+, and wp_slash_strings_only() on older versions."

Relevant thread;

Should references of wp_slash_strings_only be removed from the WordPress Importer phpunit data?
When you install from svn the wordpress-importer dir is installed to the tests/phpunit/data/plugins and the wordpress-importer/class-wp-import.php contains references to wp_slash_strings_only, as well there's a pluggable wp_slash_strings_only function in the wordpress-importer/compat.php.
Good catch, thanks! I think the plugin can be left as is for now, as it aims to be compatible with WP 3.7+, and the fix for wp_slash() to handle non-string values is only available since WP 5.5.
That said, the plugin could probably be updated to call wp_slash() on WP 5.5+, and wp_slash_strings_only() on older versions.

Opening this ticket to look into addressing the deprecation.

@Ayesh
Copy link

Ayesh commented Oct 21, 2020

If WP core were to ever remove this function, the compat should still kick in. As of now, the @deprecated attribute is solely for the human and documentation tool purposes, so it shouldn't trigger any warnings or errors from the PHP engine.

I think a sensible approach would be to call wp_slash within the compat wp_slash_strings_only function if the site is running WP >= 5.5. Given the relatively simpleness of the compat, I'd say that it's OK to leave the compat function declaration as-is as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants