wpseo_save_what

Save titles & descriptions.

Description

wpseo_save_what( (string) $what ); 

Parameters (1)

0. $what (string)
Type of item to save (title, description).

Usage

  1. if ( !function_exists( 'wpseo_save_what' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/admin/ajax.php'; 
  3.  
  4. // Type of item to save (title, description). 
  5. $what = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpseo_save_what($what); 
  9.  

Defined (1)

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

/admin/ajax.php  
  1. function wpseo_save_what( $what ) { 
  2. check_ajax_referer( 'wpseo-bulk-editor' ); 
  3.  
  4. $new = filter_input( INPUT_POST, 'new_value' ); 
  5. $post_id = intval( filter_input( INPUT_POST, 'wpseo_post_id' ) ); 
  6. $original = filter_input( INPUT_POST, 'existing_value' ); 
  7.  
  8. $results = wpseo_upsert_new( $what, $post_id, $new, $original ); 
  9.  
  10. wpseo_ajax_json_echo_die( $results );