0

i wonder if there's a relatively easy solution to this :

i have added a custom field to the categories, which in turn gets displayed in the right hand table under its own column name. (essentailly it's a "this category is the default" field.

all works fine, when editing a category. however, when adding a category with this field(checkbox) selected , all other categories update to "we are not the default anymore". the db also stores these new values as required.

however, as adding a new category is invoked via ajax, the category table on the right hand side does not refresh to reflect these new settings. (only when actually refreshing the whole page , can i actually see the current values)

question is therefore, is there a hook i can plug in to that automatically forces a page refresh after a new category has been added (or better still, just to refresh the table on the right ), or do i actually run a seperate ajax call to get the updated values and update that table ?

1
  • Hi and welcome! Would be better if you showed what code are you working with. Some screenshots would be useful too. You can edit your Question whenever needed. Please, mind the title cases of your sentences too, thanks!
    – brasofilo
    Commented Jan 14, 2013 at 19:02

1 Answer 1

0

actually I managed to solve this differently (and more elegantly).

However, even this new approach had me banging my head against the wall for way too many hours as my option table didn't get updated properly, when doing a bulk delete of more than one category. Turns out I made two - glaring mistakes .

a) i wrapped a function i needed in when updating the option table ajax into

if(!defined('DOING_AJAX') || !DOING_AJAX){ //add_action....etc }

which didnt help (DOH)

b)I also managed to include the function that validates update_option() with require_once() instead of just require() so when using update_option() in a loop , it just gave up.

Oh well, maybe someone reads this who's done the same due to lack of sleep/coffee....

Anyway, thanks for trying to help. Next time I'll include code to start off with...

cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.