WPSEO_Cornerstone

Represents the yoast cornerstone content.

Defined (1)

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

/admin/class-cornerstone.php  
  1. class WPSEO_Cornerstone { 
  2.  
  3. const META_NAME = '_yst_is_cornerstone'; 
  4.  
  5. /** 
  6. * Registers the hooks. 
  7. */ 
  8. public function register_hooks() { 
  9. add_action( 'save_post', array( $this, 'save_meta_value' ) ); 
  10.  
  11. /** 
  12. * Saves the meta value to the database. 
  13. * @param int $post_id The post id to save the meta value for. 
  14. */ 
  15. public function save_meta_value( $post_id ) { 
  16. $is_cornerstone = ( filter_input( INPUT_POST, self::META_NAME ) === '1' ); 
  17.  
  18. update_post_meta( $post_id, self::META_NAME, $is_cornerstone );