function link_category_id() { global $wpdb, $wp_db_version; $cat_id = get_option('feedwordpress_cat_id'); // If we don't yet have the category ID stored, search by name if (!$cat_id) { $cat_id = FeedWordPressCompatibility::link_category_id(DEFAULT_SYNDICATION_CATEGORY); if ($cat_id) { // We found it; let's stamp it. update_option('feedwordpress_cat_id', $cat_id); } // If we *do* have the category ID stored, verify that it exists } else { $cat_id = FeedWordPressCompatibility::link_category_id((int) $cat_id, 'cat_id'); } // If we could not find an appropriate link category, // make a new one for ourselves. if (!$cat_id) { $cat_id = FeedWordPressCompatibility::insert_link_category(DEFAULT_SYNDICATION_CATEGORY); if (!is_wp_error($cat_id)) { // Stamp it update_option('feedwordpress_cat_id', $cat_id); } } return $cat_id; }