'video_url', 'label' => 'Video URL', 'properties' => [ 'description' => 'Video url (Vimeo and Youtube support), "Video" post format should be selected' ] ] ), Node_Factory::make( WP_Gallery::class, [ 'name' => 'gallery', 'label' => 'Image Gallery', 'properties' => [ 'description' => '"Gallery" post format should be selected to show gallery on top' ] ] ) ]; } public function sanitize_data(array $data) : array { $sanitized = []; foreach ($data as $key => $val) { switch ($key) { case 'video_url': $sanitized[$key] = $val; break; case 'gallery': $sanitized[$key] = $val; break; } } return $sanitized; } } new Post_Metabox('post', 'Post format', 'post', ['context' => 'normal']);