$value ) { // Is this property whitelisted? if ( property_exists( $this, $key ) ) { $args[ $key ] = $value; } } $this->id = $config_id; $this->config_final = wp_parse_args( [ 'id' => $config_id, ], $args ); } /** * Use this method to get an instance of your config. * Each config has its own instance of this object. * * @static * @access public * @param string $id Config ID. * @param array $args { * Optional. Arguments to override config defaults. * * @type string $capability @see https://codex.wordpress.org/Roles_and_Capabilities * @type string $option_type theme_mod or option. * @type string $option_name If we want to used serialized options, * this is where we'll be adding the option name. * All fields using this config will be items in that array. * @type array $compiler Not yet fully implemented * @type bool $disable_output If set to true, no CSS will be generated * from fields using this configuration. * } * * @return Kirki\Compatibility\Config */ public static function get_instance( $id = 'global', $args = [] ) { if ( empty( $id ) ) { $id = 'global'; } $id_md5 = md5( $id ); if ( ! isset( self::$instances[ $id_md5 ] ) ) { self::$instances[ $id_md5 ] = new self( $id, $args ); } return self::$instances[ $id_md5 ]; } /** * Get the IDs of all current configs. * * @static * @access public * @since 3.0.22 * @return array */ public static function get_config_ids() { $configs = []; foreach ( self::$instances as $instance ) { $configs[] = $instance->id; } return array_unique( $configs ); } /** * Returns the $config_final property * * @access public * @return array */ public function get_config() { return $this->config_final; } }