churchthemes / church-theme-content

The Church Content WordPress plugin provides compatible themes with church-related post types, taxonomies and custom fields.
https://churchthemes.com/plugins/church-content/
GNU General Public License v2.0
58 stars 27 forks source link

Consolidate theme support calls #1

Closed justintadlock closed 9 years ago

justintadlock commented 11 years ago

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 commented 10 years ago

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.