• Resolved DoodleDogCody

    (@doodledogcody)


    I would like to add a Yarpp to a custom post type that is created in a plugin, I see that I can add 'yarpp_support' => true to the CPT in order to get it to work. However this plugin is updated often and as this is a clients site I can’t tell them how to do this every time that other plugin gets updated.

    I have also seen in the codex you are able to add to the supports array of a CPT later on with a line like this

    <?php add_post_type_support( $post_type, $supports ) ?>

    Since YARPP says to add 'yarpp_support' => true it seems as this will not work as add_post_type_support only adds to the support array and not the args array

    https://wordpress.org/plugins/yet-another-related-posts-plugin/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author YARPP

    (@jeffparker)

    I recommend the yarpp_support line if you’re creating your own custom post type. However, if you are using a theme or plugin that creates its own CPT, I recommend reaching out to the author asking how to incorporate YARPP support. Many plugin creators are fine with this type of request.

    Thread Starter DoodleDogCody

    (@doodledogcody)

    Wouldn’t it make more sense for you to alter your plugin to allow for the add_post_type_support() tag to be used. Other plugins and Themes use this method such as Genesis from Studio Press.

    When building a custom post type you can add two different genesis specific options to the supports array to activate them on the CPT.

    This seems like it would be the cleanest and best way to do this in order to make your plugin work with as many other plugins as possible

    Plugin Author YARPP

    (@jeffparker)

    Thanks for the feedback. Sounds like that might be a good approach.

    Thread Starter DoodleDogCody

    (@doodledogcody)

    Your welcome, I haven’t looked at how they do it. But it seems it would allow for more flexibility with YARPP, which is a good thing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding Yarpp to CPT created in a plugin’ is closed to new replies.