Skip to content

Custom Posts: Add Set as Homepage / Posts Page actions#25575

Open
crazytonyli wants to merge 7 commits into
trunkfrom
task/1981-page-specific-actions
Open

Custom Posts: Add Set as Homepage / Posts Page actions#25575
crazytonyli wants to merge 7 commits into
trunkfrom
task/1981-page-specific-actions

Conversation

@crazytonyli
Copy link
Copy Markdown
Contributor

Note

I recommend reviewing by commits. The first commit is code-format changes and can be ignored.

Description

Fix https://linear.app/a8c/issue/CMM-1981

Mirror the existing Pages: showing "Page Attributes" menus on published Pages.

Consolidate homepage and posts page tracking into a single PageRole
enum. Update HomepageSetting to track both homepage and posts page IDs
from site settings.
Add view model methods that update site settings via the WordPress core
REST API with optimistic local state updates and rollback on failure.
Show Set as Homepage, Set as Posts Page, and Set as Regular Page actions
in a Page Attributes submenu for published pages. Add a "Posts page"
badge alongside the existing "Homepage" badge using the consolidated
pageRole property.
Add currentUserCan(_:) to WordPressClient for checking user capabilities
via the cached current user data. Only show the Page Attributes submenu
when the user has the manage_options capability.
WordPressClient.fetchSiteSettings now takes a forceRefresh flag that
bypasses the loadSiteSettingsTask cache and re-runs the network fetch.
CustomPostListViewModel passes forceRefresh through from
pullToRefresh, so the Pages list picks up homepage and posts-page
assignments changed outside the app without requiring an app
relaunch.
The mark-page-roles guard checked for .custom("any"), a legacy form
that predates the .any case wordpress-rs now exposes. The All tab
uses .any, so the predicate never matched and the Homepage / Posts
page badges never rendered there.
@crazytonyli crazytonyli added this to the 27.0 milestone May 21, 2026
@crazytonyli crazytonyli requested a review from jkmassel May 21, 2026 08:42
@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32281
VersionPR #25575
Bundle IDorg.wordpress.alpha
Commitf12059d
Installation URL51en7rdjfd0b8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32281
VersionPR #25575
Bundle IDcom.jetpack.alpha
Commitf12059d
Installation URL1598rfc7kcu18
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants