Make WordPress Core


Ignore:
Timestamp:
07/24/2004 03:22:49 AM (22 years ago)
Author:
rboren
Message:

If the sanitized title is empty, fallback to the post ID for the nicename. http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000116

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-formatting.php

    r1435 r1481  
    11<?php
    22
    3 add_action('sanitize_title', 'sanitize_title_with_dashes');
     3add_filter('sanitize_title', 'sanitize_title_with_dashes');
    44
    55function wptexturize($text) {
     
    120120}
    121121
    122 function sanitize_title($title) {
    123     $title = do_action('sanitize_title', $title);
     122function sanitize_title($title, $fallback_title = '') {
     123    $title = apply_filters('sanitize_title', $title);
     124
     125    if (empty($title)) {
     126        $title = $fallback_title;
     127    }
    124128
    125129    return $title;
Note: See TracChangeset for help on using the changeset viewer.