Several times i have been asked : Does MailPress support Custom Post Types ?
The answer is “may be Yes, may be No” … hard to forget my norman childhood …
may be Yes :
WordPress genuinely supports a custom post type which is ‘post’. So does MailPress.
How to extend my ‘post’ newsletter and add a custom post type (e.g. ‘my_post_type’) :
- Modify the newsletters xml definition files (
weekly.xml) adding in the processor section :
<processor> <query_posts> <post_type>post</post_type> <post_type>my_post_type</post_type> </query_posts> </processor>
- Be carefull when upgrading MailPress, not to delete your specific settings in the xml files.
may be No :
That will work for daily, weekly and monthly newsletters.
For new_post newsletters, MailPress tries to send a newsletter whenever the hook ‘publish_post’ is fired (
mailpress/mp-includes/class/MP_newsletter_scheduler_post_.class.php line #7 [MailPress 5.2]).
So the hook ‘publish_my_post_type‘ is not currently supported.
Will MailPress support the hook ‘publish_my_post_type‘ in the future ?
This is a lot of work. I personnally think that complete Custom Post Type integration requires to :
- Create new directories to host Custom Post Types newsletters definitions :
mailpress !_ mp-content !_ advanced !_ newsletters !_ custom_post_types !_ taxonomies
custom_post_typefolder would contain the equivalent of
taxonomieswould contain the equivalent of
- Customize some code – that is today related to the post type ‘post’ (hook ‘publish_post’) and taxonomy ‘category’ – to make it “Custom Post Types” compatible :
And have to consider that taxonomies can be optionally hierarchical …
- Develop a new add-on :
- new settings tab asking which custom post types should be supported and if they have related taxonomies, with which taxonomies … not that simple.
- Custom Post Types newsletter registration
- … and surely many other things …
More on Custom Post Types.