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

PHP get_site_icon_url函数代码示例

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

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



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

示例1: opengraph

    public function opengraph()
    {
        $tags = [];
        if (is_singular()) {
            $tags['og:title'] = get_the_title();
        } elseif (is_archive()) {
            $tags['og:title'] = get_the_archive_title();
        }
        if (is_singular()) {
            $tags['og:description'] = get_the_excerpt();
        }
        if (is_singular()) {
            $tags['og:url'] = get_permalink();
        } elseif (is_tax()) {
            $tags['og:url'] = get_term_link(get_queried_object(), get_queried_object()->taxonomy);
        }
        if (is_singular() && has_post_thumbnail()) {
            $tags['og:image'] = get_the_post_thumbnail_url('full');
        }
        $tags = wp_parse_args($tags, ['og:type' => 'website', 'og:title' => get_bloginfo('name'), 'og:description' => get_bloginfo('description'), 'og:url' => home_url('/'), 'og:image' => get_site_icon_url()]);
        $tags = array_filter($tags);
        $tags = apply_filters('opengraph_tags', $tags);
        foreach ($tags as $property => $content) {
            printf('
			<meta property="%s" content="%s">', esc_attr($property), esc_attr($content));
        }
    }
开发者ID:tomjal,项目名称:feelingrestful-theme,代码行数:27,代码来源:class-opengraph.php


示例2: 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


示例3: prepare_item

 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'cover_image' => get_header_image(), 'color' => '#FFA000', 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'live' => in_array($id, $this->included_site_ids)];
     restore_current_blog();
     return $result;
 }
开发者ID:elordin,项目名称:cms,代码行数:9,代码来源:RestApi_Multisites.php


示例4: prepare_item

 private function prepare_item($blog)
 {
     $details = get_blog_details($blog);
     $id = $blog['blog_id'];
     switch_to_blog($id);
     $result = ['id' => $id, 'name' => $details->blogname, 'icon' => get_site_icon_url(), 'path' => $blog['path'], 'description' => get_bloginfo($blog), 'global' => in_array($id, $this->GLOBAL_SITE_IDS)];
     restore_current_blog();
     return $result;
 }
开发者ID:benginoe,项目名称:cms,代码行数:9,代码来源:RestApi_Multisites.php


