'product_cat', 'hide_empty' => true, 'fields' => 'ids', 'orderby' => 'rand', 'number' => 10, ) ); // Take 3 random product categories. if ( ! is_wp_error( $terms ) ) { shuffle( $terms ); $prod_cats = array_slice( $terms, 0, 3 ); } $missing = '

' . esc_html_x( 'No product category found, "Featured category block" removed. Please add some product categories, and use the "Featured category block" to add category.', 'Explanation for missing product categories', 'blockette' ) . '

'; return array( 'title' => __( 'WooCommerce featured categories', 'blockette' ), 'categories' => array( 'blockette-shop', 'woo-commerce' ), 'blockTypes' => array( 'core/columns' ), 'viewportWidth' => 1024, 'content' => '

' . esc_html_x( 'Featured product categories', 'Sample text for the heading', 'blockette' ) . '

' . ( ( ! empty( $prod_cats ) && isset( $prod_cats[0] ) ) ? ' ' : wp_kses_post( $missing ) ) . '
' . ( ( ! empty( $prod_cats ) && isset( $prod_cats[0] ) ) ? ' ' : wp_kses_post( $missing ) ) . '
' . ( ( ! empty( $prod_cats ) && isset( $prod_cats[0] ) ) ? ' ' : wp_kses_post( $missing ) ) . '
', );