-
Notifications
You must be signed in to change notification settings - Fork 41
feat(ui): add popup title panel to Block Editor document settings #1160
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fb0f00c
feat(ui): add popup title panel to Block Editor document settings
s-acv2 c36353a
feat(ui): add display title toggle to control popup title visibility
s-acv2 359c836
chore: update package-lock.json to sync with package.json
s-acv2 5127058
chore: regenerate package-lock.json for CI compatibility
s-acv2 5905853
refactor: extract pum_show_popup_title() conditional function
danieliser 9d4b987
refactor: strip display_title toggle, simplify to title-only panel
danieliser 7f49cff
docs: add changelog entry for block editor popup title panel
danieliser e759df8
fix: use edit_popups capability in popup_title meta auth_callback
danieliser f4039f1
fix: address CodeRabbit review feedback
danieliser e8f74ee
refactor: use imported select instead of window.wp.data cast
danieliser 5b2b093
fix: resolve select name shadowing in useSelect callback
danieliser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: PopupMaker/Popup-Maker
Length of output: 4403
🏁 Script executed:
Repository: PopupMaker/Popup-Maker
Length of output: 542
🏁 Script executed:
Repository: PopupMaker/Popup-Maker
Length of output: 697
🏁 Script executed:
Repository: PopupMaker/Popup-Maker
Length of output: 180
Use custom capability in
auth_callbackto match post type permissions.The popup post type defines custom capabilities via
get_permission('edit_popups')(lines 136-138), but theauth_callbackfor popup_title meta usesedit_posts. This creates a permission inconsistency where users with genericedit_postscapability could access the meta field when they lackedit_popups, or vice versa.Suggested fix
register_post_meta( $this->get_type_key( 'popup' ), 'popup_title', [ 'show_in_rest' => true, 'single' => true, 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'auth_callback' => function () { - return current_user_can( 'edit_posts' ); + return current_user_can( $this->container->get_permission( 'edit_popups' ) ); }, ] );📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit 7ec05ff