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

PHP jetpack_has_site_logo函数代码示例

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

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



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

示例1: storefront_site_branding

    /**
     * Display Site Branding
     * @since  1.0.0
     * @return void
     */
    function storefront_site_branding()
    {
        if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
            jetpack_the_site_logo();
        } else {
            ?>
			<div class="site-branding  <?php 
            if (is_home() || is_front_page()) {
                echo 'homepage';
            }
            ?>
">
				<h1 class="site-title" style="display:none;"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1>
				<p class="site-description" style="display:none;"><?php 
            bloginfo('description');
            ?>
</p>
				<img src="<?php 
            echo get_template_directory_uri();
            ?>
/images/logo.png" alt="">
			</div>
		<?php 
        }
    }
开发者ID:baydiwo,项目名称:RajutanIbu,代码行数:36,代码来源:header.php


示例2: storefront_site_branding

    /**
     * Display Site Branding
     * @since  1.0.0
     * @return void
     */
    function storefront_site_branding()
    {
        if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
            jetpack_the_site_logo();
        } else {
            ?>
			<div class="site-branding">
				<h1 class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
"
				                          rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1>
				<?php 
            if ('' != get_bloginfo('description')) {
                ?>
					<p class="site-description"><?php 
                echo bloginfo('description');
                ?>
</p>
				<?php 
            }
            ?>
			</div>
		<?php 
        }
    }
开发者ID:alexgomes09,项目名称:topshop,代码行数:34,代码来源:header.php


示例3: genlib_has_logo

/**
 * Determine if a site logo is assigned or not.
 *
 * @since  0.1.0
 * @uses   GenLib_Site_Logo::has_site_logo
 * @return boolean True if there is an active logo, false otherwise
 */
function genlib_has_logo()
{
    if (class_exists('GenLib_Site_Logo', false)) {
        return genlib_class('site-logo')->has_site_logo();
    }
    if (function_exists('jetpack_the_site_logo')) {
        return jetpack_has_site_logo();
    }
}
开发者ID:robneu,项目名称:genlib,代码行数:16,代码来源:template-tags.php


示例4: flagship_has_logo

/**
 * Determine if a site logo is assigned or not.
 *
 * @since  1.1.0
 * @uses   Flagship_Site_Logo::has_site_logo
 * @return boolean True if there is an active logo, false otherwise
 */
function flagship_has_logo()
{
    if (!class_exists('Flagship_Site_Logo', false)) {
        if (function_exists('jetpack_the_site_logo')) {
            return jetpack_has_site_logo();
        }
        if (function_exists('the_site_logo')) {
            return has_site_logo();
        }
        return null;
    }
    return flagship_library()->site_logo->has_site_logo();
}
开发者ID:flagshipwp,项目名称:flagship-library,代码行数:20,代码来源:template-general.php


示例5: storefront_site_branding

    /**
     * Display Site Branding
     * @since  1.0.0
     * @return void
     */
    function storefront_site_branding()
    {
        if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
            jetpack_the_site_logo();
        } else {
            $url = home_url('/');
            ?>
			<div class="site-branding">
			<img id="logo" src="/wp_development/content/plugins/rettner-plugin/new/images/uofrlogo.png">
			</div>
		<?php 
        }
    }
开发者ID:karyband,项目名称:Rettner-Website,代码行数:18,代码来源:headernew.php


示例6: sketch_body_classes

/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function sketch_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
        $classes[] = 'has-site-logo';
    }
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'no-sidebar';
    }
    return $classes;
}
开发者ID:petrofcikmatus,项目名称:wp-blog,代码行数:20,代码来源:extras.php


示例7: zorkish_body_classes

/**
Adds custom classes to the array of body classes.
@param array $classes Classes for the body element.
@return array
*/
function zorkish_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    if ('full' == get_post_meta(get_the_ID(), 'display', true)) {
        $classes[] = 'zk-full';
    }
    if ((!function_exists('jetpack_the_site_logo') || !jetpack_has_site_logo()) && get_theme_mod('zorkish_logo')) {
        $classes[] = 'has-site-logo';
    }
    return $classes;
}
开发者ID:tlongren,项目名称:zorkish,代码行数:19,代码来源:extras.php


示例8: jetpack_the_site_logo

/**
 * Output an <img> tag of the site logo, at the size specified
 * in the theme's add_theme_support() declaration.
 *
 * @uses Site_Logo::logo
 * @uses Site_Logo::theme_size()
 * @uses jetpack_has_site_logo()
 * @uses jetpack_is_customize_preview()
 * @uses esc_url()
 * @uses home_url()
 * @uses esc_attr()
 * @uses wp_get_attachment_image()
 * @uses apply_filters()
 * @since 1.0
 */
