WordPress.org

Ready to get started?Download WordPress

Forums

Can content filters see post metadata? (1 post)

  1. chrominance
    Member
    Posted 7 years ago #

    I run an mp3blog, and each post is about one song. I keep all the song info in custom fields (Artist, Song Title, etc.) and would like to construct my post titles based on the metadata. Previously I'd hacked post.php in the wp-admin directory to do this for me, but of course every time I upgrade those changes get wiped and it's a pain in the ass. So I figured, why not make it a plugin?

    It seems I have two options: add an action to the 'save_post' hook or add a filter to the 'title_save_pre' hook. The former only seems to be able to retrieve information about the post via get_post_meta() and $_REQUEST, not modify it before the save, so that's out. The latter sounds perfect for what I want to do, but because I can only pass the text of the title through the filter, I can't seem to find a way to access the post metadata.

    Is there a solution to this problem at all? Am I going to have to type in my post titles manually or *gasp* hack post.php yet again?

Topic Closed

This topic has been closed to new replies.

About this Topic