/**
  * Update a particular instance.
  *
  * This function should check that $new_instance is set correctly.
  * The newly calculated value of $instance should be returned.
  * If "false" is returned, the instance won't be saved/updated.
  *
  * @param array $new_instance New settings for this instance as input by the user via form()
  * @param array $old_instance Old settings for this instance
  * @return array Settings to save or bool false to cancel saving
  */
 function update($new_instance, $old_instance)
 {
     $new_instance['title'] = strip_tags($new_instance['title']);
     $new_instance['bio_text'] = wp_kses($new_instance['bio_text'], genesis_formatting_allowedtags());
     $new_instance['page_link_text'] = strip_tags($new_instance['page_link_text']);
     return $new_instance;
 }
示例#2
0
/**
 * Add custom headline and description to author archive pages.
 *
 * If we're not on an author archive page, or not on page 1, then nothing extra
 * is displayed.
 *
 * If there's a custom headline to display, it is marked up as a level 1 heading.
 * If there's a description (intro text) to display, it is run through wpautop()
 * before being added to a div.
 *
 * @since 1.4.0
 *
 * @return null Returns null if not author archive or not page 1.
 */
function genesis_do_author_title_description()
{
    if (!is_author()) {
        return;
    }
    if (get_query_var('paged') >= 2) {
        return;
    }
    $headline = get_the_author_meta('headline', (int) get_query_var('author'));
    $intro_text = get_the_author_meta('intro_text', (int) get_query_var('author'));
    $headline = $headline ? sprintf('<h1>%s</h1>', esc_html($headline)) : '';
    $intro_text = $intro_text ? wpautop(wp_kses($intro_text, genesis_formatting_allowedtags())) : '';
    if ($headline || $intro_text) {
        printf('<div class="author-description">%s</div>', $headline . $intro_text);
    }
}
示例#3
0
/**
 * Loads all the framework files and features.
 *
 * The genesis_pre_framework action hook is called before any of the files are
 * required().
 *
 * If a child theme defines GENESIS_LOAD_FRAMEWORK as false before requiring
 * this init.php file, then this function will abort before any other framework
 * files are loaded.
 *
 * @since 1.6.0
 *
 * @global $_genesis_formatting_allowed_tags Array of allowed tags for output formatting.
 */
