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

PHP theme_update_available函数代码示例

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

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



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

示例1: jetpack_infinite_scroll_more_info

function jetpack_infinite_scroll_more_info()
{
    $support_text = sprintf(__('If you are a theme author, you can learn about adding support for Infinite Scroll at <a href="%1$s">%1$s</a>.', 'jetpack'), 'http://jetpack.me/support/infinite-scroll/');
    ?>

	<?php 
    if (!Jetpack::is_active() || Jetpack::is_active() && current_theme_supports('infinite-scroll')) {
        ?>
		<p><?php 
        esc_html_e('When you write great content, all you really want is people to find it, right?', 'jetpack');
        ?>
</p>

		<p><?php 
        esc_html_e("With the Infinite Scroll module and a supported theme, that's exactly what happens. Instead of the old way of navigating down a page by scrolling and then clicking a link to get to the next page, waiting for a page refresh&mdash;the document model of the web&mdash;infinite scrolling pulls the next set of posts automatically into view when the reader approaches the bottom of the page, more like an application.", 'jetpack');
        ?>
</p>

	<?php 
    } else {
        ?>
		<p><?php 
        echo esc_html(sprintf(__("At this time, your theme, %s, doesn't support Infinite Scroll. Unlike other Jetpack modules, Infinite Scroll needs information from your theme to function properly.", 'jetpack'), function_exists('wp_get_theme') ? wp_get_theme()->Name : get_current_theme()));
        ?>
</p>

		<p><?php 
        esc_html_e("Until your theme supports Infinite Scroll, you won't be able to activate this module.", 'jetpack');
        ?>
</p>

		<?php 
        if (current_user_can('update_themes')) {
            ob_start();
            theme_update_available(function_exists('wp_get_theme') ? wp_get_theme() : (object) get_theme(get_current_theme()));
            $theme_update_available = ob_get_clean();
            if (!empty($theme_update_available)) {
                ?>
				<p><?php 
                printf(__('There is an update available for your theme. You may wish to check if this update adds Infinite Scroll support by visiting the <a href="%s">WordPress Updates</a> page.', 'jetpack'), esc_url(admin_url('update-core.php')));
                ?>
</p>
			<?php 
            } else {
                ?>
				<p><?php 
                echo $support_text;
                ?>
</p>
			<?php 
            }
            ?>
		<?php 
        } else {
            ?>
			<p><?php 
            echo $support_text;
            ?>
</p>
		<?php 
        }
        ?>
	<?php 
    }
}
开发者ID:aarontgrogg,项目名称:aarontgrogg,代码行数:65,代码来源:module-info.php


示例2: display_rows

    function display_rows()
    {
        $themes = $this->items;
        foreach ($themes as $theme) {
            ?>
<div class="available-theme"><?php 
            $template = $theme->get_template();
            $stylesheet = $theme->get_stylesheet();
            $title = $theme->display('Name');
            $version = $theme->display('Version');
            $author = $theme->display('Author');
            $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $stylesheet);
            $preview_link = esc_url(add_query_arg(array('preview' => 1, 'template' => urlencode($template), 'stylesheet' => urlencode($stylesheet), 'preview_iframe' => true, 'TB_iframe' => 'true'), home_url('/')));
            $actions = array();
            $actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title)) . '">' . __('Activate') . '</a>';
            $actions['preview'] = '<a href="' . $preview_link . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '">' . __('Preview') . '</a>';
            if (current_user_can('edit_theme_options')) {
                $actions['preview'] .= '<a href="' . wp_customize_url($stylesheet) . '" class="load-customize hide-if-no-customize">' . __('Live Preview') . '</a>';
            }
            if (!is_multisite() && current_user_can('delete_themes')) {
                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url('themes.php?action=delete&amp;stylesheet=' . urlencode($stylesheet), 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $title)) . "' );" . '">' . __('Delete') . '</a>';
            }
            $actions = apply_filters('theme_action_links', $actions, $theme);
            $delete_action = isset($actions['delete']) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
            unset($actions['delete']);
            ?>

			<a href="<?php 
            echo $preview_link;
            ?>
" class="screenshot hide-if-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>
			<a href="<?php 
            echo wp_customize_url($stylesheet);
            ?>
