Is there a way to get all of the options that are currently being store in the options table for my Wordpress plugin?
foreach ($options as $slug => $values) {
var_dump($slug);
}
I have that but it only returns one single option and I need all of them to iterate over the $slug variable
Please find the code below :
$options = wp_load_alloptions();
foreach ($options as $slug => $values) {
var_dump($slug);
}
Hope it works for you.
By using wp_load_alloptions You can have all the options of wp-option table.
$all_options = wp_load_alloptions();
$my_options = array();
foreach ( $all_options as $name => $value ) {
var_dump($name);
var_dump($value);
}
Hope it helps!
If you're just trying to find an option or do a one off change, there is actually a hidden page WordPress has that will let you edit these options. It's located at example.com/wp-admin/options.php.