/**
 * Adds a textarea setting - label and textarea.
 *
 * @author Gary Jones
 * @param string $id ID of the element
 * @param string $label Displayed label
 * @param integer cols Value for the cols attribute (default = 25)
 * @param integer rows Value for the rows attribute (default = 10)
 * @since 0.9.5
 * @return string HTML markup
 */
function premise_add_textarea_setting($id, $label, $cols = 25, $rows = 10)
{
    return premise_add_label($id, $label) . '<br /><textarea id="' . $id . '" name="' . 'premise-design' . '[' . $id . ']" cols="39" rows="10">' . premise_get_fresh_design_option($id) . '</textarea>';
}
Example #2
0
/**
 * Add settings to the General Settings box. Does premise_settings_general action hook.
 *
 * @author Gary Jones
 * @since 0.9.6
 * @version 1.0
 */
function premise_settings_general()
{
    global $theme, $blog_id;
    premise_setting_line(premise_add_checkbox_setting('minify_css', 'Minify CSS?'));
    premise_setting_line(premise_add_note(__('Check this box for a live site, uncheck for testing.')));
    premise_setting_line(premise_add_textarea_setting('premise_custom_css', __('Custom CSS', 'premise'), 25, 10));
    echo '<hr />';
    if (isset($_GET['premise-design-key'])) {
        premise_setting_line('<a class="button" href="' . wp_nonce_url(admin_url('admin.php?page=premise-style-settings&amp;premise=export&amp;premise-design-key=' . $_GET['premise-design-key']), 'premise-export') . '">' . __('Export Premise Settings', 'premise') . '</a>');
    }
    $title = premise_get_design_option('premise_style_title', $_GET['premise-design-key']);
    if (empty($title)) {
        $title = __('My Style', 'premise');
    }
    premise_setting_line('</form><form id="premise-settings-import" method="post" enctype="multipart/form-data" action="">' . wp_nonce_field('premise-import', '_wpnonce-premise-import') . premise_add_label('import-file', 'Import premise Settings File') . '<br /><input type="hidden" name="premise" value="import" /><input type="file" class="text_input" name="file" id="import-file" /><input class="button" type="submit" value="Upload" /><input type="hidden" name="premise-design-key" value="' . esc_attr($_GET['premise-design-key']) . '" /><input type="hidden" name="premise_style_title" value="' . esc_attr($title) . '" /></form>');
    do_action('premise_settings_general');
}