-
-
Save styledev/72ddfae8881dc5e3224a to your computer and use it in GitHub Desktop.
Fixes the Notice: Trying to get property of non-object in plugins/edit-flow/modules/editorial-metadata/editorial-metadata.php on line 634
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter_manage_posts_columns( $posts_columns ) { | |
$screen = get_current_screen(); | |
if ( $screen ) { | |
add_filter( "manage_{$screen->id}_sortable_columns", array( $this, 'filter_manage_posts_sortable_columns' ) ); | |
$terms = $this->get_editorial_metadata_terms( array( 'viewable' => true ) ); | |
foreach( $terms as $term ) { | |
// Prefixing slug with module slug because it isn't stored prefixed and we want to avoid collisions | |
$key = $this->module->slug . '-' . $term->slug; | |
$posts_columns[$key] = $term->name; | |
} | |
} | |
return $posts_columns; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment