wp_kses enable all attributes of specific tags

I’m using wp_kses to render a string containing an img tag, but it has some dynamic attributes also, I know I can define tag with attributes like this

                       echo wp_kses( $img_tag_string, array(
                            'img' => array(
                                'src' => array(),
                                'class' => array(),
                                'alt' => array(),
                                'title' => array(),
                            ),
                        ) );

But there are some other attributes also like width, height. Is there any way I can define just img tag and it can contain any attributes?

Read more here: wp_kses enable all attributes of specific tags

Leave a Reply

Your email address will not be published. Required fields are marked *