Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate theme support calls #1

Closed
justintadlock opened this issue Oct 3, 2013 · 1 comment
Closed

Consolidate theme support calls #1

justintadlock opened this issue Oct 3, 2013 · 1 comment

Comments

@justintadlock
Copy link

A feature suggestion for theme support. Instead of doing this:

add_theme_support( 'church-theme-content' );

add_theme_support( 'ctc-sermons' );
add_theme_support( 'ctc-events' );
add_theme_support( 'ctc-people' );
add_theme_support( 'ctc-locations' );

You could consolidate this into a single theme support call:

add_theme_support( 
    'church-theme-content',
    array( 'sermons', 'events', 'people', 'locations' )
);

This would be similar to how WP handles post formats:

add_theme_support(
    'post-formats',
    array( 'audio', 'video', 'image' )
);

I hadn't looked at that part of the code to see how you're handling it, but it'd be a pretty easy switch and a little more like how WP handles things like this.

Anyway, it's an enhancement suggestion that might be worth considering at some point, particularly if you start adding more theme-supported features.

@stevengliebe
Copy link
Member

Thank you for this suggestion. I will give it some consideration. I recommend people explicitly define which taxonomies and fields their theme will use so if a new one is added to the plugin, it is not automatically revealed to the theme users (since the theme likely won't support it right away).

http://churchthemes.com/guides/developer/church-theme-content/#recommended-usage

What now is this:

add_theme_support( 'church-theme-content' );

add_theme_support( 'ctc-sermons', array(
    'taxonomies' => array(
        'ctc_sermon_topic',
        'ctc_sermon_book',
        'ctc_sermon_series',
        'ctc_sermon_speaker',
        'ctc_sermon_tag',
    ),
    'fields' => array(
        '_ctc_sermon_has_full_text',
        '_ctc_sermon_video',
        '_ctc_sermon_audio',
        '_ctc_sermon_pdf',
    ),
    'field_overrides' => array()
) );

...

Might become something like:

add_theme_support( 
    'church-theme-content',
     array(
        'sermons' => array(
            'taxonomies' => array(
                'ctc_sermon_topic',
                'ctc_sermon_book',
                'ctc_sermon_series',
                'ctc_sermon_speaker',
                'ctc_sermon_tag',
            ),
            'fields' => array(
                '_ctc_sermon_has_full_text',
                '_ctc_sermon_video',
                '_ctc_sermon_audio',
                '_ctc_sermon_pdf',
            ),
            'field_overrides' => array()
        ),
        'events',
        'people',
        'locations'
    )
);

I would have to consider how to make a change like this backwards compatible.

My apologies for such a late response. I need to figure out how to get GitHub to email me when new issues are opened. For months I was thinking nobody had contributed yet. Just merged in the first pull request into the framework today, which felt great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants