Skip to content

cmb2_metabox_form second parameter is a key or an integer? #1365

@Mte90

Description

@Mte90

Describe the bug

I have this old snippet https://github.com/WPBP/WordPress-Plugin-Boilerplate-Powered/blob/master/plugin-name/backend/views/settings.php#L258 that use 2 parameter with 2 strings but PHPStan report that the second one is an integer of the Post ID (WPBP/WordPress-Plugin-Boilerplate-Powered#162).

Looking on internet in old articles like https://bigwing.com/blog/create-wordpress-cpt-archive-content-with-cmb2/ the second parameter it was a string.

Looking at the code

function cmb2_get_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
it is referring to a integer infact.

But if I configure a string as that parameter is used as key to save the settings.
So I don't know if I am doing it wrong or that parameter accept a string and also a integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions