Yoast_OnPage_Ajax

Class Yoast_OnPage_Ajax.

Defined (1)

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

/admin/ajax/class-yoast-onpage-ajax.php  
  1. class Yoast_OnPage_Ajax { 
  2.  
  3. /** 
  4. * Initialize the hooks for the AJAX request 
  5. */ 
  6. public function __construct() { 
  7. add_action( 'wp_ajax_wpseo_dismiss_onpageorg', array( $this, 'dismiss_notice' ) ); 
  8.  
  9. /** 
  10. * Handles the dismiss notice request 
  11. */ 
  12. public function dismiss_notice() { 
  13. check_ajax_referer( 'wpseo-dismiss-onpageorg' ); 
  14.  
  15. $this->save_dismissed(); 
  16.  
  17. wp_die( 'true' ); 
  18.  
  19. /** 
  20. * Storing the dismissed value as an user option in the database 
  21. */ 
  22. private function save_dismissed() { 
  23. update_user_meta( get_current_user_id(), WPSEO_OnPage::USER_META_KEY, 1 );