Title: custom function
Last modified: May 12, 2022

---

# custom function

 *  Resolved [thenax](https://wordpress.org/support/users/thenax/)
 * (@thenax)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/custom-function-6/)
 * 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](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [4 years ago](https://wordpress.org/support/topic/custom-function-6/#post-15698792)
 * 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.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/custom-function-6/#post-15698792)
 * Status: resolved