Title: Usage in another plugin
Last modified: August 31, 2016

---

# Usage in another plugin

 *  [ditler](https://wordpress.org/support/users/ditler/)
 * (@ditler)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/usage-in-another-plugin/)
 * Hi,
 * thank you for the great plugin. From what I figure those last hours it is really
   nicely written and documented. Still, my wordpress insight and php skill seems
   not sufficient to understand it perfectly.
 * I use another plugin, wp-search-suggest. That did, unlike what I expected, not
   make use of your plugin. That is, in the suggestions, findings from custom fields
   could not be found.
 * I have a solution for that in the other problem. So all I want from you folk,
   is maybe some help to understand (1) why exactly my solution works and (2) how
   this could have been solved more elegantly, either on the search-everything side
   or on the wp-search-suggest side.
 * Thanks!
 *     ```
       // Here is what I added, with minor changes just copied from your plugin
       $is_query = !empty($s);
       $result = array();
       if ($is_query) {
       	$result = array(
       		'own' => array(),
       		'external' => array()
       	);
   
       	$params = array(
       		's' => $s
       	);
   
       	$zemanta_response = se_api(array(
       		'method' => 'zemanta.suggest',
       		'return_images' => 0,
       		'return_rich_objects' => 0,
       		'return_articles' => 1,
       		'return_markup' => 0,
       		'return_rdf_links' => 0,
       		'return_keywords' => 0,
       		'careful_pc' => 1,
       		'interface' => 'wordpress-se',
       		'format' => 'json',
       		'emphasis' => $_GET['s'],
       		'text' => $_GET['text']
       	));
   
       	if (!is_wp_error($zemanta_response) && $zemanta_response['response']['code'] == 200) {
       		$result['external'] = json_decode($zemanta_response['body'])->articles;
       	}
   
       	$SE = new SearchEverything(true);
   
       	if (!empty($_GET['exact'])) {
       		$params['exact'] = true;
       	}
       	$params["showposts"] = 5;
       	$post_query = new WP_query($params);
       	$results = array();
   
       if ( $post_query->posts ) {
       	$results = apply_filters( 'wpss_search_results', wp_list_pluck( $post_query->posts, 'post_title' ), $post_query );
       	echo join( $results, "\n" );
       }
   
       }
   
       echo join($results, "\n");
       wp_die();
       // Below this line you find the original action. It is still in place, though obviously inactive due to wp_die()
   
       $query = new WP_Query( $query_args );
   
       if ( $query->posts ) {
       	$results = apply_filters( 'wpss_search_results', wp_list_pluck( $query->posts, 'post_title' ), $query );
       	echo join( $results, "\n" );
       }
   
       wp_die();
       ```
   
 * [https://wordpress.org/plugins/search-everything/](https://wordpress.org/plugins/search-everything/)

The topic ‘Usage in another plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/search-everything_242529.svg)
 * [Search Everything](https://wordpress.org/plugins/search-everything/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-everything/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-everything/)
 * [Active Topics](https://wordpress.org/support/plugin/search-everything/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-everything/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-everything/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [ditler](https://wordpress.org/support/users/ditler/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/usage-in-another-plugin/)
 * Status: not resolved