storage = new Storage_Post_Type( 'css' ); } /** * Store Critical CSS for a specific provider. * * @param string $key Provider key. * @param string $value Critical CSS. */ public function store_css( $key, $value ) { $this->storage->set( $key, array( 'css' => $value, ) ); } /** * Clear the whole Critical CSS storage. */ public function clear() { $this->storage->clear(); } /** * Get Critical CSS for specific provider keys. * * @param array $provider_keys Provider keys. * * @return array|false */ public function get_css( $provider_keys ) { foreach ( $provider_keys as $key ) { $data = $this->storage->get( $key, false ); if ( $data && $data['css'] ) { return array( 'key' => $key, 'css' => $data['css'], ); } } return false; } }