Taxonomy: get_terms_to_edit() can also return false or WP_Error. Vars using it should be set to empty string when errors are returned to avoid producing fatal errors when used in string operations.

Props valendesigns.
Fixes #30472.


git-svn-id: https://develop.svn.wordpress.org/trunk@35139 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-10-13 16:39:47 +00:00
parent 0a8b41c950
commit d929461fd8
2 changed files with 11 additions and 2 deletions
+6 -1
View File
@@ -314,8 +314,13 @@ function get_inline_data($post) {
} elseif ( $taxonomy->show_ui ) {
$terms_to_edit = get_terms_to_edit( $post->ID, $taxonomy_name );
if ( ! is_string( $terms_to_edit ) ) {
$terms_to_edit = '';
}
echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">'
. esc_html( str_replace( ',', ', ', get_terms_to_edit( $post->ID, $taxonomy_name ) ) ) . '</div>';
. esc_html( str_replace( ',', ', ', $terms_to_edit ) ) . '</div>';
}
}