redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

get switch value

Open genethic opened this issue 12 years ago • 1 comments

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' );

}

genethic avatar Feb 23 '14 16:02 genethic

Use true or false. It's easier that way.

kprovance avatar Feb 24 '14 23:02 kprovance