search_form = $search_form; } function is_name( $string ) { return preg_match( '/^[A-Za-z][-A-Za-z0-9_:.]*$/', $string ); } public function add_panel( $id, $title, $callback, $description ) { if ( $this->is_name( $id ) ) { $this->panels[$id] = array( 'title' => $title, 'callback' => $callback, 'description' => $description, ); } } public function display() { if ( empty($this->panels) ) { return; } echo '' ; echo sprintf( '
', esc_attr( $tab ) ) ; $this->notice( $tab, $tab . '_panel' ); $callback = $tab . '_panel'; if ( method_exists( $this, $callback ) ) { $this->{$callback}( $this->search_form ); } else { _e( 'The requested section does not exist.', 'add-search-to-menu' ); } echo '
' ; } public function notice( $id, $panel ) { echo '
' ; } /** * Gets all public meta keys of post types * * @global Object $wpdb WPDB object * @return Array array of meta keys */ function is_meta_keys( $post_type ) { global $wpdb ; $is_fields = $wpdb->get_results( apply_filters( 'is_meta_keys_query', "select DISTINCT meta_key from {$wpdb->postmeta} pt LEFT JOIN {$wpdb->posts} p ON (pt.post_id = p.ID) where meta_key NOT LIKE '\\_%' AND post_type IN ( '{$post_type}' ) ORDER BY meta_key ASC" ) ); $meta_keys = array(); if ( is_array( $is_fields ) && !empty($is_fields) ) { foreach ( $is_fields as $field ) { if ( isset( $field->meta_key ) ) { $meta_keys[] = $field->meta_key; } } } /** * Filter results of SQL query for meta keys */ return apply_filters( 'is_meta_keys', $meta_keys ); } public function includes_panel( $post ) { $id = '_is_includes'; $includes = $post->prop( $id ); $excludes = $post->prop( '_is_excludes' ); $settings = $post->prop( '_is_settings' ); $default_search = ( NULL == $post->id() ? true : false ); $excludes_url = ( isset( $_REQUEST['post'] ) ? '' . __( "Excludes", 'add-search-to-menu' ) . '' : '' ); ?>

' ; $post_types = get_post_types( array( 'public' => true, ), 'objects' ); $post_types2 = array(); if ( $default_search ) { $post_types2 = get_post_types( array( 'public' => true, 'exclude_from_search' => false, ) ); } else { if ( isset( $includes['post_type'] ) && !empty($includes['post_type']) && is_array( $includes['post_type'] ) ) { $post_types2 = array_values( $includes['post_type'] ); } } if ( !empty($post_types) ) { echo '
' ; echo '
' ; if ( empty($post_types2) ) { echo '' . __( 'Select Post Types', 'add-search-to-menu' ) . '' ; } else { echo '' ; foreach ( $post_types2 as $post_type2 ) { echo ' ' . $post_types[$post_type2]->labels->name . '' ; } echo '' ; } echo '
' ; echo '
' ; foreach ( $post_types as $key => $post_type ) { $checked = ( $default_search && in_array( $key, $post_types2 ) || isset( $includes['post_type'][esc_attr( $key )] ) ? esc_attr( $key ) : 0 ); echo '' ; } echo '
' ; } else { echo '' . __( 'No post types registered on the site.', 'add-search-to-menu' ) . '' ; } if ( isset( $includes['post_type'] ) && is_array( $includes['post_type'] ) && 1 == count( $includes['post_type'] ) ) { $checked = ( isset( $includes['post_type_url'] ) ? 'y' : 'n' ); echo '

' ; } ?>
labels->name; if ( 'product' == $post_type ) { $accord_title .= ' ' . __( '( WooCommerce )', 'add-search-to-menu' ) . ''; } else { if ( 'attachment' == $post_type ) { $accord_title .= ' ' . __( '( Images, Videos, Audios, Docs, PDFs, Files & Attachments )', 'add-search-to-menu' ) . ''; } } ?>

' ; if ( 'product' == $post_type && !class_exists( 'WooCommerce' ) ) { IS_Help::woocommerce_inactive_field_notice(); echo '
' ; continue; } $posts_found = false; $posts_per_page = ( defined( 'DISABLE_IS_LOAD_ALL' ) || isset( $includes['post__in'] ) ? -1 : 100 ); $posts = get_posts( array( 'post_type' => $post_type, 'posts_per_page' => $posts_per_page, 'orderby' => 'title', 'order' => 'ASC', ) ); $html = '
'; $selected_pt = array(); if ( !empty($posts) ) { $posts_found = true; $html .= '
'; $col_title = '' . $post_types[$post_type]->labels->name . ''; $temp = ''; foreach ( $posts as $post2 ) { if ( isset( $excludes['post__not_in'] ) && in_array( $post2->ID, $excludes['post__not_in'] ) ) { continue; } $checked = ( isset( $includes['post__in'] ) && in_array( $post2->ID, $includes['post__in'] ) ? $post2->ID : 0 ); if ( $checked ) { array_push( $selected_pt, $post_type ); } $post_title = ( isset( $post2->post_title ) && '' !== $post2->post_title ? esc_html( $post2->post_title ) : $post2->post_name ); $temp .= ''; } if ( !empty($selected_pt) && in_array( $post_type, $selected_pt ) ) { $col_title = '' . $col_title . ''; } $html .= $col_title . '
'; $html .= ''; if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $includes['post__in'] ) ) { $html .= '
' . __( 'Load All', 'add-search-to-menu' ) . '
'; } $html .= '
'; } if ( !$posts_found ) { $html .= '
' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types[$post_type]->labels->name ) . ''; } else { $html .= '

'; } $html .= '
'; $checked = 'all'; if ( !empty($selected_pt) && in_array( $post_type, $selected_pt ) ) { $checked = 'selected'; } else { if ( isset( $includes['post__in'] ) ) { echo '' . __( 'The search form is configured to only search specific posts of another post type.', 'add-search-to-menu' ) . '' ; echo '' ; continue; } } echo '

' ; echo '

' ; echo $html ; $tax_objs = get_object_taxonomies( $post_type, 'objects' ); if ( !empty($tax_objs) ) { $html = '
'; $selected_tax = false; foreach ( $tax_objs as $key => $tax_obj ) { $terms = get_terms( array( 'taxonomy' => $key, ) ); if ( !empty($terms) ) { $html .= '
'; $col_title = ucwords( str_replace( '-', ' ', str_replace( '_', ' ', esc_html( $tax_obj->labels->name ) ) ) ); if ( isset( $includes['tax_query'][$key] ) ) { $col_title = '' . $col_title . ''; $selected_tax = true; } $html .= $col_title . '
'; $html .= '
'; } } $html .= '

'; $html .= '
'; $checked = ( $selected_tax ? 'selected' : 'all' ); echo '

' ; echo '

' ; echo $html ; } $meta_keys = $this->is_meta_keys( $post_type ); if ( !empty($meta_keys) ) { $html = '
'; $selected_meta = false; $html .= ''; $html .= ''; $html .= '

'; $html .= '
'; $checked = ( $selected_meta ? 'selected' : 'all' ); echo '

' ; echo $html ; } if ( 'product' == $post_type ) { $woo_sku_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' ); $checked = ( isset( $includes['woo']['sku'] ) && $includes['woo']['sku'] ? 1 : 0 ); echo '
' ; if ( '' !== $woo_sku_disable ) { echo '
' ; } echo '

' ; $checked = ( isset( $includes['woo']['variation'] ) && $includes['woo']['variation'] ? 1 : 0 ); echo '

' ; echo IS_Admin::pro_link( 'pro_plus' ) ; if ( '' !== $woo_sku_disable ) { echo '

' ; } echo '

' ; } if ( 'attachment' == $post_type ) { global $wp_version ; if ( 4.9 <= $wp_version ) { if ( !isset( $excludes['post_file_type'] ) ) { echo '
' ; $file_types = get_allowed_mime_types(); if ( !empty($file_types) ) { $file_type_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( '' !== $file_type_disable ) { echo '
' ; } ksort( $file_types ); $html = '
'; $html .= ''; $html .= ''; echo IS_Admin::pro_link( 'pro_plus' ) ; $html .= '

'; if ( isset( $includes['post_file_type'] ) ) { $html .= __( 'Selected File Types :', 'add-search-to-menu' ); foreach ( $includes['post_file_type'] as $post_file_type ) { $html .= '
' . $post_file_type . ''; } } $html .= '
'; $checked = ( isset( $includes['post_file_type'] ) && !empty($includes['post_file_type']) ? 'selected' : 'all' ); echo '

' ; echo '

' ; echo $html ; echo '' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '
' ; if ( '' !== $file_type_disable ) { echo '
' ; } } } else { echo '
' . sprintf( esc_html__( "This search form is configured in the %s section to not search specific MIME types.", 'add-search-to-menu' ), $excludes_url ) . '' ; } } else { echo '
' . __( 'You are using WordPress version less than 4.9 which does not support searching by MIME type.', 'add-search-to-menu' ) . '' ; } } ?>

' ; $range = array( 'after', 'before' ); foreach ( $range as $value ) { $col_title = ( 'after' == $value ? __( 'From', 'add-search-to-menu' ) : __( 'To', 'add-search-to-menu' ) ); echo '
' . $col_title . '
' ; $checked = ( isset( $includes['date_query'][$value]['date'] ) ? $includes['date_query'][$value]['date'] : '' ); echo '' ; echo '
' ; } ?>

' ; $author_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( !isset( $excludes['author'] ) ) { $authors = get_users( array( 'fields' => array( 'ID', 'display_name' ), 'orderby' => 'post_count', 'order' => 'DESC', ) ); if ( !empty($authors) ) { if ( '' !== $author_disable ) { echo '
' . IS_Admin::pro_link() ; } echo '
' ; echo '
' ; if ( !isset( $includes['author'] ) || empty($includes['author']) ) { echo '' . __( 'Searches all author posts', 'add-search-to-menu' ) . '' ; } else { echo '' ; foreach ( $includes['author'] as $author2 ) { $display_name = get_userdata( $author2 ); if ( $display_name ) { echo ' ' . esc_html( $display_name->display_name ) . '' ; } } echo '' ; } echo '
' ; echo '
' ; foreach ( $authors as $author ) { $post_count = count_user_posts( $author->ID ); // Move on if user has not published a post (yet). if ( !$post_count ) { continue; } $checked = ( isset( $includes['author'][esc_attr( $author->ID )] ) ? $includes['author'][esc_attr( $author->ID )] : 0 ); echo '' ; } echo '
' ; } } else { echo '
' . sprintf( esc_html__( "This search form is configured in the %s section to not search for specific author posts.", 'add-search-to-menu' ), $excludes_url ) . '' ; } if ( '' !== $author_disable ) { echo '
' ; } $checked = ( isset( $includes['search_author'] ) && $includes['search_author'] ? 1 : 0 ); echo '

' ; ?>

' ; $comment_count_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( '' !== $comment_count_disable ) { echo '
' . IS_Admin::pro_link() ; } echo '' ; echo '' ; if ( '' !== $comment_count_disable ) { echo '
' ; } $checked = ( isset( $includes['search_comment'] ) && $includes['search_comment'] ? 1 : 0 ); echo '

' ; ?>

' ; $post_statuses = get_post_stati(); $post_status_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( !empty($post_statuses) ) { if ( '' !== $post_status_disable ) { echo IS_Admin::pro_link() ; } echo '
' ; echo '
' ; if ( $default_search || !isset( $includes['post_status'] ) || empty($includes['post_status']) ) { $includes['post_status'] = array( 'publish' => 'publish', 'inherit' => 'inherit', ); } echo '' ; foreach ( $includes['post_status'] as $post_status2 ) { echo ' ' . str_replace( '-', ' ', esc_html( $post_status2 ) ) . '' ; } echo '' ; echo '
' ; echo '
' ; foreach ( $post_statuses as $key => $post_status ) { $checked = ( isset( $includes['post_status'][esc_attr( $key )] ) ? $includes['post_status'][esc_attr( $key )] : 0 ); echo '' ; } echo '
' ; } ?>

' ; echo '

' ; echo '

' ; ?>

' ; $checked = ( $default_search || isset( $includes['search_content'] ) && $includes['search_content'] ? 1 : 0 ); echo '

' ; $checked = ( $default_search || isset( $includes['search_excerpt'] ) && $includes['search_excerpt'] ? 1 : 0 ); echo '

' ; $checked = ( isset( $includes['search_tax_title'] ) && $includes['search_tax_title'] ? 1 : 0 ); echo '

' ; $checked = ( isset( $includes['search_tax_desp'] ) && $includes['search_tax_desp'] ? 1 : 0 ); echo '

' ; if ( isset( $includes['tax_query'] ) ) { $tax_rel_disable = ''; if ( isset( $includes['tax_post_type'] ) ) { $temp = array(); foreach ( $includes['tax_query'] as $key => $value ) { if ( isset( $includes['tax_post_type'][$key] ) && (empty($temp) || !in_array( $includes['tax_post_type'][$key], $temp )) ) { array_push( $temp, $includes['tax_post_type'][$key] ); } if ( count( $temp ) > 1 ) { $tax_rel_disable = 'disabled'; $includes['tax_rel'] = "OR"; break; } } } echo '

' ; if ( 'disabled' == $tax_rel_disable ) { echo '
' ; $content = __( 'Note: The below option is disabled and set to OR as you have configured the search form to search multiple taxonomies.', 'add-search-to-menu' ); IS_Help::help_info( $content ); } $checked = ( isset( $includes['tax_rel'] ) && "AND" == $includes['tax_rel'] ? "AND" : "OR" ); echo '

' ; echo '

' ; } ?>
prop( $id ); $enable_customize = ( isset( $settings['enable_customize'] ) ? $settings['enable_customize'] : false ); $field_class = ( $enable_customize ? '' : 'is-field-disabled' ); ?>

' . __( "Search Form Customizer", "ivory-search" ) . '' ; } ?>
prop( $id ); $includes = $post->prop( '_is_includes' ); $includes_url = ( isset( $_REQUEST['post'] ) ? '' . __( "Includes", 'add-search-to-menu' ) . '' : '' ); // If not have any settings saved then set default value for fields. if ( empty($settings) ) { $show_description = true; $show_details_box = true; $show_more_result = true; $show_more_func = false; $show_price = true; $show_matching_categories = true; $show_image = true; $search_results = 'both'; } else { $show_description = ( isset( $settings['show_description'] ) && $settings['show_description'] ? 1 : 0 ); $show_details_box = ( isset( $settings['show_details_box'] ) ? $settings['show_details_box'] : false ); $show_more_result = ( isset( $settings['show_more_result'] ) && $settings['show_more_result'] ? 1 : 0 ); $show_more_func = ( isset( $settings['show_more_func'] ) && $settings['show_more_func'] ? 1 : 0 ); $show_price = ( isset( $settings['show_price'] ) && $settings['show_price'] ? 1 : 0 ); $show_matching_categories = ( isset( $settings['show_matching_categories'] ) && $settings['show_matching_categories'] ? 1 : 0 ); $show_image = ( isset( $settings['show_image'] ) ? 1 : 0 ); $search_results = ( isset( $settings['search_results'] ) ? $settings['search_results'] : 'both' ); } $enable_ajax = ( isset( $settings['enable_ajax'] ) ? $settings['enable_ajax'] : false ); $description_source = ( isset( $settings['description_source'] ) ? $settings['description_source'] : 'excerpt' ); $description_length = ( isset( $settings['description_length'] ) ? $settings['description_length'] : 20 ); $hide_price_out_of_stock = ( isset( $settings['hide_price_out_of_stock'] ) && $settings['hide_price_out_of_stock'] ? 1 : 0 ); $show_sale_badge = ( isset( $settings['show_sale_badge'] ) && $settings['show_sale_badge'] ? 1 : 0 ); $show_categories = ( isset( $settings['show_categories'] ) && $settings['show_categories'] ? 1 : 0 ); $show_tags = ( isset( $settings['show_tags'] ) && $settings['show_tags'] ? 1 : 0 ); $show_sku = ( isset( $settings['show_sku'] ) && $settings['show_sku'] ? 1 : 0 ); $show_matching_tags = ( isset( $settings['show_matching_tags'] ) && $settings['show_matching_tags'] ? 1 : 0 ); $show_stock_status = ( isset( $settings['show_stock_status'] ) && $settings['show_stock_status'] ? 1 : 0 ); $show_featured_icon = ( isset( $settings['show_featured_icon'] ) && $settings['show_featured_icon'] ? 1 : 0 ); $nothing_found_text = ( isset( $settings['nothing_found_text'] ) ? $settings['nothing_found_text'] : __( 'Nothing found', 'add-search-to-menu' ) ); $min_no_for_search = ( isset( $settings['min_no_for_search'] ) ? $settings['min_no_for_search'] : 1 ); $view_all_results = ( isset( $settings['view_all_results'] ) ? $settings['view_all_results'] : false ); $view_all_text = ( isset( $settings['view_all_text'] ) ? $settings['view_all_text'] : __( 'View All', 'add-search-to-menu' ) ); // Result Layout. $result_box_max_height = ( isset( $settings['result_box_max_height'] ) ? $settings['result_box_max_height'] : 400 ); $more_result_text = ( isset( $settings['more_result_text'] ) ? $settings['more_result_text'] : __( 'More Results..', 'add-search-to-menu' ) ); $show_author = ( isset( $settings['show_author'] ) && $settings['show_author'] ? 1 : 0 ); $show_date = ( isset( $settings['show_date'] ) && $settings['show_date'] ? 1 : 0 ); // Details Box. $product_list = ( isset( $settings['product_list'] ) ? $settings['product_list'] : 'all' ); $order_by = ( isset( $settings['order_by'] ) ? $settings['order_by'] : 'date' ); $order = ( isset( $settings['order'] ) ? $settings['order'] : 'desc' ); $field_class = ( $enable_ajax ? '' : 'is-field-disabled' ); ?>






' . sprintf( esc_html__( "Please first configure this search form in the %s section to search WooCommerce product post type.", 'add-search-to-menu' ), $includes_url ) . '
' ; } else { ?>


' . __( "AJAX Search Customizer", "ivory-search" ) . '' ; } ?>
prop( $id ); $includes = $post->prop( '_is_includes' ); $default_search = ( NULL == $post->id() ? true : false ); $includes_url = ( isset( $_REQUEST['post'] ) ? '' . __( "Includes", 'add-search-to-menu' ) . '' : '' ); ?>

true, 'exclude_from_search' => false, ) ); $post_types2 = get_post_types( '', 'objects' ); if ( isset( $includes['post_type'] ) && !empty($includes['post_type']) && is_array( $includes['post_type'] ) ) { $post_types = array_values( $includes['post_type'] ); } foreach ( $post_types as $key => $post_type ) { $accord_title = $post_types2[$post_type]->labels->name; if ( 'product' == $post_type ) { $accord_title .= ' ' . __( '( WooCommerce )', 'add-search-to-menu' ) . ''; } else { if ( 'attachment' == $post_type ) { $accord_title .= ' ' . __( '( Images, Videos, Audios, Docs, PDFs, Files & Attachments )', 'add-search-to-menu' ) . ''; } } ?>

' ; if ( 'product' == $post_type && !class_exists( 'WooCommerce' ) ) { IS_Help::woocommerce_inactive_field_notice(); echo '
' ; continue; } if ( 'attachment' != $post_type || !isset( $includes['post_file_type'] ) ) { $posts_found = false; $posts_per_page = ( defined( 'DISABLE_IS_LOAD_ALL' ) || isset( $excludes['post__not_in'] ) ? -1 : 100 ); $posts = get_posts( array( 'post_type' => $post_type, 'posts_per_page' => $posts_per_page, 'orderby' => 'title', 'order' => 'ASC', ) ); $html = '
'; $selected_pt = array(); $selected_pt2 = array(); if ( !empty($posts) ) { $posts_found = true; $html .= '
'; $col_title = '' . $post_types2[$post_type]->labels->name . ''; $temp = ''; foreach ( $posts as $post2 ) { $checked = ( isset( $includes['post__in'] ) && in_array( $post2->ID, $includes['post__in'] ) ? $post2->ID : 0 ); if ( $checked ) { array_push( $selected_pt2, $post_type ); } $checked = ( isset( $excludes['post__not_in'] ) && in_array( $post2->ID, $excludes['post__not_in'] ) ? $post2->ID : 0 ); if ( $checked ) { array_push( $selected_pt, $post_type ); } $post_title = ( isset( $post2->post_title ) && '' !== $post2->post_title ? esc_html( $post2->post_title ) : $post2->post_name ); $temp .= ''; } if ( !empty($selected_pt) && in_array( $post_type, $selected_pt ) ) { $col_title = '' . $col_title . ''; } $html .= $col_title . '
'; $html .= ''; if ( count( $posts ) >= 100 && !defined( 'DISABLE_IS_LOAD_ALL' ) && !isset( $excludes['post__not_in'] ) ) { $html .= '
' . __( 'Load All', 'add-search-to-menu' ) . '
'; } $html .= '
'; } if ( !$posts_found ) { $html .= '
' . sprintf( __( 'No %s created.', 'add-search-to-menu' ), $post_types2[$post_type]->labels->name ) . ''; } else { $html .= '

'; } $html .= '
'; $checked = 'all'; if ( !empty($selected_pt) && in_array( $post_type, $selected_pt ) ) { $checked = 'selected'; } else { if ( empty($selected_pt2) && isset( $includes['post__in'] ) ) { echo '
' . sprintf( esc_html__( "The search form is configured in the %s section to only search specific posts of another post type.", 'add-search-to-menu' ), $includes_url ) . '' ; echo '
' ; continue; } } if ( empty($selected_pt2) ) { echo '

' ; echo '

' ; echo $html ; } else { echo '
' . sprintf( esc_html__( "The search form is configured in the %s section to only search specific posts.", 'add-search-to-menu' ), $includes_url ) . '
' ; } } $tax_objs = get_object_taxonomies( $post_type, 'objects' ); if ( !empty($tax_objs) ) { $html = '
'; $selected_tax = false; foreach ( $tax_objs as $key => $tax_obj ) { $terms = get_terms( array( 'taxonomy' => $key, ) ); if ( !empty($terms) ) { $html .= '
'; $col_title = ucwords( str_replace( '-', ' ', str_replace( '_', ' ', esc_html( $tax_obj->labels->name ) ) ) ); if ( isset( $excludes['tax_query'][$key] ) ) { $col_title = '' . $col_title . ''; $selected_tax = true; } $html .= $col_title . '
'; } } $html .= '

'; $html .= '
'; $checked = ( $selected_tax ? 'selected' : 'all' ); echo '

' ; echo '

' ; echo $html ; } $meta_keys = $this->is_meta_keys( $post_type ); if ( !empty($meta_keys) ) { $html = '
'; $selected_meta = false; $custom_field_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); $html .= ''; $html .= ''; $html .= IS_Admin::pro_link(); $html .= '

'; $html .= '
'; $checked = ( $selected_meta ? 'selected' : 'all' ); echo '

' ; echo $html ; } if ( 'product' == $post_type ) { echo '
' ; $outofstock_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( '' !== $outofstock_disable ) { echo '
' ; } $checked = ( isset( $excludes['woo']['outofstock'] ) && $excludes['woo']['outofstock'] ? 1 : 0 ); echo '

' ; echo IS_Admin::pro_link( 'pro_plus' ) ; if ( '' !== $outofstock_disable ) { echo '
' ; } } if ( 'attachment' == $post_type ) { global $wp_version ; if ( 4.9 <= $wp_version ) { if ( !isset( $includes['post_file_type'] ) ) { echo '
' ; $file_types = get_allowed_mime_types(); if ( !empty($file_types) ) { $file_type_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' ); if ( '' !== $file_type_disable ) { echo '
' ; } ksort( $file_types ); $html = '
'; $html .= ''; $html .= ''; echo IS_Admin::pro_link( 'pro_plus' ) ; $html .= '

'; if ( isset( $excludes['post_file_type'] ) ) { $html .= __( 'Excluded File Types :', 'add-search-to-menu' ); foreach ( $excludes['post_file_type'] as $post_file_type ) { $html .= '
' . $post_file_type . ''; } } $html .= '
'; $checked = ( isset( $excludes['post_file_type'] ) && !empty($excludes['post_file_type']) ? 'selected' : 'all' ); echo '

' ; echo '

' ; echo $html ; echo '' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '

' ; echo '
' ; if ( '' !== $file_type_disable ) { echo '
' ; } } } else { echo '
' . sprintf( esc_html__( "This search form is configured in the %s section to search specific attachments.", 'add-search-to-menu' ), $includes_url ) . '
' ; } } else { echo '' . __( 'You are using WordPress version less than 4.9 which does not support searching by MIME type.', 'add-search-to-menu' ) . '' ; } } ?>

' ; if ( !isset( $includes['author'] ) ) { $author_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); $authors = get_users( array( 'fields' => array( 'ID', 'display_name' ), 'orderby' => 'post_count', 'order' => 'DESC', 'who' => 'authors', ) ); if ( !empty($authors) ) { if ( '' !== $author_disable ) { echo IS_Admin::pro_link() ; } echo '
' ; echo '
' ; if ( !isset( $excludes['author'] ) || empty($excludes['author']) ) { echo '' . __( 'Search all author posts', 'add-search-to-menu' ) . '' ; } else { echo '' ; foreach ( $excludes['author'] as $author2 ) { $display_name = get_userdata( $author2 ); if ( $display_name ) { echo ' ' . esc_html( $display_name->display_name ) . '' ; } } echo '' ; } echo '
' ; echo '
' ; foreach ( $authors as $author ) { $post_count = count_user_posts( $author->ID ); // Move on if user has not published a post (yet). if ( !$post_count ) { continue; } $checked = ( isset( $excludes['author'][esc_attr( $author->ID )] ) ? $excludes['author'][esc_attr( $author->ID )] : 0 ); echo '' ; } echo '
' ; } } else { echo '
' . sprintf( esc_html__( "This search form is configured in the %s section to search posts created by specific authors.", 'add-search-to-menu' ), $includes_url ) . '
' ; } ?>

' ; $checked = ( isset( $excludes['ignore_sticky_posts'] ) && $excludes['ignore_sticky_posts'] ? 1 : 0 ); echo '

' ; ?>
prop( $id ); ?>

' ; echo '' ; ?>

' ; $orderby_disable = ( is_fs()->is_plan_or_trial( 'pro' ) && $this->is_premium_plugin ? '' : ' disabled ' ); echo '' ; echo IS_Admin::pro_link() ; ?>

' ; $color = ( isset( $settings['highlight_color'] ) ? $settings['highlight_color'] : '#FFFFB9' ); echo '
' ; echo '' ; ?>

' ; $checked = ( isset( $settings['term_rel'] ) && "OR" === $settings['term_rel'] ? "OR" : "AND" ); echo '

' ; echo '

' ; ?>

' ; $checked = ( isset( $settings['fuzzy_match'] ) ? $settings['fuzzy_match'] : '2' ); echo '

' ; echo '

' ; ?>

' . __( 'For Example: If you search "doing" then it also searches base word of "doing" that is "do" in the specified post types.', 'add-search-to-menu' ) . '

'; $content .= '

' . __( 'Not recommended to use when Fuzzy Matching option is set to Whole.', 'add-search-to-menu' ) . '

'; IS_Help::help_info( $content ); echo '
' ; $stem_disable = ( is_fs()->is_plan_or_trial( 'pro_plus' ) && $this->is_premium_plugin ? '' : ' disabled ' ); $checked = ( isset( $settings['keyword_stem'] ) && $settings['keyword_stem'] ? 1 : 0 ); echo '

' ; echo IS_Admin::pro_link( 'pro_plus' ) ; ?>

' ; $checked = ( isset( $settings['demo'] ) && $settings['demo'] ? 1 : 0 ); echo '

' ; $checked = ( isset( $settings['disable'] ) && $settings['disable'] ? 1 : 0 ); echo '

' ; echo '

' ; $content = __( 'Select whether to display an error when user perform search without any search word.', 'add-search-to-menu' ); IS_Help::help_info( $content ); $checked = ( isset( $settings['empty_search'] ) && $settings['empty_search'] ? 1 : 0 ); echo '

' ; ?>