Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
gallery
/
plugins
/
wordpress-seo
/
src
/
schema-aggregator
/
infrastructure
/
schema_map
:
schema-map-config.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. namespace Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Schema_Map; /** * Configuration for the Schema Map. */ class Schema_Map_Config { private const ALLOWED_FREQUENCIES = [ 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never', ]; /** * Get changefreq value from configuration * * @return string Valid changefreq value (always|hourly|daily|weekly|monthly|yearly|never). */ public function get_changefreq(): string { $changefreq = \apply_filters( 'wpseo_schema_aggregator_schemamap_changefreq', 'daily' ); if ( ! \in_array( $changefreq, self::ALLOWED_FREQUENCIES, true ) ) { return 'daily'; } return $changefreq; } /** * Get priority value from configuration * * @return string Priority value as string (float between 0.0 and 1.0). */ public function get_priority(): string { $priority = \apply_filters( 'wpseo_schema_aggregator_schemamap_priority', '0.8' ); $priority_float = \is_numeric( $priority ) ? (float) $priority : 0.8; if ( $priority_float < 0.0 || $priority_float > 1.0 ) { return '0.8'; } return \number_format( $priority_float, 1, '.', '' ); } }