Is Adding Attributes to the 'Register Post Types' WP Action Possible in PG?

:evergreen_tree: Hello PG Community Members! :evergreen_tree:

Per the WordPress documentation on the register_post_type() function, there are several attributes that can be used with the function.

Iā€™m specifically interested in using the template and template_lock parameters, whereby I can dictate exactly which custom WP Blocks are used for specific post type(s).

Can I add these parameters to the register_post_type() function within Pinegrow? If so, how?

If not, how would some of the WP pros here recommend achieving this? Do I need to wait until Iā€™m finished using PG, then add the custom PHP in production?


NOTE: I am exporting as a PLUGIN, not as a theme within Pinegrow.

Hi @iamrobbie, at the moment it is not possible to add extra fields.

The easiest and most flexible workaround is to generate register_post_type code with https://generatewp.com/post-type/ and then add that code into inc/custom.php instead of using the Register Post Type action.

1 Like

Thanks for the tip, @matjaz!