Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/wordpress-seo/src/user-meta/application/ |
Upload File : |
<?php namespace Yoast\WP\SEO\User_Meta\Application; use Yoast\WP\SEO\User_Meta\Domain\Custom_Meta_Interface; /** * The collector to get custom user meta. * * @makePublic */ class Custom_Meta_Collector { /** * All custom meta. * * @var array<Custom_Meta_Interface> $custom_meta */ private $custom_meta; /** * The constructor. * * @param Custom_Meta_Interface ...$custom_meta All custom meta. */ public function __construct( Custom_Meta_Interface ...$custom_meta ) { $this->custom_meta = $custom_meta; } /** * Returns all the custom meta. * * @return array<Custom_Meta_Interface> All the custom meta. */ public function get_custom_meta(): array { return $this->custom_meta; } /** * Returns the custom meta that can't be empty. * * @return array<string> The custom meta that can't be empty. */ public function get_non_empty_custom_meta(): array { $non_empty_custom_meta = []; foreach ( $this->custom_meta as $custom_meta ) { if ( ! $custom_meta->is_empty_allowed() ) { $non_empty_custom_meta[] = $custom_meta->get_key(); } } return $non_empty_custom_meta; } }