Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author fried_eggz

    (@fried_eggz)

    Yes. That is the post id. You need to use the filter (see plugin description) in your functions.php to replace the id with the title using WordPress get_post_title()

    Thread Starter carligeanu

    (@carligeanu)

    I catch the ears. I`m just a beginner in php, can you help me with the code of this filter, please?

    Cheers,
    Andrei C.

    Plugin Author fried_eggz

    (@fried_eggz)

    Try this:
    ‘add_filter(‘filter_entries’,’convert_to_title’);
    function convert_to_title($entries) {
    foreach ($entries as $entryKey => $entryValue) {
    if ($entryKey == “1”) {
    $entries[$entryKey] == get_the_title($entryValue);
    }
    }
    return $entries;
    }`

    Where 1 above is the id if the field that you want to convert.

    Thread Starter carligeanu

    (@carligeanu)

    Thank you fried_eggz. A friend helped me with a code for this problem.
    I have two dropdowns into the form, id=36 and id=39. Who needs, replace the id number with your dropdown id.
    This is the code that works:

    add_filter(‘filter_entries’,’show_title’ );
    function show_title($entries) {
    foreach ($entries as $entryKey => $entryValue) {

    $b=get_the_title($entryValue[36]);

    if ($entryValue[36]) {
    $entries[$entryKey][36] = $b;
    }
    $e=get_the_title($entryValue[39]);

    if ($entryValue[39]) {
    $entries[$entryKey][39] = $e;
    }

    }
    return $entries;
    }

    Cheers,
    Andrei C.

    Plugin Author fried_eggz

    (@fried_eggz)

    So, a feature request would be: Show post titles instead of ID’s i list with post selections

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change VALUE display with LABEL’ is closed to new replies.