I assume you are talking about a link that is entered in the “desc” field stripping tags from your HTML code.
I’ve run in to this problem myself, and it is difficult to deal with as there is a lack of action/filters to fix the problem.
The “desc” field is sanitized via wp_kses, allowing only tags in the global $allowedtags variable. Unfortunately this variable is very strict, and removes most attributes, including “target”.
This plugin should not sanitize the field at all. Why would you sanitize code that is hard coded into the script? Sanitize user input, not source code…!
Anyway, the code below should help. It temporarily replaces the $allowtags “whitelist” with a more lineant variant, $allowedposttags. Many more elements and attributes are trusted here, so you will have more freedom.
Just drop this code in to your functions.php file, then you can use the “target” attribute on your links. This code only runs on the options framework page. It starts when the page options framework section starts, and stops when options framework is done. So other plugins should not be affected.
function rad_of_add_better_kses() {
add_action('optionsframework_after', 'rad_of_remove_better_kses'); // Will remove this hook when OF is done
// Hold on to $allowedtags in another variable, temporarily replacing the original value while Options Framework is displaying the interface
global $allowedtags, $allowedposttags, $rad_temp_allowedtags;
$rad_temp_allowedtags = $allowedtags;
$allowedtags = $allowedposttags;
}
function rad_of_remove_better_kses() {
// Options framework is done displaying the interface, reset $allowedtags as to not interfere with other plugins.
global $allowedtags, $rad_temp_allowedtags;
$allowedtags = $rad_temp_allowedtags;
}
add_action('appearance_page_options-framework', 'rad_of_add_better_kses');