HEX
Server: Apache/2.2.22
System: Linux server1.blueharbor.com 3.10.0-1160.90.1.vz7.200.7 #1 SMP Wed Jul 12 12:00:44 MSK 2023 x86_64
User: locglobe (1004)
PHP: 5.6.37
Disabled: NONE
Upload Files
File: /home/locglobe/public_html/wp-content/plugins/wordpress-seo/admin/class-cornerstone.php
<?php
/**
 * @package WPSEO\Admin
 */

/**
 * Represents the yoast cornerstone content.
 */
class WPSEO_Cornerstone {

	const META_NAME = '_yst_is_cornerstone';

	/**
	 * Registers the hooks.
	 */
	public function register_hooks() {
		add_action( 'save_post', array( $this, 'save_meta_value' ) );
	}

	/**
	 * Saves the meta value to the database.
	 *
	 * @param int $post_id The post id to save the meta value for.
	 */
	public function save_meta_value( $post_id ) {
		$is_cornerstone = ( filter_input( INPUT_POST, self::META_NAME ) === '1' );

		if ( $is_cornerstone ) {
			update_post_meta( $post_id, self::META_NAME, $is_cornerstone );

			return;
		}

		delete_post_meta( $post_id, self::META_NAME );
	}
}