Does not display search options when Tainacan plugin is not enabled.
This commit is contained in:
parent
0f09bb4ecf
commit
28963040a7
|
@ -127,143 +127,145 @@ function tainacan_customize_register( $wp_customize ) {
|
||||||
'section' => 'tainacan_header_search',
|
'section' => 'tainacan_header_search',
|
||||||
'label' => __( 'Hide search icon and input', 'tainacan-interface' )
|
'label' => __( 'Hide search icon and input', 'tainacan-interface' )
|
||||||
) );
|
) );
|
||||||
|
|
||||||
/**
|
if (defined ( 'TAINACAN_VERSION' ) ) {
|
||||||
* Adds option to configure the Global search option label.
|
/**
|
||||||
*/
|
* Adds option to configure the Global search option label.
|
||||||
$wp_customize->add_setting( 'tainacan_search_global_label', array(
|
*/
|
||||||
'type' => 'theme_mod',
|
$wp_customize->add_setting( 'tainacan_search_global_label', array(
|
||||||
'capability' => 'edit_theme_options',
|
'type' => 'theme_mod',
|
||||||
'default' => __( 'Global', 'tainacan-interface' ),
|
'capability' => 'edit_theme_options',
|
||||||
'sanitize_callback' => 'sanitize_text_field'
|
'default' => __( 'Global', 'tainacan-interface' ),
|
||||||
|
'sanitize_callback' => 'sanitize_text_field'
|
||||||
|
) );
|
||||||
|
$wp_customize->add_control( 'tainacan_search_global_label', array(
|
||||||
|
'type' => 'text',
|
||||||
|
'settings' => 'tainacan_search_global_label',
|
||||||
|
'section' => 'tainacan_header_search',
|
||||||
|
'label' => __( 'Label for "Global" search option', 'tainacan-interface' ),
|
||||||
|
'description' => __( 'The Global search is the default. Its option will only be visible if at least one of the bellow are selected.')
|
||||||
|
) );
|
||||||
|
|
||||||
|
// Option to search directly on repository items list
|
||||||
|
$wp_customize->add_setting( 'tainacan_search_on_items', array(
|
||||||
|
'type' => 'theme_mod',
|
||||||
|
'default' => false,
|
||||||
|
'capability' => 'edit_theme_options',
|
||||||
|
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_control( 'tainacan_search_global_label', array(
|
$wp_customize->add_control( 'tainacan_search_on_items', array(
|
||||||
'type' => 'text',
|
'type' => 'checkbox',
|
||||||
'settings' => 'tainacan_search_global_label',
|
'settings' => 'tainacan_search_on_items',
|
||||||
'section' => 'tainacan_header_search',
|
'section' => 'tainacan_header_search',
|
||||||
'label' => __( 'Label for "Global" search option', 'tainacan-interface' ),
|
'label' => __( 'Display option to search on tainacan items repository list', 'tainacan-interface' )
|
||||||
'description' => __( 'The Global search is the default. Its option will only be visible if at least one of the bellow are selected.')
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Option to search directly on repository items list
|
/**
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_items', array(
|
* Adds option to configure the Items search option label.
|
||||||
'type' => 'theme_mod',
|
*/
|
||||||
'default' => false,
|
$wp_customize->add_setting( 'tainacan_search_on_items_label', array(
|
||||||
'capability' => 'edit_theme_options',
|
'type' => 'theme_mod',
|
||||||
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
'capability' => 'edit_theme_options',
|
||||||
) );
|
'default' => __( 'Items', 'tainacan-interface' ),
|
||||||
$wp_customize->add_control( 'tainacan_search_on_items', array(
|
'sanitize_callback' => 'sanitize_text_field'
|
||||||
'type' => 'checkbox',
|
) );
|
||||||
'settings' => 'tainacan_search_on_items',
|
$wp_customize->add_control( 'tainacan_search_on_items_label', array(
|
||||||
'section' => 'tainacan_header_search',
|
'type' => 'text',
|
||||||
'label' => __( 'Display option to search on tainacan items repository list', 'tainacan-interface' )
|
'settings' => 'tainacan_search_on_items_label',
|
||||||
) );
|
'section' => 'tainacan_header_search',
|
||||||
|
'label' => __( 'Label for the "items" search option', 'tainacan-interface' )
|
||||||
|
) );
|
||||||
|
|
||||||
/**
|
// Option to search directly on collections list
|
||||||
* Adds option to configure the Items search option label.
|
$wp_customize->add_setting( 'tainacan_search_on_collections', array(
|
||||||
*/
|
'type' => 'theme_mod',
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_items_label', array(
|
'default' => false,
|
||||||
'type' => 'theme_mod',
|
'capability' => 'edit_theme_options',
|
||||||
'capability' => 'edit_theme_options',
|
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
||||||
'default' => __( 'Items', 'tainacan-interface' ),
|
|
||||||
'sanitize_callback' => 'sanitize_text_field'
|
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_control( 'tainacan_search_on_items_label', array(
|
$wp_customize->add_control( 'tainacan_search_on_collections', array(
|
||||||
'type' => 'text',
|
'type' => 'checkbox',
|
||||||
'settings' => 'tainacan_search_on_items_label',
|
'settings' => 'tainacan_search_on_collections',
|
||||||
'section' => 'tainacan_header_search',
|
'section' => 'tainacan_header_search',
|
||||||
'label' => __( 'Label for the "items" search option', 'tainacan-interface' )
|
'label' => __( 'Display option to search on tainacan collections list', 'tainacan-interface' )
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Option to search directly on collections list
|
/**
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_collections', array(
|
* Adds option to configure the Collections search option label.
|
||||||
'type' => 'theme_mod',
|
*/
|
||||||
'default' => false,
|
$wp_customize->add_setting( 'tainacan_search_on_collections_label', array(
|
||||||
'capability' => 'edit_theme_options',
|
'type' => 'theme_mod',
|
||||||
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
'capability' => 'edit_theme_options',
|
||||||
) );
|
'default' => __( 'Collections', 'tainacan-interface' ),
|
||||||
$wp_customize->add_control( 'tainacan_search_on_collections', array(
|
'sanitize_callback' => 'sanitize_text_field'
|
||||||
'type' => 'checkbox',
|
) );
|
||||||
'settings' => 'tainacan_search_on_collections',
|
$wp_customize->add_control( 'tainacan_search_on_collections_label', array(
|
||||||
'section' => 'tainacan_header_search',
|
'type' => 'text',
|
||||||
'label' => __( 'Display option to search on tainacan collections list', 'tainacan-interface' )
|
'settings' => 'tainacan_search_on_collections_label',
|
||||||
) );
|
'section' => 'tainacan_header_search',
|
||||||
|
'label' => __( 'Label for the "Collections" search option', 'tainacan-interface' )
|
||||||
|
) );
|
||||||
|
|
||||||
/**
|
// Option to search on wordpress posts only
|
||||||
* Adds option to configure the Collections search option label.
|
$wp_customize->add_setting( 'tainacan_search_on_posts', array(
|
||||||
*/
|
'type' => 'theme_mod',
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_collections_label', array(
|
'default' => false,
|
||||||
'type' => 'theme_mod',
|
'capability' => 'edit_theme_options',
|
||||||
'capability' => 'edit_theme_options',
|
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
||||||
'default' => __( 'Collections', 'tainacan-interface' ),
|
|
||||||
'sanitize_callback' => 'sanitize_text_field'
|
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_control( 'tainacan_search_on_collections_label', array(
|
$wp_customize->add_control( 'tainacan_search_on_posts', array(
|
||||||
'type' => 'text',
|
'type' => 'checkbox',
|
||||||
'settings' => 'tainacan_search_on_collections_label',
|
'settings' => 'tainacan_search_on_posts',
|
||||||
'section' => 'tainacan_header_search',
|
'section' => 'tainacan_header_search',
|
||||||
'label' => __( 'Label for the "Collections" search option', 'tainacan-interface' )
|
'label' => __( 'Display option to search only on WordPress posts', 'tainacan-interface' )
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Option to search on wordpress posts only
|
/**
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_posts', array(
|
* Adds option to configure the Posts search option label.
|
||||||
'type' => 'theme_mod',
|
*/
|
||||||
'default' => false,
|
$wp_customize->add_setting( 'tainacan_search_on_posts_label', array(
|
||||||
'capability' => 'edit_theme_options',
|
'type' => 'theme_mod',
|
||||||
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
'capability' => 'edit_theme_options',
|
||||||
) );
|
'default' => __( 'Posts', 'tainacan-interface' ),
|
||||||
$wp_customize->add_control( 'tainacan_search_on_posts', array(
|
'sanitize_callback' => 'sanitize_text_field'
|
||||||
'type' => 'checkbox',
|
) );
|
||||||
'settings' => 'tainacan_search_on_posts',
|
$wp_customize->add_control( 'tainacan_search_on_posts_label', array(
|
||||||
'section' => 'tainacan_header_search',
|
'type' => 'text',
|
||||||
'label' => __( 'Display option to search only on WordPress posts', 'tainacan-interface' )
|
'settings' => 'tainacan_search_on_posts_label',
|
||||||
) );
|
'section' => 'tainacan_header_search',
|
||||||
|
'label' => __( 'Label for the "Posts" search option', 'tainacan-interface' )
|
||||||
|
) );
|
||||||
|
|
||||||
/**
|
// Option to search on wordpress pages only
|
||||||
* Adds option to configure the Posts search option label.
|
$wp_customize->add_setting( 'tainacan_search_on_pages', array(
|
||||||
*/
|
'type' => 'theme_mod',
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_posts_label', array(
|
'default' => false,
|
||||||
'type' => 'theme_mod',
|
'capability' => 'edit_theme_options',
|
||||||
'capability' => 'edit_theme_options',
|
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
||||||
'default' => __( 'Posts', 'tainacan-interface' ),
|
|
||||||
'sanitize_callback' => 'sanitize_text_field'
|
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_control( 'tainacan_search_on_posts_label', array(
|
$wp_customize->add_control( 'tainacan_search_on_pages', array(
|
||||||
'type' => 'text',
|
'type' => 'checkbox',
|
||||||
'settings' => 'tainacan_search_on_posts_label',
|
'settings' => 'tainacan_search_on_pages',
|
||||||
'section' => 'tainacan_header_search',
|
'section' => 'tainacan_header_search',
|
||||||
'label' => __( 'Label for the "Posts" search option', 'tainacan-interface' )
|
'label' => __( 'Display option to search only on WordPress pages', 'tainacan-interface' )
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Option to search on wordpress pages only
|
/**
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_pages', array(
|
* Adds option to configure the Pages search option label.
|
||||||
'type' => 'theme_mod',
|
*/
|
||||||
'default' => false,
|
$wp_customize->add_setting( 'tainacan_search_on_pages_label', array(
|
||||||
'capability' => 'edit_theme_options',
|
'type' => 'theme_mod',
|
||||||
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
|
'capability' => 'edit_theme_options',
|
||||||
) );
|
'default' => __( 'Pages', 'tainacan-interface' ),
|
||||||
$wp_customize->add_control( 'tainacan_search_on_pages', array(
|
'sanitize_callback' => 'sanitize_text_field'
|
||||||
'type' => 'checkbox',
|
) );
|
||||||
'settings' => 'tainacan_search_on_pages',
|
$wp_customize->add_control( 'tainacan_search_on_pages_label', array(
|
||||||
'section' => 'tainacan_header_search',
|
'type' => 'text',
|
||||||
'label' => __( 'Display option to search only on WordPress pages', 'tainacan-interface' )
|
'settings' => 'tainacan_search_on_pages_label',
|
||||||
) );
|
'section' => 'tainacan_header_search',
|
||||||
|
'label' => __( 'Label for the "Pages" search option', 'tainacan-interface' )
|
||||||
/**
|
) );
|
||||||
* Adds option to configure the Pages search option label.
|
}
|
||||||
*/
|
|
||||||
$wp_customize->add_setting( 'tainacan_search_on_pages_label', array(
|
|
||||||
'type' => 'theme_mod',
|
|
||||||
'capability' => 'edit_theme_options',
|
|
||||||
'default' => __( 'Pages', 'tainacan-interface' ),
|
|
||||||
'sanitize_callback' => 'sanitize_text_field'
|
|
||||||
) );
|
|
||||||
$wp_customize->add_control( 'tainacan_search_on_pages_label', array(
|
|
||||||
'type' => 'text',
|
|
||||||
'settings' => 'tainacan_search_on_pages_label',
|
|
||||||
'section' => 'tainacan_header_search',
|
|
||||||
'label' => __( 'Label for the "Pages" search option', 'tainacan-interface' )
|
|
||||||
) );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Social Share Links
|
* Social Share Links
|
||||||
|
|
Loading…
Reference in New Issue