Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update types of getCurrentPostId
  • Loading branch information
kmanijak committed Aug 26, 2025
commit 83fc63de07cd423e188e628221db0410e5515d6b
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ _Parameters_

_Returns_

- `?number`: ID of current post.
- `?(string|number)`: Template slug or current post ID.

### getCurrentPostLastRevisionId

Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function getCurrentPostType( state ) {
*
* @param {Object} state Global application state.
*
* @return {?number} ID of current post.
* @return {?(string|number)} Template slug or current post ID.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return {?(string|number)} Template slug or current post ID.
* @return {?(string|number)} The current post ID or template slug.

Let's emphasize the post ID.

Copy link
Contributor Author

@kmanijak kmanijak Aug 27, 2025

Choose a reason for hiding this comment

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

Good point. Updated in 7d658bb. I swapped types as well so there's more logical order.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, @kmanijak!

*/
export function getCurrentPostId( state ) {
return state.postId;
Expand Down
Loading