Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bw_custom_column_admin() should check the context #2

Closed
bobbingwide opened this issue May 3, 2015 · 1 comment
Closed

bw_custom_column_admin() should check the context #2

bobbingwide opened this issue May 3, 2015 · 1 comment
Assignees
Labels

Comments

@bobbingwide
Copy link
Owner

I was developing a new plugin which handles its own display of a custom column.
During debugging, I registered the field using oik-types
When the column was being shown on a custom post type, bw_custom_column_admin() displayed the value using its own logic.
This was in addition to the custom column being formatted by the new plugin.
bw_custom_column_admin() should have checked that the column was a valid column for the given post type.

Workaround.

Remove the field registration

@bobbingwide bobbingwide added the bug label May 3, 2015
@bobbingwide bobbingwide self-assigned this May 3, 2015
@bobbingwide
Copy link
Owner Author

Proposed solution

The code should determine the post type by querying the current filter, then look for the field name associated with the post type. bw_custom_column should only be called when it's a registered field.

bw_custom_column_admin() is in includes\bw_fields.inc so should be tested in tests\test-includes-bw-fields.php

The tests should be performed for both registered and unregistered fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant