/**
     * @return string Inline CSS
     * @since 0.0.1-dev
     */
    private function get_css()
    {
        if (has_post_thumbnail() && !post_password_required()) {
            $thumb = esc_url(get_the_post_thumbnail_url(null, 'push7ssb-sbz-thumbnail'));
        } elseif (has_site_icon()) {
            $thumb = esc_url(get_site_icon_url());
        } else {
            $thumb = '';
        }
        return <<<EOI
.push7-sb-sbz-with-thumb {
\tbackground-image: url({$thumb});
}
.push7-sb-sbz-with-thumb-subscribe {
\tbackground-color: rgba(43,43,43, 0.7);
\tcolor: #ffffff;
}
@media only screen and (min-width : 415px) {
\t.push7-sb-sbz-with-thumb-thumbnail {
\t\tbackground-image: url({$thumb});
\t}
\t.push7-sb-sbz-with-thumb-subscribe {
\t\tbackground-color: rgba(43,43,43, 1);
\t}
}
EOI;
    }
예제 #2
0
/**
 * Add custom favicon
 *
 * @since 1.0
 */
function cruxstore_add_site_icon()
{
    if (!function_exists('has_site_icon') || !has_site_icon()) {
        $custom_favicon = cruxstore_option('custom_favicon');
        $custom_favicon_iphone = cruxstore_option('custom_favicon_iphone');
        $custom_favicon_iphone_retina = cruxstore_option('custom_favicon_iphone_retina');
        $custom_favicon_ipad = cruxstore_option('custom_favicon_ipad');
        $custom_favicon_ipad_retina = cruxstore_option('custom_favicon_ipad_retina');
        if ($custom_favicon['url']) {
            printf('<link rel="shortcut icon" href="%s"/>', esc_url($custom_favicon['url']));
        }
        if ($custom_favicon_iphone['url']) {
            printf('<link rel="apple-touch-icon" href="%s"/>', esc_url($custom_favicon_iphone['url']));
        }
        if ($custom_favicon_ipad['url']) {
            printf('<link rel="apple-touch-icon" sizes="72x72" href="%s"/>', esc_url($custom_favicon_ipad['url']));
        }
        if ($custom_favicon_iphone_retina['url']) {
            printf('<link rel="apple-touch-icon" sizes="114x114" href="%s"/>', esc_url($custom_favicon_iphone_retina['url']));
        }
        if ($custom_favicon_ipad_retina['url']) {
            printf('<link rel="apple-touch-icon" sizes="144x144" href="%s"/>', esc_url($custom_favicon_ipad_retina['url']));
        }
    }
}
 /**
  * Register our actions and filters
  * @return null
  */
 public function register_hooks()
 {
     add_action('jetpack_modules_loaded', array($this, 'jetpack_modules_loaded'));
     add_action('admin_menu', array($this, 'admin_menu_upload_site_icon'));
     add_filter('display_media_states', array($this, 'add_media_state'));
     add_action('admin_init', array($this, 'admin_init'));
     add_action('admin_init', array($this, 'delete_site_icon_hook'));
     add_action('admin_print_styles-options-general.php', array($this, 'add_general_options_styles'));
     // Add the favicon to the front end and backend if Core's site icon not used.
     /**
      * As of WP 4.3 and JP 3.6, both are outputting the same icons so no need to fire these.
      * This is a temporary solution until Jetpack's module primary function is deprecated.
      * In the future, Jetpack's can output other sizes using Core's icon.
      */
     if (function_exists('has_site_icon') && !has_site_icon() || !function_exists('has_site_icon')) {
         add_action('wp_head', array($this, 'site_icon_add_meta'));
         add_action('admin_head', array($this, 'site_icon_add_meta'));
         add_action('atom_head', array($this, 'atom_icon'));
         add_action('rss2_head', array($this, 'rss2_icon'));
     }
     // Check if site icon is available in core, and if so convert Jetpack's to use it.
     add_action('admin_init', array('Jetpack', 'jetpack_site_icon_available_in_core'));
     add_action('delete_option', array('Jetpack_Site_Icon', 'delete_temp_data'), 10, 1);
     // used to clean up after itself.
     add_action('delete_attachment', array('Jetpack_Site_Icon', 'delete_attachment_data'), 10, 1);
     // in case user deletes the attachment via
     add_filter('get_post_metadata', array('Jetpack_Site_Icon', 'delete_attachment_images'), 10, 4);
 }
