WordPress.org

Forums

Co-Authors Plus
Fix for supported_post_types (5 posts)

  1. dancingmammoth
    Member
    Posted 1 year ago #

    Around line 169 if you change:

    $this->supported_post_types = apply_filters( 'coauthors_supported_post_types', $post_types_with_authors );

    to check for an already set array

    if (!$this->supported_post_types) {
    $this->supported_post_types = apply_filters( 'coauthors_supported_post_types', $post_types_with_authors );
    }

    Then the ability to declare supported_post_types will actually work. Without this fix I couldn't get your plugin working with CPT-onomies.

    https://wordpress.org/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Sorry, not sure I follow. Why aren't you using the filter?

  3. dancingmammoth
    Member
    Posted 1 year ago #

    Because for some reason get_post_types() doesn't return all the custom fields registered by CPT-onomies.

    The point isn't to avoid the filter. It's to force it to not redeclare $this->supported_post_types if you set it manually at the beginning of the file.

  4. Rachel Carden
    Member
    Posted 1 year ago #

    Is get_post_types() not returning CPT-onomies custom post types or is get_post_types() getting everything and then certain custom post types are being removed in the foreach loop that removes custom post types that don't support 'author'?

  5. dancingmammoth
    Member
    Posted 1 year ago #

    It's not returning them irrespective of whether they support the 'author' or not.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic