Bug / DX Improvement: Admin Columns 'Position' parameter ignores group prefix

Support MB Admin Columns Bug / DX Improvement: Admin Columns 'Position' parameter ignores group prefix

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #50172
    Jayron CastroJayron Castro
    Participant

    Hi Meta Box Team / Anh,

    I am writing to report a "leaky abstraction" issue in the Meta Box Builder regarding the Admin Columns extension and field prefixes.

    The Setup:
    We have a field group with a globally defined prefix (e.g., "escola_"). Inside this group, we have two fields:
    1. Field A: ID "sigla_escola" (enabled as an admin column)
    2. Field B: ID "codigo_inep" (enabled as an admin column)

    The Issue:
    When configuring Field B's Admin Column position to appear immediately after Field A, we naturally input "after sigla_escola" in the Position setting within the visual builder.

    However, this fails silently, and Field B's column is completely dropped from the WP post list table.

    The Root Cause & Workaround:
    The failure happens because the Builder passes the raw string ("after sigla_escola") directly to the WordPress WP_List_Table. However, WordPress only recognizes the real prefixed column ID in the database ("escola_sigla_escola").

    To make it work, developers must manually hardcode the prefix into the position field: "after escola_sigla_escola".

    The Suggestion:
    Since the Builder automatically abstracts the prefix for the field IDs themselves during creation, it should ideally do the same for the "Position" parameter. If the target string in the position setting matches a field ID within the same group, the Builder should automatically prepend the active prefix before parsing the column logic.

    Fixing this short-circuit between the visual builder and the Admin Columns extension would prevent a lot of debugging time and drastically improve the Developer Experience (DX).

    Thanks for your continuous excellent work on Meta Box!

    Best regards,

    Jayron Castro
    CEO, Kstros.com

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.