function genesis_load_framework()
{
    //* Run the genesis_pre_framework Hook
    do_action('genesis_pre_framework');
    //* Short circuit, if necessary
    if (defined('GENESIS_LOAD_FRAMEWORK') && GENESIS_LOAD_FRAMEWORK === false) {
        return;
    }
    //* Load Framework
    require_once GENESIS_LIB_DIR . '/framework.php';
    //* Load Classes
    require_once GENESIS_CLASSES_DIR . '/admin.php';
    require_if_theme_supports('genesis-breadcrumbs', GENESIS_CLASSES_DIR . '/breadcrumb.php');
    require_once GENESIS_CLASSES_DIR . '/sanitization.php';
    //* Load Functions
    require_once GENESIS_FUNCTIONS_DIR . '/upgrade.php';
    require_once GENESIS_FUNCTIONS_DIR . '/compat.php';
    require_once GENESIS_FUNCTIONS_DIR . '/general.php';
    require_once GENESIS_FUNCTIONS_DIR . '/options.php';
    require_once GENESIS_FUNCTIONS_DIR . '/image.php';
    require_once GENESIS_FUNCTIONS_DIR . '/markup.php';
    require_if_theme_supports('genesis-breadcrumbs', GENESIS_FUNCTIONS_DIR . '/breadcrumb.php');
    require_once GENESIS_FUNCTIONS_DIR . '/menu.php';
    require_once GENESIS_FUNCTIONS_DIR . '/layout.php';
    require_once GENESIS_FUNCTIONS_DIR . '/formatting.php';
    require_once GENESIS_FUNCTIONS_DIR . '/seo.php';
    require_once GENESIS_FUNCTIONS_DIR . '/widgetize.php';
    require_once GENESIS_FUNCTIONS_DIR . '/feed.php';
    if (apply_filters('genesis_load_deprecated', true)) {
        require_once GENESIS_FUNCTIONS_DIR . '/deprecated.php';
    }
    //* Load Shortcodes
    require_once GENESIS_SHORTCODES_DIR . '/post.php';
    require_once GENESIS_SHORTCODES_DIR . '/footer.php';
    //* Load Structure
    require_once GENESIS_STRUCTURE_DIR . '/header.php';
    require_once GENESIS_STRUCTURE_DIR . '/footer.php';
    require_once GENESIS_STRUCTURE_DIR . '/menu.php';
    require_once GENESIS_STRUCTURE_DIR . '/layout.php';
    require_once GENESIS_STRUCTURE_DIR . '/post.php';
    require_once GENESIS_STRUCTURE_DIR . '/loops.php';
    require_once GENESIS_STRUCTURE_DIR . '/comments.php';
    require_once GENESIS_STRUCTURE_DIR . '/sidebar.php';
    require_once GENESIS_STRUCTURE_DIR . '/archive.php';
    require_once GENESIS_STRUCTURE_DIR . '/search.php';
    //* Load Admin
    if (is_admin()) {
        require_once GENESIS_ADMIN_DIR . '/menu.php';
        require_once GENESIS_ADMIN_DIR . '/theme-settings.php';
        require_once GENESIS_ADMIN_DIR . '/seo-settings.php';
        require_once GENESIS_ADMIN_DIR . '/cpt-archive-settings.php';
        require_once GENESIS_ADMIN_DIR . '/import-export.php';
        require_once GENESIS_ADMIN_DIR . '/inpost-metaboxes.php';
        require_once GENESIS_ADMIN_DIR . '/whats-new.php';
    }
    require_once GENESIS_ADMIN_DIR . '/customizer.php';
    require_once GENESIS_ADMIN_DIR . '/term-meta.php';
    require_once GENESIS_ADMIN_DIR . '/user-meta.php';
    //* Load Javascript
    require_once GENESIS_JS_DIR . '/load-scripts.php';
    //* Load CSS
    require_once GENESIS_CSS_DIR . '/load-styles.php';
    //* Load Widgets
    require_once GENESIS_WIDGETS_DIR . '/widgets.php';
    global $_genesis_formatting_allowedtags;
    $_genesis_formatting_allowedtags = genesis_formatting_allowedtags();
}
示例#4
0
/**
 * Helper function for wp_kses() that can be used as a filter function.
 *
 * @since 1.8.0
 *
 * @uses genesis_formatting_allowedtags() List of allowed HTML elements
 *
 * @param string $string Content to filter through kses.
 * @return string
 */
function genesis_formatting_kses($string)
{
    return wp_kses($string, genesis_formatting_allowedtags());
}
/**
 * Loads all the framework files and features.
 *
 * The genesis_pre_framework action hook is called before any of the files are
 * required().
 *
 * If a child theme defines GENESIS_LOAD_FRAMEWORK as false before requiring
 * this init.php file, then this function will abort before any other framework
 * files are loaded.
 *
 * @since 1.6.0
 */
