Skip to content

Typo: Query_Loop::get_query_type_filed() should be get_query_type_field() #123

Description

@Herm71

Found while writing docblocks for src/Blocks/ (#121).

Problem

Query_Loop::get_query_type_filed() — "filed" should be "field". It builds the query-mode button group (latest / automatic / manual) that every query-loop block depends on, so it is a method people will read while working out how those blocks are wired.

Introduced in 7bb59e0 ("Register News block (#30) (#32)") along with the rest of the query-loop base.

Fix

Rename to get_query_type_field().

Low risk, and confirmed by grep rather than assumed. The method is protected, and there are exactly two references in the entire repository — the declaration and a single call, both inside Query_Loop.php:

src/Blocks/Query_Loop.php:174    $this->get_query_type_filed(),
src/Blocks/Query_Loop.php:188    protected function get_query_type_filed(): array {

No subclass overrides or calls it, and nothing outside src/Blocks/ touches it. It is not a hook callback, not a field name, and not persisted anywhere — renaming it changes no stored data and no editor-visible string.

Why it wasn't fixed in #121

That PR is documentation-only and verified as such by token comparison. A rename is a code change, however small, and belongs in a diff that can be reviewed as one.

Worth doing at the same time

Nothing else in src/Blocks/ is misspelled, but this is a reasonable moment to skim for siblings — a quick pass turned up no others.

Acceptance

  • Method renamed to get_query_type_field()
  • Both references updated
  • composer lint no worse than before
  • Query-loop blocks still offer all three modes in the editor
  • The stale note in the get_query_type_filed() docblock referencing this issue is removed

Location: src/Blocks/Query_Loop.php:188, called at :174

Activity

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

    P3Tooling, packaging, docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions