I would like to offer a listing of all choices set through plugins and so forth to distant calls. There’s a plugin WP API Choices however it hardly does the job.
There are two potential methods (that I do know of) to get a listing of all choices set within the weblog/website:
-
Use
$wpdb
to run a question like so:$option_names = $wpdb->get_col( "SELECT DISTINCT option_name FROM
$wpdb->choices WHERE option_name NOT LIKE '_transient_%'" ); -
Use
wp_load_alloptions()
Which certainly one of these two could be one of the best ways to retrieve all of the choices? Is there a cleaner manner than both of those two?
Edit: In an ideal world, I wish to use an inbuilt operate for this, as an alternative of writing MySql queries. Additionally, by all choices I’m implying any choice set by a plugin utilizing add_option
or update_option
capabilities.