Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter lakong

    (@lakong)

    Thanks for taking the time to answer this Roger. I actually saw the same post but the functions work fine outside of WP. The issue, I believe, is in the order that WP acts on the filters. I believe it first does the content filter and then the category filter. It doesn’t matter what order I reference them with the add_filter constructs. I think I’ll need to use a different hook for the content. Perhaps one of the action hooks.

    Thread Starter lakong

    (@lakong)

    bump

    Thread Starter lakong

    (@lakong)

    Roger, oops, I made a mistake in the example. Sorry. The first function will definitely assign $cat_holder to $replaced_cat like:

    $replaced_cat = $cat_holder[0];

    So the issue is that the value of $replaced_cat is not available to the second function. It does work outside of the plugin if I I call each function in sequence, but it does not work in WP when they are called in order via the two add_filter calls.

    Thread Starter lakong

    (@lakong)

    I solved it. The function is being passed an array and you must return an array.

Viewing 4 replies - 1 through 4 (of 4 total)