alexis-magina / cmb2-field-post-search-ajax

CMB2 field type to attach posts to each others.
GNU General Public License v3.0
40 stars 18 forks source link

[Hook Request] mag_cmb_post_search_ajax_result filter #4

Closed rubengc closed 7 years ago

rubengc commented 7 years ago

Adding a filter in cmb_post_search_ajax_get_results() to allow customize the text returned:

                while ( $results->have_posts() ) : $results->the_post();
                    $datas[] = apply_filters( 'mag_cmb_post_search_ajax_result', array(
                        'value' => get_the_title(),
                        'data'  => get_the_ID(),
                        'guid'  => get_edit_post_link()
                    ) );
                endwhile;

If you are ok with this i can PR this changes