本文整理汇总了PHP中links_add_base_url函数的典型用法代码示例。如果您正苦于以下问题:PHP links_add_base_url函数的具体用法?PHP links_add_base_url怎么用?PHP links_add_base_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了links_add_base_url函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install_plugin_information
//.........这里部分代码省略.........
px;"></span>
</span>
</a>
<span class="counter-count"><?php
echo number_format_i18n($ratecount);
?>
</span>
</div>
<?php
}
}
if (!empty($api->contributors)) {
?>
<h3><?php
_e('Contributors');
?>
</h3>
<ul class="contributors">
<?php
foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
if (empty($contrib_username) && empty($contrib_profile)) {
continue;
}
if (empty($contrib_username)) {
$contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile);
}
$contrib_username = sanitize_user($contrib_username);
if (empty($contrib_profile)) {
echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>";
} else {
echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>";
}
}
?>
</ul>
<?php
if (!empty($api->donate_link)) {
?>
<a target="_blank" href="<?php
echo esc_url($api->donate_link);
?>
"><?php
_e('Donate to this plugin »');
?>
</a>
<?php
}
?>
<?php
}
?>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
}
}
foreach ((array) $api->sections as $section_name => $content) {
$content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr($section_name);
$display = $section_name === $section ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
echo "</div>\n";
echo "</div>\n";
// #plugin-information-scrollable
echo "<div id='{$tab}-footer'>\n";
if (!empty($api->download_link) && (current_user_can('install_plugins') || current_user_can('update_plugins'))) {
$status = install_plugin_install_status($api);
switch ($status['status']) {
case 'install':
if ($status['url']) {
echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
}
break;
case 'update_available':
if ($status['url']) {
echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>';
}
break;
case 'newer_installed':
echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
break;
case 'latest_installed':
echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>';
break;
}
}
echo "</div>\n";
iframe_footer();
exit;
}
示例2: install_plugin_information
//.........这里部分代码省略.........
<?php
}
if (!empty($api->tested)) {
?>
<li><strong><?php
_e('Compatible up to:');
?>
</strong> <?php
echo $api->tested;
?>
</li>
<?php
}
if (!empty($api->downloaded)) {
?>
<li><strong><?php
_e('Downloaded:');
?>
</strong> <?php
printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded));
?>
</li>
<?php
}
if (!empty($api->slug) && empty($api->external)) {
?>
<li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php
echo $api->slug;
?>
/"><?php
_e('WordPress.org Plugin Page »');
?>
</a></li>
<?php
}
if (!empty($api->homepage)) {
?>
<li><a target="_blank" href="<?php
echo $api->homepage;
?>
"><?php
_e('Plugin Homepage »');
?>
</a></li>
<?php
}
?>
</ul>
<?php
if (!empty($api->rating)) {
?>
<h2><?php
_e('Average Rating');
?>
</h2>
<div class="star-holder" title="<?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings));
?>
">
<div class="star star-rating" style="width: <?php
echo esc_attr(str_replace(',', '.', $api->rating));
?>
px"></div>
</div>
<small><?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings));
?>
</small>
<?php
}
?>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
}
}
foreach ((array) $api->sections as $section_name => $content) {
if (isset($plugins_section_titles[$section_name])) {
$title = $plugins_section_titles[$section_name];
} else {
$title = ucwords(str_replace('_', ' ', $section_name));
}
$content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr($section_name);
$display = $section_name == $section ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>{$title}</h2>";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
iframe_footer();
exit;
}
示例3: fs_install_plugin_information
//.........这里部分代码省略.........
}
}
if (!empty($api->contributors)) {
?>
<h3><?php
_e('Contributors');
?>
</h3>
<ul class="contributors">
<?php
foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
if (empty($contrib_username) && empty($contrib_profile)) {
continue;
}
if (empty($contrib_username)) {
$contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile);
}
$contrib_username = sanitize_user($contrib_username);
if (empty($contrib_profile)) {
echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>";
} else {
echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>";
}
}
?>
</ul>
<?php
if (!empty($api->donate_link)) {
?>
<a target="_blank"
href="<?php
echo esc_url($api->donate_link);
?>
"><?php
_e('Donate to this plugin »');
?>
</a>
<?php
}
?>
<?php
}
?>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been tested with your current version of WordPress.') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been marked as compatible with your version of WordPress.') . '</p></div>';
}
}
foreach ((array) $api->sections as $section_name => $content) {
$content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr($section_name);
$display = $section_name === $section ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
echo "</div>\n";
echo "</div>\n";
// #plugin-information-scrollable
echo "<div id='{$tab}-footer'>\n";
if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
if (!empty($api->checkout_link) && isset($api->plans) && 0 < is_array($api->plans)) {
echo ' <a class="button button-primary right" href="' . esc_url(add_query_arg(array('plugin_id' => $plan->plugin_id, 'plan_id' => $plan->id, 'pricing_id' => $plan->pricing[0]->id, 'billing_cycle' => $billing_cycle), $api->checkout_link)) . '" target="_parent">' . __fs('purchase', $api->slug) . '</a>';
// @todo Add Cart concept.
// echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>';
} else {
if (!empty($api->download_link)) {
$status = install_plugin_install_status($api);
switch ($status['status']) {
case 'install':
if ($status['url']) {
echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
}
break;
case 'update_available':
if ($status['url']) {
echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>';
}
break;
case 'newer_installed':
echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
break;
case 'latest_installed':
echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>';
break;
}
}
}
}
echo "</div>\n";
iframe_footer();
exit;
}
示例4: install_plugin_information
//.........这里部分代码省略.........
echo $api->slug;
?>
/"><?php
_e('WordPress.org Plugin Page »');
?>
</a></li>
<?php
}
if (!empty($api->homepage)) {
?>
<li><a target="_blank" href="<?php
echo $api->homepage;
?>
"><?php
_e('Plugin Homepage »');
?>
</a></li>
<?php
}
?>
</ul>
<h2><?php
_e('Average Rating');
?>
</h2>
<div class="star-holder" title="<?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings));
?>
">
<div class="star star-rating" style="width: <?php
echo attribute_escape($api->rating);
?>
px"></div>
<div class="star star5"><img src="<?php
echo admin_url('images/star.gif');
?>
" alt="<?php
_e('5 stars');
?>
" /></div>
<div class="star star4"><img src="<?php
echo admin_url('images/star.gif');
?>
" alt="<?php
_e('4 stars');
?>
" /></div>
<div class="star star3"><img src="<?php
echo admin_url('images/star.gif');
?>
" alt="<?php
_e('3 stars');
?>
" /></div>
<div class="star star2"><img src="<?php
echo admin_url('images/star.gif');
?>
" alt="<?php
_e('2 stars');
?>
" /></div>
<div class="star star1"><img src="<?php
echo admin_url('images/star.gif');
?>
" alt="<?php
_e('1 star');
?>
" /></div>
</div>
<small><?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings));
?>
</small>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
}
}
foreach ((array) $api->sections as $section_name => $content) {
$title = $section_name;
$title[0] = strtoupper($title[0]);
$title = str_replace('_', ' ', $title);
$content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_title = attribute_escape(sanitize_title_with_dashes($title));
$display = $section_name == $section ? 'block' : 'none';
echo "\t<div id='section-{$san_title}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>{$title}</h2>";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
iframe_footer();
exit;
}
示例5: info
//.........这里部分代码省略.........
</strong> <?php
echo $api->tested;
?>
</li>
<?php
}
if (!empty($api->requires_wpec)) {
?>
<li><strong><?php
_e('Requires WPeC Version:', 'wpsc');
?>
</strong> <?php
printf(__('%s or higher', 'wpsc'), $api->requires_wpec);
?>
</li>
<?php
}
if (!empty($api->tested_wpec)) {
?>
<li><strong><?php
_e('Compatible up to WPEC Version:', 'wpsc');
?>
</strong> <?php
echo $api->tested_wpec;
?>
</li>
<?php
}
if (!empty($api->downloaded)) {
?>
<li><strong><?php
_e('Downloaded:', 'wpsc');
?>
</strong> <?php
printf(_n('%s time', '%s times', $api->downloaded, 'wpsc'), number_format_i18n($api->downloaded));
?>
</li>
<?php
}
if (!empty($api->homepage)) {
?>
<li><a target="_blank" href="<?php
echo $api->homepage;
?>
"><?php
_e('Plugin Homepage »', 'wpsc');
?>
</a></li>
<?php
}
?>
</ul>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.', 'wpsc') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.', 'wpsc') . '</p></div>';
} else {
if (!empty($api->requires_wpec) && version_compare(substr(WPSC_VERSION, 0, strlen($api->requires_wpec)), $api->requires_wpec, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WP eCommerce.', 'wpsc') . '</p></div>';
} else {
if (!empty($api->tested_wpec) && version_compare(substr(WPSC_VERSION, 0, strlen($api->tested_wpec)), $api->tested_wpec, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your version of WP eCommerce.', 'wpsc') . '</p></div>';
}
}
}
}
foreach ($api->sections as $section_name => $content) {
if (isset($plugins_section_titles[$section_name])) {
$title = $plugins_section_titles[$section_name];
} else {
$title = ucwords(str_replace('_', ' ', $section_name));
}
$content = links_add_base_url($content, $api->permalink);
$content = links_add_target($content, '_blank');
$san_section = esc_attr($title);
$display = $section_name == $section ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>{$title}</h2>";
echo $content;
echo "\t</div>\n";
}
if (!empty($api->screenshots)) {
$display = 'screenshots' == $section ? 'block' : 'none';
echo "\t<div id='section-screenshots' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>Screenshots</h2>\n";
echo "\t\t<ol>\n";
foreach ($api->screenshots as $data) {
echo "\t\t\t<li><img src='{$data->location}' class='screenshot' /><p>{$data->caption}</p></li>\n";
}
echo "\t\t</ol>\n";
echo "\t</div>\n";
}
echo "</div>\n";
iframe_footer();
die;
}
示例6: install_plugin_information
//.........这里部分代码省略.........
?filter=<?php
echo $key;
?>
"
target="_blank"
title="<?php
echo esc_attr(sprintf(_n('Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key), $key));
?>
"><?php
printf(_n('%d star', '%d stars', $key), $key);
?>
</a></span>
<span class="counter-back">
<span class="counter-bar" style="width: <?php
echo 92 * $_rating;
?>
px;"></span>
</span>
<span class="counter-count"><?php
echo number_format_i18n($ratecount);
?>
</span>
</div>
<?php
}
}
if (!empty($api->contributors)) {
?>
<h3><?php
_e('Contributors');
?>
</h3>
<ul class="contributors">
<?php
foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
if (empty($contrib_username) && empty($contrib_profile)) {
continue;
}
if (empty($contrib_username)) {
$contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile);
}
$contrib_username = sanitize_user($contrib_username);
if (empty($contrib_profile)) {
echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>";
} else {
echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>";
}
}
?>
</ul>
<?php
if (!empty($api->donate_link)) {
?>
<a target="_blank"
href="<?php
echo esc_url($api->donate_link);
?>
"><?php
_e('Donate to this plugin »');
?>
</a>
<?php
}
?>
<?php
}
?>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been tested with your current version of WordPress.') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been marked as compatible with your version of WordPress.') . '</p></div>';
}
}
foreach ((array) $api->sections as $section_name => $content) {
$content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr($section_name);
$display = $section_name === $section ? 'block' : 'none';
if ('description' === $section_name && (!$api->external && $api->wp_org_missing || $api->external && $api->fs_missing)) {
$missing_notice = array('type' => 'error', 'id' => md5(microtime()), 'message' => __fs($api->is_paid ? 'paid-addon-not-deployed' : 'free-addon-not-deployed', $api->slug));
fs_require_template('admin-notice.php', $missing_notice);
}
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
echo "</div>\n";
echo "</div>\n";
// #plugin-information-scrollable
echo "<div id='{$tab}-footer'>\n";
echo $this->get_plugin_cta($api);
echo "</div>\n";
iframe_footer();
exit;
}
示例7: wprc_install_plugin_information
//.........这里部分代码省略.........
</h2>
<div class="star-holder" title="<?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings, 'installer'), number_format_i18n(intval($api->num_ratings)));
?>
">
<div class="star star-rating" style="width: <?php
echo esc_attr($api->rating);
?>
px"></div>
<div class="star star5"><img src="<?php
echo admin_url('images/star.png?v=20110615');
?>
" alt="<?php
esc_attr_e('5 stars');
?>
" /></div>
<div class="star star4"><img src="<?php
echo admin_url('images/star.png?v=20110615');
?>
" alt="<?php
esc_attr_e('4 stars');
?>
" /></div>
<div class="star star3"><img src="<?php
echo admin_url('images/star.png?v=20110615');
?>
" alt="<?php
esc_attr_e('3 stars');
?>
" /></div>
<div class="star star2"><img src="<?php
echo admin_url('images/star.png?v=20110615');
?>
" alt="<?php
esc_attr_e('2 stars');
?>
" /></div>
<div class="star star1"><img src="<?php
echo admin_url('images/star.png?v=20110615');
?>
" alt="<?php
esc_attr_e('1 star');
?>
" /></div>
</div>
<small><?php
printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings, 'installer'), number_format_i18n(intval($api->num_ratings)));
?>
</small>
<?php
}
?>
<?php
}
?>
</div>
<div id="section-holder" class="wrap">
<?php
if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.', 'installer') . '</p></div>';
} else {
if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.', 'installer') . '</p></div>';
}
}
if (version_compare($wp_version, "3.4", ">=")) {
foreach ((array) $api->sections as $section_name => $content) {
if (isset($plugins_section_titles[$section_name])) {
$title = $plugins_section_titles[$section_name];
} else {
$title = ucwords(str_replace('_', ' ', $section_name));
}
$content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr($section_name);
$display = $section_name == $section ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>{$title}</h2>";
echo $content;
echo "\t</div>\n";
}
} else {
foreach ((array) $api->sections as $section_name => $content) {
$title = $section_name;
$title[0] = strtoupper($title[0]);
$title = str_replace('_', ' ', $title);
$content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_title = esc_attr(sanitize_title_with_dashes($title));
$display = $section_name == $section ? 'block' : 'none';
echo "\t<div id='section-{$san_title}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>{$title}</h2>";
echo $content;
echo "\t</div>\n";
}
}
echo "</div>\n";
iframe_footer();
exit;
}
示例8: hw_install_module_information
/**
* Display plugin information in dialog box form.
* @hook install_plugins_pre_plugin-information
*/
function hw_install_module_information()
{
global $tab;
if (empty($_REQUEST['module'])) {
return;
}
$api = modules_api('module_information', array('slug' => wp_unslash($_REQUEST['module']), 'is_ssl' => is_ssl(), 'fields' => array('banners' => true, 'reviews' => true, 'downloaded' => false, 'active_installs' => true)));
//for testing
$api = (object) array('name' => 'HW YARPP', 'version' => '1.0', 'author' => 'hoangweb', 'slug' => 'hw-yarpp', 'last_updated' => time());
if (is_wp_error($api)) {
wp_die($api);
}
$plugins_section_titles = array('description' => _x('Description', 'Plugin installer section title'), 'installation' => _x('Installation', 'Plugin installer section title'));
$section = 'description';
// Default to the Description tab,
$_tab = 'plugin-information';
//esc_attr( $tab ); because avaiable exists css for 'plugin-information'
iframe_header(__('HW Module Install'));
echo '<div id="plugin-information-scrollable">';
echo "<div id='{$_tab}-title' class=''><div class='vignette'></div><h2>{$api->name}</h2></div>";
//tabs
echo "<div id='{$_tab}-tabs' class=''>\n";
echo "<a href='#' class=''>Tab</a>";
echo "<a href='#' class=''>Tab 1</a>";
echo "</div>\n";
$date_format = __('M j, Y @ H:i');
$last_updated_timestamp = strtotime($api->last_updated);
?>
<div id="<?php
echo $_tab;
?>
-content" class='<?php
?>
'>
<!-- right info -->
<div class="fyi">
<ul>
<?php
if (!empty($api->version)) {
?>
<li><strong><?php
_e('Version:');
?>
</strong> <?php
echo $api->version;
?>
</li>
<?php
}
if (!empty($api->author)) {
?>
<li><strong><?php
_e('Author:');
?>
</strong> <?php
echo links_add_target($api->author, '_blank');
?>
</li>
<?php
}
if (!empty($api->last_updated)) {
?>
<li><strong><?php
_e('Last Updated:');
?>
</strong> <span title="<?php
echo esc_attr(date_i18n($date_format, $last_updated_timestamp));
?>
">
<?php
printf(__('%s ago'), human_time_diff($last_updated_timestamp));
?>
</span></li>
<?php
}
if (!empty($api->slug) && empty($api->external)) {
?>
<li><a target="_blank" href="https://develop.hoangweb.com/plugins/<?php
echo $api->slug;
?>
/"><?php
_e('Hoangweb.com Plugin Page »');
?>
</a></li>
<?php
}
?>
</ul>
</div>
<!-- tabs content -->
<div id="section-holder" class="wrap">
<?php
if (!empty($api->sections)) {
foreach ((array) $api->sections as $section_name => $content) {
$content = links_add_base_url($content, 'https://develop.hoangweb.com/modules/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
//.........这里部分代码省略.........