• Resolved controvi

    (@controvi)


    Recently the company I work for wanted to implement different custom generated block graph data.
    I crated filters for it and it seems like the Yoast plugin will not take multiple Filter bound Callbacks that are set.

    I did a few tests and in no way was I able to fix the issue.

    To show what I did.

    • setup a class necessary for the added graph piece.
    • added the filter calling a callback function to add the instance of the piece to the pieces array that comes with the filter.
    • Tested if it works. Result: CHECK
    • Added a second filter for some test data on the same page.
    • Testing if it works. Result: only the second added filter took affect.
    • Tried adding a third filter
    • Tested if it works. Result: only the third filter took affect.

    I checked the wp_filter global to see if maybe 1 filter was overwriting the others but this was not the case and I saw all the added callbacks nicely layed out.

    After lots of testing and debugging I can confirm that doing the same with adding multiple filters for example on the wp_title works just fine.

    As you can see, apparently it seems like the Yoast plugin is only reading the final item in the callback array instead of looping through it in order of priority.

    Any one or the devs of Yoast have any idea what is going on?

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Structured data through multiple bound callbacks in filter.’ is closed to new replies.