'fas fa-search', 'library' => 'solid']; $is_keywords = isset($attributes['is_keywords']) ? $attributes['is_keywords'] : true; $keywords_label = isset($attributes['keywords_label']) ? $attributes['keywords_label'] : 'Popular:'; $keywords_align = isset($attributes['keywords_align']) ? $attributes['keywords_align'] : 'center'; $keywords = isset($attributes['keywords']) ? $attributes['keywords'] : [['title' => 'Keyword #1'], ['title' => 'Keyword #2']]; $search_post_type = isset($attributes['search_post_type']) ? $attributes['search_post_type'] : 'forum'; $is_pro_active = function_exists( 'forumax_is_premium' ) && forumax_is_premium(); $search_highlight = ! empty( $attributes['search_highlight'] ) ? 'true' : 'false'; $is_ajax_search = ! empty( $attributes['is_ajax_search'] ) ? 'true' : 'false'; // Enforce free defaults for Pro-gated attributes. if ( ! $is_pro_active ) { $search_post_type = 'forum'; unset( $attributes['wrapper_max_width'] ); } $unique_id = uniqid( 'bbpc-search-' ); $widget_id = $unique_id; $input_id = $widget_id . '-input'; $result_id = $widget_id . '-result'; $post_type_id = $widget_id . '-post-type'; // Include dependencies. if ( ! wp_style_is( 'bbpc-el-widgets', 'registered' ) ) { wp_register_style( 'bbpc-el-widgets', FORUMAX_STYLES . 'frontend/el-widgets.css', array(), FORUMAX_VERSION ); } wp_enqueue_style( 'bbpc-el-widgets' ); wp_enqueue_script( 'bbpc-frontend-js', FORUMAX_FRONT_ASS . 'js/frontend.js', array( 'jquery' ), FORUMAX_VERSION, true ); // Localize AJAX data for the search script. wp_localize_script( 'bbpc-frontend-js', 'forumax_localize_script', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'forumax-nonce' ), ) ); $wrapper_attributes = get_block_wrapper_attributes([ 'id' => $unique_id, ]); ob_start(); ?>