* @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_setting_args( $args, $wp_customize ) { return $args; } /** * Filter control args. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { return $args; } /** * Registers the setting. * * @access public * @since 0.1 * @param WP_Customize_Manager $customizer The customizer instance. * @return void */ public function add_setting( $customizer ) { $args = $this->args; // This is for postMessage purpose. // @see wp-content/plugins/kirki/kirki-packages/module-postmessage/src/Postmessage.php inside 'field_add_setting_args' method. $args['type'] = isset( $this->type ) ? $this->type : ''; /** * Allow filtering the arguments. * * @since 0.1 * @param array $this->args The arguments. * @param WP_Customize_Manager $customizer The customizer instance. * @return array Return the arguments. */ $args = apply_filters( 'kirki_field_add_setting_args', $args, $customizer ); if ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) { return; } $setting_id = $args['settings']; $args = [ 'type' => isset( $args['option_type'] ) ? $args['option_type'] : 'theme_mod', // 'type' here doesn't use the $args['type'] but instead checking the $args['option_type']. 'capability' => isset( $args['capability'] ) ? $args['capability'] : 'edit_theme_options', 'theme_supports' => isset( $args['theme_supports'] ) ? $args['theme_supports'] : '', 'default' => isset( $args['default'] ) ? $args['default'] : '', 'transport' => isset( $args['transport'] ) ? $args['transport'] : 'refresh', 'sanitize_callback' => isset( $args['sanitize_callback'] ) ? $args['sanitize_callback'] : '', 'sanitize_js_callback' => isset( $args['sanitize_js_callback'] ) ? $args['sanitize_js_callback'] : '', ]; $settings_class = $this->settings_class ? $this->settings_class : null; if ( $settings_class ) { $customizer->add_setting( new $settings_class( $customizer, $setting_id, $args ) ); } else { $customizer->add_setting( $setting_id, $args ); } } /** * Registers the control. * * @access public * @since 0.1 * @param WP_Customize_Manager $wp_customize The customizer instance. * @return void */ public function add_control( $wp_customize ) { $control_class = $this->control_class; // If no class-name is defined, early exit. if ( ! $control_class ) { return; } /** * Allow filtering the arguments. * * @since 0.1 * @param array $this->args The arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array Return the arguments. */ $args = apply_filters( 'kirki_field_add_control_args', $this->args, $wp_customize ); $wp_customize->add_control( new $control_class( $wp_customize, $this->args['settings'], $args ) ); } }
Fatal error: Uncaught Error: Class "Kirki\Field" not found in /htdocs/wp-content/plugins/kirki/kirki-packages/field-background/src/Background.php:22 Stack trace: #0 /htdocs/wp-content/plugins/build-app-online/admin/vendor/composer/ClassLoader.php(571): include() #1 /htdocs/wp-content/plugins/build-app-online/admin/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/htdocs/wp-cont...') #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Kirki\\Field\\Bac...') #3 /htdocs/wp-content/plugins/kirki/kirki-packages/compatibility/src/Aliases.php(164): class_exists('Kirki\\Field\\Bac...') #4 /htdocs/wp-content/plugins/kirki/kirki-packages/compatibility/src/Aliases.php(151): Kirki\Compatibility\Aliases->add_aliases() #5 /htdocs/wp-content/plugins/kirki/inc/bootstrap.php(14): Kirki\Compatibility\Aliases->__construct() #6 /htdocs/wp-content/plugins/kirki/kirki.php(44): require_once('/htdocs/wp-cont...') #7 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #8 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #9 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #10 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #11 /htdocs/index.php(17): require('/htdocs/wp-blog...') #12 {main} thrown in /htdocs/wp-content/plugins/kirki/kirki-packages/field-background/src/Background.php on line 22