options = get_option( 'advert_cp_options_general' ); //display settings messages settings_errors(); //get current screen and set option name global $currentScreen; $currentScreen = '_general'; //get page - http or https $tab1 = esc_url(admin_url( 'admin.php?page=advert-cp-general' )); $tab2 = esc_url(admin_url( 'admin.php?page=advert-cp-users' )); $tab3 = esc_url(admin_url( 'admin.php?page=advert-cp-ads' )); ?>
' . $args['text'] . '
' : '' ); $textarea_options = get_option('advert_cp_options'.$currentScreen); printf( ''.$text, isset( $textarea_options[$textarea_id] ) ? esc_attr( $textarea_options[$textarea_id] ) : '' ); } // Selection public function select_callback(array $selectOptions) { global $currentScreen; $select_id = $selectOptions['label_for']; $text = ( array_key_exists('text', $selectOptions) ? '' . $args['text'] . '' : '' ); $select_options = get_option('advert_cp_options'.$currentScreen); $howmany = sizeof($selectOptions); $count = 1; $selected = ''; $html = ''; echo $html.$text; } // Checkbox public function checkbox_callback(array $args) { global $currentScreen; $checkbox_id = $args['label_for']; $checkbox_options = get_option('advert_cp_options'.$currentScreen); $checked = ( isset($checkbox_options[$checkbox_id]) && intval($checkbox_options[$checkbox_id]) === 1 ? $checked = 1 : $checked = 0 ); $text = ( array_key_exists('text', $args) ? '' . $args['text'] . '' : '' ); $warning = ( array_key_exists('warning', $args) ? '' . $args['warning'] . '' : '' ); $warningClass = ( !empty($warning) ? $warningClass = 'class="hide-if-no-js advert-cp-warning"' : '' ); $html = ''; echo $html.$text.$warning; } // Radio public function radio_callback(array $radioOptions) { global $currentScreen; $radio_id = $radioOptions['label_for']; $text = ( array_key_exists('text', $args) ? '' . $args['text'] . '
' : '' ); $radio_options = get_option('advert_cp_options'.$currentScreen); $howmany = sizeof($radioOptions); $count = 1; $html = ''; while ($count < $howmany) { $html .= '