Make WordPress Core


Ignore:
Timestamp:
03/31/2007 06:16:12 AM (18 years ago)
Author:
matt
Message:

All the query stuff we need for tag= URLs to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r5119 r5149  
    207207}
    208208
     209function get_category_by_slug( $slug  ) {
     210    global $wpdb;
     211    $slug = sanitize_title( $slug );
     212    if ( empty( $slug ) )
     213        return false;
     214    $category = $wpdb->get_var( "SELECT * FROM $wpdb->categories WHERE category_nicename = '$slug' " );
     215    return get_category( $category );
     216}
     217
    209218// Get the ID of a category from its name
    210219function get_cat_ID($cat_name='General') {
Note: See TracChangeset for help on using the changeset viewer.