function genesis_load_framework()
{
    /** Run the genesis_pre_framework Hook */
    do_action('genesis_pre_framework');
    /** Short circuit, if necessary */
    if (defined('GENESIS_LOAD_FRAMEWORK') && GENESIS_LOAD_FRAMEWORK === false) {
        return;
    }
    /** Load Framework */
    require_once GENESIS_LIB_DIR . '/framework.php';
    /** Load Classes */
    require_once GENESIS_CLASSES_DIR . '/admin.php';
    require_once GENESIS_CLASSES_DIR . '/breadcrumb.php';
    require_once GENESIS_CLASSES_DIR . '/sanitization.php';
    /** Load Functions */
    require_once GENESIS_FUNCTIONS_DIR . '/upgrade.php';
    require_once GENESIS_FUNCTIONS_DIR . '/general.php';
    require_once GENESIS_FUNCTIONS_DIR . '/options.php';
    require_once GENESIS_FUNCTIONS_DIR . '/image.php';
    require_once GENESIS_FUNCTIONS_DIR . '/menu.php';
    require_once GENESIS_FUNCTIONS_DIR . '/layout.php';
    require_once GENESIS_FUNCTIONS_DIR . '/formatting.php';
    require_once GENESIS_FUNCTIONS_DIR . '/seo.php';
    require_once GENESIS_FUNCTIONS_DIR . '/widgetize.php';
    require_once GENESIS_FUNCTIONS_DIR . '/feed.php';
    require_once GENESIS_FUNCTIONS_DIR . '/i18n.php';
    require_once GENESIS_FUNCTIONS_DIR . '/deprecated.php';
    /** Load Shortcodes */
    require_once GENESIS_SHORTCODES_DIR . '/post.php';
    require_once GENESIS_SHORTCODES_DIR . '/footer.php';
    /** Load Structure */
    require_once GENESIS_STRUCTURE_DIR . '/header.php';
    require_once GENESIS_STRUCTURE_DIR . '/footer.php';
    require_once GENESIS_STRUCTURE_DIR . '/menu.php';
    require_once GENESIS_STRUCTURE_DIR . '/layout.php';
    require_once GENESIS_STRUCTURE_DIR . '/post.php';
    require_once GENESIS_STRUCTURE_DIR . '/loops.php';
    require_once GENESIS_STRUCTURE_DIR . '/comments.php';
    require_once GENESIS_STRUCTURE_DIR . '/sidebar.php';
    require_once GENESIS_STRUCTURE_DIR . '/archive.php';
    require_once GENESIS_STRUCTURE_DIR . '/search.php';
    /** Load Admin */
    if (is_admin()) {
        require_once GENESIS_ADMIN_DIR . '/editor.php';
        require_once GENESIS_ADMIN_DIR . '/menu.php';
        require_once GENESIS_ADMIN_DIR . '/theme-settings.php';
        require_once GENESIS_ADMIN_DIR . '/seo-settings.php';
        require_once GENESIS_ADMIN_DIR . '/import-export.php';
        require_once GENESIS_ADMIN_DIR . '/readme-menu.php';
        require_once GENESIS_ADMIN_DIR . '/inpost-metaboxes.php';
    }
    require_once GENESIS_ADMIN_DIR . '/term-meta.php';
    require_once GENESIS_ADMIN_DIR . '/user-meta.php';
    /** Load Javascript */
    require_once GENESIS_JS_DIR . '/load-scripts.php';
    /** Load CSS */
    require_once GENESIS_CSS_DIR . '/load-styles.php';
    /** Load Widgets */
    require_once GENESIS_WIDGETS_DIR . '/widgets.php';
    /** Load Tools */
    require_once GENESIS_TOOLS_DIR . '/custom-field-redirect.php';
    require_if_theme_supports('post-templates', GENESIS_TOOLS_DIR . '/post-templates.php');
    global $_genesis_formatting_allowedtags;
    $_genesis_formatting_allowedtags = genesis_formatting_allowedtags();
}
示例#6
0
/**
 * Save term meta data.
 *
 * Fires when a user edits and saves a term.
 *
 * @category Genesis
 * @package Admin
 * @subpackage Term-Meta
 *
 * @since 1.2.0
 *
 * @param integer $term_id
 * @param integer $tt_id
 */
function genesis_term_meta_save($term_id, $tt_id)
{
    if (defined('DOING_AJAX') && DOING_AJAX) {
        return;
    }
    $term_meta = (array) get_option('genesis-term-meta');
    $term_meta[$term_id] = isset($_POST['meta']) ? (array) $_POST['meta'] : array();
    if (!current_user_can('unfiltered_html') && isset($term_meta[$term_id]['archive_description'])) {
        $term_meta[$term_id]['archive_description'] = wp_kses($term_meta[$term_id]['archive_description'], genesis_formatting_allowedtags());
    }
    update_option('genesis-term-meta', $term_meta);
}