WordPress post_content gets deleted in cron after wp_update_post
WooCommerce stock quantity update by using wc_update_product_stock( $postId, $quantity ) used to remove post_content, so I put quantity update before the post_content update.
Well, you could do it this way: if ( 101 === get_current_blog_id() ) { add_filter( ‘wp_kses_allowed_html’, allow_iframes_for_editor, 1 ); } (Note: edited to use the get_current_blog_id() ; see https://developer.wordpress.org/reference/functions/get_current_blog_id/ But you should consider Tom’s comment as a warning against doing this.
There are no signs that this was accidental or a bug, and has been in core for many years. This is because of this set of lines at the end of the main loop of safecss_filter_attr: // Only add the CSS part if it passes the regex check. if ( $allow_css ) { if ( … Read more
Problem solved with this gist https://gist.github.com/4329321 . [notexturize]–[/notexturize] worked like a charm.
Ok This Thread did helped me a LOT! So now my function works (i can embeld HTML5 videos) and it looks like this: function validate_setting($plugin_options){ global $allowedtags; $allowedtags = array( ‘a’ => array( ‘href’ => array (), ‘title’ => array ()), ‘b’ => array( ‘style’=> array(), ), ); $allowedtags[‘video’] = array( ‘width’ => true, ‘height’ … Read more
You need to use the kses_allowed_protocols filter: function wpse_allow_sms_protocol( $protocols ) { $protocols[] = ‘sms’; return $protocols; } add_filter( ‘kses_allowed_protocols’, ‘wpse_allow_sms_protocol’ );
The > entity is probably being filtered by “esc_textarea”. You can read more about “esc_” below: http://codex.wordpress.org/Data_Validation
According to the codex, you should define your wp_kses list of allowed html elements as below with array() instead of true $allowed_html = array( ‘input’ => array( ‘type’ => array(), ‘name’ => array(), ‘value’ => array(), ‘checked’ => array() ), );
WooCommerce stock quantity update by using wc_update_product_stock( $postId, $quantity ) used to remove post_content, so I put quantity update before the post_content update.
The question changed somewhat to what was asked – however thought this might be useful if some other mug gets carried away with react in their save functions. So – this was solved as @Tom J Nowell suggested and a PHP callback was made instead to allow the save instead. I deprecated the block and … Read more
When you use the deprecated CUSTOM_TAGS constant, you have to define the variables WordPress would normally create in kses.php at the top. If you do not then you will encounter this issue. /** * Specifies the default allowable HTML tags. * * Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The * {@see … Read more