false ) ) === 0 ) { // No tags to suggest echo wp_json_encode( array() ); exit(); } // Prepare search $search = ( isset( $_GET['term'] ) ) ? trim( stripslashes( sanitize_text_field($_GET['term']) )) : ''; // Get all terms, or filter with search $terms = SimpleTags_Admin::getTermsForAjax( $taxonomy, $search ); if ( empty( $terms ) ) { echo wp_json_encode( array() ); exit(); } // Format $results = array(); foreach ( (array) $terms as $term ) { $term->name = stripslashes( $term->name ); $term->name = str_replace( array( "\r\n", "\r", "\n" ), '', $term->name ); $results[] = array( 'id' => $term->term_id, 'label' => $term->name, 'value' => $term->name, ); } echo wp_json_encode( $results ); exit(); } /** * Content of custom meta box of TaxoPress * * @param object $post * * @return void * @author WebFactory Ltd */ public static function metabox( $post ) { // Get options $autocomplete_min = 0 ?>