function jetpack_the_site_logo()
{
    $logo = site_logo()->logo;
    $size = site_logo()->theme_size();
    $html = '';
    // If no logo is set, but we're in the Customizer, leave a placeholder (needed for the live preview).
    if (!jetpack_has_site_logo()) {
        if (jetpack_is_customize_preview()) {
            $html = sprintf('<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>', esc_url(home_url('/')), esc_attr($size));
        }
    } else {
        $html = sprintf('<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>', esc_url(home_url('/')), wp_get_attachment_image($logo['id'], $size, false, array('class' => "site-logo attachment-{$size}", 'data-size' => $size, 'itemprop' => "logo")));
    }
    echo apply_filters('jetpack_the_site_logo', $html, $logo, $size);
}
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:30,代码来源:functions.php


示例9: jetpack_the_site_logo

/**
 * Output an <img> tag of the site logo, at the size specified
 * in the theme's add_theme_support() declaration.
 *
 * @uses Site_Logo::logo
 * @uses Site_Logo::theme_size()
 * @uses jetpack_has_site_logo()
 * @uses jetpack_is_customize_preview()
 * @uses esc_url()
 * @uses home_url()
 * @uses esc_attr()
 * @uses wp_get_attachment_image()
 * @uses apply_filters()
 * @since 1.0
 */
function jetpack_the_site_logo()
{
    $logo = site_logo()->logo;
    $size = site_logo()->theme_size();
    // Bail if no logo is set. Leave a placeholder if we're in the Customizer, though (needed for the live preview).
    if (!jetpack_has_site_logo()) {
        if (jetpack_is_customize_preview()) {
            printf('<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>', esc_url(home_url('/')), esc_attr($size));
        }
        return;
    }
    // We have a logo. Logo is go.
    $html = sprintf('<a href="%1$s" class="site-logo-link" rel="home">%2$s</a>', esc_url(home_url('/')), wp_get_attachment_image($logo['id'], $size, false, array('class' => "site-logo attachment-{$size}", 'data-size' => $size)));
    echo apply_filters('jetpack_the_site_logo', $html, $logo, $size);
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:30,代码来源:functions.php


示例10: ultra_display_logo

 /**
  * Display the logo.
  */
 function ultra_display_logo()
 {
     $logo = siteorigin_setting('header_logo');
     $logo = apply_filters('ultra_logo_image_id', $logo);
     if (empty($logo)) {
         if (function_exists('jetpack_the_site_logo') && jetpack_has_site_logo()) {
             // We'll let Jetpack handle things
             jetpack_the_site_logo();
             return;
         }
         // Just display the site title
         $logo_html = '<h1 class="site-title">' . get_bloginfo('name') . '</h1>';
         $logo_html = apply_filters('ultra_logo_text', $logo_html);
     } else {
         // Load the logo image
         if (is_array($logo)) {
             list($src, $height, $width) = $logo;
         } else {
             $image = wp_get_attachment_image_src($logo, 'full');
             $src = $image[0];
             $height = $image[2];
             $width = $image[1];
         }
         // Add all the logo attributes
         $logo_attributes = apply_filters('ultra_logo_image_attributes', array('src' => $src, 'width' => round($width), 'height' => round($height), 'alt' => sprintf(__('%s Logo', 'ultra'), get_bloginfo('name'))));
         if (siteorigin_setting('header_sticky') && siteorigin_setting('header_scale')) {
             $logo_attributes['data-scale'] = '1';
         }
         $logo_attributes_str = array();
         if (!empty($logo_attributes)) {
             foreach ($logo_attributes as $name => $val) {
                 if (empty($val)) {
                     continue;
                 }
                 $logo_attributes_str[] = $name . '="' . esc_attr($val) . '" ';
             }
         }
         $logo_html = apply_filters('ultra_logo_image', '<img ' . implode(' ', $logo_attributes_str) . ' />');
     }
     // Echo the image
     echo apply_filters('ultra_logo_html', $logo_html);
 }
开发者ID:craighays,项目名称:wpcraighays,代码行数:45,代码来源:template-tags.php


示例11: jetpack_the_site_logo

/**
 * Output an <img> tag of the site logo, at the size specified
 * in the theme's add_theme_support() declaration.
 *
 * @uses Site_Logo::logo
 * @uses Site_Logo::theme_size()
 * @uses jetpack_has_site_logo()
 * @uses jetpack_is_customize_preview()
 * @uses esc_url()
 * @uses home_url()
 * @uses esc_attr()
 * @uses wp_get_attachment_image()
 * @uses apply_filters()
 * @since 1.0
 */
function jetpack_the_site_logo()
{
    $logo = site_logo()->logo;
    $size = site_logo()->theme_size();
    $html = '';
    // If no logo is set, but we're in the Customizer, leave a placeholder (needed for the live preview).
    if (!jetpack_has_site_logo()) {
        if (jetpack_is_customize_preview()) {
            $html = sprintf('<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>', esc_url(home_url('/')), esc_attr($size));
        }
    } else {
        $html = sprintf('<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>', esc_url(home_url('/')), wp_get_attachment_image($logo['id'], $size, false, array('class' => "site-logo attachment-{$size}", 'data-size' => $size, 'itemprop' => "logo")));
    }
    /**
     * Filter the Site Logo output.
     *
     * @since 3.2.0
     *
     * @param string $html Site Logo HTML output.
     * @param array $logo Array of Site Logo details.
     * @param string $size Size specified in add_theme_support declaration, or 'thumbnail' default.
     */
    echo apply_filters('jetpack_the_site_logo', $html, $logo, $size);
}
开发者ID:style55,项目名称:jetpack,代码行数:39,代码来源:functions.php


示例12: esc_url

			<?php 
    }
    ?>

		</header>
	<?php 
}
?>

	<!-- TODO customizer setting for fixed drawer -->

	<div class="mdl-layout__drawer">
    <span class="site-title mdl-layout-title">

			<?php 
