ajax_get_keyword_usage

Retrieves the keyword for the keyword doubles.

Description

ajax_get_keyword_usage(); 

Usage

  1. if ( !function_exists( 'ajax_get_keyword_usage' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/admin/ajax.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ajax_get_keyword_usage(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/admin/ajax.php  
  1. function ajax_get_keyword_usage() { 
  2. $post_id = filter_input( INPUT_POST, 'post_id' ); 
  3. $keyword = filter_input( INPUT_POST, 'keyword' ); 
  4.  
  5. if ( ! current_user_can( 'edit_post', $post_id ) ) { 
  6. die( '-1' ); 
  7.  
  8. wp_die( 
  9. wp_json_encode( WPSEO_Meta::keyword_usage( $keyword, $post_id ) ) 
  10. );