Support » Developing with WordPress » Filter/hook to parse / modify author Biographical Info

  • Resolved markisu72

    (@markisu72)


    Hi guys,

    I am trying to achieve the following:

    On a blog page, the author box is being shown and I want to modify the biographical info before rendering (that is: I want to replace/add certain text).

    So, the idea is: the authors maintain their bio by themselves but some info is being added on-the-fly upon rendering.

    I have to admit that I am a beginner in WP coding but I already used filters to do some customisation.

    In that particular case I tried to find some hints how to do it but without success.

    Can someone give me some skeleton which hooks in correctly into which I can place my code?

    That I would very much appreciated – no clue where to look next.

    Thanks
    Markus

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Look at the template responsible for outputting the author box and determine what function is called to output what you want to alter. Locate that function’s source code and see if a filter is available. Sometimes you have to dig through a few sub-function calls before an appropriate filter is found.

    A likely function to call is the_author_meta( 'description' ). YMMV. If that really is the function used, the filter "get_the_author_{$field}" can be used. Replace $field} with “description” or whichever other author meta field you want.

    Thread Starter markisu72

    (@markisu72)

    Thanks a lot for your response!

    I had tried this already (at least I thought) but I must have made some mistake or was too tired to see the issue.
    It worked right out of the box now.

    Thanks a lot!
    Markus

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.