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 usePostThumbnail hook #260

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Add usePostThumbnail hook #260

merged 1 commit into from
Feb 27, 2024

Conversation

Sephsekla
Copy link
Contributor

This PR introduces a new hook: usePostThumbnail, which provides a straightforward way to use and update the post thumbnail within blocks. It returns an object with 3 properties:

  • postThumbnail - The post thumbnail media object
  • postThumbnailId - The post thumbnail ID
  • setPostThumbnail - A function to set the post thumbnail by ID

Copy link
Contributor

@roborourke roborourke left a comment

Choose a reason for hiding this comment

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

Neat!

@mattheu mattheu merged commit 6a57306 into main Feb 27, 2024
2 checks passed
@mattheu mattheu deleted the use-post-thumbnail branch February 27, 2024 10:37
Copy link
Contributor

@tomjn tomjn left a comment

Choose a reason for hiding this comment

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

Some tweaks to the readme

@@ -0,0 +1,49 @@
# usePostThumbnail

The `usePostThumbnail` hook allows for easy use and updates of the post thumbnail from within a
Copy link
Contributor

Choose a reason for hiding this comment

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

from within a what?


## Usage

The `usePostThumbnail` hook provides 2 values, and a setter function
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs punctuation at the end

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.

4 participants