• Resolved thenax

    (@thenax)


    hello
    I need to build a function where I can extract all the events as “event_start_date + post_title” but it won’t work…. why?

    function events_as_options( $posts, $select_text = ” ) {
    if ( !is_array( $posts ) ) return;
    $posts = array_map( function( $item ) {
    return $item->event_start_date . ‘|’ . $item->post_title
    }, $posts );
    return ( $select_text ? $select_text . ‘|’ . PHP_EOL : ” ) . implode( PHP_EOL, $posts );
    }

Viewing 1 replies (of 1 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    I have not tried a similar snippet before but can I know which filter or hook you are using?

Viewing 1 replies (of 1 total)

The topic ‘custom function’ is closed to new replies.