In theme and plugin development I like to completely run through everything to make sure there are no issues and I’m not getting any errors. ONLY in development do I add the following in my footer.php to see what is going on:

if (is_user_logged_in()) :
    // GET POST META
    // https://developer.wordpress.org/reference/functions/get_post_meta/
    global $wp_query;
    $post_meta = get_post_meta($post->ID);
    echo '<h1>Post Meta</h1>';
    echo '<pre>';
    var_dump($post_meta);
    echo '</pre>';
    wp_reset_query();


    // SEE WHAT IS ASSIGNED
    $queried_object = get_queried_object();
    echo '<h1>Quered Object</h1>';
    echo '<pre>';
    var_dump($queried_object);
    echo '</pre>';
    wp_reset_query();
endif;

However since I’ve been trying to implement more settings pages instead of widgets I’d like to test what I’m getting when I build a settings page so instead of calling each get_option('whatever'); I’d like to dump everything so I can see what is being collected and if any errors arise. However, when I do:

echo '<h1>Get Options</h1>';
echo '<pre>';
var_dump(get_option());
echo '</pre>';
wp_reset_query();

I’m thrown an error. When I research get_option() I do not see anything discussing a dump and I’m not finding a solution when I view get-option. Is there a way I can dump everything in get_option()?

Read more here: How to see everything in get_option()?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: