1 | <?php |
||
6 | class Jetpack_SEO_Utils { |
||
7 | /** |
||
8 | * Site option name used to store front page meta description. |
||
9 | */ |
||
10 | const FRONT_PAGE_META_OPTION = 'advanced_seo_front_page_description'; |
||
11 | |||
12 | /** |
||
13 | * Old version of option name that was previously used under Free plan. |
||
14 | */ |
||
15 | const LEGACY_META_OPTION = 'seo_meta_description'; |
||
16 | |||
17 | /** |
||
18 | * Used to check whether SEO tools are enabled for given site. |
||
19 | * |
||
20 | * @param int $site_id Optional. Defaults to current blog id if not given. |
||
21 | * |
||
22 | * @return bool True if SEO tools are enabled, false otherwise. |
||
23 | */ |
||
24 | public static function is_enabled_jetpack_seo( $site_id = 0 ) { |
||
50 | |||
51 | /** |
||
52 | * Checks if this option was set while it was still available under free plan. |
||
53 | * |
||
54 | * @return bool True if we should enable legacy usage, false otherwise. |
||
55 | */ |
||
56 | public static function has_legacy_front_page_meta() { |
||
57 | return ! self::is_enabled_jetpack_seo() && get_option( self::LEGACY_META_OPTION ); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Returns front page meta description for current site. |
||
62 | * |
||
63 | * Since we allowed non-business users to set Front page meta description for some time, |
||
64 | * before bundling it with other SEO tools features that require a business plan, |
||
65 | * we are supporting legacy usage here. |
||
66 | * |
||
67 | * @return string Front page meta description string or empty string. |
||
68 | */ |
||
69 | public static function get_front_page_meta_description() { |
||
78 | |||
79 | /** |
||
80 | * Updates the site option value for front page meta description. |
||
81 | * |
||
82 | * We are taking care to update the correct option, in case the value is legacy-ed for current site. |
||
83 | * |
||
84 | * @param $value string New value for front page meta description. |
||
85 | * |
||
86 | * @return string Saved value, or empty string if no update was performed. |
||
87 | */ |
||
88 | public static function update_front_page_meta_description( $value ) { |
||
126 | } |
||
127 |