You appear to be a bot. Output may be restricted
Description
Save the SEO settings when we save a post or page.
Some values get sanitized, the rest are pulled from identically named sub-keys in the $_POST['genesis_seo'] array.
Usage
$void = genesis_inpost_seo_save( $post_id, $post );
Parameters
- $post_id
- ( int ) required – Post ID.
- $post
- ( WP_Post ) required – Post object.
Returns
void Return early if genesis_seo
is not a key in POST
data.
Source
File name: genesis/lib/admin/inpost-metaboxes.php
Lines:
1 to 34 of 34
function genesis_inpost_seo_save( $post_id, $post ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Filtered Later if ( ! isset( $_POST['genesis_seo'] ) ) { return; } // Merge user submitted options with fallback defaults. $data = wp_parse_args( // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Filtered Later $_POST['genesis_seo'], [ '_genesis_title' => '', '_genesis_description' => '', '_genesis_keywords' => '', '_genesis_canonical_uri' => '', 'redirect' => '', '_genesis_noindex' => 0, '_genesis_nofollow' => 0, '_genesis_noarchive' => 0, ] ); // Sanitize the title, description, and tags. foreach ( $data as $key => $value ) { if ( in_array( $key, [ '_genesis_title', '_genesis_description', '_genesis_keywords' ], true ) ) { $data[ $key ] = wp_strip_all_tags( $value ); } } genesis_save_custom_fields( $data, 'genesis_inpost_seo_save', 'genesis_inpost_seo_nonce', $post ); }