You don’t need to fake being in the customizer, just grab the theme mods directly via get_theme_mods
. Afterall they’re just theme specific options.
Something like this would print out all the theme mods in a definition list:
function tomjn_print_theme_mods() {
$mods = get_theme_mods();
if ( empty( $mods ) {
return;
}
echo '<dl>';
foreach ( $mods as $k => $v ) {
echo '<dt>'.esc_html( $k ).'</dt>';
echo '<dd>'.esc_html( $v ).'</dd>';
}
echo. '</dl>';
}
https://codex.wordpress.org/Function_Reference/get_theme_mods