ForgeWP

Practice: Member Tools

Build different content for signed-out visitors, members and editors.

Practice: member tools

Build one component with three outcomes: a signed-out message, a member welcome, and editorial tools visible only to an account with edit_posts.

Requirements

  • Share one WpAuthProvider across the interface.
  • Read the user's display name using useWpUser().
  • Use WpAuthGate for the signed-out/member branches.
  • Use WpCapabilityGate for editorial content, with a helpful fallback.
  • Use capability keys rather than role names.
Work from the outside in

Establish the member branch first, then add the capability check inside it. Think about which fallback a signed-out visitor should reach.

Table · 2 columns
Preview account
Expected content
Signed out
Login guidance
Subscriber with read
Greeting and editorial fallback
Editor with edit_posts
Greeting and editorial tools

Explain why this does not authorize an editing endpoint. Compare preview output with the WordPress account workflow later; live acceptance is a separate check.

See the solution.