本文整理汇总了PHP中current_theme_info函数的典型用法代码示例。如果您正苦于以下问题:PHP current_theme_info函数的具体用法?PHP current_theme_info怎么用?PHP current_theme_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了current_theme_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare_items
function prepare_items()
{
global $ct;
$ct = current_theme_info();
$themes = get_allowed_themes();
if (!empty($_REQUEST['s'])) {
$search = strtolower(stripslashes($_REQUEST['s']));
$this->search = array_merge($this->search, array_filter(array_map('trim', explode(',', $search))));
$this->search = array_unique($this->search);
}
if (!empty($_REQUEST['features'])) {
$this->features = $_REQUEST['features'];
$this->features = array_map('trim', $this->features);
$this->features = array_map('sanitize_title_with_dashes', $this->features);
$this->features = array_unique($this->features);
}
if ($this->search || $this->features) {
foreach ($themes as $key => $theme) {
if (!$this->search_theme($theme)) {
unset($themes[$key]);
}
}
}
unset($themes[$ct->name]);
uksort($themes, "strnatcasecmp");
$per_page = 24;
$page = $this->get_pagenum();
$start = ($page - 1) * $per_page;
$this->items = array_slice($themes, $start, $per_page);
$this->set_pagination_args(array('total_items' => count($themes), 'per_page' => $per_page));
}
示例2: load_theme_data
/**
* Load all themes information into local properties
*
* @todo only list themes which implement the scheme
*/
protected function load_theme_data()
{
ICE_Loader::load_wpadmin_lib('ms');
ICE_Loader::load_wpadmin_lib('theme');
// get current theme
$ct = current_theme_info();
// get all themes
$this->__wp_themes__ = get_allowed_themes();
// extract current theme
$this->__wp_theme__ = $this->__wp_themes__[$ct->name];
}
示例3: wp_united_display_theme_menu
function wp_united_display_theme_menu()
{
global $user_ID, $title, $parent_file, $wp_version;
$wpuConnSettings = get_settings('wputd_connection');
if (!validate_current_theme()) {
?>
<div id="message1" class="updated fade"><p><?php
_e('The active theme is broken. Reverting to the default theme.');
?>
</p></div>
<?php
} elseif (isset($_GET['activated'])) {
?>
<div id="message2" class="updated fade"><p><?php
printf(__('New theme activated. <a href="%s">View your blog »</a>'), wpu_homelink('wpu-activate-theme') . '/');
?>
</p></div>
<?php
}
$themes = get_themes();
$theme_names = array_keys($themes);
$user_theme = 'WordPress Default';
$user_template = get_usermeta($user_ID, 'WPU_MyTemplate');
$user_stylesheet = get_usermeta($user_ID, 'WPU_MyStylesheet');
$site_theme = current_theme_info();
$user_theme = $site_theme->title;
// if user hasn't set a theme yet, it is the same as site default
// get current user theme
if ($themes) {
foreach ($theme_names as $theme_name) {
if ($themes[$theme_name]['Stylesheet'] == $user_stylesheet && $themes[$theme_name]['Template'] == $user_template) {
$user_theme = $themes[$theme_name]['Name'];
break;
}
}
}
$template = $themes[$user_theme]['Template'];
$stylesheet = $themes[$user_theme]['Stylesheet'];
$title = $themes[$user_theme]['Title'];
$version = $themes[$user_theme]['Version'];
$description = $themes[$user_theme]['Description'];
$author = $themes[$user_theme]['Author'];
$screenshot = $themes[$user_theme]['Screenshot'];
$stylesheet_dir = $themes[$user_theme]['Stylesheet Dir'];
$tags = $themes[$user_theme]['Tags'];
if ($wp_version > 2.5) {
// paginate if necessary
ksort($themes);
$theme_total = count($themes);
$per_page = 15;
if (isset($_GET['pagenum'])) {
$page = absint($_GET['pagenum']);
}
if (empty($page)) {
$page = 1;
}
$start = $offset = ($page - 1) * $per_page;
$page_links = paginate_links(array('base' => add_query_arg('pagenum', '%#%') . '#themenav', 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => ceil($theme_total / $per_page), 'current' => $page));
$themes = array_slice($themes, $start, $per_page);
$pageTitle = __('Set Your Blog Theme');
$parent_file = 'wpu-plugin.php&wputab=themes';
?>
<div class="wrap">
<?php
screen_icon();
?>
<h2><?php
echo wp_specialchars($pageTitle);
?>
</h2>
<?php
/* CURRENT THEME */
?>
<h3><?php
_e('Current Theme');
?>
</h3>
<div id="current-theme">
<?php
if ($screenshot) {
?>
<img src="<?php
echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot;
?>
" alt="<?php
_e('Current theme preview');
?>
" />
<?php
}
?>
<h4><?php
printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $title, $version, $author);
?>
</h4>
<p class="description"><?php
echo $description;
?>
</p>
//.........这里部分代码省略.........
示例4: get_themes
<?php
require_once 'admin.php';
$themes = get_themes();
$ct = current_theme_info();
$allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes());
if ($allowed_themes == false) {
$allowed_themes = array();
}
$blog_allowed_themes = wpmu_get_blog_allowedthemes();
if (is_array($blog_allowed_themes)) {
$allowed_themes = array_merge($allowed_themes, $blog_allowed_themes);
}
if ($blog_id != 1) {
unset($allowed_themes["h3"]);
}
if (isset($allowed_themes[wp_specialchars($ct->stylesheet)]) == false) {
$allowed_themes[wp_specialchars($ct->stylesheet)] = true;
}
reset($themes);
foreach ($themes as $key => $theme) {
if (isset($allowed_themes[wp_specialchars($theme['Stylesheet'])]) == false) {
unset($themes[$key]);
}
}
reset($themes);
if (isset($_GET['action'])) {
check_admin_referer('switch-theme_' . $_GET['template']);
if ('activate' == $_GET['action']) {
switch_theme($_GET['template'], $_GET['stylesheet']);
wp_redirect('themes.php?activated=true');
示例5: wp_dashboard_right_now
function wp_dashboard_right_now() {
$num_posts = wp_count_posts( 'post' );
$num_pages = wp_count_posts( 'page' );
$num_cats = wp_count_terms('category');
$num_tags = wp_count_terms('post_tag');
$num_comm = wp_count_comments( );
echo "\n\t".'<p class="sub">' . __('At a Glance') . '</p>';
echo "\n\t".'<div class="table">'."\n\t".'<table>';
echo "\n\t".'<tr class="first">';
// Posts
$num = number_format_i18n( $num_posts->publish );
if ( current_user_can( 'edit_posts' ) )
$text = "<a href='edit.php'>$num</a>";
else
$text = $num;
echo '<td class="first b b-posts">' . $text . '</td>';
echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>';
/* TODO: Show status breakdown on hover
if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can
$post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
}
if ( $can_edit_posts && !empty($num_posts->draft) ) {
$post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>';
}
if ( $can_edit_posts && !empty($num_posts->future) ) {
$post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>';
}
if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) {
$pending_text = sprintf( __ngettext( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) );
} else {
$pending_text = '';
}
*/
// Total Comments
$num = number_format_i18n($num_comm->total_comments);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php'>$num</a>";
echo '<td class="b b-comments">'.$num.'</td>';
echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>';
echo '</tr><tr>';
// Pages
$num = number_format_i18n( $num_pages->publish );
if ( current_user_can( 'edit_pages' ) )
$num = "<a href='edit-pages.php'>$num</a>";
echo '<td class="first b b_pages">'.$num.'</td>';
echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';
// Approved Comments
$num = number_format_i18n($num_comm->approved);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
echo '<td class="b b_approved">'.$num.'</td>';
echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>';
echo "</tr>\n\t<tr>";
// Categories
$num = number_format_i18n( $num_cats );
if ( current_user_can( 'manage_categories' ) )
$num = "<a href='categories.php'>$num</a>";
echo '<td class="first b b-cats">'.$num.'</td>';
echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>';
// Pending Comments
$num = number_format_i18n($num_comm->moderated);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>";
echo '<td class="b b-waiting">'.$num.'</td>';
echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>';
echo "</tr>\n\t<tr>";
// Tags
$num = number_format_i18n( $num_tags );
if ( current_user_can( 'manage_categories' ) )
$num = "<a href='edit-tags.php'>$num</a>";
echo '<td class="first b b-tags">'.$num.'</td>';
echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>';
// Spam Comments
$num = number_format_i18n($num_comm->spam);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>";
echo '<td class="b b-spam">'.$num.'</td>';
echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>';
echo "</tr>";
do_action('right_now_table_end');
echo "\n\t</table>\n\t</div>";
echo "\n\t".'<div class="versions">';
$ct = current_theme_info();
//.........这里部分代码省略.........
示例6: csp_po_collect_by_type
function csp_po_collect_by_type($type){
$res = array();
if (empty($type) || ($type == 'wordpress')) {
$res[] = csp_po_get_wordpress_capabilities();
}
if (empty($type) || ($type == 'plugins')) {
//WARNING: Plugin handling is not well coded by WordPress core
$err = error_reporting(0);
$plugs = get_plugins();
error_reporting($err);
$textdomains = array();
foreach($plugs as $key => $value) {
$data = csp_po_get_plugin_capabilities($key, $value);
if (!$data['gettext_ready']) continue;
if (in_array($data['textdomain'], $textdomains)) {
for ($i=0; $i<count($res); $i++) {
if ($data['textdomain'] == $res[$i]['textdomain']) {
$res[$i]['child-plugins'][] = $data;
break;
}
}
}
else{
array_push($textdomains, $data['textdomain']);
$res[] = $data;
}
}
}
if (isset($GLOBALS['wpmu_version'])) {
if (empty($type) || ($type == 'plugins_mu')) {
$plugs = array();
$textdomains = array();
if( is_dir( WPMU_PLUGIN_DIR ) ) {
if( $dh = opendir( WPMU_PLUGIN_DIR ) ) {
while( ( $plugin = readdir( $dh ) ) !== false ) {
if( substr( $plugin, -4 ) == '.php' ) {
$plugs[$plugin] = get_plugin_data( WPMU_PLUGIN_DIR . '/' . $plugin );
}
}
}
}
foreach($plugs as $key => $value) {
$data = csp_po_get_plugin_mu_capabilities($key, $value);
if (!$data['gettext_ready']) continue;
if (in_array($data['textdomain'], $textdomains)) {
for ($i=0; $i<count($res); $i++) {
if ($data['textdomain'] == $res[$i]['textdomain']) {
$res[$i]['child-plugins'][] = $data;
break;
}
}
}
else{
array_push($textdomains, $data['textdomain']);
$res[] = $data;
}
}
}
}
if (empty($type) || ($type == 'themes')) {
$themes = get_themes();
//WARNING: Theme handling is not well coded by WordPress core
$err = error_reporting(0);
$ct = current_theme_info();
error_reporting($err);
foreach($themes as $key => $value) {
$data = csp_po_get_theme_capabilities($key, $value, $ct);
if (!$data['gettext_ready']) continue;
$res[] = $data;
}
}
return $res;
}
示例7: ms_copy_themes
public function ms_copy_themes()
{
pb_backupbuddy::status('message', 'Copying theme(s) into temporary WordPress installation.');
if (!function_exists('wp_get_theme')) {
pb_backupbuddy::status('details', 'wp_get_theme() function not found. Loading `/wp-admin/includes/theme.php`.');
require_once ABSPATH . 'wp-admin/includes/theme.php';
pb_backupbuddy::status('details', 'Loaded `/wp-admin/includes/theme.php`.');
}
// Use new wp_get_theme() if available.
if (function_exists('wp_get_theme')) {
// WordPress v3.4 or newer.
pb_backupbuddy::status('details', 'wp_get_theme() available. Using it.');
$current_theme = wp_get_theme();
} else {
// WordPress pre-v3.4
pb_backupbuddy::status('details', 'wp_get_theme() still unavailable (pre WordPress v3.4?). Attempting to use older current_theme_info() fallback.');
$current_theme = current_theme_info();
}
//Step 5 - Copy over themes
$template_dir = $current_theme->template_dir;
$stylesheet_dir = $current_theme->stylesheet_dir;
pb_backupbuddy::status('details', 'Got current theme information.');
//If $template_dir and $stylesheet_dir don't match, that means we have a child theme and need to copy over the parent also
$items_to_copy = array();
$items_to_copy[basename($template_dir)] = $template_dir;
if ($template_dir != $stylesheet_dir) {
$items_to_copy[basename($stylesheet_dir)] = $stylesheet_dir;
}
pb_backupbuddy::status('details', 'About to begin copying theme files...');
//Copy the files over
if (count($items_to_copy) > 0) {
$wp_dir = $this->_backup['backup_root'];
$wp_theme_dir = $wp_dir . 'wp-content/themes/';
foreach ($items_to_copy as $file => $original_destination) {
if (file_exists($original_destination) && file_exists($wp_theme_dir)) {
$result = pb_backupbuddy::$filesystem->recursive_copy($original_destination, $wp_theme_dir . $file);
if ($result === false) {
pb_backupbuddy::status('error', 'Unable to copy theme from `' . $original_destination . '` to `' . $wp_theme_dir . $file . '`. Verify permissions.');
return false;
} else {
pb_backupbuddy::status('details', 'Copied theme from `' . $original_destination . '` to `' . $wp_theme_dir . $file . '`.');
}
}
// end if file exists.
}
// end foreach $items_to_copy.
}
// end if.
pb_backupbuddy::status('message', 'Copied theme into temporary WordPress installation.');
return true;
}
示例8: get_allowed_themes
/**
* Get the allowed themes for the current blog.
*
* @since 3.0.0
*
* @uses get_themes()
* @uses current_theme_info()
* @uses get_site_allowed_themes()
* @uses wpmu_get_blog_allowedthemes
*
* @return array $themes Array of allowed themes.
*/
function get_allowed_themes()
{
if (!is_multisite()) {
return get_themes();
}
$themes = get_themes();
$ct = current_theme_info();
$allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes());
if ($allowed_themes == false) {
$allowed_themes = array();
}
$blog_allowed_themes = wpmu_get_blog_allowedthemes();
if (is_array($blog_allowed_themes)) {
$allowed_themes = array_merge($allowed_themes, $blog_allowed_themes);
}
if (isset($allowed_themes[esc_html($ct->stylesheet)]) == false) {
$allowed_themes[esc_html($ct->stylesheet)] = true;
}
reset($themes);
foreach ($themes as $key => $theme) {
if (isset($allowed_themes[esc_html($theme['Stylesheet'])]) == false) {
unset($themes[$key]);
}
}
reset($themes);
return $themes;
}
示例9: dpa_admin_screen_siteinfo
/**
* Site info box
*
* @global nxtdb $nxtdb NXTClass database object
* @global string $nxt_version NXTClass version number
* @global nxt_Rewrite $nxt_rewrite NXTClass Rewrite object for creating pretty URLs
* @global object $nxt_rewrite
* @param array $settings Site's options 'achievements' meta
* @since 2.0
*/
function dpa_admin_screen_siteinfo($settings)
{
global $nxtdb, $nxt_rewrite, $nxt_version;
$active_plugins = array();
$all_plugins = apply_filters('all_plugins', get_plugins());
foreach ($all_plugins as $filename => $plugin) {
if ('Achievements' != $plugin['Name'] && 'BuddyPress' != $plugin['Name'] && is_plugin_active($filename)) {
$active_plugins[] = $plugin['Name'] . ': ' . $plugin['Version'];
}
}
natcasesort($active_plugins);
if (!$active_plugins) {
$active_plugins[] = __('No other plugins are active', 'dpa');
}
if (defined('MULTISITE') && constant('MULTISITE') == true) {
if (defined('SUBDOMAIN_INSTALL') && constant('SUBDOMAIN_INSTALL') == true) {
$is_multisite = __('subdomain', 'dpa');
} else {
$is_multisite = __('subdirectory', 'dpa');
}
} else {
$is_multisite = __('no', 'dpa');
}
if (1 == constant('BP_ROOT_BLOG')) {
$is_bp_root_blog = __('standard', 'dpa');
} else {
$is_bp_root_blog = __('non-standard', 'dpa');
}
$is_bp_default_child_theme = __('no', 'dpa');
$theme = current_theme_info();
if ('BuddyPress Default' == $theme->parent_theme) {
$is_bp_default_child_theme = __('yes', 'dpa');
}
if ('BuddyPress Default' == $theme->name) {
$is_bp_default_child_theme = __('n/a', 'dpa');
}
if (empty($nxt_rewrite->permalink_structure)) {
$custom_permalinks = __('default', 'dpa');
} else {
if (strpos($nxt_rewrite->permalink_structure, 'index.php')) {
$custom_permalinks = __('almost', 'dpa');
} else {
$custom_permalinks = __('custom', 'dpa');
}
}
?>
<p><?php
_e("If you're submitting a support request, some information about your NXTClass site really helps us to diagnose the problem.", 'dpa');
?>
</p>
<p><?php
_e("It's entirely optional, but if you include the information below in your support request, it really will help. Thank you!", 'dpa');
?>
</p>
<h4><?php
_e('Versions', 'dpa');
?>
</h4>
<ul>
<li><?php
printf(__('Achievements: %s', 'dpa'), ACHIEVEMENTS_VERSION);
?>
</li>
<li><?php
printf(__('BuddyPress: %s', 'dpa'), BP_VERSION);
?>
</li>
<li><?php
printf(__('BP_ROOT_BLOG: %s', 'dpa'), $is_bp_root_blog);
?>
</li>
<li><?php
printf(__('MySQL: %s', 'dpa'), $nxtdb->db_version());
?>
</li>
<li><?php
printf(__('Permalinks: %s', 'dpa'), $custom_permalinks);
?>
</li>
<li><?php
printf(__('PHP: %s', 'dpa'), phpversion());
?>
</li>
<li><?php
printf(__('NXTClass: %s', 'dpa'), $nxt_version);
?>
</li>
<li><?php
printf(__('NXTClass multisite: %s', 'dpa'), $is_multisite);
//.........这里部分代码省略.........
示例10: infinity_dashboard_support_info
/**
* Show useful support information. Props to Paul Gibbs for 90% of the code!
*
* @copyright Original code Copyright (C) Paul Gibbs
*/
function infinity_dashboard_support_info()
{
// globals
global $wpdb, $wp_rewrite, $wp_version;
// show some useful infinity info
if (INFINITY_DEV_MODE) {
$is_developer_mode = __('Enabled', infinity_text_domain);
} else {
$is_developer_mode = __('Disabled', infinity_text_domain);
}
// get theme info
$theme = current_theme_info();
// get plugin info
$active_plugins = array();
$all_plugins = apply_filters('all_plugins', get_plugins());
// what plugins are active?
foreach ($all_plugins as $filename => $plugin) {
if ('BuddyPress' != $plugin['Name'] && is_plugin_active($filename)) {
$active_plugins[] = $plugin['Name'] . ': ' . $plugin['Version'];
}
}
natcasesort($active_plugins);
if (!$active_plugins) {
$active_plugins[] = __('No other plugins are active', infinity_text_domain);
}
// multisite info
if (defined('MULTISITE') && MULTISITE == true) {
if (defined('SUBDOMAIN_INSTALL') && SUBDOMAIN_INSTALL == true) {
$is_multisite = __('subdomain', infinity_text_domain);
} else {
$is_multisite = __('subdirectory', infinity_text_domain);
}
} else {
$is_multisite = __('no', infinity_text_domain);
}
// what permalinks are being used?
if (empty($wp_rewrite->permalink_structure)) {
$custom_permalinks = __('default', infinity_text_domain);
} else {
if (strpos($wp_rewrite->permalink_structure, 'index.php')) {
$custom_permalinks = __('almost', infinity_text_domain);
} else {
$custom_permalinks = __('custom', infinity_text_domain);
}
}
?>
<h3><?php
_e('Installation Details', infinity_text_domain);
?>
</h3>
<p><?php
_e("If you are having issues with the theme and need support, below is some useful info about your installation.", infinity_text_domain);
?>
</p>
<p><?php
_e("Please submit this information with your support request so it's easier for us to help you!", infinity_text_domain);
?>
</p>
<h4><?php
_e('Versions', infinity_text_domain);
?>
</h4>
<ul>
<li><?php
printf(__('Infinity Version: %s', infinity_text_domain), INFINITY_VERSION);
?>
</li>
<li><?php
printf(__('Developer Mode: %s', infinity_text_domain), $is_developer_mode);
?>
</li>
<li><?php
printf(__('BuddyPress: %s', infinity_text_domain), BP_VERSION);
?>
</li>
<li><?php
printf(__('MySQL: %s', infinity_text_domain), $wpdb->db_version());
?>
</li>
<li><?php
printf(__('Permalinks: %s', infinity_text_domain), $custom_permalinks);
?>
</li>
<li><?php
printf(__('PHP: %s', infinity_text_domain), phpversion());
?>
</li>
<li><?php
printf(__('WordPress: %s', infinity_text_domain), $wp_version);
?>
</li>
<li><?php
printf(__('WordPress multisite: %s', infinity_text_domain), $is_multisite);
?>
//.........这里部分代码省略.........
示例11: prepare_items
function prepare_items()
{
global $ct;
$ct = current_theme_info();
$themes = get_allowed_themes();
unset($themes[$ct->name]);
uksort($themes, "strnatcasecmp");
$per_page = 15;
$page = $this->get_pagenum('pagenum');
$start = $offset = ($page - 1) * $per_page;
$this->items = array_slice($themes, $start, $per_page);
$this->set_pagination_args(array('query_var' => 'pagenum', 'total_items' => count($themes), 'per_page' => $per_page));
}
示例12: bp_groupblog_management_page
function bp_groupblog_management_page()
{
global $wpdb;
// only allow site admins to come here.
if (is_super_admin() == false) {
wp_die(__('You do not have permission to access this page.', 'groupblog'));
}
// process form submission
if (isset($_POST['action']) && $_POST['action'] == 'update') {
bp_groupblog_update_defaults();
$updated = true;
} else {
$updated = false;
}
// make sure we're using latest data
$opt = get_site_option('bp_groupblog_blog_defaults_options');
?>
<?php
if ($updated) {
?>
<div id="message" class="updated fade">
<p><?php
_e('Options saved.', 'groupblog');
?>
</p>
</div>
<?php
}
?>
<div class="wrap" style="position: relative">
<h2><?php
_e('BuddyPress GroupBlog Settings', 'groupblog');
?>
</h2>
<form name="bp-groupblog-setup" id="bp-groupblog-setup" action="" method="post">
<div id="tabctnr">
<ul class="tabnav">
<li><a href="#groupblog_default_theme"><?php
_e('Theme', 'groupblog');
?>
</a></li>
<li><a href="#groupblog_landing_page"><?php
_e('Redirect', 'groupblog');
?>
</a></li>
<li><a href="#groupblog_template_layout"><?php
_e('Layout', 'groupblog');
?>
</a></li>
<li><a href="#groupblog_default_blog_settings"><?php
_e('Defaults', 'groupblog');
?>
</a></li>
<li><a href="#groupblog_validation_settings"><?php
_e('Validation', 'groupblog');
?>
</a></li>
<li><a href="#groupblog_about"><?php
_e('About', 'groupblog');
?>
</a></li>
</ul>
<div id='groupblog_default_theme'>
<?php
$current_groupblog_theme = '';
// get all themes
if (function_exists('wp_get_themes')) {
// get theme data the WP3.4 way...
$themes = wp_get_themes(false, 'network', 0);
$ct = wp_get_theme();
$allowed_themes = WP_Theme::get_allowed_on_network();
$blog_allowed_themes = WP_Theme::get_allowed_on_site();
} else {
// pre WP3.4 functions
$themes = get_themes();
$ct = current_theme_info();
$allowed_themes = get_site_allowed_themes();
$blog_allowed_themes = wpmu_get_blog_allowedthemes();
}
if ($allowed_themes == false) {
$allowed_themes = array();
}
if (is_array($blog_allowed_themes)) {
$allowed_themes = array_merge($allowed_themes, $blog_allowed_themes);
}
if ($wpdb->blogid != 1) {
unset($allowed_themes['h3']);
}
if (isset($allowed_themes[esc_html($ct->stylesheet)]) == false) {
$allowed_themes[esc_html($ct->stylesheet)] = true;
}
reset($themes);
foreach ($themes as $key => $theme) {
if (isset($allowed_themes[esc_html($theme['Stylesheet'])]) == false) {
//.........这里部分代码省略.........
示例13: print_message
function print_message()
{
// Read current user
global $current_user;
get_currentuserinfo();
// Array which contains all my extensions
$arr_extension = array();
// Read the active plugins
foreach (get_option('active_plugins') as $plugin) {
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
if (StrPos(StrToLower($plugin_data['Author']), 'dennis hoppe') !== False) {
$arr_extension[] = $plugin_data['Title'];
}
}
// Read the current theme
if (StrPos(StrToLower(current_theme_info()->author), 'dennis hoppe') !== False) {
$arr_extension[] = $this->t('the theme') . ' ' . current_theme_info()->title;
}
// Write the Dashboard message
?>
<img src="http://www.gravatar.com/avatar/d50a70b7a2e91bb31e8f00c13149f059?s=100" class="alignright" alt="Dennis Hoppe" height="100" width="100" style="margin:0 0 3px 10px;" />
<div style="text-align:justify">
<h4><?php
PrintF($this->t('Hello %1$s!'), $current_user->display_name);
?>
</h4>
<p>
<?php
echo $this->t('My name is Dennis Hoppe and I am a computer science student working and living in Berlin, Germany.');
?>
<?php
PrintF($this->t('Beside other plugins and themes I developed %1$s.'), $this->Extended_Implode($arr_extension, ', ', ' ' . $this->t('and') . ' '));
?>
<?php
echo $this->t('I love the spirit of the open source movement, to write and share code and knowledge, but I think the system can work only if everyone contributes one\'s part properly.');
?>
</p>
<p>
<?php
PrintF($this->t('Because you are using %1$s of my WordPress extensions I hope you will appreciate my job.'), $this->Number_to_Word(Count($arr_extension)));
?>
<?php
echo $this->t('So please think about a donation. You would also help to keep alive and growing the community.');
?>
</p>
</div>
<ul>
<li><?php
echo $this->t('Make a gift of the Amazon Wish List');
?>
:
<ul>
<li>» <a href="http://amzn.com/w/1A45MS7KY75CY" target="_blank"><?php
echo $this->t('Amazon USA');
?>
</a></li>
<li>» <a href="http://www.amazon.de/wishlist/2AG0R8BHEOJOL" target="_blank"><?php
echo $this->t('Amazon Germany');
?>
</a></li>
</ul>
</li>
<li class="hide_if_js">» <?php
echo $this->t('Make a donation via PayPal:');
?>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1220480" target="_blank"><?php
echo $this->t('U$ Dollars');
?>
</a> |
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HECSPGLPTQL24" target="_blank"><?php
echo $this->t('€uro');
?>
</a>
</li>
<li class="show_if_js" style="display:none"><?php
echo $this->t('Make a donation via PayPal');
?>
:
<ul>
<li>» U$ Dollar:
<input type="hidden" class="dennis_hoppe_donation_currency" value="USD" />
<select class="dennis_hoppe_donation_amount">
<option value="" disabled="disabled" selected="selected"><?php
echo $this->t('Amount in USD');
?>
</option>
<!--
<option value="104.37">$104.37</option>
<option value="83.56">$83.56</option>
<option value="62.75">$62.75</option>
-->
<option value="52.34">$52.34</option>
<option value="41.94">$41.94</option>
//.........这里部分代码省略.........
示例14: ajax_site_export
//.........这里部分代码省略.........
if (basename($plugin_path) == 'plugins') {
$plugin_path = $plugins_dir . '/' . $plugin;
}
$items_to_copy[basename($plugin_path)] = $plugin_path;
}
}
//end foreach $plugins
}
//end foreach special plugins
//Copy the files over
$wp_dir = '';
if (count($items_to_copy) > 0) {
$wp_dir = $extract_files_to . '/wordpress/';
$wp_plugin_dir = $wp_dir . '/wp-content/plugins/';
foreach ($items_to_copy as $file => $original_destination) {
if (file_exists($original_destination) && file_exists($wp_plugin_dir)) {
$this->copy($original_destination, $wp_plugin_dir . $file);
}
}
}
//Prepare the response
$return_args['debug'] = $wp_dir;
$return_args['message'] = __('Plugins copied over. Now copying over the active theme.', 'it-l10n-backupbuddy');
$return_args['completion'] = 50;
} else {
//Nothing has technically failed at this point - There just aren't any plugins to copy over
$return_args['message'] = __('Plugins copied over. Now copying over the active theme.', 'it-l10n-backupbuddy');
$return_args['completion'] = 50;
$this->log('MS-MS Step 4 - ' . __('No plugins to copy over', 'it-l10n-backupbuddy'), 'error');
}
break;
case 5:
//Step 5 - Copy over themes
$current_theme = current_theme_info();
$template_dir = $current_theme->template_dir;
$stylesheet_dir = $current_theme->stylesheet_dir;
//If $template_dir and $stylesheet_dir don't match, that means we have a child theme and need to copy over the parent also
$items_to_copy = array();
$items_to_copy[basename($template_dir)] = $template_dir;
if ($template_dir != $stylesheet_dir) {
$items_to_copy[basename($stylesheet_dir)] = $stylesheet_dir;
}
//Copy the files over
if (count($items_to_copy) > 0) {
$wp_dir = $extract_files_to . '/wordpress/';
$wp_theme_dir = $wp_dir . '/wp-content/themes/';
foreach ($items_to_copy as $file => $original_destination) {
if (file_exists($original_destination) && file_exists($wp_theme_dir)) {
$this->copy($original_destination, $wp_theme_dir . $file);
}
}
}
$return_args['debug'] = $wp_dir;
$return_args['message'] = __('Theme has been copied over. Now copying over media files.', 'it-l10n-backupbuddy');
$return_args['completion'] = 60;
break;
case 6:
//Step 6 - Copy over media/upload files
$upload_dir = wp_upload_dir();
$original_upload_base_dir = $upload_dir['basedir'];
$destination_upload_base_dir = $extract_files_to . '/wordpress/wp-content/uploads';
$this->copy($original_upload_base_dir, $destination_upload_base_dir, array('ignore_files' => array($zip_id)));
$return_args['debug'] = $destination_upload_base_dir;
$return_args['message'] = __('Media has been copied over. Now preparing the export.', 'it-l10n-backupbuddy');
$return_args['completion'] = 70;
break;
示例15: getCurrentTheme
/**
* @return string the name and the version of the current theme.
*/
public static function getCurrentTheme()
{
if (function_exists('wp_get_theme')) {
//Since WP 3.4
$currentTheme = wp_get_theme();
return $currentTheme->get('Name') . " v" . $currentTheme->get('Version');
} else {
$currentTheme = current_theme_info();
return $currentTheme->name . " v" . $currentTheme->version;
}
}