[wp-trac] [WordPress Trac] #32481: Pass the original `$user_id` to the filter in `get_the_author_meta()`

WordPress Trac noreply at wordpress.org
Mon May 25 04:07:01 UTC 2015


#32481: Pass the original `$user_id` to the filter in `get_the_author_meta()`
--------------------------------+-----------------------------
 Reporter:  dlh                 |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 The `"get_the_author_$field"` filter includes `$user_id`, but there's no
 way to know whether that `$user_id` was provided to
 `get_the_author_meta()` or inferred from the current post.

 So, I couldn't add a filter that acted only when I was sure
 `get_the_author_meta()` was called to get meta about the current post
 author, as opposed to a specific user (or vice versa).

 The attached patch would add a parameter to the filter with the original
 `$user_id` value.

 (The `"the_author_$field"` filter already provides this information
 because `the_author_meta()` passes the `$user_id` it receives straight to
 the filter.)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32481>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list