这是关于stackoverflow的一个问题的复述,已提交到此网站:
我的客户想在他的新WP网站上创建一个表单,填写并提交后将提交给他的管理帖子队列进行审批,如果他批准,则会在他的网站上的“博客”(实际上是一堆吉他般的标签)中发布。表单将是自定义的,并具有自定义字段。下面是表单,但在我刷新之前是旧设计的。
那么,这有多难呢?他不希望它出现在我开始做的WP管理面板中,而是出现在像/贡献这样的页面中
这是关于stackoverflow的一个问题的复述,已提交到此网站:
我的客户想在他的新WP网站上创建一个表单,填写并提交后将提交给他的管理帖子队列进行审批,如果他批准,则会在他的网站上的“博客”(实际上是一堆吉他般的标签)中发布。表单将是自定义的,并具有自定义字段。下面是表单,但在我刷新之前是旧设计的。
那么,这有多难呢?他不希望它出现在我开始做的WP管理面板中,而是出现在像/贡献这样的页面中
您可以使用插件进行前端发布:
或者您可以自己创建表单 <!-- New Post Form -->
<div id="postbox">
<form id="new_post" name="new_post" method="post" action="">
<p><label for="title">Title</label><br />
<input type="text" id="title" value="" tabindex="1" size="20" name="title" />
</p>
<p><label for="description">Description</label><br />
<textarea id="description" tabindex="3" name="description" cols="50" rows="6"></textarea>
</p>
<p><?php wp_dropdown_categories( \'show_option_none=Category&tab_index=4&taxonomy=category\' ); ?></p>
<p><label for="post_tags">Tags</label>
<input type="text" value="" tabindex="5" size="16" name="post_tags" id="post_tags" /></p>
<p align="right"><input type="submit" value="Publish" tabindex="6" id="submit" name="submit" /></p>
<input type="hidden" name="action" value="new_post" />
<?php wp_nonce_field( \'new-post\' ); ?>
</form>
</div>
<!--// New Post Form -->
并对其进行处理 if( \'POST\' == $_SERVER[\'REQUEST_METHOD\'] && !empty( $_POST[\'action\'] ) && ($_POST[\'action\']== \'new_post\')) {
if (isset ($_POST[\'title\'])) {
$title = $_POST[\'title\'];
} else {
echo \'Please enter a title\';
}
if (isset ($_POST[\'description\'])) {
$description = $_POST[\'description\'];
} else {
echo \'Please enter the content\';
}
$tags = $_POST[\'post_tags\'];
$new_post = array(
\'post_title\' => $title,
\'post_content\' => $description,
\'post_category\' => $_POST[\'cat\'],
\'tags_input\' => $tags,
\'post_status\' => \'draft\'
);
wp_insert_post($new_post);
}
并确保检查表单字段的nonce和清理。 if( \'POST\' == $_SERVER[\'REQUEST_METHOD\'] && !empty( $_POST[\'action\'] ) && ($_POST[\'action\']== \'new_post\')) {
$has_errors = false;
if (isset ($_POST[\'title\'])) {
$title = $_POST[\'title\'];
} else {
echo \'Please enter a title\';
$has_errors = true;
}
if (isset ($_POST[\'performer\'])) {
$performer = $_POST[\'preformer\'];
} else {
echo \'Please enter a performer\';
$has_errors = true;
}
if (isset ($_POST[\'composer\'])) {
$composer = $_POST[\'composer\'];
} else {
echo \'Please enter a composer\';
$has_errors = true;
}
if (isset ($_POST[\'tablature\'])) {
$tablature = $_POST[\'tablature\'];
} else {
echo \'Please enter the content\';
$has_errors = true;
}
$tags = $_POST[\'post_tags\'];
if (!$has_errors){
//save <title> by: <preformer>
$title .= " by: " .$performer;
//save Composed by: <composer> Performed by: <performer> <tablature>
$content = "<h4>Composed by: ". $composer."</h4><br/><h4>Performed by: ".$performer."</h4><br/>".$tablature;
$new_post = array(
\'post_title\' => $title,
\'post_content\' => $content,
\'post_category\' => $_POST[\'cat\'],
\'tags_input\' => $tags,
\'post_status\' => \'draft\'
);
$pid = wp_insert_post($new_post);
//save email and submmiter as post meta in custom fields
update_post_meta($pid, \'submiter_email\', urldecode($_POST[\'email\']));
update_post_meta($pid, \'submiter_name\', urldecode($_POST[\'submitter\']));
}
}
我还没有查出来,但是this plugin 可能会向您展示如何接近它。Here is another one, 或者您可以创建一个名为“匿名”的特殊用户,并授予他们“作者”权限。在授予他们编辑或删除权限时,您可能需要小心。
首先,我不能使用Trac,这是WP-dev社区用来跟踪bug的。然而,我的咨询公司正在使用WordPress作为CMS来处理几乎所有的事情——产品信息、销售门户、新闻网站等。我想将其设置为将我们的插件列表与bug追踪器集成在一起。。。现在,我已经将Flyspore设置为一个独立的bug追踪器。它工作正常,但它是一个单独的域(http://bt.jumping-duck.com) 使其与WordPress保持分离。但我希望能够在WP页面上列出我们插件的数量。理想情况下,用户还可以直接从插件信息页面提交bug