array_map() for sanitizing $_POST

It’s probably not a great idea. Firstly, if you’ve got other field types then you should probably use more appropriate functions. For example, textarea fields should be sanitised with sanitize_textarea_field(), and color pickers should be sanitized with sanitize_hex_color(). You should also consider that $_POST likely also contains fields that you don’t want to save, such … Read more

Why when I instantiate wp_error in a validation method my user registration method stops working?

It seems you need to use $errors = new \WP_Error(); in your code, since WP_Error isn’t part of your namespace. I ran a quick test on my machine, using wp-cli commands: Using new WP_Error(): % wp eval ‘namespace PJ\NS\Test; $x = new WP_Error(); var_dump( $x );’ Fatal error: Uncaught Error: Class ‘PJ\NS\Test\WP_Error’ not found in … Read more

Modifying WordPress plugins

In the spirit of open source software, I would definitely start by contacting the original developer. If your changes are an improvement to the codebase, and do not take the functionality of the plugin in a new direction, collaboration may be welcomed. If your modifications are rejected by the original developer, there are some other … Read more

Updating my plugin without releasing a new version

yes, it’s absolutely possible. When you’ve done developing your plugin, you set Stable Tag field on trunk/readme.txt to, lets say 1.0.1 This value should match with Version field on your plugin’s meta data. Then, when you publish your plugin, you tag it with, let’s say, /tags/1.0.1/ To continue development, change Version field on your plugin’s … Read more