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

    (@steveindzine)

    I just tried the obsolete wpmem_default_text_strings filter and this is working as expected.

    Steve

    Plugin Author Chad Butler

    (@cbutlerjr)

    Thanks for posting this, Steve. It’s not actually the filter hook that has a problem. It was that the example in the documentation was incorrect.

    The difference between the new and the old hooks is that the new one passes all of the strings into the filter, and expects them all to return. The old one just merges any changes with the defaults.

    So with the new hook, if you redefine the array, yes, you’d have to include every value (which is the way the example was). But what you should do is just change the specific keys you want to change, without redefining the entire array (which is what the example shows now).

    The example given on the documentation was probably copied from the documentation for the old filter and not changed. It defined an array setting two key/value pairs and returned only those.

    I’ve updated the example accordingly. Sorry about the confusion.

    • This reply was modified 4 years, 9 months ago by Chad Butler.
    • This reply was modified 4 years, 9 months ago by Chad Butler.
    Thread Starter steveindzine

    (@steveindzine)

    Hi Chad,

    No problem, that works now, thank you for updating the docs.

    Steve

    Plugin Author Chad Butler

    (@cbutlerjr)

    thank you for updating the docs.

    No problem! Thanks for you question, as that is what alerted me to the mistake.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wpmem_default_text filter help’ is closed to new replies.