add_section( $section, array( 'title' => __( 'Publisher', 'pjax-blog' ), 'panel' => $panel, 'description' => __( 'Set appropriate publisher info, company or individual name which is used for better SEO markup especially in AMP and Profile Card Widget as well.', 'pjax-blog' ), 'priority' => 100, 'capability' => 'edit_theme_options', )); /** * Type of Publisher */ $wp_customize->add_setting( $setting_id = LEAPIN_IDs::$leapin_publisher_type, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control( LEAPIN_IDs::$leapin_publisher_type, array( 'type' => 'select', 'settings' => LEAPIN_IDs::$leapin_publisher_type, 'label' => __('Type of Publisher', 'pjax-blog'), 'section' => $section, 'choices' => array( 'person' => 'Person', 'publisher' => 'Organization', ), )); /** * Publisher Name */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_name, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_name, array( 'label' => __('Name', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Publisher Logo */ //$default_logo = get_template_directory_uri() . '/logo.png'; $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_logo, array( 'type' => 'theme_mod', 'capability' => 'manage_options', // 'default' => esc_url($default_logo), 'default' => '', 'transport' => LEAPIN_IDs::$refresh, 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'leapin_logo_control', array( 'label' => __('Upload a Publisher Logo', 'pjax-blog'), 'section' => $section, 'settings' => LEAPIN_IDs::$leapin_publisher_logo, 'priority' => 10, 'description' => '' ) )); /** * Twitter Name */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_twitter_name, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_twitter_name, array( 'label' => __('Twitter username (without @)', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Facebook profile URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_fb_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_fb_url, array( 'label' => __('Facebook profile URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Google+ profile URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_gplus_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_gplus_url, array( 'label' => __('Google+ profile URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Instagram profile URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_insta_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_insta_url, array( 'label' => __('Instagram profile URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * LinkedIn profile URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_linkedin_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_linkedin_url, array( 'label' => __('LinkedIn profile URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Youtube profile URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_youtube_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_youtube_url, array( 'label' => __('Youtube profile URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Website URL */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_website_url, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_website_url, array( 'label' => __('Website URL', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Email */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_email, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_email, array( 'label' => __('Email', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Phone Number */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_phone_num, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_phone_num, array( 'label' => __('Phone Number', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, )); /** * Address */ $wp_customize->add_setting($setting_id = LEAPIN_IDs::$leapin_publisher_address, array( 'type' => 'theme_mod', // or 'option' 'capability' => 'manage_options', 'transport' => LEAPIN_IDs::$refresh, 'default' => '', 'sanitize_callback' => 'leapin_sanitize_text', )); $wp_customize->add_control(LEAPIN_IDs::$leapin_publisher_address, array( 'label' => __('Address', 'pjax-blog'), 'section' => $section, 'type' => 'text', 'priority' => 10, ));