if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
    ?>
				<img src="<?php 
    echo esc_url(jetpack_get_site_logo('url'));
    ?>
" alt="<?php 
    echo esc_attr(get_bloginfo('name'));
    ?>
" class="site-logo">
			<?php 
}
?>

			<a href="<?php 
echo esc_url(home_url('/'));
?>
开发者ID:peiche,项目名称:_smdl,代码行数:31,代码来源:header.php


示例13: woa_sf_layout_adjustments

    /**
     * Layout
     * Adjusts the default Storefront layout when the plugin is active
     */
    public function woa_sf_layout_adjustments()
    {
        $check = get_theme_mod('woa_sf_enable_logo', 'title_tagline');
        $logo = get_theme_mod('woa_sf_logo', null);
        if (($check == 'logo_img' || $check == 'logo_img_tagline') && $logo) {
            if (is_ssl()) {
                $logo = str_replace('http://', 'https://', $logo);
            }
            ?>
			<div class="site-branding site-logo-anchor">
				<a href="<?php 
            bloginfo('url');
            ?>
">
					<img src="<?php 
            echo $logo;
            ?>
" style="display:inline-block;">
				</a>
				<?php 
            if ($check == 'logo_img_tagline') {
                ?>
					<p class="site-description"><?php 
                bloginfo('description');
                ?>
</p>
				<?php 
            }
            ?>
			</div>
		<?php 
        } else {
            if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
                jetpack_the_site_logo();
            } else {
                ?>
			<div class="site-branding">
				<h1 class="site-title"><a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" rel="home"><?php 
                bloginfo('name');
                ?>
</a></h1>
				<p class="site-description"><?php 
                bloginfo('description');
                ?>
</p>
			</div>
		<?php 
            }
        }
    }
开发者ID:bailoo,项目名称:DagnaMusicWP,代码行数:57,代码来源:storefront-site-logo.php


示例14: jinn_the_site_logo

            
	<header id="masthead" class="group site-header title-bar top-bar" role="banner" data-sticky data-options="marginTop:0;" style="width:100%" data-top-anchor="masthead" data-btm-anchor="colophon:bottom">
            
            <div class="row"> <!-- Start Foundation row -->
                
                <div class="top-bar-title">
<!--                    <div class="title-bar" data-responsive-toggle="example-menu" data-hide-for="large">
                    <button class="menu-icon" type="button" data-toggle></button>
                    <div class="title-bar-title">Menu</div>
                    </div>-->
                    <div class="site-branding">
                    <?php 
