WordPress.org

Ready to get started?Download WordPress

Forums

Reference a Custom Field, inside a Second Custom Field (2 posts)

  1. Alberto
    Member
    Posted 2 years ago #

    Hello Everyone!

    Is there anyway to do this? I want to reference some custom field (1) in custom field (2) under the same post.

    The details -- I have custom field that looks like this:

    <object type="application/x-shockwave-flash"
    id="live_embed_player_flash"
    data="http://www.justin.tv/widgets/live_embed_player.swf?channel=cineplatiniun507"
    bgcolor="#000000" height="300" width="400">
    <param name="allowFullScreen" value="true">
    <param name="allowScriptAccess" value="always">
    <param name="wmode" value="opaque" />
    <param name="allowNetworking" value="all">
    <param name="movie" value="http://www.justin.tv/widgets/live_embed_player.swf">
    <param name="flashvars" value="channel=cineplatiniun507">
    </object>

    And want to create a second custom field that feeds its content into the custom field above. Essentially, I want the second custom field to be the bold part here: "channel=cineplatiniun507" thus making it easier to update for some of my less tech-savvy teammates.

    I have tried dropping some php code into custom field 1 referencing custom field two, but it displays the php code as text, and fails to reference the second field.

    Any ideas?

    Thanks a lot for your input!!

    Alberto

  2. vtxyzzy
    Member
    Posted 2 years ago #

    I think this approach might work:

    • Use a unique string in CF1 where the replacement is needed.
    • Retrieve the contents of both CF's.
    • Use str_replace to replace the unique string with the value from CF2.

Topic Closed

This topic has been closed to new replies.

About this Topic