Skip to content

Enable schedule blocks#118

Merged
perarnborg merged 4 commits intomasterfrom
feature/schedule-publishing
Jun 24, 2024
Merged

Enable schedule blocks#118
perarnborg merged 4 commits intomasterfrom
feature/schedule-publishing

Conversation

@xelius
Copy link
Copy Markdown
Contributor

@xelius xelius commented Jun 20, 2024

Closes #114

WIP see comments below.

@xelius xelius changed the title Enable schedule publishing Enable schedule blocks Jun 20, 2024
@xelius
Copy link
Copy Markdown
Contributor Author

xelius commented Jun 20, 2024

@perarnborg Now block is always shown in editor-mode using is_gutenberg_request(), ignoring scheduling settings.

Like you mentioned, perhaps some visual clue would be nice when block is hidden and/or have an active scheduling in editor mode.

Also: json block settings is not done!

@xelius xelius requested a review from perarnborg June 20, 2024 09:55
Copy link
Copy Markdown
Collaborator

@perarnborg perarnborg left a comment

Choose a reason for hiding this comment

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

Looks great!

I have added a config setting so only block types that are meant to be scheduled get the behaviour, and also I moved the publish date check from the block_args to the render callback. This is because some implementations of the plugin can have a behaviour where they want a block to show even if there are not posts in it. Those blocks would still show up with the previous implementatoin since whate we did there was to set the posts array to an empty list.

Good job!!

@perarnborg
Copy link
Copy Markdown
Collaborator

Also added styling in editor (opacity: 0.4) for unpublished blocks.

@perarnborg perarnborg merged commit d6bae2b into master Jun 24, 2024
@perarnborg perarnborg deleted the feature/schedule-publishing branch June 24, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable schedule blocks

2 participants