WordPress.org

Forums

[resolved] [Plugin: Custom Field Template] WordPress does not process custom text field (7 posts)

  1. proximity2008
    Member
    Posted 6 years ago #

    This could be really simple but:

    I have a custom field as a textfield with tinyMCE.
    If I attach an image to the custom field the image shows up fine but the caption is not processed on the front end. It literally is outputted as [caption id="attachment_646" align="alignnone" width="225" caption="caption information"]: ...image...[/caption]

    How do I get around this? Do I need to run content through a function to get it outputting properly first?

    [Image Column]
    type = textarea
    cols = 36
    rows = 10
    tinyMCE = true
    mediaButton = true
    class= imagecol
    output = true

    Thanks

  2. kandi_nyc
    Member
    Posted 5 years ago #

    have you been able to find a solution for this? i'm having the same issue.

    thanks!

  3. kandi_nyc
    Member
    Posted 5 years ago #

    can anyone provide assistance?

  4. proximity2008
    Member
    Posted 5 years ago #

    Hi Kandi,

    Yes I got is sorted:

    <?php
    $unprocessedfield = get_post_meta($post->ID, 'nameofyourcustomfield',true));
    $processedfield = apply_filters('the_content', $unprocessedfield );
    echo $processedfield;
    ?>
  5. manntis
    Member
    Posted 5 years ago #

    I don't get how that fixed it.

    When I use the method above, I still get the close tag for caption showing

    [/caption]then article text begins

  6. morethanever
    Member
    Posted 5 years ago #

    Manntis,

    proximity2008's solution didn't work for me either,
    while this, which seems identical, did:

    echo apply_filters('the_content', get_post_meta($post->ID, 'nameofyourcustomfield', true));

    i don't know if it's a PHP4 thing or maybe the way strings are stored/displayed. Hope that helps.

  7. zandercent
    Member
    Posted 5 years ago #

    just thought I'd point out that there's an extra ')' in here - it should be

    <?php
    $unprocessedfield = get_post_meta($post->ID, 'nameofyourcustomfield',true);
    $processedfield = apply_filters('the_content', $unprocessedfield );
    echo $processedfield;
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic