Custom Post Types discussion

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 (mailpress\mp-content\advanced\newsletters\ daily.xml, monthly.xml & 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_type folder would contain the equivalent of daily.xml, monthly.xml, new_post.xml & weekly.xml files.
    taxonomies would contain the equivalent of categories.xml file(s).

  • 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.

This entry was posted in News. Bookmark the permalink.

One Response to Custom Post Types discussion

  1. admin says:

    (MailPress 5.3) With some code changes, custom post type integration will be simpler but will still require some code (processor and scheduler) and xml files.
    Custom post type + custom taxonomies can be possible using http://codex.wordpress.org/Taxonomies#Querying_by_taxonomy

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>