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

Fix the usage of the 'manage_posts_custom_column' hook #1069

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

justinmaurerdotdev
Copy link

Fixes #1068.

Description

Per the #1068 issue, there are some use cases where the 'manage_posts_custom_column' hook is used outside of The Loop. In current versions of the plugin, this scenario produces an empty column. This PR refactors the callback for that hook to use the passed $post_id instead of using the global $post variable.

Testing

You can test that nothing has broken by viewing the Posts table and checking that the Authors column displays the same as before. I'm not 100% sure of a reliable test for the edge case, besides installing a plugin like Admin Columns and running the export from the Posts table.

…ils, since some uses of the 'manage_posts_custom_column' hook don't happen inside The Loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List table $post is null in exports
1 participant