• Resolved Greg Ross

    (@gregross)


    There’s a bug in the custom column code on line 44 of src/Admin/Post/ListTable.php:

    $disable?=?array_key_exists($typenow,?$this->settings->disable??:?[]);

    This code always evaluates to true as it only checks to see if the array key exists, not what it is set to. The code should be:

    $disable = array_key_exists($typenow, $this->settings->disable ?: []) ? $this->settings->disable[$typenow] : false;

    So that the value of the array setting is used if it exists, otherwise it is set to false in all other circumstances.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @gregross,

    Thanks for this, however we only need to know if it’s truthy as we are just checking if Age Gate is disabled for the current post type – which we get from the $typenow global.

    If the column isn’t showing it’s either not enabled in the screen options or a different bug of some kind. If it’s not the first one, let me know and I’ll dig deeper.

    Thanks
    Phil

    Thread Starter Greg Ross

    (@gregross)

    Ok, so I looked into this a little more and it looks like something weird was going on in my install. $this->settings->disable had each post type listed with a value of 0 (aka not disabled) instead of just those post types that had been disabled.

    Re-saving the settings seems to have cleared out the issue ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom column on posts/pages not displayed’ is closed to new replies.