I am pulling info from the excerpt of a custom post type into a 3rd party application. I need to be able to add line breaks and for them to be saved in the database. If my user switches to "visual" from "text" and saves the post, the
tags are stripped out.
My solution was to disable the use of the rich text editor for my custom post type. Solution was from user @biziclop here; Is it possible to remove WYSIWYG for a certain Custom Post Type?
add_filter('user_can_richedit', 'disable_wyswyg_for_custom_post_type');
function disable_wyswyg_for_custom_post_type( $default ){
if( get_post_type() === 'custom-post-type') return false;
return $default;
}
I need to leave the WYSIWYG tools for the main post content. Reading the codex, there are no parameters for the user_can_richedit function: https://codex.wordpress.org/Function_Reference/user_can_richedit
Is there a way to modify my filter to only target the excerpt?
Thank you in advance!