getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Extend options via filter #221

Closed neilberry001 closed 10 years ago

neilberry001 commented 10 years ago

Discuss/Include

$options = apply_filters( 'tanlinell_theme_options', $options );

This will allow Theme options to be extended outside of the theme.

The use case for this is extending/providing extra customization options to CWD

e.g.

function tanlinell_child_theme_options( $options ) {

    /**
     * Theme Styling Settings
     */
    $options[] = array(
        'name' => __('Theme Styling Settings', 'options_framework_theme'),
        'type' => 'heading');

    // Company Logo
    $options[] = array(
        'name' => __('Company Logo', 'options_framework_theme'),
        'desc' => __('Assign the company logo to be used in the theme.', 'options_framework_theme'),
        'id' => 'company_logo',
        'type' => 'upload');

    // Company Color
    $options[] = array(
        'name' => __('Company Color', 'options_framework_theme'),
        'desc' => __('Assign the company logo to be used in the theme.', 'options_framework_theme'),
        'id' => 'company_color',
        'type' => 'color');

    return $options;        
}
add_action( 'tanlinell_theme_options', 'tanlinell_child_theme_options' );
neilberry001 commented 10 years ago

Revision, use case is

/Tanlinell-child/functions.php

function extends theme options

getdave commented 10 years ago

@neilberry001 Can you please update the status of this, assign to a Milestone (as appropriate) and ensure it is addressed? Much appreciated.

neilberry001 commented 10 years ago

Closing as we went for a different method for creating CWD.

May be useful in the future if we were to add extensive theme options to sites and wanted these changes to persist through an update to the core theme. I don't think its necessary now.