Exemplo n.º 1
0
/**
 * Changes the Breadcrumb arguments based on the Plugin Options
 * 
 * @author Nick Croft
 * @since 0.1
 * @version 0.1
 * @param array $args
 * @return array 
 */
function gsb_breadcrumb_args($args)
{
    $args['home'] = gsb_get_option('home');
    $args['sep'] = gsb_get_option('sep');
    $args['list_sep'] = gsb_get_option('list_sep');
    // Genesis 1.5 and later
    $args['prefix'] = gsb_get_option('prefix');
    $args['suffix'] = gsb_get_option('suffix');
    $args['heirarchial_attachments'] = gsb_get_option('heirarchial_attachments');
    // Genesis 1.5 and later
    $args['heirarchial_categories'] = gsb_get_option('heirarchial_categories');
    // Genesis 1.5 and later
    $args['display'] = gsb_get_option('display');
    $args['labels']['prefix'] = gsb_get_option('label_prefix');
    $args['labels']['author'] = gsb_get_option('author');
    $args['labels']['category'] = gsb_get_option('category');
    // Genesis 1.6 and later
    $args['labels']['tag'] = gsb_get_option('tag');
    $args['labels']['date'] = gsb_get_option('date');
    $args['labels']['search'] = gsb_get_option('search');
    $args['labels']['tax'] = gsb_get_option('tax');
    $args['labels']['404'] = gsb_get_option('404');
    // Genesis 1.5 and later
    return $args;
}
/**
 * Pull an Simple Breadcrumbs option from the database, echo value
 *
 * @since 0.1
 */
function gsb_option($hook = null, $field = null)
{
    echo gsb_get_option($hook, $field);
}
/**
 * This function generates the form code to be used in the metaboxes
 *
 * @since 0.1
 */
function gsb_defaults_box()
{
    ?>

	<h4>Default Settings</h4>

            <p><?php 
    _e("Home Link Text:", 'GSB');
    ?>
		<input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[home]" value="<?php 
    echo esc_attr(gsb_get_option('home'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Trail Seperator:", 'GSB');
    ?>
		<input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[sep]" value="<?php 
    echo esc_attr(gsb_get_option('sep'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("List Seperator:", 'genesis');
    ?>
		<input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[list_sep]" value="<?php 
    echo esc_attr(gsb_get_option('list_sep'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Prefix:", 'genesis');
    ?>
		<input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[prefix]" value="<?php 
    echo esc_attr(gsb_get_option('prefix'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Suffix:", 'genesis');
    ?>
		<input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[suffix]" value="<?php 
    echo esc_attr(gsb_get_option('suffix'));
    ?>
" size="27" /></p>

	<hr class="div" />

            <p><input type="checkbox" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_attachments]" id="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_attachments]" value="1" <?php 
    checked(1, gsb_get_option('heirarchial_attachments'));
    ?>
 /> <label for="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_attachments]"><?php 
    _e("Enable Hierarchial Attachments?", 'GSB');
    ?>
</label>
		</p>

            <p><input type="checkbox" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_categories]" id="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_categories]" value="1" <?php 
    checked(1, gsb_get_option('heirarchial_categories'));
    ?>
 /> <label for="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[heirarchial_categories]"><?php 
    _e("Enable Hierarchial Categories?", 'GSB');
    ?>
</label>
		</p>

            <?php 
    /* <p><input type="checkbox" name="<?php echo GSB_SETTINGS_FIELD; ?>[display]" id="<?php echo GSB_SETTINGS_FIELD; ?>[display]" value="1" <?php checked(1, gsb_get_option('display')); ?> /> <label for="<?php echo GSB_SETTINGS_FIELD; ?>[display]"><?php _e("Display?", 'GSB'); ?></label>
    		</p> */
    ?>

        <hr class="div" />

        <h5>Labels</h5>

            <p><?php 
    _e("Prefix:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[label_prefix]" value="<?php 
    echo esc_attr(gsb_get_option('label_prefix'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Author:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[author]" value="<?php 
    echo esc_attr(gsb_get_option('author'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Category:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[category]" value="<?php 
    echo esc_attr(gsb_get_option('category'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Tag:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[tag]" value="<?php 
    echo esc_attr(gsb_get_option('tag'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Date:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[date]" value="<?php 
    echo esc_attr(gsb_get_option('date'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Search:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[search]" value="<?php 
    echo esc_attr(gsb_get_option('search'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Taxonomy:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[tax]" value="<?php 
    echo esc_attr(gsb_get_option('tax'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("Post Type:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[post_type]" value="<?php 
    echo esc_attr(gsb_get_option('post_type'));
    ?>
" size="27" /></p>

            <p><?php 
    _e("404:", 'GSB');
    ?>
                    <input type="text" name="<?php 
    echo GSB_SETTINGS_FIELD;
    ?>
[404]" value="<?php 
    echo esc_attr(gsb_get_option('404'));
    ?>
" size="27" /></p>

<?php 
}