• I’m trying to write a function which manipulates certain categories prior to saving. I assume I should use the filter: category_save_pre

    I would like to write a function which tests for a certain category and if it finds it I will save a different category under certain circumstances. I assume if I use:

    add_filter(‘category_save_pre’,’sb_change_category’);

    Then my function will be passed a coma-delimited list of ID #’s and I can return a coma-delimited list of ID #’s. However, it doesn’t appear to work. For example, if I simply write a function like this:

    function sb_change_category($cat_holder)
    {
    $cat_holder = ‘3’;
    return $cat_holder;
    }

    My posts will be saved as uncategorized. Of course I don’t want to just change all of my categories to category 3, but nothing seemed to work so I tried to see if I can get anything to work.

    Any help will be appreciated.

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘question on category_save_pre function’ is closed to new replies.