if (has_custom_logo() || jetpack_has_site_logo()) {
    jinn_the_site_logo();
}
if (!has_custom_logo() && !jetpack_has_site_logo() || has_custom_logo() && get_theme_mod('show_logo_sitename') === true) {
    ?>
                    
                                <?php 
    if (is_front_page() || is_home() || is_page_template('page-templates/frontpage-portfolio.php')) {
        ?>
                                    <h1 class="site-title"><a href="<?php 
        echo esc_url(home_url('/'));
        ?>
" rel="home"><?php 
        bloginfo('name');
        ?>
</a></h1>
                                <?php 
    } else {
        ?>
开发者ID:jekkilekki,项目名称:theme-jin,代码行数:30,代码来源:header.php


示例15: storefront_site_branding

/**
 *
 */
function storefront_site_branding()
{
    $is_logo = pbosfc_get_option('site_logo');
    $logo_uri = pbosfc_get_option('site_logo_image');
    if ($is_logo && $logo_uri) {
        if (is_ssl()) {
            $logo_uri = str_replace('http://', 'https://', $logo_uri);
        }
        ?>
		<div class="site-logo-anchor">
			<a href="<?php 
        bloginfo('url');
        ?>
"><img src="<?php 
        echo esc_html($logo_uri);
        ?>
" style="display:inline-block;"></a>
		</div>
		<?php 
    } else {
        if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
            jetpack_the_site_logo();
        } else {
            ?>
		<div class="site-branding">
			<h1 class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
"
			                          rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1>
			<?php 
            if ('' != get_bloginfo('description')) {
                ?>
				<p class="site-description"><?php 
                echo bloginfo('description');
                ?>
</p>
			<?php 
            }
            ?>
		</div>
	<?php 
        }
    }
}
开发者ID:boguslawski-piotr,项目名称:pbo-storefront-compact,代码行数:51,代码来源:header.php


示例16: twitter_cards_define_type_based_on_image_count

 static function twitter_cards_define_type_based_on_image_count($og_tags, $extract)
 {
     $card_type = 'summary';
     $img_count = $extract['count']['image'];
     if (empty($img_count)) {
         // No images, use Blavatar as a thumbnail for the summary type.
         if (function_exists('blavatar_domain')) {
             $blavatar_domain = blavatar_domain(site_url());
             if (blavatar_exists($blavatar_domain)) {
                 $og_tags['twitter:image'] = blavatar_url($blavatar_domain, 'img', 240);
             }
         }
         // Second fall back, Site Logo
         if (empty($og_tags['twitter:image']) && (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo())) {
             $og_tags['twitter:image'] = jetpack_get_site_logo('url');
         }
         // Third fall back, Site Icon
         if (empty($og_tags['twitter:image']) && (function_exists('jetpack_has_site_icon') && jetpack_has_site_icon())) {
             $og_tags['twitter:image'] = jetpack_site_icon_url(null, '240');
         }
         // Not falling back on Gravatar, because there's no way to know if we end up with an auto-generated one.
     } elseif (1 == $img_count && ('image' == $extract['type'] || 'gallery' == $extract['type'])) {
         // 1 image = photo
         // Test for $extract['type'] to limit to image and gallery, so we don't send a potential fallback image like a Gravatar as a photo post.
         $card_type = 'photo';
         $og_tags['twitter:image'] = add_query_arg('w', 1400, empty($extract['images']) ? $extract['image'] : $extract['images'][0]['url']);
     } elseif ($img_count <= 3) {
         // 2-3 images = summary with small thumbnail
         $og_tags['twitter:image'] = add_query_arg('w', 240, empty($extract['images']) ? $extract['image'] : $extract['images'][0]['url']);
     } elseif ($img_count >= 4) {
         // >= 4 images = gallery
         $card_type = 'gallery';
         $og_tags = self::twitter_cards_gallery($extract, $og_tags);
     }
     return array($og_tags, $card_type);
 }
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:36,代码来源:class.jetpack-twitter-cards.php


示例17: regala_the_site_logo

/**
 * Halves the size of the site-logo to make it retina ready
 *
 * @param	$html string The rendered site-logo html
 * @param	$logo array The logo-Jetpack object
 * @param	$size string The size of the logo
 * @see	jetpack_the_site_logo filter in Jetpack
 */
function regala_the_site_logo($html, $logo, $size)
{
    if (empty($logo)) {
        return '<a href="' . esc_url(home_url('/')) . '" class="site-logo-link" rel="home"><img class="site-logo attachment" width="160" src="' . get_template_directory_uri() . '/images/logo.png" title="Regala WordPress Theme"/></a>';
    }
    if (empty($logo['url'])) {
        return '<a href="' . esc_url(home_url('/')) . '" class="site-logo-link" rel="home"><img class="site-logo attachment" width="160" src="' . get_template_directory_uri() . '/images/logo.png" title="Regala WordPress Theme"/></a>';
    }
    // Checker, comes from jetpack_the_site_logo
    if (!jetpack_has_site_logo()) {
        return $html;
    }
    // Get the image size
    $imageAttachment = wp_get_attachment_image_src($logo['id'], $size);
    // Half the image size since we want a retina ready image
    $html = preg_replace('/width="(\\d+)"/i', 'width="' . $imageAttachment[1] / 2 . '"', $html);
    $html = preg_replace('/height="(\\d+)"/i', 'height="' . $imageAttachment[2] / 2 . '"', $html);
    return $html;
}
开发者ID:patilswapnilv,项目名称:Regala-Theme,代码行数:27,代码来源:extras.php


示例18: vantage_display_logo

 /**
  * Display the logo 
  */
 function vantage_display_logo()
 {
     $logo = siteorigin_setting('logo_image');
     $logo = apply_filters('vantage_logo_image_id', $logo);
     if (empty($logo)) {
         if (function_exists('jetpack_the_site_logo') && jetpack_has_site_logo()) {
             // We'll let Jetpack handle things
             jetpack_the_site_logo();
             return;
         }
         // Just display the site title
         $logo_html = '<h1 class="site-title">' . get_bloginfo('name') . '</h1>';
         $logo_html = apply_filters('vantage_logo_text', $logo_html);
     } else {
         // load the logo image
         if (is_array($logo)) {
             list($src, $height, $width) = $logo;
         } else {
             $image = wp_get_attachment_image_src($logo, 'full');
             $src = $image[0];
             $height = $image[2];
             $width = $image[1];
         }
         // Add all the logo attributes
         $logo_attributes = apply_filters('vantage_logo_image_attributes', array('src' => $src, 'class' => siteorigin_setting('logo_in_menu_constrain') ? 'logo-height-constrain' : 'logo-no-height-constrain', 'width' => round($width), 'height' => round($height), 'alt' => sprintf(__('%s Logo', 'vantage'), get_bloginfo('name'))));
         if ($logo_attributes['width'] > vantage_get_site_width()) {
             // Don't let the width be more than the site width.
             $width = vantage_get_site_width();
             $logo_attributes['height'] = round($logo_attributes['height'] / ($logo_attributes['width'] / $width));
             $logo_attributes['width'] = $width;
         }
         $logo_attributes_str = array();
         if (!empty($logo_attributes)) {
             foreach ($logo_attributes as $name => $val) {
                 if (empty($val)) {
                     continue;
                 }
                 $logo_attributes_str[] = $name . '="' . esc_attr($val) . '" ';
             }
         }
         $logo_html = apply_filters('vantage_logo_image', '<img ' . implode(' ', $logo_attributes_str) . ' />');
     }
     // Echo the image
     echo apply_filters('vantage_logo_html', $logo_html);
 }
开发者ID:simplon-emmanuelD,项目名称:Simplon-INESS,代码行数:48,代码来源:template-tags.php


示例19: lsx_site_identity

 function lsx_site_identity()
 {
     if (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
         jetpack_the_site_logo();
     } else {
         // shouldn't show both together.. its just strange
         if (true == get_theme_mod('site_logo_header_text', 1)) {
             lsx_site_title();
         }
     }
 }
开发者ID:LinaPeterssonOberg,项目名称:exam,代码行数:11,代码来源:template-tags.php


示例20: jetpack_og_get_image

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 = '';
        // Attempt to find something good for this post using our generalized PostImages code
        if (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[] = $post_image['src'];
                }
            }
        }
    } 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 = 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 = wp_specialchars_decode($matches[1], ENT_QUOTES);
                }
            }
        }
    }
    if (empty($image)) {
        $image = array();
    } else {
        if (!is_array($image)) {
            $image = array($image);
        }
    }
    // First fall back, blavatar
    if (empty($image) && function_exists('blavatar_domain')) {
        $blavatar_domain = blavatar_domain(site_url());
        if (blavatar_exists($blavatar_domain)) {
            $image[] = blavatar_url($blavatar_domain, 'img', $width);
        }
    }
    // Second fall back, Site Logo
    if (empty($image) && (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo())) {
        $image[] = jetpack_get_site_logo('url');
    }
    // Third fall back, Site Icon
    if (empty($image) && (function_exists('jetpack_has_site_icon') && jetpack_has_site_icon())) {
        $image[] = jetpack_site_icon_url(null, '512');
    }
    // Fourth fall back, blank image
    if (empty($image)) {
        $image[] = apply_filters('jetpack_open_graph_image_default', 'https://s0.wp.com/i/blank.jpg');
    }
    return $image;
}
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:68,代码来源:functions.opengraph.php



注:本文中的jetpack_has_site_logo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP jetpack_is_mobile函数代码示例发布时间:2022-05-15
下一篇:
PHP jetpack_has_site_icon函数代码示例发布时间: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