alleyinteractive / options-importer

Export and import WordPress Options
GNU General Public License v2.0
37 stars 14 forks source link

Remove default whitelist #17

Closed binaryfire closed 3 years ago

binaryfire commented 3 years ago

Hi guys

Is there a way to remove the default whitelist? I'd like to only export and import the options I specify (no defaults).

Cheers

mboynes commented 3 years ago

Hi @binaryfire, yes, you can manipulate the default allowlist using the options_import_allowlist filter. If you were to return an empty array to that filter, nothing would be checked by default. The "default" option would still exist, but it would do nothing. Here's some code for your plugin or theme to get you started:

add_filter( 'options_import_allowlist', '__return_empty_array' );
binaryfire commented 3 years ago

Great, thanks so much!