示例5: ensure

 /**
  * If there is no current site icon create one.
  *
  * @since 2.0.0
  *
  */
 public static function ensure()
 {
     if (get_site_icon_url(64)) {
         return;
     }
     if (Prompt_Core::$options->get('site_icon')) {
         return;
     }
     self::refresh();
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:16,代码来源:site-icon.php


示例6: __construct

 public function __construct($post_id)
 {
     $this->template_dir = AMP__DIR__ . '/templates';
     $this->ID = $post_id;
     $this->post = get_post($post_id);
     $content_max_width = isset($GLOBALS['content_width']) ? absint($GLOBALS['content_width']) : 600;
     $content_max_width = apply_filters('amp_content_max_width', $content_max_width);
     $this->data = array('content_max_width' => $content_max_width, 'document_title' => function_exists('wp_get_document_title') ? wp_get_document_title() : wp_title('', false), 'canonical_url' => get_permalink($post_id), 'home_url' => home_url(), 'blog_name' => get_bloginfo('name'), 'site_icon_url' => get_site_icon_url(self::SITE_ICON_SIZE), 'placeholder_image_url' => amp_get_asset_url('images/placeholder-icon.png'), 'amp_runtime_script' => 'https://cdn.ampproject.org/v0.js', 'amp_component_scripts' => array());
     $this->build_post_content();
     $this->build_post_data();
     $this->data = apply_filters('amp_post_template_data', $this->data, $this->post);
 }
开发者ID:escobar022,项目名称:amp-wp,代码行数:12,代码来源:class-amp-post-template.php


示例7: tokopress_wphead_favicon

function tokopress_wphead_favicon()
{
    if (function_exists('get_site_icon_url') && get_site_icon_url()) {
        return;
    }
    $icon = of_get_option('tokopress_favicon') ? of_get_option('tokopress_favicon') : THEME_URI . '/img/favicon.png';
    ?>
<link rel="shortcut icon" type="image/x-icon" href="<?php 
    echo esc_url($icon);
    ?>
" />
	<?php 
}
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:13,代码来源:frontend.php


示例8: 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


示例9: test_jetpack_og_get_site_icon_and_logo_url

 /**
  * @author automattic
  * @covers ::jetpack_og_get_image
  * @since  3.9.2
  */
 public function test_jetpack_og_get_site_icon_and_logo_url()
 {
     $test_icon_id = self::_create_upload_object(dirname(__FILE__) . '/jetpack-icon.jpg');
     // Test Jetpack's Site Logo
     update_option('site_logo', array('id' => $test_icon_id, 'url' => wp_get_attachment_url($test_icon_id)));
     require_once JETPACK__PLUGIN_DIR . 'modules/theme-tools/site-logo/inc/functions.php';
     require_once JETPACK__PLUGIN_DIR . 'modules/theme-tools/site-logo/inc/class-site-logo.php';
     $image_url = jetpack_og_get_image();
     $this->assertEquals($image_url['src'], jetpack_get_site_logo('url'));
     // Test core's Site Icon
     update_option('site_icon', $test_icon_id);
     $image_url = jetpack_og_get_image();
     $this->assertEquals($image_url['src'], get_site_icon_url(512));
     delete_option('site_icon');
     wp_delete_attachment($test_icon_id);
 }
开发者ID:bisko,项目名称:jetpack,代码行数:21,代码来源:test_class.functions.opengraph.php


示例10: __construct

 public function __construct($post_id)
 {
     $this->template_dir = apply_filters('amp_post_template_dir', AMP__DIR__ . '/templates');
     $this->ID = $post_id;
     $this->post = get_post($post_id);
     $content_max_width = self::CONTENT_MAX_WIDTH;
     if (isset($GLOBALS['content_width']) && $GLOBALS['content_width'] > 0) {
         $content_max_width = $GLOBALS['content_width'];
     }
     $content_max_width = apply_filters('amp_content_max_width', $content_max_width);
     $this->data = array('content_max_width' => $content_max_width, 'document_title' => function_exists('wp_get_document_title') ? wp_get_document_title() : wp_title('', false), 'canonical_url' => get_permalink($post_id), 'home_url' => home_url(), 'blog_name' => get_bloginfo('name'), 'body_class' => '', 'site_icon_url' => apply_filters('amp_site_icon_url', function_exists('get_site_icon_url') ? get_site_icon_url(self::SITE_ICON_SIZE) : ''), 'placeholder_image_url' => amp_get_asset_url('images/placeholder-icon.png'), 'featured_image' => false, 'comments_link_url' => false, 'comments_link_text' => false, 'amp_runtime_script' => 'https://cdn.ampproject.org/v0.js', 'amp_component_scripts' => array(), 'customizer_settings' => array(), 'font_urls' => array('merriweather' => 'https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic'), 'amp_analytics' => apply_filters('amp_post_template_analytics', array(), $this->post));
     $this->build_post_content();
     $this->build_post_data();
     $this->build_customizer_settings();
     $this->data = apply_filters('amp_post_template_data', $this->data, $this->post);
 }
开发者ID:thenextweb,项目名称:amp-wp,代码行数:16,代码来源:class-amp-post-template.php


示例11: test_jetpack_og_get_site_icon_and_logo_url

 /**
  * @author automattic
  * @covers ::jetpack_og_get_image
  * @since  3.9.2
  */
 public function test_jetpack_og_get_site_icon_and_logo_url()
 {
     $default_url = jetpack_og_get_image();
     // Test Jetpack's Site Logo
     update_option('site_logo', array('id' => $this->icon_id, 'url' => wp_get_attachment_url($this->icon_id)));
     require_once JETPACK__PLUGIN_DIR . 'modules/theme-tools/site-logo/inc/functions.php';
     require_once JETPACK__PLUGIN_DIR . 'modules/theme-tools/site-logo/inc/class-site-logo.php';
     // Test Smaller/Invalid Jetpack's Site Logo
     $image_url = jetpack_og_get_image(512, 512);
     $this->assertNotEquals(jetpack_get_site_logo('url'), $image_url['src']);
     $this->assertEquals($default_url['src'], $image_url['src']);
     // Test Valid-sized Jetpack's Site Logo
     $image_url = jetpack_og_get_image(128, 128);
     $this->assertEquals(jetpack_get_site_logo('url'), $image_url['src']);
     delete_option('site_logo');
     update_option('site_icon', $this->icon_id);
     // Test Valid-sized core's Site Icon
     $image_url = jetpack_og_get_image(128, 128);
     $this->assertEquals(get_site_icon_url(128), $image_url['src']);
     delete_option('site_icon');
 }
开发者ID:automattic,项目名称:jetpack,代码行数:26,代码来源:test_class.functions.opengraph.php


示例12: on_transition_post_status

 public static function on_transition_post_status($new_status, $old_status, $post)
 {
     if (empty($post) || $new_status !== 'publish') {
         return;
     }
     $title_option = get_option('webpush_title');
     $icon_option = get_option('webpush_icon');
     update_option('webpush_payload', array('title' => $title_option === 'blog_title' ? get_bloginfo('name') : $title_option, 'body' => get_the_title($post->ID), 'icon' => $icon_option === 'blog_icon' ? get_site_icon_url() : $icon_option, 'url' => get_permalink($post->ID)));
     $notification_count = get_option('webpush_notification_count');
     $gcmKey = get_option('webpush_gcm_key');
     $subscriptions = WebPush_DB::get_subscriptions();
     foreach ($subscriptions as $subscription) {
         if (!sendNotification($subscription->endpoint, $gcmKey)) {
             // If there's an error while sending the push notification,
             // the subscription is no longer valid, hence we remove it.
             WebPush_DB::remove_subscription($subscription->endpoint);
         } else {
             $notification_count++;
         }
     }
     update_option('webpush_notification_count', $notification_count);
 }
开发者ID:darkwing,项目名称:wp-web-push,代码行数:22,代码来源:wp-web-push-main.php


示例13: get_site_icon_url

<footer class="w-section rodape">
   <div class="w-container">
      <img
        class="imagem-do-rodape"
        src="<?php 
echo get_site_icon_url(16);
?>
">
      <p class="copyright"><?php 
echo date('Y');
?>
&nbsp;<?php 
bloginfo('name');
?>
</p>
   </div>
</footer>
<div class="fundo-da-pagina"></div>
开发者ID:approx,项目名称:approx,代码行数:18,代码来源:page-footer.php


示例14: _e

    _e('Oops! That embed can&#8217;t be found.');
    ?>
</p>

		<div class="wp-embed-excerpt">
			<p>
				<?php 
    printf(__('It looks like nothing was found at this location. Maybe try visiting %s directly?'), '<strong><a href="' . esc_url(home_url()) . '">' . esc_html(get_bloginfo('name')) . '</a></strong>');
    ?>
			</p>
		</div>

		<div class="wp-embed-footer">
			<div class="wp-embed-site-title">
				<?php 
    printf('<a href="%s" target="_top"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>', esc_url(home_url()), esc_url(get_site_icon_url(32, admin_url('images/w-logo-blue.png'))), esc_url(get_site_icon_url(64, admin_url('images/w-logo-blue.png'))), esc_html(get_bloginfo('name')));
    ?>
			</div>
		</div>
	</div>
	<?php 
}
/**
 * Print scripts or data before the closing body tag in the embed template.
 *
 * @since 4.4.0
 */
