• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP has_site_icon函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中has_site_icon函数的典型用法代码示例。如果您正苦于以下问题:PHP has_site_icon函数的具体用法?PHP has_site_icon怎么用?PHP has_site_icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了has_site_icon函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: get_css

    /**
     * @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;
    }
开发者ID:hinaloe,项目名称:push7-subscribe-button,代码行数:31,代码来源:class.withthumb.php


示例2: cruxstore_add_site_icon

/**
 * 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']));
        }
    }
}
开发者ID:websideas,项目名称:Mondova,代码行数:30,代码来源:functions.php


示例3: register_hooks

 /**
  * 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);
 }
开发者ID:annbransom,项目名称:techishowl_prod_backup,代码行数:32,代码来源:jetpack-site-icon.php


示例4: __construct

 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());
     }
 }
开发者ID:jimdough,项目名称:Roadmaster,代码行数:8,代码来源:page_general_settings.php


示例5: test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set

 /**
  * @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));
 }
开发者ID:pbearne,项目名称:contrib2core,代码行数:12,代码来源:template.php


示例6: test_has_site_icon

 /**
  * @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());
 }
开发者ID:rclilly,项目名称:wordpress-develop,代码行数:11,代码来源:template.php


示例7: beans_favicon

/**
 * 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'));
}
开发者ID:Getbeans,项目名称:Beans,代码行数:14,代码来源:header.php


示例8: load_new_favicons

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;
}
开发者ID:arobbins,项目名称:foodgroup,代码行数:9,代码来源:theme-defaults.php


示例9: beans_favicon

/**
 * 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'));
}
开发者ID:JoomPassion,项目名称:Beans,代码行数:14,代码来源:header.php


示例10: catchflames_is_site_icon_active

 /**
  * 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;
     }
 }
开发者ID:ilke-zilci,项目名称:newcomers-wp,代码行数:15,代码来源:customizer-active-callbacks.php


示例11: ci_favicon

        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 
            }
        }
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:13,代码来源:favicon.php


示例12: inspiry_generate_favicon

    /**
     * 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 
            }
        }
    }
开发者ID:Juni4567,项目名称:mycashflow,代码行数:18,代码来源:header-functions.php


示例13: omega_customize_logo_register

/**
 * 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")));
    }
}
开发者ID:davidgilman,项目名称:Live2Give,代码行数:22,代码来源:custom-logo.php


示例14: get_thumbnail

 /**
  * 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;
 }
开发者ID:visualive,项目名称:va-social-buzz,代码行数:23,代码来源:trait-functions.php


示例15: wen_corporate_add_favicon_webclip

 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;
     }
 }
开发者ID:diptigandhi24,项目名称:Trade-Bucket-Global,代码行数:16,代码来源:theme-hooks.php


示例16: ci_touch_favicon

        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 
            }
        }
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:36,代码来源:touch_favicon.php


示例17: jetpack_site_icon_available_in_core

 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;
 }
开发者ID:jordankoschei,项目名称:jordankoschei-dot-com,代码行数:30,代码来源:class.jetpack.php


示例18: build_connect_url

 /**
  * 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);
 }
开发者ID:automattic,项目名称:jetpack,代码行数:55,代码来源:class.jetpack.php


示例19: foundation_maybe_output_homescreen_icon

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";
    }
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:17,代码来源:root-functions.php


示例20: wp_head

 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- 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP has_slot函数代码示例发布时间:2022-05-15
下一篇:
PHP has_single_author函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap