Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




sanitize_title [ WordPress Function ]

sanitize_title ( $title, $fallback_title = '', $context = 'save' )
Parameters:
  • (string) $title The string to be sanitized.
  • (string) $fallback_title Optional. A title to use if $title is empty.
  • (string) $context Optional. The operation for which the string is sanitized
Returns:
  • (string) The sanitized string.
Defined at:



Sanitizes title or use fallback title.

Specifically, HTML and PHP tags are stripped. Further actions can be added via the plugin API. If $title is empty and $fallback_title is set, the latter will be used.

Source


<?php
function sanitize_title($title$fallback_title ''$context 'save') {
    
$raw_title $title;

    if ( 
'save' == $context )
        
$title remove_accents($title);

    
$title apply_filters('sanitize_title'$title$raw_title$context);

    if ( 
'' === $title || false === $title )
        
$title $fallback_title;

    return 
$title;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics