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' ) . ' ' : '' );
?>
' ;
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 .= 'ID, $checked, false ) . '>' . $post_title . ' ';
}
if ( !empty($selected_pt) && in_array( $post_type, $selected_pt ) ) {
$col_title = '' . $col_title . ' ';
}
$html .= $col_title . '
';
$html .= '
';
$html .= $temp . ' ';
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 .= '
' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
}
$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 ' ' . sprintf( esc_html__( "Search all %s", 'add-search-to-menu' ), strtolower( $post_types[$post_type]->labels->name ) ) . '
' ;
echo ' ' ;
echo ' ' . sprintf( esc_html__( "Search only selected %s", 'add-search-to-menu' ), strtolower( $post_types[$post_type]->labels->name ) ) . '
' ;
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 .= '
';
}
}
$html .= '
' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
$html .= '
';
$checked = ( $selected_tax ? 'selected' : 'all' );
echo ' ' ;
echo ' ' . sprintf(
esc_html__( "Search %s of all taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
strtolower( $post_types[$post_type]->labels->name ),
'',
' '
) . '
' ;
echo ' ' ;
echo ' ' . sprintf(
esc_html__( "Search %s of only selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
strtolower( $post_types[$post_type]->labels->name ),
'',
' '
) . '
' ;
echo $html ;
}
$meta_keys = $this->is_meta_keys( $post_type );
if ( !empty($meta_keys) ) {
$html = '';
$selected_meta = false;
$html .= ' ';
$html .= '';
foreach ( $meta_keys as $meta_key ) {
$checked = ( isset( $includes['custom_field'] ) && in_array( $meta_key, $includes['custom_field'] ) ? $meta_key : 0 );
if ( $checked ) {
$selected_meta = true;
}
$html .= '' . esc_html( $meta_key ) . ' ';
}
$html .= ' ';
$html .= '' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
$html .= '
';
$checked = ( $selected_meta ? 'selected' : 'all' );
echo ' ' ;
echo ' ' . sprintf( esc_html__( "Search selected %s custom fields values", 'add-search-to-menu' ), $post_type ) . '
' ;
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 '' ;
}
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 .= '';
foreach ( $file_types as $key => $file_type ) {
$checked = ( isset( $includes['post_file_type'] ) && in_array( $file_type, $includes['post_file_type'] ) ? $file_type : 0 );
$html .= '' . esc_html( $key ) . ' ';
}
$html .= ' ';
echo IS_Admin::pro_link( 'pro_plus' ) ;
$html .= '' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
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 ' ' . esc_html__( "Search all MIME types", 'add-search-to-menu' ) . '
' ;
echo '
' ;
echo ' ' . esc_html__( "Search only selected MIME types", 'add-search-to-menu' ) . '
' ;
echo $html ;
echo '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search Images", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search Videos", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search Audios", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search Text Files", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search PDF Files", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Search Document Files", 'add-search-to-menu' ) . '
' ;
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 '' . __( 'Searches all author posts', 'add-search-to-menu' ) . ' ' ;
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 ' ID, $checked, false ) . '/>' ;
echo ' ' . ucfirst( esc_html( $author->display_name ) ) . ' ' ;
}
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 '
' ;
echo ' ' . esc_html__( "Search author Display Name and display the posts created by that author", 'add-search-to-menu' ) . '
' ;
?>
' ;
$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 ' ' . esc_html( __( 'Search posts having number of comments', 'add-search-to-menu' ) ) . ' ' ;
echo '' ;
if ( '' !== $comment_count_disable ) {
echo '
' ;
}
$checked = ( isset( $includes['search_comment'] ) && $includes['search_comment'] ? 1 : 0 );
echo '
' ;
echo ' ' . esc_html__( "Search approved comment content", 'add-search-to-menu' ) . '
' ;
?>
' ;
$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 '' . __( 'Select Post Status', 'add-search-to-menu' ) . ' ' ;
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 ' ' . ucwords( str_replace( '-', ' ', esc_html( $post_status ) ) ) . ' ' ;
}
echo '
' ;
}
?>
prop( $id );
$enable_customize = ( isset( $settings['enable_customize'] ) ? $settings['enable_customize'] : false );
$field_class = ( $enable_customize ? '' : 'is-field-disabled' );
?>
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' );
?>
prop( $id );
$includes = $post->prop( '_is_includes' );
$default_search = ( NULL == $post->id() ? true : false );
$includes_url = ( isset( $_REQUEST['post'] ) ? '' . __( "Includes", 'add-search-to-menu' ) . ' ' : '' );
?>
' ;
continue;
}
}
if ( empty($selected_pt2) ) {
echo ' ' ;
echo ' ' . sprintf( esc_html__( "Do not exclude any %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->singular_name ) ) . '
' ;
echo ' ' ;
echo ' ' . sprintf( esc_html__( "Exclude selected %s from search", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '
' ;
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 .= '
';
}
}
$html .= '
' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
$html .= '
';
$checked = ( $selected_tax ? 'selected' : 'all' );
echo ' ' ;
echo ' ' . sprintf(
esc_html__( "Do not exclude any %s from search of any taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
strtolower( $post_types2[$post_type]->labels->singular_name ),
'',
' '
) . '
' ;
echo ' ' ;
echo ' ' . sprintf(
esc_html__( "Exclude %s from search of selected taxonomies (%s categories, tags & terms %s)", 'add-search-to-menu' ),
strtolower( $post_types2[$post_type]->labels->name ),
'',
' '
) . '
' ;
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 .= '';
foreach ( $meta_keys as $meta_key ) {
$checked = ( isset( $excludes['custom_field'] ) && in_array( $meta_key, $excludes['custom_field'] ) ? $meta_key : 0 );
if ( $checked ) {
$selected_meta = true;
}
$html .= '' . esc_html( $meta_key ) . ' ';
}
$html .= ' ';
$html .= IS_Admin::pro_link();
$html .= '' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
$html .= '
';
$checked = ( $selected_meta ? 'selected' : 'all' );
echo ' ' ;
echo ' ' . sprintf( esc_html__( "Exclude %s from search having selected custom fields", 'add-search-to-menu' ), strtolower( $post_types2[$post_type]->labels->name ) ) . '
' ;
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 ' ' . esc_html__( "Exclude 'Out of Stock' products from search", 'add-search-to-menu' ) . '
' ;
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 .= '';
foreach ( $file_types as $key => $file_type ) {
$checked = ( isset( $excludes['post_file_type'] ) && in_array( $file_type, $excludes['post_file_type'] ) ? $file_type : 0 );
$html .= '' . esc_html( $key ) . ' ';
}
$html .= ' ';
echo IS_Admin::pro_link( 'pro_plus' ) ;
$html .= '' . esc_html__( "Hold down the control (ctrl) or command button to select multiple options.", 'add-search-to-menu' ) . ' ';
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 ' ' . esc_html__( "Search all MIME types", 'add-search-to-menu' ) . '
' ;
echo '
' ;
echo ' ' . esc_html__( "Exclude selected MIME types from search", 'add-search-to-menu' ) . '
' ;
echo $html ;
echo '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude Images", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude Videos", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude Audios", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude Text Files", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude PDF Files", 'add-search-to-menu' ) . '
' ;
echo ' ' ;
echo ' ' . esc_html__( "Exclude Document Files", 'add-search-to-menu' ) . '
' ;
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 '' . __( 'Search all author posts', 'add-search-to-menu' ) . ' ' ;
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 ' ID, $checked, false ) . '/>' ;
echo ' ' . ucfirst( esc_html( $author->display_name ) ) . ' ' ;
}
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 '
' ;
echo ' ' . esc_html__( "Exclude sticky posts from search", 'add-search-to-menu' ) . '
' ;
?>
prop( $id );
?>
' . __( '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 ' ' . esc_html__( "Also search base word of searched keyword", 'add-search-to-menu' ) . '
' ;
echo IS_Admin::pro_link( 'pro_plus' ) ;
?>