= $optiondetails['min'] ) && intval( $input[$setting] <= $optiondetails['max'] ) ? intval( $input[$setting] ) : $option_defaults[$setting] ); } // Validate repeatable fields else if ( 'repeatable' == $optiondetails['type'] ) { $valid_input[$setting] = quadro_array_map_r( 'wp_filter_kses', $input[$setting] ); } // Validate backup options fields else if ( 'backup_options' == $optiondetails['type'] ) { } // Validate transfer options fields else if ( 'transfer_options' == $optiondetails['type'] ) { } } // If reset, reset defaults elseif ( 'reset' == $submittype ) { // Escape this Reset iteration if no_reset is set to true if ( isset($optiondetails['no_reset']) && $optiondetails['no_reset'] == true ) continue; // Set $setting to the default value $valid_input[$setting] = $option_defaults[$setting]; } } return $valid_input; } /** * Globalize the variable that holds * the Settings Page tab definitions * * @global array Settings Page Tab definitions */ global $quadro_tabs; $quadro_tabs = quadro_get_settings_page_tabs(); /** * Call add_settings_section() for each Settings * * Loop through each Theme Settings page tab, and add * a new section to the Theme Settings page for each * section specified for each tab. * * @link http://codex.wordpress.org/Function_Reference/add_settings_section Codex Reference: add_settings_section() * * @param string $sectionid Unique Settings API identifier; passed to add_settings_field() call * @param string $title Title of the Settings page section * @param callback $callback Name of the callback function in which section text is output * @param string $pageid Name of the Settings page to which to add the section; passed to do_settings_sections() */ foreach ( $quadro_tabs as $tab ) { $tabname = $tab['name']; $tabsections = $tab['sections']; foreach ( $tabsections as $section ) { $sectionname = $section['name']; $sectiontitle = $section['title']; // Add settings section add_settings_section( // $sectionid 'quadro_' . $sectionname . '_section', // $title $sectiontitle, // $callback 'quadro_sections_callback', // $pageid 'quadro_' . $tabname . '_tab' ); } } /** * Callback for add_settings_section() * * Generic callback to output the section text * for each Theme settings section. * * @uses quadro_get_settings_page_tabs() Defined in /functions/options.php * * @param array $section_passed Array passed from add_settings_section() */ function quadro_sections_callback( $section_passed ) { global $quadro_tabs; $quadro_tabs = quadro_get_settings_page_tabs(); foreach ( $quadro_tabs as $tabname => $tab ) { $tabsections = $tab['sections']; foreach ( $tabsections as $sectionname => $section ) { if ( 'quadro_' . $sectionname . '_section' == $section_passed['id'] ) { ?>

/> value="" />

Once you upload the file, click "Insert into post".

'; // Make it behave as an array even if it's not if ( !is_array($meta) ) $meta[0] = array(); $i = 0; foreach ( $meta as $row ) { echo '
  • '; echo '' . __('Remove', 'quadro') . ''; echo '
    '; foreach ( $repeat_fields as $repeat_field ) { $this_item = $repeat_field['name']; $this_value = ( !empty($row) && isset($row[$this_item]) ) ? esc_attr($row[$this_item]) : ''; echo '
    '; echo '
  • '; $i++; } echo ''; echo '+ ' . $option['repeat-item'] . ''; } // Output font form field markup else if ( 'font' == $fieldtype ) { $valid_fonts = array(); $valid_fonts = quadro_get_valid_fontslist(); ?>


    '; echo '' . __('Set Skin', 'quadro') . ''; } // Output backup and restore options markup else if ( 'backup_options' == $fieldtype ) { global $quadro_options_group; $backup = get_option( $quadro_options_group . '_backup' ); if(!isset($backup['backup_log'])) { $log = __('No backups yet', 'quadro'); } else { $log = $backup['backup_log']; } $output = ''; $output .= '
    '; $output .= ''; $output .= ''; $output .= '

    '. __('Last Backup : ', 'quadro').''.$log.'

    '."\n"; $output .= '' . __('Backup Options', 'quadro') . ''; $output .= '' . __('Restore Options', 'quadro') . ''; $output .= ''; echo $output; } // Output transfer options markup else if ( 'transfer_options' == $fieldtype ) { // Get Theme Options $data = quadro_get_options(); echo ''; echo ''."\n"; echo '' . __('Select All', 'quadro') . ''; echo '' . __('Import Options', 'quadro') . ''; } // Output dummy content import options markup else if ( 'dummy_import' == $fieldtype ) { echo ''; echo ''; echo ''; echo '' . __('Import Dummy Content', 'quadro') . ''; } // Output user check markup else if ( 'usercheck' == $fieldtype ) { echo '' . __('Check Now', 'quadro') . ''; } // Output the setting description ?> array( 'item_slug' => get_option('template'), 'username' => $current_options['quadro_username'], 'userpass' => $current_options['quadro_userpass'], ) ); $raw_response = wp_remote_post($check_url, $send_for_check); if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200)) { // Print the proper response now if ( $raw_response['body'] == 'ok' ) { echo __('You theme was sucesfully verified.', 'quadro'); } else { echo $raw_response['body']; } } else { // If there was a WP error, print it echo $result->get_error_message(); } die(); } die(); } add_action('wp_ajax_quadro_ajax_options_action', 'quadro_ajax_callback'); ?>