do_action('embed_footer');
?>
</body>
</html>
开发者ID:WenZhuang,项目名称:WordPress,代码行数:31,代码来源:embed-template.php


示例15: the_embed_site_title

/**
 * Prints the necessary markup for the site title in an embed template.
 *
 * @since 4.5.0
 */
function the_embed_site_title()
{
    $site_title = sprintf('<a href="%s" target="_top"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>', esc_url(home_url()), esc_url(get_site_icon_url(32, admin_url('images/w-logo-blue.png'))), esc_url(get_site_icon_url(64, admin_url('images/w-logo-blue.png'))), esc_html(get_bloginfo('name')));
    $site_title = '<div class="wp-embed-site-title">' . $site_title . '</div>';
    /**
     * Filters the site title HTML in the embed footer.
     *
     * @since 4.4.0
     *
     * @param string $site_title The site title HTML.
     */
    echo apply_filters('embed_site_title_html', $site_title);
}
开发者ID:ntwb,项目名称:wordpress-travis,代码行数:18,代码来源:embed.php


示例16: jetpack_sync_core_icon

 function jetpack_sync_core_icon()
 {
     if (function_exists('get_site_icon_url')) {
         $url = get_site_icon_url();
     } else {
         return;
     }
     require_once JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php';
     // If there's a core icon, maybe update the option.  If not, fall back to Jetpack's.
     if (!empty($url) && $url !== jetpack_site_icon_url()) {
         // This is the option that is synced with dotcom
         Jetpack_Options::update_option('site_icon_url', $url);
     } else {
         if (empty($url) && did_action('delete_option_site_icon')) {
             Jetpack_Options::delete_option('site_icon_url');
         }
     }
 }
