" . str_replace( array(
'[code]',
'[/code]'
), array(
'',
''
), esc_html__( 'When enabled, the Admin Search box will display instantly on keypress except when a text field is in focus. The Admin Search box can be opened anytime by clicking the search icon in the admin bar.', 'admin-search' ) ) . "
";
}
/*
* Set up 'autosearch' setting
*/
function admin_search_setting_autosearch() {
echo "
" . str_replace( array(
'[code]',
'[/code]'
), array(
'',
''
), esc_html__( 'When enabled, search results will be displayed as you type. When disabled, press [code]Enter[/code] to search.', 'admin-search' ) ) . "
";
}
/*
* Set up 'result_count' setting
*/
function admin_search_setting_result_count() {
$field = "";
/* translators: %s: the settings field, rendered as a dropdown inline with this label */
echo "
" . esc_html__( 'If a search returns more results than the limit, an option to load more will be displayed in the search box. A high result limit may cause longer load times when searching.', 'admin-search' ) . "
";
}
/*
* Set up 'highlight_query' setting
*/
function admin_search_setting_highlight_query() {
echo "";
}
/*
* Set up 'show_when_viewing_site' setting
*/
function admin_search_setting_show_when_viewing_site() {
echo "
" . esc_html__( 'When enabled, the Admin Search box will be accessible to admins when viewing the website.', 'admin-search' ) . "
";
}
/*
* Set up 'result_previews' setting
*/
function admin_search_setting_result_previews() {
echo "
" . esc_html__( 'When enabled, permalinks of supported search results can be previewed directly in the Admin Search box.', 'admin-search' ) . "
";
}
/*
* Set up 'show_suggestions' setting
*/
function admin_search_setting_show_suggestions() {
echo "
";
global $wpdb;
$table_name = $wpdb -> prefix . 'admin_search__searches';
$top_searches = $wpdb -> get_results( $wpdb -> prepare( "SELECT * FROM {$table_name} ORDER BY LENGTH(query) DESC, occurrences DESC, results DESC LIMIT 100" ) );
if ( empty( $top_searches ) ) {
esc_html_e( 'When enabled, search suggestions will be displayed as you type. These suggestions are based on past searches – the more you search, the more accurate the suggestions become.', 'admin-search' );
} else {
echo str_replace(
array(
'[span clearSuggestionContainer]',
'[a clearSuggestions]',
'[/a]',
'[/span]'
),
array(
'',
'',
'',
''
),
esc_html__( 'When enabled, search suggestions will be displayed as you type. These suggestions are based on past searches – the more you search, the more accurate the suggestions become.[span clearSuggestionContainer] [a clearSuggestions]Clear search suggestions[/a].[/span]', 'admin-search' )
);
}
echo "
";
}
/*
* Set up 'include_admin_pages' setting
*/
function admin_search_setting_include_admin_pages() {
echo "
" . esc_html__( 'Users will only see admin pages they have access to.', 'admin-search' ) . "
";
}
/*
* Set up 'include_comments' setting
*/
function admin_search_setting_include_comments() {
echo "";
}
/*
* Set up 'include_users' setting
*/
function admin_search_setting_include_users() {
echo "";
}
/*
* Set up 'external_websites' setting
*/
function admin_search_setting_external_websites() {
echo "
" . str_replace( array(
'[code]',
'[/code]'
), array(
'',
''
), esc_html__( 'Display links to external websites in search results. Use [code]%q%[/code] in place of the query value in the URL. Separate multiple website URLs with line breaks.', 'admin-search' ) ) . "
" . str_replace( array(
'[code]',
'[/code]'
), array(
'',
''
), esc_html__( 'Example: Add [code]https://wordpress.org/search/%q%[/code] to display a link to the WordPress.org search pre-populated with your search query.', 'admin-search' ) ) . "