Skip to content

Commit

Permalink
Add JSDoc block for getSectionRootClientId in block editor package (#…
Browse files Browse the repository at this point in the history
…65219)

* Add JSDoc block for getSectionRootClientId in block editor

* Apply suggestions from code review

Co-authored-by: Dave Smith <getdavemail@gmail.com>

---------

Co-authored-by: Dave Smith <getdavemail@gmail.com>
  • Loading branch information
colorful-tones and getdave authored Sep 16, 2024
1 parent d9e3075 commit 38e74db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/block-editor/src/store/private-selectors.js
Original file line number Diff line number Diff line change
@@ -548,6 +548,15 @@ export function isZoomOutMode( state ) {
return state.editorMode === 'zoom-out';
}

/**
* Retrieves the client ID of the block which contains the blocks
* acting as "sections" in the editor. This is typically the "main content"
* of the template/post.
*
* @param {Object} state Editor state.
*
* @return {string|undefined} The section root client ID or undefined if not set.
*/
export function getSectionRootClientId( state ) {
return state.settings?.[ sectionRootClientIdKey ];
}

0 comments on commit 38e74db

Please sign in to comment.