开发者ID:annbransom,项目名称:techishowl_prod_backup,代码行数:18,代码来源:class.jetpack.php


示例17: esc_html

?>
">
			<?php 
echo esc_html($post->post_title);
?>
		</a>
	</p>

	<div class="wp-embed-excerpt"><?php 
the_excerpt();
?>
</div>

	<div class="wp-embed-meta">
		<?php 
printf('<img src="%s" width="32" height="32" alt="" class="wp-embed-site-icon"/>', esc_url(get_site_icon_url(32, admin_url('images/w-logo-blue.png'))));
?>
		<div class="wp-embed-site-title">
			<?php 
printf('<a href="%s" target="_top" title="%s">%s</a>', esc_url(home_url()), esc_attr(get_bloginfo('name')), get_bloginfo('name'));
?>
		</div>
	</div>
	<div class="wp-embed-social">
		<?php 
if (get_comments_number($post->ID) || comments_open($post->ID)) {
    ?>
			<div class="wp-embed-comments">
				<a href="<?php 
    echo esc_url(get_comments_link($post->ID));
    ?>
开发者ID:kanenas,项目名称:oEmbed-API,代码行数:31,代码来源:template.php


示例18: get_browserconfig

 /**
  * 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;
 }
开发者ID:felixarntz,项目名称:site-icon-extended,代码行数:25,代码来源:XMLHandler.php


示例19: _e

    ?>
</p>

		<div class="wp-embed-excerpt">
			<p><?php 
    _e('Error 404! The requested content was not found.', 'oembed-api');
    ?>
</p>
		</div>

		<div class="wp-embed-meta">
			<?php 
    printf('<a href="%s" target="_top">', esc_url(home_url()));
    $site_icon_url = admin_url('images/w-logo-blue.png');
    if (function_exists('get_site_icon_url')) {
        $site_icon_url = get_site_icon_url(32, $site_icon_url);
    }
    /**
     * Filters the site icon URL for use in the oEmbed template.
     *
     * @param string $site_icon_url The site icon URL.
     */
    $site_icon_url = apply_filters('oembed_site_icon_url', $site_icon_url);
    printf('<img src="%s" width="32" height="32" alt="" class="wp-embed-site-icon"/>', esc_url($site_icon_url));
    ?>
				<div class="wp-embed-site-title">
					<?php 
    echo get_bloginfo('name');
    ?>
				</div>
			</a>
开发者ID:bjork,项目名称:oEmbed-API,代码行数:31,代码来源:template.php


示例20: wp_site_icon

/**
 * 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";
    }
}
开发者ID:jenoya,项目名称:final,代码行数:26,代码来源:general-template.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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