Can I use "options" or "theme_mod" values from WP_Customizer in other functions?
-
I’ve added a setting in the Customizer which is (supposed) to allow users to add css class names to the body tag.
So then in another function I want to add a filter of the body_class hook to add the classnames entered.
The following doesn’t seem to work:
function custom_body_class_filter($classse) { $classes[] = get_option('custom_body_classes); return $classes; } add_filter('body_classes', 'custom_body_classes');
Do I need to call the options globally within any other function? Such as:
global $wp_options; // or $wp_cusomize or something else?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can I use "options" or "theme_mod" values from WP_Customizer in other functions?’ is closed to new replies.