예제 #4
0
 function __construct()
 {
     $this->options = array('custom_css_enable' => array('name' => 'custom_css_enable', 'title' => __('Custom CSS', "news-magazine"), 'type' => 'checkbox_open', 'show' => array("custom_css_text"), 'hide' => array(), 'description' => __('Custom CSS will change the visual style of the website. The CSS code in this box is being applied to any page or post.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'custom_css_text' => array('name' => 'custom_css_text', 'title' => '', 'type' => 'textarea', "sanitize_type" => "css", 'valid_options' => '', 'description' => __('Custom CSS code.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => '', 'customizer' => array()), 'latest_posts_enable' => array('name' => 'latest_posts_enable', 'title' => __('Latest posts', "news-magazine"), 'type' => 'checkbox_open', 'show' => array("latest_posts_text", "latest_posts_count", "latest_post_categories"), 'hide' => array(), 'description' => __('Latest posts.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'latest_posts_text' => array('name' => 'latest_posts_text', 'title' => '', 'type' => 'text', "sanitize_type" => "sanitize_text_field", 'valid_options' => '', 'description' => __('Latest posts text.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => 'Latest:', 'customizer' => array()), 'latest_posts_count' => array('name' => 'latest_posts_count', 'title' => '', 'type' => 'text', "sanitize_type" => "sanitize_text_field", 'inpus_size' => 2, 'valid_options' => '', 'description' => __('Latest posts count.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => get_option('posts_per_page'), 'customizer' => array()), "latest_post_categories" => array("name" => "latest_post_categories", "title" => "", 'type' => 'select', 'multiple' => "true", "valid_options" => $this->get_all_categories(), "description" => __("Show posts only from these categories.", "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => array(''), 'customizer' => array()), 'logo_type' => array("name" => "logo_type", "title" => __("Logo type", "news-magazine"), 'type' => 'radio_open', "description" => "", 'valid_options' => array('none' => __("None", "news-magazine"), 'image' => __("Image", "news-magazine"), 'text' => __("Text", "news-magazine")), 'show' => array('image' => 'logo_img'), 'hide' => array(), 'section' => 'general_main', 'tab' => 'general', 'default' => 'image', 'customizer' => array()), 'logo_img' => array('name' => 'logo_img', 'title' => __('Logo', "news-magazine"), "sanitize_type" => "esc_url_raw", 'type' => 'upload_single', 'description' => __('Upload custom logo image.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => WDWT_IMG . 'logo1.png', 'customizer' => array()), 'show_desc' => array('name' => 'show_desc', 'title' => __('Show description', "news-magazine"), 'type' => 'checkbox', 'description' => __('Check the box to show site description.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'blog_style' => array('name' => 'blog_style', 'title' => __('Blog Style post format', "news-magazine"), 'type' => 'checkbox', 'description' => __('Check the box to have short previews for the homepage/index posts.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'grab_image' => array('name' => 'grab_image', 'title' => __('Grab the first post image', "news-magazine"), 'type' => 'checkbox', 'description' => __('Enable this option if you want to use the images that are already in your post to create a thumbnail without using custom fields. In this case thumbnail images will be generated automatically using the first image of the post. Note that the image needs to be hosted on your own server.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'date_enable' => array("name" => "date_enable", "title" => __("Display post meta information", "news-magazine"), 'type' => 'checkbox', "description" => __("Choose whether to display the post meta information such as date, author and etc.", "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'footer_text_enable' => array("name" => "footer_text_enable", "title" => __("Information in the Footer", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("footer_text"), 'hide' => array(), "description" => __("Check the box to display custom HTML for the footer.", "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'footer_text' => array("name" => "footer_text", "title" => __("Information in the Footer", "news-magazine"), 'type' => 'textarea', "sanitize_type" => "sanitize_footer_html_field", "description" => __("Here you can provide the HTML code to be inserted in the footer of your web site.", "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => '<span id="copyright">WordPress Themes by <a href="' . WDWT_HOMEPAGE . '"  target="_blank" title="Web-Dorado">Web-Dorado</a></span>', 'customizer' => array()), 'show_facebook_icon' => array("name" => "show_facebook_icon", "title" => __("Show Facebook Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("facebook_url"), 'hide' => array(), "description" => __("Check the box to display Facebook icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'facebook_url' => array("name" => "facebook_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Facebook Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_twitter_icon' => array("name" => "show_twitter_icon", "title" => __("Show Twitter Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("twitter_url"), 'hide' => array(), "description" => __("Check the box to display Twitter icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'twitter_url' => array("name" => "twitter_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Twitter Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_google_icon' => array("name" => "show_google_icon", "title" => __("Show Google+ Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("google_url"), 'hide' => array(), "description" => __("Check the box to display Google + icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'google_url' => array("name" => "google_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Google+ Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_rss_icon' => array("name" => "show_rss_icon", "title" => __("Show RSS Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("rss_url"), 'hide' => array(), "description" => __("Check the box to display RSS feed icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'rss_url' => array("name" => "rss_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your RSS URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_instagram_icon' => array("name" => "show_instagram_icon", "title" => __("Show instagram Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("instagram_url"), 'hide' => array(), "description" => __("Check the box to display Instagram icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'instagram_url' => array("name" => "instagram_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Instagram Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_linkedin_icon' => array("name" => "show_linkedin_icon", "title" => __("Show linkedin Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("linkedin_url"), 'hide' => array(), "description" => __("Check the box to display LinkedIn icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'linkedin_url' => array("name" => "linkedin_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your LinkedIn Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_pinterest_icon' => array("name" => "show_pinterest_icon", "title" => __("Show pinterest Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("pinterest_url"), 'hide' => array(), "description" => __("Check the box to display Pinterest icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'pinterest_url' => array("name" => "pinterest_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Pinterest Profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()), 'show_youtube_icon' => array("name" => "show_youtube_icon", "title" => __("Show youtube Icon", "news-magazine"), 'type' => 'checkbox_open', 'show' => array("youtube_url"), 'hide' => array(), "description" => __("Check the box to display Youtube icon.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => true, 'customizer' => array()), 'youtube_url' => array("name" => "youtube_url", "title" => "", 'type' => 'text', "sanitize_type" => "esc_url_raw", "description" => __("Enter your Youtube profile URL below.", "news-magazine"), 'section' => 'general_links', 'tab' => 'general', 'default' => '#', 'customizer' => array()));
     if (!function_exists('has_site_icon') || !has_site_icon()) {
         $this->options['favicon_enable'] = array('name' => 'favicon_enable', 'title' => __('Show Favicon', "news-magazine"), 'type' => 'checkbox_open', 'show' => array("favicon_img"), 'hide' => array(), 'description' => __('Check the box to display the favicon.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => false, 'customizer' => array());
         $this->options['favicon_img'] = array('name' => 'favicon_img', 'title' => '', 'type' => 'upload_single', "sanitize_type" => "esc_url_raw", 'valid_options' => '', 'description' => __('Click on the Upload Image button to upload the favicon image.', "news-magazine"), 'section' => 'general_main', 'tab' => 'general', 'default' => WDWT_IMG . 'favico.ico', 'customizer' => array());
     }
 }
예제 #5
0
 /**
  * @group site_icon
  * @group multisite
  */
 function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set()
 {
     if (!is_multisite()) {
         $this->markTestSkipped('This test requires multisite.');
     }
     $blog_id = $this->factory->blog->create();
     $this->assertFalse(has_site_icon($blog_id));
 }
예제 #6
0
 /**
  * @group site_icon
  */
 function test_has_site_icon()
 {
     $this->assertFalse(has_site_icon());
     $this->_set_site_icon();
     $this->assertTrue(has_site_icon());
     $this->_remove_site_icon();
     $this->assertFalse(has_site_icon());
 }
예제 #7
0
파일: header.php 프로젝트: Getbeans/Beans
/**
 * Echo head favicon if no icon was added via the customizer.
 *
 * @since 1.0.0
 */
function beans_favicon()
{
    // Stop here if and icon was added via the customizer.
    if (function_exists('has_site_icon') && has_site_icon()) {
        return;
    }
    $url = file_exists(get_stylesheet_directory() . '/favicon.ico') ? get_stylesheet_directory_uri() . '/favicon.ico' : BEANS_URL . 'favicon.ico';
    beans_selfclose_markup_e('beans_favicon', 'link', array('rel' => 'Shortcut Icon', 'href' => $url, 'type' => 'image/x-icon'));
}
예제 #8
0
function load_new_favicons()
{
    // Use WP site icon, if available
    if (function_exists('has_site_icon') && has_site_icon()) {
        return;
    }
    $output = '<link rel="favicon" sizes="57x57" href="/content/themes/foodgroup-child/images/favicons/favicon.ico"><link rel="apple-touch-icon" sizes="57x57" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/content/themes/foodgroup-child/images/favicons/apple-touch-icon-180x180.png"><link rel="icon" type="image/png" href="/content/themes/foodgroup-child/images/favicons/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/content/themes/foodgroup-child/images/favicons/favicon-194x194.png" sizes="194x194"><link rel="icon" type="image/png" href="/content/themes/foodgroup-child/images/favicons/favicon-96x96.png" sizes="96x96"><link rel="icon" type="image/png" href="/content/themes/foodgroup-child/images/favicons/android-chrome-192x192.png" sizes="192x192"><link rel="icon" type="image/png" href="/content/themes/foodgroup-child/images/favicons/favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/content/themes/foodgroup-child/images/favicons/manifest.json"><link rel="mask-icon" href="/content/themes/foodgroup-child/images/favicons/safari-pinned-tab.svg" color="#ffffff"><meta name="apple-mobile-web-app-title" content="The Food Group"><meta name="application-name" content="The Food Group"><meta name="msapplication-TileColor" content="#ffffff"><meta name="msapplication-TileImage" content="/mstile-144x144.png"><meta name="theme-color" content="#ffffff">';
    echo $output;
}
예제 #9
0
/**
 * Echo head favicon if no icon was added via the customizer.
 *
 * @since 1.0.0
 */
function beans_favicon()
{
    // Stop here if and icon was added via the customizer.
    if (function_exists('has_site_icon') && has_site_icon()) {
        return;
    }
    $path = file_exists(get_template_directory() . 'favicon.ico') ? get_template_directory() . 'favicon.ico' : BEANS_URL . 'favicon.ico';
    echo beans_selfclose_markup('beans_favicon', 'link', array('rel' => 'Shortcut Icon', 'href' => $path, 'type' => 'image/x-icon'));
}
 /**
  * Return true if no core site icon is present
  *
  * @since Catch Flames 2.7
  */
 function catchflames_is_site_icon_active($control)
 {
     //Check if has_site_icon function exists. If it does not, WP version is less than 4.3
     if (function_exists('has_site_icon')) {
         //Return true if core site icon is not present, else return false
         return !has_site_icon();
     } else {
         return true;
     }
 }
        function ci_favicon()
        {
            if (function_exists('has_site_icon') && has_site_icon()) {
                return;
            }
            if (ci_setting('favicon')) {
                ?>
<link rel="shortcut icon" type="image/x-icon" href="<?php 
                echo esc_attr(ci_setting('favicon'));
                ?>
" /><?php 
            }
        }
예제 #12
0
    /**
     * Generate favicon
     */
    function inspiry_generate_favicon()
    {
        if (!function_exists('has_site_icon') || !has_site_icon()) {
            global $inspiry_options;
            if (!empty($inspiry_options['inspiry_favicon']) && !empty($inspiry_options['inspiry_favicon']['url'])) {
                ?>
                <!-- favicon -->
                <link rel="shortcut icon" href="<?php 
                echo esc_url($inspiry_options['inspiry_favicon']['url']);
                ?>
"/>
                <?php 
            }
        }
    }
예제 #13
0
/**
 * Registers custom sections, settings, and controls for the $wp_customize instance.
 *
 * @since 0.3.2
 * @access private
 * @param object $wp_customize
 */
function omega_customize_logo_register($wp_customize)
{
    /* Add the footer section. */
    $wp_customize->add_section('title_tagline', array('title' => esc_html__('Branding', 'omega'), 'priority' => 1, 'capability' => 'edit_theme_options'));
    /* Add the 'custom_logo' setting. */
    $wp_customize->add_setting("custom_logo", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
    /* Add the textarea control for the 'custom_css' setting. */
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_logo', array('label' => esc_html__('Logo', 'omega'), 'section' => 'title_tagline', 'settings' => "custom_logo")));
    if (!function_exists('has_site_icon') || !has_site_icon()) {
        /* Add the 'custom_favicon' setting. */
        $wp_customize->add_setting("custom_favicon", array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
        /* Add the textarea control for the 'custom_css' setting. */
        $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_favicon', array('label' => esc_html__('Favicon', 'omega'), 'section' => 'title_tagline', 'settings' => "custom_favicon")));
    }
}
예제 #14
0
 /**
  * Get thumbnail image url
  *
  * @param null|\WP_Post $_post Post data object.
  *
  * @return string
  */
 public static function get_thumbnail($_post = null)
 {
     $thumb = apply_filters(VA_SOCIALBUZZ_PREFIX . 'default_thumbnail', 'none');
     if (empty($_post)) {
         global $post;
         $_post = $post;
     }
     if (!empty($_post) && has_post_thumbnail($_post) && !post_password_required($_post)) {
         $thumb = get_the_post_thumbnail_url($_post, VA_SOCIALBUZZ_PREFIX . 'thumbnail');
     } elseif ('none' === $thumb && has_header_image()) {
         $thumb = get_header_image();
     } elseif ('none' === $thumb && has_site_icon()) {
         $thumb = get_site_icon_url();
     }
     return $thumb;
 }
 function wen_corporate_add_favicon_webclip()
 {
     if (function_exists('has_site_icon') && has_site_icon()) {
         return;
     }
     $site_favicon = wen_corporate_get_option('site_favicon');
     if (!empty($site_favicon)) {
         $wen_corporate_favicon = '<link rel="shortcut icon" href="' . esc_url($site_favicon) . '" type="image/x-icon" />';
         echo $wen_corporate_favicon;
     }
     $site_web_clip_icon = wen_corporate_get_option('site_web_clip_icon');
     if (!empty($site_web_clip_icon)) {
         $wen_corporate_web_clip_icon = '<link rel="apple-touch-icon-precomposed" href="' . esc_url($site_web_clip_icon) . '" />';
         echo $wen_corporate_web_clip_icon;
     }
 }
        function ci_touch_favicon()
        {
            if (function_exists('has_site_icon') && has_site_icon()) {
                return;
            }
            if (ci_setting('touch_favicon')) {
                ?>
<link rel="apple-touch-icon<?php 
                echo ci_setting('touch_favicon_pre') == 'enabled' ? '-precomposed' : '';
                ?>
" href="<?php 
                echo esc_attr(ci_setting('touch_favicon'));
                ?>
" /><?php 
            }
            if (ci_setting('touch_favicon_72')) {
                ?>
<link rel="apple-touch-icon<?php 
                echo ci_setting('touch_favicon_72_pre') == 'enabled' ? '-precomposed' : '';
                ?>
" sizes="72x72" href="<?php 
                echo esc_attr(ci_setting('touch_favicon_72'));
                ?>
" /><?php 
            }
            if (ci_setting('touch_favicon_114')) {
                ?>
<link rel="apple-touch-icon<?php 
                echo ci_setting('touch_favicon_114_pre') == 'enabled' ? '-precomposed' : '';
                ?>
" sizes="114x114" href="<?php 
                echo esc_attr(ci_setting('touch_favicon_72'));
                ?>
" /><?php 
            }
        }
 public static function jetpack_site_icon_available_in_core()
 {
     global $wp_version;
     $core_icon_available = function_exists('has_site_icon') && version_compare($wp_version, '4.3-beta') >= 0;
     if (!$core_icon_available) {
         return false;
     }
     // No need for Jetpack's site icon anymore if core's is already set
     if (has_site_icon()) {
         if (Jetpack::is_module_active('site-icon')) {
             Jetpack::log('deactivate', 'site-icon');
             Jetpack::deactivate_module('site-icon');
         }
         return true;
     }
     // Transfer Jetpack's site icon to use core.
     $site_icon_id = Jetpack::get_option('site_icon_id');
     if ($site_icon_id) {
         // Update core's site icon
         update_option('site_icon', $site_icon_id);
         // Delete Jetpack's icon option. We still want the blavatar and attached data though.
         delete_option('site_icon_id');
     }
     // No need for Jetpack's site icon anymore
     if (Jetpack::is_module_active('site-icon')) {
         Jetpack::log('deactivate', 'site-icon');
         Jetpack::deactivate_module('site-icon');
     }
     return true;
 }
예제 #18
0
 /**
  * Builds a URL to the Jetpack connection auth page
  *
  * @since 3.9.5
  *
  * @param bool $raw If true, URL will not be escaped.
  * @param bool|string $redirect If true, will redirect back to Jetpack wp-admin landing page after connection.
  *                              If string, will be a custom redirect.
  * @param bool|string $from If not false, adds 'from=$from' param to the connect URL.
  *
  * @return string Connect URL
  */
 function build_connect_url($raw = false, $redirect = false, $from = false)
 {
     if (!Jetpack_Options::get_option('blog_token') || !Jetpack_Options::get_option('id')) {
         $url = Jetpack::nonce_url_no_esc(Jetpack::admin_url('action=register'), 'jetpack-register');
         if (is_network_admin()) {
             $url = add_query_arg('is_multisite', network_admin_url('admin.php?page=jetpack-settings'), $url);
         }
     } else {
         if (defined('JETPACK__GLOTPRESS_LOCALES_PATH') && (include_once JETPACK__GLOTPRESS_LOCALES_PATH)) {
             $gp_locale = GP_Locales::by_field('wp_locale', get_locale());
         }
         $role = self::translate_current_user_to_role();
         $signed_role = self::sign_role($role);
         $user = wp_get_current_user();
         $jetpack_admin_page = esc_url_raw(admin_url('admin.php?page=jetpack'));
         $redirect = $redirect ? wp_validate_redirect(esc_url_raw($redirect), $jetpack_admin_page) : $jetpack_admin_page;
         if (isset($_REQUEST['is_multisite'])) {
             $redirect = Jetpack_Network::init()->get_url('network_admin_page');
         }
         $secrets = Jetpack::init()->generate_secrets('authorize');
         @(list($secret) = explode(':', $secrets));
         $site_icon = function_exists('has_site_icon') && has_site_icon() ? get_site_icon_url() : false;
         /**
          * Filter the type of authorization.
          * 'calypso' completes authorization on wordpress.com/jetpack/connect
          * while 'jetpack' ( or any other value ) completes the authorization at jetpack.wordpress.com.
          *
          * @since 4.3.3
          *
          * @param string $auth_type Defaults to 'calypso', can also be 'jetpack'.
          */
         $auth_type = apply_filters('jetpack_auth_type', 'calypso');
         $args = urlencode_deep(array('response_type' => 'code', 'client_id' => Jetpack_Options::get_option('id'), 'redirect_uri' => add_query_arg(array('action' => 'authorize', '_wpnonce' => wp_create_nonce("jetpack-authorize_{$role}_{$redirect}"), 'redirect' => urlencode($redirect)), esc_url(admin_url('admin.php?page=jetpack'))), 'state' => $user->ID, 'scope' => $signed_role, 'user_email' => $user->user_email, 'user_login' => $user->user_login, 'is_active' => Jetpack::is_active(), 'jp_version' => JETPACK__VERSION, 'auth_type' => $auth_type, 'secret' => $secret, 'locale' => isset($gp_locale) && isset($gp_locale->slug) ? $gp_locale->slug : '', 'blogname' => get_option('blogname'), 'site_url' => site_url(), 'home_url' => home_url(), 'site_icon' => $site_icon));
         $url = add_query_arg($args, Jetpack::api_url('authorize'));
     }
     if ($from) {
         $url = add_query_arg('from', $from, $url);
     }
     if (isset($_GET['calypso_env'])) {
         $url = add_query_arg('calypso_env', sanitize_key($_GET['calypso_env']), $url);
     }
     return $raw ? $url : esc_url($url);
 }
function foundation_maybe_output_homescreen_icon($image, $width, $height, $pixel_ratio = 1)
{
    $settings = foundation_get_settings();
    if (function_exists('has_site_icon') && has_site_icon()) {
        $use_wordpress_icon = true;
    } else {
        $use_wordpress_icon = false;
    }
    if ($image && !$use_wordpress_icon) {
        if ($width != 57) {
            $size_string = ' sizes="' . $width . 'x' . $height . '"';
        } else {
            $size_string = '';
        }
        echo '<link rel="apple-touch-icon-precomposed" ' . $size_string . ' href="' . foundation_prepare_uploaded_file_url($image) . '" />' . "\n";
    }
}
예제 #20
0
 public function wp_head()
 {
     if ($this->op("wfb_google_analytics")) {
         if ($this->op("wfb_exclude_loggedin") && is_user_logged_in()) {
         } else {
             echo apply_filters("wp_total_hacks_google_analytics", stripslashes($this->op("wfb_google_analytics")));
         }
     }
     if (!function_exists('has_site_icon') || function_exists('has_site_icon') && !has_site_icon()) {
         if ($this->op('wfb_favicon')) {
             $link = '<link rel="Shortcut Icon" type="image/x-icon" href="%s" />' . "\n";
             printf($link, $this->remove_scheme(esc_url($this->op("wfb_favicon"))));
         }
         if ($this->op('wfb_apple_icon')) {
             if ($this->op('wfb_apple_icon_precomposed')) {
                 $link = '<link rel="apple-touch-icon-precomposed" href="%s" />' . "\n";
             } else {
                 $link = '<link rel="apple-touch-icon" href="%s" />' . "\n";
             }
             printf($link, $this->remove_scheme(esc_url($this->op("wfb_apple_icon"))));
         }
     }
     echo $this->get_meta('google-site-verification', $this->op('wfb_google'));
     echo $this->get_meta('msvalidate.01', $this->op('wfb_bing'));
     if (is_user_logged_in() && $this->op("wfb_custom_logo")) {
         $style = '<style type="text/css">';
         $style .= '#wp-admin-bar-wp-logo > .ab-item .ab-icon{background-position: 0 0;}';
         $style .= '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {position: absolute; left: -1000%%;}';
         $style .= '#wpadminbar > #wp-toolbar.quicklinks > #wp-admin-bar-root-default.ab-top-menu > #wp-admin-bar-wp-logo.menupop > .ab-item > .ab-icon {background-image: url( %s ) !important; width: 16px; height: 16px; background-repeat: no-repeat; background-position: center center; background-size: auto; margin-top: 6px; left: 2px;}';
         $style .= '</style>';
         printf($style, $this->remove_scheme(esc_url($this->op("wfb_custom_logo"))));
     }
 }
 public static function site_icon_url()
 {
     if (!function_exists('get_site_icon_url') || !has_site_icon()) {
         return get_option('jetpack_site_icon_url');
     }
     return get_site_icon_url();
 }
 /**
  * Render favicon from options
  * Since WP 4.3 : let WP do the job if user has set the WP site_icon setting.
  *
  * @package Customizr
  * @since Customizr 3.0
  */
 function tc_favicon_display()
 {
     //is there a WP favicon set ?
     //if yes then let WP do the job
     if (function_exists('has_site_icon') && has_site_icon()) {
         return;
     }
     $_fav_option = esc_attr(TC_utils::$inst->tc_opt('tc_fav_upload'));
     if (!$_fav_option || is_null($_fav_option)) {
         return;
     }
     $_fav_src = '';
     //check if option is an attachement id or a path (for backward compatibility)
     if (is_numeric($_fav_option)) {
         $_attachement_id = $_fav_option;
         $_attachment_data = apply_filters('tc_fav_attachment_img', wp_get_attachment_image_src($_fav_option, 'full'));
         $_fav_src = $_attachment_data[0];
     } else {
         //old treatment
         $_saved_path = esc_url(TC_utils::$inst->tc_opt('tc_fav_upload'));
         //rebuild the path : check if the full path is already saved in DB. If not, then rebuild it.
         $upload_dir = wp_upload_dir();
         $_fav_src = false !== strpos($_saved_path, '/wp-content/') ? $_saved_path : $upload_dir['baseurl'] . $_saved_path;
     }
     //makes ssl compliant url
     $_fav_src = apply_filters('tc_fav_src', is_ssl() ? str_replace('http://', 'https://', $_fav_src) : $_fav_src);
     if (null == $_fav_src || !$_fav_src) {
         return;
     }
     $type = "image/x-icon";
     if (strpos($_fav_src, '.png')) {
         $type = "image/png";
     }
     if (strpos($_fav_src, '.gif')) {
         $type = "image/gif";
     }
     echo apply_filters('tc_favicon_display', sprintf('<link id="czr-favicon" rel="shortcut icon" href="%1$s" type="%2$s">', $_fav_src, $type));
 }
예제 #23
0
 /**
  * Gets the content of the browserconfig.xml file.
  *
  * @since 0.1.0
  * @return string the content as valid XML
  */
 private function get_browserconfig()
 {
     $content = '<browserconfig>' . "\n";
     $content .= '<msapplication>' . "\n";
     $content .= '<tile>' . "\n";
     if (has_site_icon()) {
         foreach ($this->sizes as $size) {
             $content .= sprintf('<square%1$slogo src="%2$s"/>', sprintf('%1$dx%1$d', $size), esc_url(get_site_icon_url($size))) . "\n";
         }
     }
     $background_color = BackgroundHandler::instance()->get_background_color();
     if ($background_color) {
         $content .= sprintf('<TileColor>%s</TileColor>', esc_html('#' . ltrim($background_color, '#'))) . "\n";
     }
     $content .= '</tile>' . "\n";
     $content .= '</msapplication>' . "\n";
     $content .= '</browserconfig>' . "\n";
     return $content;
 }
예제 #24
0
        ?>
    <?php 
    } else {
        echo get_template_directory_uri();
        ?>
/apple-touch-icon-precomposed.png<?php 
    }
    ?>
" />
<?php 
}
if (!function_exists('wp_site_icon')) {
    add_action('wp_head', 'flatsome_favicons', 0);
}
if (function_exists('has_site_icon')) {
    if (!has_site_icon()) {
        add_action('wp_head', 'flatsome_favicons', 0);
    }
}
/* Insert custom header script */
function flatsome_custom_header_js()
{
    global $flatsome_opt;
    if ($flatsome_opt['html_scripts_header']) {
        echo $flatsome_opt['html_scripts_header'];
    }
}
add_action('wp_head', 'flatsome_custom_header_js');
/* Add IE fixer to header */
function add_ieFix()
{
예제 #25
0
    function plazarttheme_config_theme()
    {
        $styles = '';
        $styles .= '/**
* 1.0 - Reset
* -----------------------------------------------------------------------------
*/
';
        // logo
        $plazarttheme_colorlogo = ot_get_option('plazarttheme_logoTextcolor');
        if (isset($plazarttheme_colorlogo) && !empty($plazarttheme_colorlogo)) {
            $styles .= '.tz_logo .tz-logo-text{ color: ' . $plazarttheme_colorlogo . ' }';
        }
        //  Font Options
        // method body font
        $plazarttheme_body_font_type = ot_get_option('plazarttheme_TZFontType', 'TzFontSquirrel');
        $plazarttheme_body_font_weight = ot_get_option('plazarttheme_TzFontFami', '300,400,400italic,600,700');
        $plazarttheme_body_font_family = ot_get_option('plazarttheme_TzFontFaminy');
        $plazarttheme_body_font_selecter = ot_get_option('plazarttheme_TzBodySelecter');
        $plazarttheme_body_font_default = ot_get_option('plazarttheme_TzFontDefault', 'Arial');
        $plazarttheme_body_font_color = ot_get_option('plazarttheme_TzBodyColor');
        switch ($plazarttheme_body_font_type) {
            case 'Tzgoogle':
                $plazarttheme_body_font = $plazarttheme_body_font_family;
                break;
            default:
                $plazarttheme_body_font = $plazarttheme_body_font_default;
                break;
        }
        //            if ( isset ( $plazarttheme_body_font_weight ) && $plazarttheme_body_font_weight != ""){ wp_enqueue_style( 'plazarttheme-body-font', plazarttheme_slug_fonts_url($plazarttheme_body_font_family,$plazarttheme_body_font_weight), array(), null ); }
        if (!empty($plazarttheme_body_font_selecter) && !empty($plazarttheme_body_font_selecter)) {
            if (!empty($plazarttheme_body_font) && !empty($plazarttheme_body_font)) {
                $styles .= '' . esc_attr($plazarttheme_body_font_selecter) . '{
                        font-family:"' . esc_attr($plazarttheme_body_font) . '" !important;}';
            }
            if (!empty($plazarttheme_body_font_color) && !empty($plazarttheme_body_font_color)) {
                $styles .= '' . esc_attr($plazarttheme_body_font_selecter) . '{color:' . esc_attr($plazarttheme_body_font_color) . ' !important;}';
            }
        }
        // Method header font
        $plazarttheme_header_font_type = ot_get_option('plazarttheme_TZFontTypeHead', 'TzFontDefault');
        // type font google or defaul
        $plazarttheme_header_font_weight = ot_get_option('plazarttheme_TzFontHeadGoodurl', '300,400,400italic,600,700');
        //  url google font
        $plazarttheme_header_font_family = ot_get_option('plazarttheme_TzFontFaminyHead');
        //  font family google       //  font squireel
        $plazarttheme_header_font_selecter = ot_get_option('plazarttheme_TzHeadSelecter');
        //  body selecter
        $plazarttheme_header_font_default = ot_get_option('plazarttheme_TzFontHeadDefault', 'Arial');
        //  font standard
        $plazarttheme_header_font_color = ot_get_option('plazarttheme_TzHeaderFontColor');
        switch ($plazarttheme_header_font_type) {
            case 'Tzgoogle':
                $plazarttheme_header_font = $plazarttheme_header_font_family;
                break;
            default:
                $plazarttheme_header_font = $plazarttheme_header_font_default;
                break;
        }
        if (!empty($plazarttheme_header_font_selecter) && !empty($plazarttheme_header_font_selecter)) {
            if (!empty($plazarttheme_header_font) && !empty($plazarttheme_header_font)) {
                $styles .= '' . esc_attr($plazarttheme_header_font_selecter) . '{
                        font-family:"' . esc_attr($plazarttheme_header_font) . '" !important;}';
            }
            if (!empty($plazarttheme_header_font_color) && !empty($plazarttheme_header_font_color)) {
                $styles .= '' . esc_attr($plazarttheme_header_font_selecter) . '{color:' . esc_attr($plazarttheme_header_font_color) . ' !important;}';
            }
        }
        // Method Menu font
        $plazarttheme_menu_font_type = ot_get_option('plazarttheme_TZFontTypeMenu', 'TzFontDefault');
        $plazarttheme_menu_font_weight = ot_get_option('plazarttheme_TzFontMenuGoodurl', '300,400,400italic,600,700');
        $plazarttheme_menu_font_family = ot_get_option('plazarttheme_TzFontFaminyMenu');
        $plazarttheme_menu_font_selecter = ot_get_option('plazarttheme_TzMenuSelecter');
        $plazarttheme_menu_font_default = ot_get_option('plazarttheme_TzFontMenuDefault', 'Arial');
        $plazarttheme_menu_font_color = ot_get_option('plazarttheme_TzMenuFontColor');
        switch ($plazarttheme_menu_font_type) {
            case 'Tzgoogle':
                $plazarttheme_menu_font = $plazarttheme_menu_font_family;
                break;
            default:
                $plazarttheme_menu_font = $plazarttheme_menu_font_default;
                break;
        }
        if (!empty($plazarttheme_menu_font_selecter) && !empty($plazarttheme_menu_font_selecter)) {
            if (!empty($plazarttheme_menu_font) && !empty($plazarttheme_menu_font)) {
                $styles .= '' . esc_attr($plazarttheme_menu_font_selecter) . '{
                        font-family:"' . esc_attr($plazarttheme_menu_font) . '" !important;}';
            }
            if (!empty($plazarttheme_menu_font_color) && !empty($plazarttheme_menu_font_color)) {
                $styles .= '' . esc_attr($plazarttheme_menu_font_selecter) . '{color:' . esc_attr($plazarttheme_menu_font_color) . ' !important;}';
            }
        }
        // Method Custom font
        $plazarttheme_custom_font_type = ot_get_option('plazarttheme_TZFontTypeCustom', 'TzFontDefault');
        $plazarttheme_custom_font_weight = ot_get_option('plazarttheme_TzFontCustomGoodurl', '300,400,400italic,600,700');
        $plazarttheme_custom_font_family = ot_get_option('plazarttheme_TzFontFaminyCustom');
        $plazarttheme_custom_font_selecter = ot_get_option('plazarttheme_TzCustomSelecter');
        $plazarttheme_custom_font_default = ot_get_option('plazarttheme_TzFontCustomDefault', 'Arial');
        $plazarttheme_custom_font_color = ot_get_option('plazarttheme_TzCustomFontColor');
        switch ($plazarttheme_custom_font_type) {
            case 'Tzgoogle':
                $plazarttheme_custom_font = $plazarttheme_custom_font_family;
                break;
            default:
                $plazarttheme_custom_font = $plazarttheme_custom_font_default;
                break;
        }
        if (!empty($plazarttheme_custom_font_selecter) && !empty($plazarttheme_custom_font_selecter)) {
            if (!empty($plazarttheme_custom_font) && !empty($plazarttheme_custom_font)) {
                $styles .= '' . esc_attr($plazarttheme_custom_font_selecter) . '{
                        font-family:"' . esc_attr($plazarttheme_custom_font) . '" !important;}';
            }
            if (!empty($plazarttheme_custom_font_color) && !empty($plazarttheme_custom_font_color)) {
                $styles .= '' . esc_attr($plazarttheme_custom_font_selecter) . '{color:' . esc_attr($plazarttheme_custom_font_color) . ' !important;}';
            }
        }
        //  End - Font Options
        // add Custom css
        $plazarttheme_customcss = ot_get_option('plazarttheme_TzCustomCss', '');
        if (isset($plazarttheme_customcss) && !empty($plazarttheme_customcss)) {
            $styles .= esc_attr($plazarttheme_customcss);
        }
        // end custom css
        //            if ( isset ( $plazarttheme_body_fontbodyurl ) && $plazarttheme_body_fontbodyurl != ""){ wp_enqueue_style('google-font', $plazarttheme_body_fontbodyurl, false); }
        //            if ( isset ( $plazarttheme_headerurl ) && $plazarttheme_headerurl != ""){ wp_enqueue_style('header-font', $plazarttheme_headerurl, false); }
        //            if ( isset ( $plazarttheme_menuurl ) && $plazarttheme_menuurl != ""){ wp_enqueue_style('menu-font', $plazarttheme_menuurl, false); }
        //            if( isset ( $plazarttheme_customurl ) && $plazarttheme_customurl != ""){ wp_enqueue_style('custom-font', $plazarttheme_customurl, false); }
        //Background
        $plazarttheme_default_background_type = ot_get_option('plazarttheme_background_type');
        $plazarttheme_default_color = ot_get_option('plazarttheme_TZBackgroundColor', '#ffffff');
        $plazarttheme_default_pattern = ot_get_option('plazarttheme_background_pattern');
        $plazarttheme_default_single_image = ot_get_option('plazarttheme_background_single_image');
        switch ($plazarttheme_default_background_type) {
            case 'pattern':
                $styles .= 'body#bd {background: url("' . get_template_directory_uri() . '/images/patterns/' . $plazarttheme_default_pattern . '") repeat scroll 0 0 transparent !important;}';
                break;
            case 'single_image':
                $styles .= 'body#bd {background: url("' . $plazarttheme_default_single_image . '") no-repeat fixed center center / cover transparent !important;}';
                break;
            case 'default':
                $styles .= 'body#bd {background: ' . $plazarttheme_default_color . ' !important;}';
                break;
            default:
                $styles .= 'body#bd {background: ' . $plazarttheme_default_color . ' !important;}';
                break;
        }
        ?>

            <?php 
        if (!function_exists('has_site_icon') || !has_site_icon()) {
            if (ot_get_option('plazarttheme_favicon_onoff', 'no') == 'yes') {
                $plazarttheme_favicon = ot_get_option('plazarttheme_favicon');
                if ($plazarttheme_favicon) {
                    echo '<link rel="shortcut icon" href="' . $plazarttheme_favicon . '" type="image/x-icon" />';
                }
            }
        }
        ?>

        <?php 
        plazarttheme_CustomCss($styles, 'custom');
    }
function jetpack_og_get_image($width = 200, $height = 200, $max_images = 4)
{
    // Facebook requires thumbnails to be a minimum of 200x200
    $image = '';
    if (is_singular() && !is_home()) {
        global $post;
        $image = '';
        // Grab obvious image if $post is an attachment page for an image
        if (is_attachment($post->ID) && 'image' == substr($post->post_mime_type, 0, 5)) {
            $image = wp_get_attachment_url($post->ID);
        }
        // Attempt to find something good for this post using our generalized PostImages code
        if (!$image && class_exists('Jetpack_PostImages')) {
            $post_images = Jetpack_PostImages::get_images($post->ID, array('width' => $width, 'height' => $height));
            if ($post_images && !is_wp_error($post_images)) {
                $image = array();
                foreach ((array) $post_images as $post_image) {
                    $image['src'] = $post_image['src'];
                    if (isset($post_image['src_width'], $post_image['src_height'])) {
                        $image['width'] = $post_image['src_width'];
                        $image['height'] = $post_image['src_height'];
                    }
                }
            }
        }
    } else {
        if (is_author()) {
            $author = get_queried_object();
            if (function_exists('get_avatar_url')) {
                // Prefer the core function get_avatar_url() if available, WP 4.2+
                $image['src'] = get_avatar_url($author->user_email, array('size' => $width));
            } else {
                $has_filter = has_filter('pre_option_show_avatars', '__return_true');
                if (!$has_filter) {
                    add_filter('pre_option_show_avatars', '__return_true');
                }
                $avatar = get_avatar($author->user_email, $width);
                if (!$has_filter) {
                    remove_filter('pre_option_show_avatars', '__return_true');
                }
                if (!empty($avatar) && !is_wp_error($avatar)) {
                    if (preg_match('/src=["\']([^"\']+)["\']/', $avatar, $matches)) {
                    }
                    $image['src'] = wp_specialchars_decode($matches[1], ENT_QUOTES);
                }
            }
        }
    }
    if (empty($image)) {
        $image = array();
    } else {
        if (!is_array($image)) {
            $image = array('src' => $image);
        }
    }
    // First fall back, blavatar
    if (empty($image) && function_exists('blavatar_domain')) {
        $blavatar_domain = blavatar_domain(site_url());
        if (blavatar_exists($blavatar_domain)) {
            $image['src'] = blavatar_url($blavatar_domain, 'img', $width, false, true);
            $image['width'] = $width;
            $image['height'] = $height;
        }
    }
    // Second fall back, Site Logo
    if (empty($image) && (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo())) {
        $image['src'] = jetpack_get_site_logo('url');
        $image_dimensions = jetpack_get_site_logo_dimensions();
        if (!empty($image_dimensions)) {
            $image['width'] = $image_dimensions['width'];
            $image['height'] = $image_dimensions['height'];
        }
    }
    // Third fall back, Site Icon
    if (empty($image) && (function_exists('jetpack_has_site_icon') && jetpack_has_site_icon())) {
        $image['src'] = jetpack_site_icon_url(null, '512');
        $image['width'] = '512';
        $image['height'] = '512';
    }
    // Fourth fall back, Core Site Icon. Added in WP 4.3.
    if (empty($image) && (function_exists('has_site_icon') && has_site_icon())) {
        $image['src'] = get_site_icon_url(null, '512');
    }
    // Finally fall back, blank image
    if (empty($image)) {
        /**
         * Filter the default Open Graph Image tag, used when no Image can be found in a post.
         *
         * @since 3.0.0
         *
         * @param string $str Default Image URL.
         */
        $image['src'] = apply_filters('jetpack_open_graph_image_default', 'https://s0.wp.com/i/blank.jpg');
    }
    return $image;
}
예제 #27
0
/**
 * Display site icon meta tags.
 *
 * @since 4.3.0
 *
 * @link http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-icon HTML5 specification link icon.
 */
function wp_site_icon()
{
    if (!has_site_icon() && !is_customize_preview()) {
        return;
    }
    $meta_tags = array(sprintf('<link rel="icon" href="%s" sizes="32x32" />', esc_url(get_site_icon_url(32))), sprintf('<link rel="icon" href="%s" sizes="192x192" />', esc_url(get_site_icon_url(192))), sprintf('<link rel="apple-touch-icon-precomposed" href="%s">', esc_url(get_site_icon_url(180))), sprintf('<meta name="msapplication-TileImage" content="%s">', esc_url(get_site_icon_url(270))));
    /**
     * Filter the site icon meta tags, so Plugins can add their own.
     *
     * @since 4.3.0
     *
     * @param array $meta_tags Site Icon meta elements.
     */
    $meta_tags = apply_filters('site_icon_meta_tags', $meta_tags);
    $meta_tags = array_filter($meta_tags);
    foreach ($meta_tags as $meta_tag) {
        echo "{$meta_tag}\n";
    }
}
예제 #28
0
/**
 * Echo favicon link if one is found.
 *
 * Falls back to Genesis theme favicon.
 *
 * URL to favicon is filtered via `genesis_favicon_url` before being echoed.
 *
 * @since 0.2.2
 *
 * @uses CHILD_DIR
 * @uses CHILD_URL
 * @uses PARENT_URL
 */
function genesis_load_favicon()
{
    //* Use WP site icon, if available
    if (function_exists('has_site_icon') && has_site_icon()) {
        return;
    }
    //* Allow child theme to short-circuit this function
    $pre = apply_filters('genesis_pre_load_favicon', false);
    if ($pre !== false) {
        $favicon = $pre;
    } elseif (file_exists(CHILD_DIR . '/images/favicon.ico')) {
        $favicon = CHILD_URL . '/images/favicon.ico';
    } elseif (file_exists(CHILD_DIR . '/images/favicon.gif')) {
        $favicon = CHILD_URL . '/images/favicon.gif';
    } elseif (file_exists(CHILD_DIR . '/images/favicon.png')) {
        $favicon = CHILD_URL . '/images/favicon.png';
    } elseif (file_exists(CHILD_DIR . '/images/favicon.jpg')) {
        $favicon = CHILD_URL . '/images/favicon.jpg';
    } else {
        $favicon = PARENT_URL . '/images/favicon.ico';
    }
    $favicon = apply_filters('genesis_favicon_url', $favicon);
    if ($favicon) {
        echo '<link rel="icon" href="' . esc_url($favicon) . '" />' . "\n";
    }
}
예제 #29
0
파일: demo8.php 프로젝트: roadthemez/allen
<head>
<?php 
global $road_opt;
?>
<meta charset="<?php 
bloginfo('charset');
?>
" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
" />
<?php 
if (!function_exists('has_site_icon') || !has_site_icon()) {
    if (isset($road_opt['opt-favicon']) && $road_opt['opt-favicon'] != "") {
        if (is_ssl()) {
            $road_opt['opt-favicon'] = str_replace('http:', 'https:', $road_opt['opt-favicon']);
        }
        ?>
		<link rel="icon" type="image/png" href="<?php 
        echo esc_url($road_opt['opt-favicon']['url']);
        ?>
">
	<?php 
    }
}
wp_head();
?>
</head>
예제 #30
0
_e('In a few words, explain what this site is about.');
?>
</p></td>
</tr>
<tr>
<th scope="row"><label for="site_icon"><?php 
_e('Site Icon');
?>
</label></th>
<td>
	<?php 
$upload_url = admin_url('options-general.php?page=site-icon');
$update_url = esc_url(add_query_arg(array('page' => 'site-icon', 'action' => 'crop_site_icon'), wp_nonce_url(admin_url('options-general.php'), 'crop-site-icon')));
wp_enqueue_media();
wp_enqueue_script('site-icon');
if (has_site_icon()) {
    $remove_url = add_query_arg(array('action' => 'remove_site_icon'), wp_nonce_url(admin_url('options-general.php'), 'remove-site-icon'));
    ?>

	<img class="avatar avatar-150" src="<?php 
    site_icon_url(null, 150);
    ?>
" height="150" width="150" />
	<p class="hide-if-no-js">
		<label class="screen-reader-text" for="choose-from-library-link"><?php 
    _e('Choose an image from your media library:');
    ?>
</label>
		<button type="button" id="choose-from-library-link" class="button" data-update-link="<?php 
    echo esc_attr($update_url);
    ?>