PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 All 200 releases
← All changes | includes/Shortcodes/CategoryBoxThree.php +6 -1 4.5.64.9.2 View file →
@@ -64,9 +64,14 @@
64 64 public function view_params() {
65 65 $parent_params = parent::view_params();
66 66 $query_arg = $parent_params['terms_query_args'];
67 67
68 - $term_count = count( get_terms( $query_arg ) );
68 + // get_terms() returns a WP_Error for an invalid taxonomy, and the taxonomy
69 + // is a shortcode attribute the author controls — [betterdocs_category_box_3
70 + // taxonomy=nope] reached count(WP_Error), which is a TypeError on PHP 8 and
71 + // takes the whole page down with a 500 for anonymous visitors.
72 + $_terms = get_terms( $query_arg );
73 + $term_count = is_wp_error( $_terms ) ? 0 : count( $_terms );
69 74 $styles = '';
70 75
71 76 if ( $this->isset( 'column' ) ) {
72 77 $_c = intval( $this->attributes['column'] );