This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ku-www/wp-content/plugins/wordpress-seo/admin/class-cornerstone.php
T
2017-04-26 21:10:22 +02:00

31 lines
616 B
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' );
update_post_meta( $post_id, self::META_NAME, $is_cornerstone );
}
}