本文整理汇总了PHP中get_blog_status函数的典型用法代码示例。如果您正苦于以下问题:PHP get_blog_status函数的具体用法?PHP get_blog_status怎么用?PHP get_blog_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_blog_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_columns
/**
* Add custom columns (ID and Site Category) in Sites listing
*
*/
public function add_columns($column_name, $blog_id)
{
if ('mature' === $column_name) {
if (apply_filters('msc_show_mature_column', B5F_Multisite_Categories::$show_mature_column)) {
echo get_blog_status($blog_id, 'mature');
}
} elseif ('column-site-cat' === $column_name) {
$cat_name = get_blog_option($blog_id, 'site_category');
$uncategorized = '<span style="opacity:.5">Uncategorized</span>';
echo empty($cat_name) ? $uncategorized : $cat_name;
}
return $column_name;
}
示例2: add_new_blog_field
/**
* Add new option when registering a site (back and front end)
*
* URI: http://stackoverflow.com/a/10372861/1287812
*/
public function add_new_blog_field($blog_id, $user_id, $domain, $path, $site_id, $meta)
{
$new_field_value = '';
# Site added in the back end
if (!empty($_POST['blog']['input_site_cat'])) {
switch_to_blog($blog_id);
$cat_id = $_POST['blog']['input_site_cat'];
# TODO: if Sign-up is to be enabled, change this to a method
$val = B5F_Multisite_Categories::get_instance()->do_mature_to_name($cat_id);
update_blog_option($blog_id, 'site_category', $val);
update_blog_status($blog_id, 'mature', $cat_id);
get_blog_status($blog_id, 'mature');
restore_current_blog();
} elseif (!empty($meta['input_site_cat'])) {
$new_field_value = $meta['input_site_cat'];
update_option('site_category', $new_field_value);
}
}
示例3: get_wpmu_posts
function get_wpmu_posts($args = array())
{
global $wpdb;
$blogArgs = array('network_id' => $wpdb->siteid, 'public' => is_user_logged_in() ? null : 1, 'archived' => null, 'mature' => null, 'spam' => null, 'deleted' => null, 'limit' => 999, 'offset' => 1);
$blogs = get_sites($blogArgs);
foreach ($blogs as $i => $blog) {
$status = get_blog_status($blog->blog_id, 'public');
if (!$status && (!is_user_logged_in() || !is_user_member_of_blog(get_current_user_id(), $blog->blog_id) && !is_super_admin())) {
unset($blogs[$i]);
}
}
$args = array_merge(array('posts_per_page' => 5, 'offset' => 0, 'category' => '', 'category_name' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish', 'suppress_filters' => true, 'paged' => get_query_var('paged') ? get_query_var('paged') : 1), $args);
extract($args);
$args['posts_per_page'] = -1;
$args['paged'] = 1;
$orderbyVal = $orderby === 'meta_value' ? $meta_key : $orderby;
$posts = array();
$current_blog = get_current_blog_id();
foreach ($blogs as $blog) {
switch_to_blog($blog->blog_id);
$blog_posts = get_posts($args);
foreach ($blog_posts as $blog_post) {
$blog_post->blog_id = $blog->blog_id;
if ($orderby === 'date') {
$ordering = strtotime($blog_post->{$orderbyVal});
} else {
$ordering = $blog_post->{$orderbyVal};
}
while (isset($posts[$ordering])) {
$ordering = $ordering + 1;
}
$posts[$ordering] = $blog_post;
}
}
switch_to_blog($current_blog);
krsort($posts);
if ($posts_per_page == -1) {
return array_slice($posts, 0, count($posts));
} else {
return array_slice($posts, ($paged - 1) * $posts_per_page, $posts_per_page);
}
}
示例4: sitewide_tags_post
function sitewide_tags_post($post_id, $post)
{
global $wpdb;
if (!get_sitewide_tags_option('tags_blog_enabled')) {
return;
}
// wp_insert_category()
include_once ABSPATH . 'wp-admin/includes/admin.php';
$tags_blog_id = get_sitewide_tags_option('tags_blog_id');
if (!$tags_blog_id || $wpdb->blogid == $tags_blog_id) {
return;
}
$allowed_post_types = apply_filters('sitewide_tags_allowed_post_types', array('post' => true));
if (!$allowed_post_types[$post->post_type]) {
return;
}
$post_blog_id = $wpdb->blogid;
$blog_status = get_blog_status($post_blog_id, "public");
if ($blog_status != 1 && ($blog_status != 0 || get_sitewide_tags_option('tags_blog_public') == 1 || get_sitewide_tags_option('tags_blog_pub_check') == 0)) {
return;
}
$post->post_category = wp_get_post_categories($post_id);
$cats = array();
foreach ($post->post_category as $c) {
$cat = get_category($c);
$cats[] = array('name' => esc_html($cat->name), 'slug' => esc_html($cat->slug));
}
$post->tags_input = implode(', ', wp_get_post_tags($post_id, array('fields' => 'names')));
$post->guid = $post_blog_id . '.' . $post_id;
$global_meta = array();
$global_meta['permalink'] = get_permalink($post_id);
$global_meta['blogid'] = $org_blog_id = $wpdb->blogid;
// org_blog_id
$meta_keys = apply_filters('sitewide_tags_meta_keys', get_sitewide_tags_option('tags_blog_postmeta', array()));
if (is_array($meta_keys) && !empty($meta_keys)) {
foreach ($meta_keys as $key) {
$global_meta[$key] = get_post_meta($post->ID, $key, true);
}
}
unset($meta_keys);
if (get_sitewide_tags_option('tags_blog_thumbs') && ($thumb_id = get_post_meta($post->ID, '_thumbnail_id', true))) {
$thumb_size = apply_filters('sitewide_tags_thumb_size', 'thumbnail');
$global_meta['thumbnail_html'] = wp_get_attachment_image($thumb_id, $thumb_size);
}
// custom taxonomies
$taxonomies = apply_filters('sitewide_tags_custom_taxonomies', array());
if (!empty($taxonomies) && $post->post_status == 'publish') {
$registered_tax = array_diff(get_taxonomies(), array('post_tag', 'category', 'link_category', 'nav_menu'));
$custom_tax = array_intersect($taxonomies, $registered_tax);
$tax_input = array();
foreach ($custom_tax as $tax) {
$terms = wp_get_object_terms($post_id, $tax, array('fields' => 'names'));
if (empty($terms)) {
continue;
}
if (is_taxonomy_hierarchical($tax)) {
$tax_input[$tax] = $terms;
} else {
$tax_input[$tax] = implode(',', $terms);
}
}
if (!empty($tax_input)) {
$post->tax_input = $tax_input;
}
}
switch_to_blog($tags_blog_id);
if (is_array($cats) && !empty($cats) && $post->post_status == 'publish') {
foreach ($cats as $t => $d) {
$term = get_term_by('slug', $d['slug'], 'category');
if ($term && $term->parent == 0) {
$category_id[] = $term->term_id;
continue;
}
/* Here is where we insert the category if necessary */
wp_insert_category(array('cat_name' => $d['name'], 'category_description' => $d['name'], 'category_nicename' => $d['slug'], 'category_parent' => ''));
/* Now get the category ID to be used for the post */
$category_id[] = $wpdb->get_var("SELECT term_id FROM " . $wpdb->get_blog_prefix($tags_blog_id) . "terms WHERE slug = '" . $d['slug'] . "'");
}
}
$global_post = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE guid IN (%s,%s)", $post->guid, esc_url($post->guid)));
if ($post->post_status != 'publish' && is_object($global_post)) {
wp_delete_post($global_post->ID);
} else {
if ($global_post->ID != '') {
$post->ID = $global_post->ID;
// editing an old post
foreach (array_keys($global_meta) as $key) {
delete_post_meta($global_post->ID, $key);
}
} else {
unset($post->ID);
// new post
}
}
if ($post->post_status == 'publish') {
$post->ping_status = 'closed';
$post->comment_status = 'closed';
/* Use the category ID in the post */
$post->post_category = $category_id;
$p = wp_insert_post($post);
//.........这里部分代码省略.........
示例5: display_rows
public function display_rows()
{
global $mode;
$status_list = array('archived' => array('site-archived', __('Archived')), 'spam' => array('site-spammed', _x('Spam', 'site')), 'deleted' => array('site-deleted', __('Deleted')), 'mature' => array('site-mature', __('Mature')));
if ('list' == $mode) {
$date = 'Y/m/d';
} else {
$date = 'Y/m/d \\<\\b\\r \\/\\> g:i:s a';
}
$class = '';
foreach ($this->items as $blog) {
$class = 'alternate' == $class ? '' : 'alternate';
reset($status_list);
$blog_states = array();
foreach ($status_list as $status => $col) {
if (get_blog_status($blog['blog_id'], $status) == 1) {
$class = $col[0];
$blog_states[] = $col[1];
}
}
$blog_state = '';
if (!empty($blog_states)) {
$state_count = count($blog_states);
$i = 0;
$blog_state .= ' - ';
foreach ($blog_states as $state) {
++$i;
$i == $state_count ? $sep = '' : ($sep = ', ');
$blog_state .= "<span class='post-state'>{$state}{$sep}</span>";
}
}
echo "<tr class='{$class}'>";
$blogname = is_subdomain_install() ? str_replace('.' . get_current_site()->domain, '', $blog['domain']) : $blog['path'];
list($columns, $hidden) = $this->get_column_info();
foreach ($columns as $column_name => $column_display_name) {
$style = '';
if (in_array($column_name, $hidden)) {
$style = ' style="display:none;"';
}
switch ($column_name) {
case 'cb':
?>
<th scope="row" class="check-column">
<?php
if (!is_main_site($blog['blog_id'])) {
?>
<label class="screen-reader-text" for="blog_<?php
echo $blog['blog_id'];
?>
"><?php
printf(__('Select %s'), $blogname);
?>
</label>
<input type="checkbox" id="blog_<?php
echo $blog['blog_id'];
?>
" name="allblogs[]" value="<?php
echo esc_attr($blog['blog_id']);
?>
" />
<?php
}
?>
</th>
<?php
break;
case 'id':
?>
<th scope="row">
<?php
echo $blog['blog_id'];
?>
</th>
<?php
break;
case 'blogname':
echo "<td class='column-{$column_name} {$column_name}'{$style}>";
?>
<a href="<?php
echo esc_url(network_admin_url('site-info.php?id=' . $blog['blog_id']));
?>
" class="edit"><?php
echo $blogname . $blog_state;
?>
</a>
<?php
if ('list' != $mode) {
switch_to_blog($blog['blog_id']);
echo '<p>' . sprintf(_x('%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.'), get_option('blogname'), get_option('blogdescription ')) . '</p>';
restore_current_blog();
}
// Preordered.
$actions = array('edit' => '', 'backend' => '', 'activate' => '', 'deactivate' => '', 'archive' => '', 'unarchive' => '', 'spam' => '', 'unspam' => '', 'delete' => '', 'visit' => '');
$actions['edit'] = '<span class="edit"><a href="' . esc_url(network_admin_url('site-info.php?id=' . $blog['blog_id'])) . '">' . __('Edit') . '</a></span>';
$actions['backend'] = "<span class='backend'><a href='" . esc_url(get_admin_url($blog['blog_id'])) . "' class='edit'>" . __('Dashboard') . '</a></span>';
if (get_current_site()->blog_id != $blog['blog_id']) {
if (get_blog_status($blog['blog_id'], 'deleted') == '1') {
$actions['activate'] = '<span class="activate"><a href="' . esc_url(wp_nonce_url(network_admin_url('sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to activate the site %s'), $blogname))), 'confirm')) . '">' . __('Activate') . '</a></span>';
} else {
$actions['deactivate'] = '<span class="activate"><a href="' . esc_url(wp_nonce_url(network_admin_url('sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to deactivate the site %s'), $blogname))), 'confirm')) . '">' . __('Deactivate') . '</a></span>';
//.........这里部分代码省略.........
示例6: array
</th>
<th> </th>
</tr>
</tfoot>
<tbody>
<?php
$status_list = array('archived' => array('site-archived', __('Archived')), 'spam' => array('site-spammed', _x('Spam', 'site')), 'deleted' => array('site-deleted', __('Deleted')), 'mature' => array('site-mature', __('Mature')));
$class = '';
foreach ($wp_list_table->items as $blog) {
if (class_exists('WP_Site') && $blog instanceof WP_Site) {
$blog = object_to_array($blog);
}
$class = 'alternate' == $class ? '' : 'alternate';
$blog_states = array();
foreach ($status_list as $status => $col) {
if (1 === get_blog_status($blog['blog_id'], $status)) {
$class = $col[0];
$blog_states[] = $col[1];
}
}
$blog_state = '';
if (!empty($blog_states)) {
$state_count = count($blog_states);
$i = 0;
$blog_state .= ' - ';
foreach ($blog_states as $state) {
++$i;
$i == $state_count ? $sep = '' : ($sep = ', ');
$blog_state .= "<span class='post-state'>{$state}{$sep}</span>";
}
}
示例7: mysql2date
?>
<td><?php
echo mysql2date(__('Y-m-d \\<\\b\\r \\/\\> g:i:s a'), $user['user_registered']);
?>
</td>
<?php
break;
case 'blogs':
$blogs = get_blogs_of_user($user['ID'], true);
?>
<td>
<?php
if (is_array($blogs)) {
foreach ((array) $blogs as $key => $val) {
echo '<a href="wpmu-blogs.php?action=editblog&id=' . $val->userblog_id . '">' . str_replace('.' . $current_site->domain, '', $val->domain . $val->path) . '</a> (<a ';
if (get_blog_status($val->userblog_id, 'spam') == 1) {
echo 'style="background-color: #f66" ';
}
echo 'target="_new" href="http://' . $val->domain . $val->path . '">' . __('View') . '</a>)<br />';
}
}
?>
</td>
<?php
break;
default:
?>
<td><?php
do_action('manage_users_custom_column', $column_name, $user['ID']);
?>
</td>
示例8: update_site_status
private function update_site_status($ids, $pref, $value)
{
if ($pref == 'archived' && $value == 1) {
$action = 'archived';
} else {
if ($pref == 'archived' && $value == 0) {
$action = 'unarchived';
} else {
if ($pref == 'deleted' && $value == 1) {
$action = 'deactivated';
} else {
if ($pref == 'deleted' && $value == 0) {
$action = 'activated';
} else {
if ($pref == 'spam' && $value == 1) {
$action = 'marked as spam';
} else {
if ($pref == 'spam' && $value == 0) {
$action = 'removed from spam';
}
}
}
}
}
}
foreach ($ids as $site_id) {
$site = $this->fetcher->get_check($site_id);
if (is_main_site($site->blog_id)) {
WP_CLI::warning("You are not allowed to change the main site.");
continue;
}
$old_value = get_blog_status($site->blog_id, $pref);
if ($value == $old_value) {
WP_CLI::warning("Site {$site->blog_id} already {$action}.");
continue;
}
update_blog_status($site->blog_id, $pref, $value);
WP_CLI::success("Site {$site->blog_id} {$action}.");
}
}
示例9: array
// Preordered.
$actions = array('edit' => '', 'backend' => '', 'activate' => '', 'deactivate' => '', 'archive' => '', 'unarchive' => '', 'spam' => '', 'unspam' => '', 'delete' => '', 'visit' => '');
$actions['edit'] = '<span class="edit"><a href="' . esc_url(admin_url('ms-sites.php?action=editblog&id=' . $blog['blog_id'])) . '">' . __('Edit') . '</a><span>';
$actions['backend'] = "<span class='backend'><a href='" . esc_url(get_admin_url($blog['blog_id'])) . "' class='edit'>" . __('Backend') . '</a></span>';
if ($current_site->blog_id != $blog['blog_id']) {
if (get_blog_status($blog['blog_id'], 'deleted') == '1') {
$actions['activate'] = '<span class="activate"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to activate the site %s'), $blogname)))) . '">' . __('Activate') . '</a></span>';
} else {
$actions['deactivate'] = '<span class="activate"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to deactivate the site %s'), $blogname)))) . '">' . __('Deactivate') . '</a></span>';
}
if (get_blog_status($blog['blog_id'], 'archived') == '1') {
$actions['unarchive'] = '<span class="archive"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to unarchive the site %s.'), $blogname)))) . '">' . __('Unarchive') . '</a></span>';
} else {
$actions['archive'] = '<span class="archive"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to archive the site %s.'), $blogname)))) . '">' . __('Archive') . '</a></span>';
}
if (get_blog_status($blog['blog_id'], 'spam') == '1') {
$actions['unspam'] = '<span class="spam"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to unspam the site %s.'), $blogname)))) . '">' . __('Not Spam') . '</a></span>';
} else {
$actions['spam'] = '<span class="spam"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to mark the site %s as spam.'), $blogname)))) . '">' . __('Spam') . '</a></span>';
}
$actions['delete'] = '<span class="delete"><a href="' . esc_url(admin_url('ms-edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode(sprintf(__('You are about to delete the site %s.'), $blogname)))) . '">' . __('Delete') . '</a></span>';
}
$actions['visit'] = "<span class='view'><a href='" . esc_url(get_home_url($blog['blog_id'])) . "' rel='permalink'>" . __('Visit') . '</a>';
$actions = array_filter($actions);
if (count($actions)) {
?>
<div class="row-actions">
<?php
echo implode(' | ', $actions);
?>
</div>
示例10: get_blog_status
<?php
echo get_blog_status(get_current_blog_id(), 'registered');
示例11: sitewide_tags_post
function sitewide_tags_post($post_id, $post)
{
global $wpdb;
if (!get_sitewide_tags_option('tags_blog_enabled')) {
return;
}
// wp_insert_category()
include_once ABSPATH . 'wp-admin/includes/admin.php';
$tags_blog_id = get_sitewide_tags_option('tags_blog_id');
if (!$tags_blog_id || $wpdb->blogid == $tags_blog_id) {
return;
}
$allowed_post_types = apply_filters('sitewide_tags_allowed_post_types', array('post' => true));
if (!$allowed_post_types[$post->post_type]) {
return;
}
$post_blog_id = $wpdb->blogid;
$blog_status = get_blog_status($post_blog_id, "public");
if ($blog_status != 1 && ($blog_status != 0 || get_sitewide_tags_option('tags_blog_public') == 1 || get_sitewide_tags_option('tags_blog_pub_check') == 0)) {
return;
}
$post->post_category = wp_get_post_categories($post_id);
foreach ($post->post_category as $c) {
$cat = get_category($c);
$cats[] = array('name' => wp_specialchars($cat->name), 'slug' => wp_specialchars($cat->slug));
}
$post->tags_input = implode(', ', wp_get_post_tags($post_id, array('fields' => 'names')));
$post->guid = $post_blog_id . '.' . $post_id;
$permalink = get_permalink($post_id);
$org_blog_id = $wpdb->blogid;
// org_blog_id
$meta_keys = apply_filters('sitewide_tags_meta_keys', get_sitewide_tags_option('tags_blog_postmeta', array()));
if (is_array($meta_keys) && count($meta_keys)) {
foreach ($meta_keys as $key) {
${$key} = get_post_meta($post->ID, $key, true);
}
}
switch_to_blog($tags_blog_id);
if (is_array($cats) && !empty($cats)) {
foreach ($cats as $t => $d) {
/* Here is where we insert the category */
wp_insert_category(array('cat_name' => $d['name'], 'category_description' => $d['name'], 'category_nicename' => $d['slug'], 'category_parent' => ''));
/* Now get the category ID to be used for the post */
$category_id[] = $wpdb->get_var("SELECT term_id FROM " . $wpdb->get_blog_prefix($tags_blog_id) . "terms WHERE slug = '" . $d['slug'] . "'");
}
}
$global_post = $wpdb->get_row("SELECT * FROM {$wpdb->posts} WHERE guid = '{$post->guid}'");
if ($post->post_status != 'publish' && is_object($global_post)) {
wp_delete_post($global_post->ID);
} else {
if ($global_post->ID != '') {
$post->ID = $global_post->ID;
// editing an old post
/* using this kind of update not simple add: fixing permalink-problems */
delete_post_meta($global_post->ID, "permalink");
if (is_array($meta_keys) && count($meta_keys)) {
foreach ($meta_keys as $key) {
delete_post_meta($global_post->ID, $key);
}
}
} else {
unset($post->ID);
// new post
}
}
if ($post->post_status == 'publish') {
$post->ping_status = 'closed';
$post->comment_status = 'closed';
/* Use the category ID in the post */
$post->post_category = $category_id;
$p = wp_insert_post($post);
add_post_meta($p, "permalink", $permalink);
add_post_meta($p, "blogid", $org_blog_id);
// org_blog_id
if (is_array($meta_keys) && count($meta_keys)) {
foreach ($meta_keys as $key) {
if (${$key}) {
add_post_meta($p, $key, ${$key});
}
}
}
}
restore_current_blog();
}
示例12: display_rows
//.........这里部分代码省略.........
?>
</strong>
<br/>
<div class="row-actions">
<span class="edit"><a href="<?php
echo esc_url(admin_url($edit_link));
?>
"><?php
_e('Edit');
?>
</a></span>
<?php
if (!in_array($user['user_login'], $super_admins)) {
?>
| <span class="delete"><a href="<?php
echo $delete = esc_url(network_admin_url(add_query_arg('_wp_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), wp_nonce_url('edit.php', 'deleteuser') . '&action=deleteuser&id=' . $user['ID'])));
?>
" class="delete"><?php
_e('Delete');
?>
</a></span>
<?php
}
?>
</div>
</td>
<?php
break;
case 'name':
?>
<td class="name column-name"><?php
echo $user['display_name'];
?>
</td>
<?php
break;
case 'email':
?>
<td class="email column-email"><a href="mailto:<?php
echo $user['user_email'];
?>
"><?php
echo $user['user_email'];
?>
</a></td>
<?php
break;
case 'registered':
if ('list' == $mode) {
$date = 'Y/m/d';
} else {
$date = 'Y/m/d \\<\\b\\r \\/\\> g:i:s a';
}
?>
<td><?php
echo mysql2date(__($date), $user['user_registered']);
?>
</td>
<?php
break;
case 'blogs':
$blogs = get_blogs_of_user($user['ID'], true);
?>
<td>
<?php
if (is_array($blogs)) {
foreach ((array) $blogs as $key => $val) {
$path = $val->path == '/' ? '' : $val->path;
echo '<a href="' . esc_url(network_admin_url('sites.php?action=editblog&id=' . $val->userblog_id)) . '">' . str_replace('.' . $current_site->domain, '', $val->domain . $path) . '</a>';
echo ' <small class="row-actions">';
// Edit
echo '<a href="' . esc_url(network_admin_url('sites.php?action=editblog&id=' . $val->userblog_id)) . '">' . __('Edit') . '</a> | ';
// View
echo '<a ';
if (get_blog_status($val->userblog_id, 'spam') == 1) {
echo 'style="background-color: #faa" ';
}
echo 'href="' . esc_url(get_home_url($val->userblog_id)) . '">' . __('View') . '</a>';
echo '</small><br />';
}
}
?>
</td>
<?php
break;
default:
?>
<td><?php
do_action('manage_users_custom_column', $column_name, $user['ID']);
?>
</td>
<?php
break;
}
}
?>
</tr>
<?php
}
}
示例13: pmpron_manage_sites_shortcode
//.........这里部分代码省略.........
</div>
</td>
</tr>
</tbody>
</table>
</form>
<?php
}
?>
<?php
if (!empty($blog_ids)) {
?>
<h3>Your Sites</h3>
<table id="pmpro_add_site" class="pmpro_checkout" width="100%" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th><?php
_e('Name');
?>
</th>
<th><?php
_e('Options');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($blog_ids as $blog_id) {
?>
<tr<?php
if (get_blog_status($blog_id, "deleted")) {
?>
class="pmpro_disabled"<?php
}
?>
>
<td>
<?php
if (get_blog_status($blog_id, "deleted")) {
echo get_blog_option($blog_id, "blogname");
} else {
?>
<a href="<?php
echo get_site_url($blog_id);
?>
"><?php
echo get_blog_option($blog_id, "blogname");
?>
</a><br />
<?php
echo get_site_url($blog_id);
?>
<?php
}
?>
</td>
<td>
<?php
if (get_blog_status($blog_id, "deleted")) {
?>
<?php
_e('(deactivated)');
示例14: array
<th> </th>
</tr>
</tfoot>
<tbody>
<?php
$status_list = array('archived' => array('site-archived', __('Archived')), 'spam' => array('site-spammed', _x('Spam', 'site')), 'deleted' => array('site-deleted', __('Deleted')), 'mature' => array('site-mature', __('Mature')));
$class = '';
?>
<?php
foreach ($wp_list_table->items as $blog) {
?>
<?php
$class = 'alternate' == $class ? '' : 'alternate';
$blog_states = array();
foreach ($status_list as $status => $col) {
if (get_blog_status($blog['blog_id'], $status) == 1) {
$class = $col[0];
$blog_states[] = $col[1];
}
}
$blog_state = '';
if (!empty($blog_states)) {
$state_count = count($blog_states);
$i = 0;
$blog_state .= ' - ';
foreach ($blog_states as $state) {
++$i;
$i == $state_count ? $sep = '' : ($sep = ', ');
$blog_state .= "<span class='post-state'>{$state}{$sep}</span>";
}
}
示例15: xpress_primary_blog_link
function xpress_primary_blog_link() {
global $xoops_config;
global $current_user;
global $blog_id;
$ret = array();
if (xpress_is_multiblog() && is_user_logged_in()){
$blog_list = get_blog_list();
$root_path = get_blog_status(1,'path');
$primary_blog_id = @$current_user->primary_blog;
if(empty($primary_blog_id)) return $ret;
$primary_path = get_blog_status($primary_blog_id,'path');
$script = str_replace($root_path, "", $primary_path);
if ($primary_blog_id !== $blog_id){
$ret['url'] = get_blogaddress_by_id($primary_blog_id);
$ret['menu_url'] = $script;
$ret['title'] = __('Your Primary Blog','xpressme');
$ret['link'] = '<a href="' . $ret['url'] . '">' . $ret['title'] . '</a>';
}
}
return $ret;
}