admin管理员组文章数量:1023282
If i insert a trigger for wp_posts table, wordpress make me impossible to publish posts,forums,articles.
And get error: "You don't have permission for publish".
How it should bee(it's without trigger on db)
Error below:
trigger code:
CREATE TRIGGER added_new_forum
AFTER INSERT ON wp_posts FOR EACH ROW BEGIN
IF(post_type='forum' AND post_status='publish') THEN
INSERT INTO wp_posts(ID,post_author,post_date,post_date_gmt,post_content,post_title,post_excerpt,post_status,comment_status,ping_status,post_password,post_name,to_ping,pinged,post_modified,post_modified_gmt,post_content_filtered,post_parent,guid,menu_order,post_type,post_mime_type,comment_count) VALUES(NEW.ID+5,NEW.post_author,NEW.post_date,NEW.post_date_gmt,NEW.post_content,NEW.post_title,NEW.post_excerpt,NEW.post_status,NEWment_status,NEW.ping_status,NEW.post_password,NEW.post_name,NEW.to_ping,NEW.pinged,NEW.post_modified,NEW.post_modified_gmt,NEW.post_content_filtered,NEW.post_parent,NEW.guid,NEW.menu_order,NEW.post_type,NEW.post_mime_type,NEWment_count); END IF;
If i insert a trigger for wp_posts table, wordpress make me impossible to publish posts,forums,articles.
And get error: "You don't have permission for publish".
How it should bee(it's without trigger on db)
Error below:
trigger code:
CREATE TRIGGER added_new_forum
AFTER INSERT ON wp_posts FOR EACH ROW BEGIN
IF(post_type='forum' AND post_status='publish') THEN
INSERT INTO wp_posts(ID,post_author,post_date,post_date_gmt,post_content,post_title,post_excerpt,post_status,comment_status,ping_status,post_password,post_name,to_ping,pinged,post_modified,post_modified_gmt,post_content_filtered,post_parent,guid,menu_order,post_type,post_mime_type,comment_count) VALUES(NEW.ID+5,NEW.post_author,NEW.post_date,NEW.post_date_gmt,NEW.post_content,NEW.post_title,NEW.post_excerpt,NEW.post_status,NEWment_status,NEW.ping_status,NEW.post_password,NEW.post_name,NEW.to_ping,NEW.pinged,NEW.post_modified,NEW.post_modified_gmt,NEW.post_content_filtered,NEW.post_parent,NEW.guid,NEW.menu_order,NEW.post_type,NEW.post_mime_type,NEWment_count); END IF;
本文标签: postsTrigger on DB make problem on wordpress
版权声明:本文标题:posts - Trigger on DB make problem on wordpress? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745516839a2154106.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论