本文整理汇总了PHP中dropdown_categories函数的典型用法代码示例。如果您正苦于以下问题:PHP dropdown_categories函数的具体用法?PHP dropdown_categories怎么用?PHP dropdown_categories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dropdown_categories函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLoadEvent
// focus on first input field
document.post.title.focus();
}
addLoadEvent(focusit);
</script>
<?php endif; ?>
<div id="poststuff">
<div id="moremeta">
<div id="grabit" class="dbx-group">
<fieldset id="categorydiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
<div class="dbx-content">
<p id="jaxcat"></p>
<ul id="categorychecklist"><?php dropdown_categories(); ?></ul></div>
</fieldset>
<fieldset id="commentstatusdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
<div class="dbx-content">
<input name="advanced_view" type="hidden" value="1" />
<label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label>
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
</div>
</fieldset>
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post Password') ?></h3>
示例2: _e
}
?>
<div id="poststuff">
<div id="moremeta">
<div id="grabit" class="dbx-group">
<fieldset id="categorydiv" class="dbx-box">
<h3 class="dbx-handle"><?php
_e('Categories');
?>
</h3>
<div class="dbx-content">
<p id="jaxcat"></p>
<ul id="categorychecklist"><?php
dropdown_categories();
?>
</ul></div>
</fieldset>
<fieldset id="commentstatusdiv" class="dbx-box">
<h3 class="dbx-handle"><?php
_e('Discussion');
?>
</h3>
<div class="dbx-content">
<input name="advanced_view" type="hidden" value="1" />
<label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php
checked($post->comment_status, 'open');
?>
示例3: focusit
function focusit() { // focus on first input field
document.getElementById('title').focus();
}
addLoadEvent(focusit);
//-->
</script>
<div id="poststuff">
<fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend>
<div><?php dropdown_categories($post->post_category); ?></div>
</fieldset>
<br />
<fieldset id="postdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>
<?php the_quicktags(); ?>
<?php
$rows = get_option('default_post_edit_rows');
if (($rows < 3) || ($rows > 100)) {
$rows = 10;
}
?>
<div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $post->post_content ?></textarea></div>
</fieldset>
示例4: _e
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
</fieldset>
<fieldset id="slugdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post slug') ?></h3>
<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
</fieldset>
<fieldset id="categorydiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
<div class="dbx-content">
<p id="jaxcat"></p>
<div id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></div></div>
</fieldset>
<fieldset id="poststatusdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post Status') ?></h3>
<div class="dbx-content"><?php if ( current_user_can('publish_posts') ) : ?>
<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post->post_status, 'publish'); ?> /> <?php _e('Published') ?></label>
<?php endif; ?>
<label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post->post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="radio" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Private') ?></label></div>
</fieldset>
<?php if ( current_user_can('edit_posts') ) : ?>
<fieldset id="posttimestampdiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Post Timestamp'); ?>:</h3>
<div class="dbx-content"><?php touch_time(($action == 'edit')); ?></div>
示例5: _e
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php
echo $edited_post_title;
?>
" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php
_e('Help on categories');
?>
"><?php
_e('Categories');
?>
</a></legend>
<div><?php
dropdown_categories($default_post_cat);
?>
</div>
</fieldset>
<br />
<fieldset id="postdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php
_e('Help with post field');
?>
"><?php
_e('Post');
?>
</a></legend>
<?php
the_quicktags();
示例6: _e
</h3>
<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php
echo $post->post_name;
?>
" /></div>
</fieldset>
<fieldset id="categorydiv" class="dbx-box">
<h3 class="dbx-handle"><?php
_e('Categories');
?>
</h3>
<div class="dbx-content">
<p id="jaxcat"></p>
<div id="categorychecklist"><?php
dropdown_categories(get_settings('default_category'));
?>
</div></div>
</fieldset>
<fieldset class="dbx-box">
<h3 class="dbx-handle"><?php
_e('Post Status');
?>
</h3>
<div class="dbx-content"><?php
if (current_user_can('publish_posts')) {
?>
<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php
checked($post->post_status, 'publish');
?>
示例7: get_category
if ($parent) {
// Do these all at once in a second
continue;
}
$category = get_category($cat_id);
ob_start();
wp_category_checklist(0, $cat_id, $checked_categories, $popular_ids);
$data = ob_get_contents();
ob_end_clean();
$x->add(array('what' => 'category', 'id' => $cat_id, 'data' => $data, 'position' => -1));
}
if ($parent) {
// Foncy - replace the parent and all its children
$parent = get_category($parent);
ob_start();
dropdown_categories(0, $parent);
$data = ob_get_contents();
ob_end_clean();
$x->add(array('what' => 'category', 'id' => $parent->term_id, 'old_id' => $parent->term_id, 'data' => $data, 'position' => -1));
}
$x->send();
break;
case 'add-link-category':
// On the Fly
check_ajax_referer($action);
if (!current_user_can('manage_categories')) {
die('-1');
}
$names = explode(',', $_POST['newcat']);
$x = new WP_Ajax_Response();
foreach ($names as $cat_name) {
示例8: attribute_escape
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php
echo attribute_escape($post->post_title);
?>
" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php
_e('Help on categories');
?>
"><?php
_e('Categories');
?>
</a></legend>
<div><?php
dropdown_categories($post->post_category);
?>
</div>
</fieldset>
<br />
<fieldset id="postdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php
_e('Help with post field');
?>
"><?php
_e('Post');
?>
</a></legend>
<?php
$rows = get_option('default_post_edit_rows');
示例9: dropdown_categories
width: 90%;
}
</style>
</head>
<body id="sidebar">
<h1 id="wphead"><a href="http://wordpress.org" rel="external">WordPress</a></h1>
<form name="post" action="post.php" method="POST">
<div><input type="hidden" name="action" value="post" />
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="mode" value="sidebar" />
<p>Title:
<input type="text" name="post_title" size="20" tabindex="1" style="width: 100%;" />
</p>
<p>Categories:
<span class="sidebar-categories">
<?php dropdown_categories(); ?>
</span>
</p>
<p>
Post:
<textarea rows="8" cols="12" style="width: 100%" name="content" tabindex="2"></textarea>
</p>
<p>
<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="Save as Draft" />
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="Publish" />
</p>
</div>
</form>
</body>
示例10: ame_custom_column_category_actions
/**
* Adds content to the modified 'Category' column on the post management view
*
* @since 1.2.0
* @author scripts@schloebe.de
*
* @param string
* @param int
*/
function ame_custom_column_category_actions($ame_column_name, $ame_id)
{
global $wpdb, $locale;
$wp_version = !isset($wp_version) ? get_bloginfo('version') : $wp_version;
if ($ame_column_name == 'ame_cat_actions') {
$categories = get_the_category($ame_id);
$post_cats = "";
if (!empty($categories)) {
$out = array();
foreach ($categories as $c) {
$out[] = "<a href='edit.php?category_name={$c->slug}'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
}
$ame_post_cats .= join(', ', $out);
} else {
$ame_post_cats .= __('Uncategorized');
}
if (current_user_can('edit_post', $ame_id)) {
?>
<div id="categorychoosewrap<?php
echo $ame_id;
?>
" style="width:300px;height:215px;overflow:auto;display:none;">
<div id="categorychoose<?php
echo $ame_id;
?>
" class="categorydiv">
<strong><a href="javascript:void(0);" onclick="ame_check_all(<?php
echo $ame_id;
?>
, true);"><?php
_e('Check All');
?>
</a></strong> | <strong><a href="javascript:void(0);" onclick="ame_check_all(<?php
echo $ame_id;
?>
, false);"><?php
_e('Uncheck All');
?>
</a></strong>
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear" style="height:165px;overflow:auto;">
<?php
if (version_compare($wp_version, '2.5.1', '>=')) {
wp_category_checklist($ame_id);
} elseif (version_compare($wp_version, '2.5', '=')) {
dropdown_categories(get_settings('default_category'));
}
?>
</ul>
<div style="text-align:center;"><input type="button" value="<?php
_e('Save');
?>
" class="button-primary" onclick="ame_ajax_save_categories(<?php
echo $ame_id;
?>
);return false;" /> <input type="button" value="<?php
_e('Cancel');
?>
" class="button" onclick="tb_remove();" /></div>
</div>
</div>
<?php
}
echo '<span id="ame_category' . $ame_id . '">' . $ame_post_cats . '</span> ';
if (current_user_can('edit_post', $ame_id)) {
echo '<a class="thickbox" id="thickboxlink' . $ame_id . '" href="#TB_inline?height=215&width=300&inlineId=categorychoosewrap' . $ame_id . '&modal=true" title="' . __('Edit') . '"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'edit_small.gif" border="0" alt="' . __('Edit') . '" title="' . __('Edit') . '" /></a>';
}
}
}
示例11: _e
// focus on first input field
document.getElementById('title').focus();
}
window.onload = focusit;
//-->
</script>
<div id="poststuff">
<fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend>
<div><?php dropdown_categories($default_post_cat); ?></div>
</fieldset>
<br />
<fieldset id="postdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>
<?php the_quicktags(); ?>
<?php
$rows = get_settings('default_post_edit_rows');
if (($rows < 3) || ($rows > 100)) {
$rows = 10;
}
?>
<div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $content ?></textarea></div>
</fieldset>
示例12: _e
// focus on first input field
document.post.title.focus();
}
window.onload = focusit;
//-->
</script>
<?php endif; ?>
<div id="poststuff">
<fieldset id="titlediv">
<legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
</fieldset>
<fieldset id="categorydiv">
<legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend>
<div><?php dropdown_categories(get_settings('default_category')); ?></div>
</fieldset>
<fieldset id="commentstatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#comments" title="<?php _e('Help on comment status') ?>"><?php _e('Discussion') ?></a></legend>
<div>
<input name="advanced_view" type="hidden" value="1" />
<label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label>
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
</div>
</fieldset>
<fieldset id="postpassworddiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="<?php _e('Help on post password') ?>"><?php _e('Post Password') ?></a></legend>
<div><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post_password ?>" /></div>