WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] modified author meta? (5 posts)

  1. halvard
    Member
    Posted 2 years ago #

    Is there a way to get modified author meta (similar to the_author_meta())? I have searched both api and forums, but nothing has come up.

    I need to do something like this:

    Post modified by <?php the_modified_author_meta('first_name'); ?>.

    Thank you for any help!

  2. vtxyzzy
    Member
    Posted 2 years ago #

    Not sure what you are trying to do. Can you just create your own function which in turn calls the_author_meta() and modifies the results before returning them?

  3. halvard
    Member
    Posted 2 years ago #

    No, the_author and the_author_meta refer to the user who originally published a post. the_modified_author refers to the user who most recently modified a post.

    How do you propose to modify the results of the_author_meta (which btw returns null, perhaps you were thinking of get_the_author_meta())?

    Thank you for replying.

  4. halvard
    Member
    Posted 2 years ago #

    Never mind, I sort of figured it out by myself:

    function the_modified_author_meta($field) {
    	global $post;
    	if ($id = get_post_meta($post->ID, '_edit_last', true)) {
    		the_author_meta($field, $id);
    	}
    }
  5. vtxyzzy
    Member
    Posted 2 years ago #

    Please excuse my ignorance - I was not aware of that.

Topic Closed

This topic has been closed to new replies.

About this Topic