" class="screenshot load-customize hide-if-no-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>

			<h3><?php 
            echo $title;
            ?>
</h3>
			<div class="theme-author"><?php 
            printf(__('By %s'), $author);
            ?>
</div>
			<div class="action-links">
				<ul>
					<?php 
            foreach ($actions as $action) {
                ?>
						<li><?php 
                echo $action;
                ?>
</li>
					<?php 
            }
            ?>
					<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php 
            _e('Details');
            ?>
</a></li>
				</ul>
				<?php 
            echo $delete_action;
            ?>

				<?php 
            theme_update_available($theme);
            ?>
			</div>

			<div class="themedetaildiv hide-if-js">
				<p><strong><?php 
            _e('Version: ');
            ?>
</strong><?php 
            echo $version;
            ?>
</p>
//.........这里部分代码省略.........
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:101,代码来源:class-wp-themes-list-table.php


示例3: implode

echo implode(' | ', $options);
if ($ct->tags) {
    ?>
	<p><?php 
    _e('Tags:');
    ?>
 <?php 
    echo join(', ', $ct->tags);
    ?>
</p>
	<?php 
}
?>
</div>
<?php 
theme_update_available($ct);
?>

</div>

<br class="clear" />
<?php 
if (!current_user_can('switch_themes')) {
    echo '</div>';
    require './admin-footer.php';
    exit;
}
?>

<h3><?php 
_e('Available Themes');
开发者ID:nuevomediagroup,项目名称:WordPress,代码行数:31,代码来源:themes.php


示例4: _e

<?php 
                }
                if ($tags) {
                    ?>
<p><?php 
                    _e('Tags:');
                    ?>
 <?php 
                    echo join(', ', $tags);
                    ?>
</p>
<?php 
                }
                ?>
		<?php 
                theme_update_available($themes[$theme_name]);
            }
            // end if not empty theme_name
            ?>
	</td>
<?php 
        }
        // end foreach $cols
        ?>
</tr>
<?php 
    }
    // end foreach $table
    ?>
</table>
<?php 
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:themes.php


示例5: display_rows


//.........这里部分代码省略.........
                $stylesheet = $themes[$theme_name]['Stylesheet'];
                $title = $themes[$theme_name]['Title'];
                $version = $themes[$theme_name]['Version'];
                $description = $themes[$theme_name]['Description'];
                $author = $themes[$theme_name]['Author'];
                $screenshot = $themes[$theme_name]['Screenshot'];
                $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
                $template_dir = $themes[$theme_name]['Template Dir'];
                $parent_theme = $themes[$theme_name]['Parent Theme'];
                $theme_root = $themes[$theme_name]['Theme Root'];
                $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
                $preview_link = esc_url(get_option('home') . '/');
                if (is_ssl()) {
                    $preview_link = str_replace('http://', 'https://', $preview_link);
                }
                $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), $preview_link));
                $preview_text = esc_attr(sprintf(__('Preview of &#8220;%s&#8221;'), $title));
                $tags = $themes[$theme_name]['Tags'];
                $thickbox_class = 'thickbox thickbox-preview';
                $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
                $activate_text = esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title));
                $actions = array();
                $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
                $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $theme_name)) . '">' . __('Preview') . '</a>';
                if (!is_multisite() && current_user_can('delete_themes')) {
                    $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template={$stylesheet}", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name)) . "' );" . '">' . __('Delete') . '</a>';
                }
                $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
                $actions = implode(' | ', $actions);
                ?>
		<a href="<?php 
                echo $preview_link;
                ?>
" class="<?php 
                echo $thickbox_class;
                ?>
 screenshot">
<?php 
                if ($screenshot) {
                    ?>
			<img src="<?php 
                    echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot;
                    ?>
" alt="" />
<?php 
                }
                ?>
		</a>
<h3><?php 
                /* translators: 1: theme title, 2: theme version, 3: theme author */
                printf(__('%1$s %2$s by %3$s'), $title, $version, $author);
                ?>
</h3>
<p class="description"><?php 
                echo $description;
                ?>
</p>
<span class='action-links'><?php 
                echo $actions;
                ?>
</span>
	<?php 
                if (current_user_can('edit_themes') && $parent_theme) {
                    /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */
                    ?>
	<p><?php 
                    printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace(WP_CONTENT_DIR, '', $template_dir), str_replace(WP_CONTENT_DIR, '', $stylesheet_dir), $title, $parent_theme);
                    ?>
