1 | <?php |
||
8 | class WordAds_API { |
||
9 | |||
10 | private static $wordads_status = null; |
||
11 | |||
12 | /** |
||
13 | * Returns site's WordAds status |
||
14 | * @return array boolean values for 'approved' and 'active' |
||
15 | * |
||
16 | * @since 4.5.0 |
||
17 | */ |
||
18 | public static function get_wordads_status() { |
||
45 | |||
46 | /** |
||
47 | * Returns status of WordAds approval. |
||
48 | * @return boolean true if site is WordAds approved |
||
49 | * |
||
50 | * @since 4.5.0 |
||
51 | */ |
||
52 | public static function is_wordads_approved() { |
||
53 | if ( is_null( self::$wordads_status ) ) { |
||
54 | self::get_wordads_status(); |
||
55 | } |
||
56 | |||
57 | return self::$wordads_status['approved'] ? '1' : '0'; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * Returns status of WordAds active. |
||
62 | * @return boolean true if ads are active on site |
||
63 | * |
||
64 | * @since 4.5.0 |
||
65 | */ |
||
66 | public static function is_wordads_active() { |
||
67 | if ( is_null( self::$wordads_status ) ) { |
||
68 | self::get_wordads_status(); |
||
69 | } |
||
70 | |||
71 | return self::$wordads_status['active'] ? '1' : '0'; |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * Returns status of WordAds house ads. |
||
76 | * @return boolean true if WP.com house ads should be shown |
||
77 | * |
||
78 | * @since 4.5.0 |
||
79 | */ |
||
80 | public static function is_wordads_house() { |
||
81 | if ( is_null( self::$wordads_status ) ) { |
||
82 | self::get_wordads_status(); |
||
83 | } |
||
84 | |||
85 | return self::$wordads_status['house'] ? '1' : '0'; |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * Grab WordAds status from WP.com API and store as option |
||
90 | * |
||
91 | * @since 4.5.0 |
||
92 | */ |
||
93 | static function update_wordads_status_from_api() { |
||
101 | } |
||
102 |