There has been a very strange situation, is in WordPress can not add video code, specifically in the background editor text mode after adding video code, switch to the visual can see the video frame, but save the video code message.
Careful observation reveals that authors cannot add, while editors and administrators can add.
No appetite, first of all. Solution: To put it simply, install a plugin "User Role Editor", the "Do not filter HTML tags" under the role of the author Hook.
Here is the toss-up process:
1. Debug, find the following sequence of code calls:
Wp_update_post->
Wp_insert_post->
Sanitize_post->
Sanitize_post_field->
2.< span="">
< span="">
< span="">Content_save_pre.
< span="">
Wp_filter_post_kses ');.
< span="">
< span="">
function Kses_init () {
Kses_remove_filters ();
if (current_user_can (' unfiltered_html ') = = False)
Kses_init_filters ();
}
Add_action (' init ', ' kses_init ');
Add_action (' Set_current_user ', ' kses_init ');
At this time the discovery is belong to the current user does not have unfilter_html this permission.
Solution Solutions
1. Try to get rid of this wp_filter_post_kses using function Remove_filter, but there is a add_filter and remove_filter relationship problem, but I add the place remove_ Filter even before add_filter.
This way, even if you find a clever place to add the remove, too dependent on this relationship, to protect no one out of great trouble.
2. Directly to the user to assign pre-unfilter_html permissions, this is a disadvantage is to Kses_init_filters in a series of functions are deleted. Considering that this is their own blog, the author is a number of designated people, and this solution is easy to understand, not so much around, decided to use this method.
WordPress is really powerful, and really enough to toss people.
http://www.bkjia.com/PHPjc/440311.html www.bkjia.com true http://www.bkjia.com/PHPjc/440311.html techarticle There has been a very strange situation, that is, in WordPress can not add video code, specifically in the background editor text mode after adding video code, switch to the visualization can see the normal ...