【问题标题】:Submit posts from users without wordpress panel提交来自没有 wordpress 面板的用户的帖子
【发布时间】:2016-12-06 03:28:59
【问题描述】:

我想创建一个用户可以提交帖子的系统。 为此,我将用户角色更改为贡献者。 而且很完美,用户可以提交帖子。 但我不喜欢用户可以访问 wordpress 面板。 我想用户从主题中的自定义用户配置文件提交他们的帖子。 我有什么功能或技巧吗?

【问题讨论】:

标签: wordpress user-roles


【解决方案1】:

有两种方法可以做到这一点: 方法一:

There are certain plugins that you can use to accomplish the task. 
The below is an example:
https://wordpress.org/plugins/user-submitted-posts/screenshots/

方法二:

You too can achieve this functionality by writing a piece of code that will insert the data in the posts table. for that you have to create a page template and create a form for that template and write code that will work on submit of the form.
Make sure the form data gets inserted into the posts table.

【讨论】:

  • 好的,步骤如下: 1:创建一个表单页面模板,其中包含所需的字段。 2:点击提交按钮尝试调用function.php中的wp_insert_post。以下链接最好地描述了如何使用 wp_insert_post 插入帖子:developer.wordpress.org/reference/functions/wp_insert_post
猜你喜欢
  • 2015-05-11
  • 1970-01-01
  • 2014-09-17
  • 2018-12-30
  • 1970-01-01
  • 2016-10-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多