</p>
<?php 
                } else {
                    ?>
	<p><?php 
                    printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace(WP_CONTENT_DIR, '', $template_dir), str_replace(WP_CONTENT_DIR, '', $stylesheet_dir));
                    ?>
</p>
<?php 
                }
                if ($tags) {
                    ?>
<p><?php 
                    _e('Tags:');
                    ?>
 <?php 
                    echo join(', ', $tags);
                    ?>
</p>
<?php 
                }
                ?>
		<?php 
                theme_update_available($themes[$theme_name]);
            }
            // end if not empty theme_name
            ?>
	</div>
<?php 
        }
        // end foreach $theme_names
    }
开发者ID:vivekkodira1,项目名称:wordpress,代码行数:101,代码来源:class-wp-themes-list-table.php


示例6: printf

	<h4>
		<?php echo $ct->display('Name'); ?>
	</h4>

	<div>
		<ul class="theme-info">
			<li><?php printf( __('By %s'), $ct->display('Author') ); ?></li>
			<li><?php printf( __('Version %s'), $ct->display('Version') ); ?></li>
		</ul>
		<p class="theme-description"><?php echo $ct->display('Description'); ?></p>
		<?php if ( $ct->parent() ) {
			printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
				__( 'http://codex.wordpress.org/Child_Themes' ),
				$ct->parent()->display( 'Name' ) );
		} ?>
		<?php theme_update_available( $ct ); ?>
	</div>

	<?php
	// Pretend you didn't see this.
	$options = array();
	if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
		foreach ( (array) $submenu['themes.php'] as $item) {
			$class = '';
			if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
				continue;
			// 0 = name, 1 = capability, 2 = file
			if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
				$class = ' class="current"';
			if ( !empty($submenu[$item[2]]) ) {
				$submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:31,代码来源:THEMES.PHP


示例7: display_rows

    function display_rows()
    {
        $themes = $this->items;
        foreach ($themes as $theme) {
            ?>
<div class="available-theme"><?php 
            $template = $theme->get_template();
            $stylesheet = $theme->get_stylesheet();
            $title = $theme->display('Name');
            $version = $theme->display('Version');
            $author = $theme->display('Author');
            $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
            $preview_link = esc_url(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), home_url('/')));
            $actions = array();
            $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title)) . '">' . __('Activate') . '</a>';
            $actions[] = '<a href="' . $preview_link . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '">' . __('Preview') . '</a>' . '<a href="' . wp_customize_url($stylesheet) . '" class="load-customize hide-if-no-customize">' . __('Customize') . '</a>';
            if (!is_multisite() && current_user_can('delete_themes')) {
                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template={$stylesheet}", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $title)) . "' );" . '">' . __('Delete') . '</a>';
            }
            $actions = apply_filters('theme_action_links', $actions, $theme);
            $delete_action = isset($actions['delete']) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
            unset($actions['delete']);
            ?>

			<a href="<?php 
            echo $preview_link;
            ?>
" class="screenshot hide-if-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>
			<a href="<?php 
            echo wp_customize_url($stylesheet);
            ?>
" class="screenshot load-customize hide-if-no-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>

			<h3><?php 
            echo $title;
            ?>
</h3>
			<div class="theme-author"><?php 
            printf(__('By %s'), $author);
            ?>
</div>
			<div class="action-links">
				<ul>
					<?php 
            foreach ($actions as $action) {
                ?>
						<li><?php 
                echo $action;
                ?>
</li>
					<?php 
            }
            ?>
					<li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php 
            _e('Details');
            ?>
</a></li>
				</ul>
				<?php 
            echo $delete_action;
            ?>

				<?php 
            theme_update_available($theme);
            ?>
			</div>

			<div class="themedetaildiv hide-if-js">
				<p><strong><?php 
            _e('Version: ');
            ?>
</strong><?php 
            echo $version;
            ?>
</p>
				<p><?php 
            echo $theme->display('Description');
            ?>
//.........这里部分代码省略.........
开发者ID:nzeyimana,项目名称:WordPress,代码行数:101,代码来源:class-wp-themes-list-table.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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