Noobie here. I need to insert target="_blank" into the following php code...any suggestions would be really appreciated :-)
<?php
echo wp_kses(
do_shortcode( "[cmo_footer_social][/cmo_footer_social]" ),
array(
'ul' => array (
'class' => array()
),
'i' => array (
'class' => array()
),
'li' => array ( ),
'a' => array (
'class' => array(),
'href' => array(),
)
)
);
?>
wp_kses()
filters content and keeps only allowable HTML elements. Depending on what the shortcode [cmo_footer_social]
does, you may not need to filter the content at all (ie you may not need to use wp_kses()
?).
The second parameter is allowed HTML tags, so just add target as suggested by @chris85, but without the value.
echo wp_kses(
do_shortcode( "[cmo_footer_social][/cmo_footer_social]" ),
array(
'ul' => array (
'class' => array()
),
'i' => array (
'class' => array()
),
'li' => array ( ),
'a' => array (
'class' => array(),
'href' => array(),
'target' => array()
)
)
);