Skip to content

Add menu-order accessors #4

Description

@hokoo

Status: completed

Epic: E3 — Minimal 1.0 public API

Goal: Provide symmetric public accessors for the WordPress menu_order field.

Scope:

  • Add getMenuOrder(): int and chainable setMenuOrder(int $menuOrder): self behavior.
  • Add the methods to the stable interface contract.
  • Persist the value through the existing savePost() lifecycle.
  • Cover zero, positive, negative, successful persistence, reload, and save-failure state.
  • Update API, migration, and changelog documentation.

Out of Scope:

  • Reordering adjacent posts.
  • Enforcing application-specific menu-order ranges.
  • Automatic saving from the setter.

DoR:

  • 0.7.0 is published and verified.
  • Naming and chainability are approved by the 1.0 API gate.

DoD:

  • Interface, trait, tests, and docs expose the same contract.
  • Real WordPress persists and reloads integer menu order correctly.
  • Existing post fields are unaffected.

AC:

  • Given a loaded post, getMenuOrder() returns its integer menu_order value.
  • Given setMenuOrder(), the in-memory value changes and the same instance is returned.
  • Given savePost() and reload, the new value is returned.

Dependencies:

  • T8 — Publish 0.7.0.

Artifacts:

  • Interface and trait changes
  • Unit and integration tests
  • API/changelog documentation

Verification:

  • Unit suite on PHP 7.4 and 8.4.
  • WordPress 6.0 and latest integration profiles.

Notes/Risks:

  • Negative values are valid integers at the library layer and persisted by both supported WordPress integration edges.
  • The library intentionally makes no range, reordering, or query-semantics promise.

Readiness evidence:

  • T8/0.7.0 is published, independently verified, and completed.
  • Accepted ADR 0001 explicitly includes symmetric menu-order accessors; the approved task contract fixes get/set naming and setter chainability.

Execution evidence:

  • Batch 4 runs on branch codex/1.0-api-batch-4 after T8/E2 closure.
  • Implementation, dedicated tests, migration notes, and user/testing documentation are committed as dde6dc6.
  • make check and the direct PHP 7.4 unit suite: 59 tests, 354 assertions on PHP 8.4 and 7.4.
  • make coverage: 180/180 source lines and 43/43 methods (100%).
  • make test.package-install and make smoke: pass.
  • Minimum artifact minimum-20260910T232558Z-42780-14671: WordPress 6.0 / PHP 7.4.33, pass, zero remaining fixtures.
  • Latest artifact latest-20260910T232631Z-44008-10331: WordPress 7.1 / PHP 8.4.25, pass, zero remaining fixtures.
  • Both real profiles proved positive, zero, and negative persistence. A forced Core WP_Error retained -7 in memory, left the database at 0, and a retry persisted -7 without altering unrelated post state.
  • Diagnostic logs are empty, temporary resources were removed, and root diff/lint/unit/coverage/package/localdev verification passed.
  • PR Complete the minimal 1.0 API additions #33 passed final protected CI run 34543321838, merged as 48b2923, and post-merge CI run 34579837783 passed all five jobs. T11 is completed.

Activity

  1. added this to the 1.0.0 milestone on Sep 10, 2026
  2. changed the title [-]Set menu order method[/-] [+]Add menu-order accessors[/+] on Sep 10, 2026
  3. added
    semver:minorBackward-compatible feature or pre-1.0 contract change
    status:todoReady to pull; Definition of Ready is satisfied
    status:reviewImplementation complete and awaiting verification or review
    and removed
    status:waiting-dependencyExecution-ready but waiting on a listed dependency
    status:todoReady to pull; Definition of Ready is satisfied
    on Sep 10, 2026
  4. removed
    status:reviewImplementation complete and awaiting verification or review
    on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsemver:minorBackward-compatible feature or pre-1.0 contract change

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions