File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,14 @@ public function __construct() {
1717 add_action ('admin_enqueue_scripts ' , [$ this , 'enqueue_metabox_styles ' ]);
1818
1919 $ this ->selected_taxonomies = get_option ( 'runthings_ttc_selected_taxonomies ' , [] );
20+ if ( ! is_array ( $ this ->selected_taxonomies ) ) {
21+ $ this ->selected_taxonomies = [];
22+ }
2023
2124 $ this ->selected_taxonomies = apply_filters ( 'runthings_ttc_selected_taxonomies ' , $ this ->selected_taxonomies );
25+ if ( ! is_array ( $ this ->selected_taxonomies ) ) {
26+ $ this ->selected_taxonomies = [];
27+ }
2228
2329 // Remove the default Gutenberg taxonomy panel for selected taxonomies
2430 add_action ( 'enqueue_block_editor_assets ' , [ $ this , 'enqueue_block_editor_assets ' ] );
@@ -148,6 +154,9 @@ public function render_taxonomy_metabox( $post, $taxonomy ) {
148154 ] );
149155
150156 $ post_terms = wp_get_post_terms ( $ post ->ID , $ taxonomy , [ 'fields ' => 'ids ' ] );
157+ if ( is_wp_error ( $ post_terms ) ) {
158+ $ post_terms = [];
159+ }
151160
152161 // Get style for the taxonomy container
153162 $ style = $ this ->get_taxonomy_container_style ($ taxonomy );
You can’t perform that action at this time.
0 commit comments