[wp-hackers] Allowing theme to override plugin markup on data

Tom Barrett tcbarrett at gmail.com
Fri Nov 8 14:22:38 UTC 2013


Thanks John

I can see the bbPress does some clever stuff with making their own template
stack.

I think I'll try something with filters and hope that
http://core.trac.wordpress.org/ticket/22355 gets to see the light of day :)


On 7 November 2013 18:17, John <dailyrants at gmail.com> wrote:

> I've done this by checking if a template exists in the theme directory,
> using locate_template( 'single-post-type.php' ), and if not loading
> template parts from the plugin dir and/or filtering the_content. The
> assumption being, if the theme isn't handling the custom post type template
> stuff, my plugins needed to.
>
> bbPress has a good example of modifying the template stack and loading them
> from the plugin dir if they don't exist in the child or parent theme
> directories. I think the function is named bbp_locate_template. See also
> bbp_get_template_part.
>
>
> On Thu, Nov 7, 2013 at 10:45 AM, Tom Barrett <tcbarrett at gmail.com> wrote:
>
> > I'm writing a shortcode that is going to produce a list of items (oof!).
> > It's a custom post type, with some meta. Pretty much a standard loop
> > scenario.
> >
> > I'd like the shortcode to produce some basic output, and let the theme
> > really jazz things up. Ideally I'd have the data available with no markup
> > (for the theme) and then, if the theme doesn't do anything, let the
> plugin
> > apply some simple markup of it's own.
> >
> > Any recommendations on how to engineer this the best?
> >
> > --
> > http://www.tcbarrett.com | http://gplus.to/tcbarrett |
> > http://twitter.com/tcbarrett
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
http://www.tcbarrett.com | http://gplus.to/tcbarrett |
http://twitter.com/tcbarrett


More information about the wp-hackers mailing list