Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for other post types #539

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

shantanu2704
Copy link

@shantanu2704 shantanu2704 commented Oct 8, 2018

Addresses #223.

Submitting a new PR because the changes from this PR were lost.

  1. Added a static variable for supported post types that can be filtered with the liveblog_modify_supported_post_types filter in the init() method.
  2. Addressed the feedback for page post type in the previous PR.
  3. Modified get_liveblog_state() and is_viewing_liveblog_post() to accommodate additional post types.

liveblog.php Outdated
@@ -250,7 +251,11 @@ public static function init() {
* Add liveblog support to the 'post' post type. This is done here so
* we can possibly introduce this to other post types later.
*/
add_post_type_support( 'post', self::KEY );
$post_types = array( 'post' );
self::$supported_post_types = apply_filters( 'liveblog_modify_supported_post_types', $post_types );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter should be documented.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename it to liveblog_supported_post_types

liveblog.php Outdated
/**
* Filters post types supported by liveblog.
*
* @since 2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to 2.0.0. Versions should use the 3-digit style.

liveblog.php Outdated
*
* @since 2.0
*
* @param array An array of supported post types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type is already specified as an array, so the description can just be Supported post types.

liveblog.php Outdated
self::$supported_post_types = apply_filters( 'liveblog_modify_supported_post_types', $post_types );

/**
* Filters post types supported by liveblog.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a plan to possibly change the name of the plugin, so maybe change liveblog here to be this plugin?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we changing the name in this release?
If not, I think this should stay as liveblog as it'll be easier to change the prefix with a search-replace when the name is finalised.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefix on the filter is unlikely to change, unless it was aiming to break BC.

In this case, it was just the name in the filter description (line 257), that I was referring to.

Not a biggie - there are likely other instances of "liveblog" in other DocBlocks as well that would need changing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, got it! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants