Support » Fixing WordPress » Reference a Custom Field, inside a Second Custom Field

  • 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"
    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="">
    <param name="flashvars" value="channel=cineplatiniun507">

    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!!


Viewing 1 replies (of 1 total)
  • 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.
Viewing 1 replies (of 1 total)
  • The topic ‘Reference a Custom Field, inside a Second Custom Field’ is closed to new replies.