redux-framework
redux-framework copied to clipboard
get switch value
hi!
I have this field:
array(
'id'=>'activate_pagination',
'type' => 'switch',
'title' => __('Activate Post Pagination', 'redux-framework-demo'),
"default" => 1,
),
And i want to add a filter when this option is activate. If I echo the options it retrieve "1", but if I do if ( $afc_opt['activate_pagination'] == 1 ) , it doen't work.. What i am doing bad?
global $afc_opt;
if ( $afc_opt['activate_pagination'] == 1 ) {
function add_afc_pagination ($content) {
$content .= afc_post_pagination();
return $content;
}
add_filter('the_content', 'add_afc_pagination' );
}
Use true or false. It's easier that way.