Wordpress:使用wp_insert_post时post_content的问题

时间:2014-03-12 11:28:41

标签: wordpress

我有一个非常奇怪的问题,我非常感谢你的帮助。

当用户提交帖子时,我正在使用wp_insert_post。当我提交表单(即wordpress网站的管理员)时,它工作正常,但当我尝试与不同的用户(即不同的电子邮件,而不是wordpress网站的管理员)相同的事情,它只显示部分内容我在post_content字段中使用过。

我的代码:

$my_post = array(
'post_title'    => 'My bet',
'post_content'  => '<form action="" method="post" id=form_id>' . 'bet ID: ' . '<input readonly id=betid     type=text value=' . $bet_id . '>' . '<input id=url name=urlpath type=hidden value=>' . '</form>' ."\r\n match: " . '<span id=match>' . $_POST[event] . '</span>' . "\r\n" . $current_user->user_login . "'s Pick: " . $_POST[bet] . '</span>' . '<span id=friends>' . '</span>' ."\r\n Amount: " . '<span id=amount>' . $_POST[amount] . '</span>' . "<?php include('wp-content/themes/twentyfourteen/test.php') ?>"
'post_status'   => 'publish');

当为wordpress管理员用户执行(用户ID = 1)时,它可以正常工作。当它为任何其他用户执行时(用户ID!= 1)它没有显示表单的输入字段,更重要的是,不包括我已经包含的test.php。

0 个答案:

没有答案