1. Home
  2. Developer
  3. Code Snippets
  4. Adjust allowed tags in Job descriptions

Adjust allowed tags in Job descriptions

Filter: matador_the_jobs_description_allowed_tags

Use this control which HTML elements are permitted in the imported descriptions. Any HTML elements not included will not have the desired impact on the layout and styling of the job description. This is passed into a wp_kses call as the second parm

apply_filters( 'matador_the_jobs_description_allowed_tags', array(    'a'      => array(       'href'  => array(),       'title' => array(),    ),  
'br'     => array(),    
'em'     => array(),    
'strong' => array(),    
'b'      => array(),    
'i'      => array(),    
'p'      => array(),    
'div'    => array(),    
'table'  => array(),    
'thead'  => array(),    
'tbody'  => array(),    
'tr'     => array(),    
'th'     => array(),    
'td'     => array(),    
'span'   => array(),    
'h1'     => array(),    
'h2'     => array(),    
'h3'     => array(),    
'h4'     => array(),    
'h5'     => array(),    
'h6'     => array(),    
'ul'     => array(),    
'ol'     => array(),    
'li'     => array(), 
) );

Example:

add_filter( 'matador_the_jobs_description_allowed_tags', 'prefix_jobs_allowed_tags' );

function prefix_jobs_allowed_tags( $allow_html ){

   $allow_htm['hr'] = arrauy();

   return $allow_html
}
add_filter( 'matador_the_jobs_description_allowed_tags', 'prefix_jobs_allowed_tags' ); 
function prefix_jobs_allowed_tags( $allow_html ){
    $allow_htm['hr'] = arrauy();   

    return $allow_html 
}

You can return the output of wp_kses_allowed_html( 'post' ) https://codex.wordpress.org/Function_Reference/wp_kses_allowed_html to allow all supported in posts

Updated on September 25, 2023
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support