Creating Custom Post Type for Jumpstart 2.x based on Portfolio Plugin
-
Topic
-
Hi Jason,
Still loving Jumpstart 2.x.
I’m in the throws of upgrading a website from Jumpstart 1.x to 2.x. As part of the website upgrade/re-design, I need to (re)create 3 or 4 custom post types.
This go-around, I would like them to integrate (better) with Jumpstart and Layout Builder ala your Portfolios plugin (easier to use post lists, grids, etc.). They need some individual custom fields, other special handling, etc. and I will also have Jumpstart custom-xxxxxx.php template post files for them. Also, UI/UX design-wise I think it’s better to keep them separate from other posts and portfolio posts. Plus, I will be able to use them as needed in future Jumpstart 1.x to 2.x website upgrades and new websites.
I’ve built several custom post type plugins before and have programming experience.
It looks fairly straightforward to base this on your Portfolio plugin (v1.1.3). I’ve looked through the code extensively, but I have several questions (hope this doesn’t seem too dumb):
1) It looks like I can copy ThemeBlvd theme and layout builder integration code from tb-portfolios.php…CAREFULLY changing ‘portfolio’ and ‘portfolios’ ids, tag-ids, labels and variables to my ids, tag-ids, labels, variables….plus adding custom-field and adding/removing other supports. I plan to precede my ids/tag ids with “mytag_cpt_XXXXXXX’.
Are there any gotcha’s to doing this strategy?
2) Change ‘themeblvd_’ references in class/function names to ‘my_name_’ etc.?
3) On line 129 of tb-portfolios.php, you apprear to be registering taxonomies ‘tb_portfolio’ and ‘tb_portfolio_tag’ for the ‘portfolio_item’ post_type. Elsewhere (lines 158, 182, 185, 186) the taxonomies seem to be ‘portfolio’ and ‘portfolio_tag’…am I missing/mis-understanding how the ‘tb_*’ taxonomy tags were used?
4) The following filters are added in Portfolio Plugin:
• line 206 add_filter( ‘themeblvd_portfolio_module_options’, array( $this, ‘portfolio_module_options’ ) );
• line 211 add_filter( ‘themeblvd_portfolio_module_args’, array( $this, ‘query_args’ ), 9, 2 );)How are these used in the theme or Layout Builder used? in a way that I have to worry about–if I just copy these lines? Can I use these hook_names in my derived CPT plugins as is – or will they collided with Portfolios (if using Portfolios and my CPTs on same page), or just break something? If changed, do they need to be assigned a different priority than for Portfolio?
5) The following filter is applied:
• line 341 return apply_filters( ‘themeblvd_portfolios_builder_items’, $items );
I don’t see where this filter was added, so I’m just assuming it’s assigning the template parts for portfolios? Can I just use as is? Also, modify get_builder_items function, if needed?
6) Is there a list of themeblvd filters documented somewhere? code for where?
7) Re-assign default archive template part in line 940 from ‘grid’ to ‘list’?
8) Anything else to be aware of?
I’m hoping that my assumption that I can add additional integrated CPTs into Jumpstart and Layout Builder seems as straightforward as it is.
Thanks in advance.
RonP.S. Links on this page are broken:
- You must be logged in to reply to this topic.