Solved by adding use WP_Customize_Image_Control;
to inc\Customizer\FeaturedCategories.php:
namespace Ivana\Api\Customizer;
use WP_Customize_Image_Control;
use Ivana\Helpers;
class FeaturedCategories
{
public function register( $wp_customize )
{
$this->add_panels( $wp_customize );
$this->add_sections( $wp_customize );
$this->add_settings( $wp_customize );
$this->add_controls( $wp_customize );
}
public function add_panels( $wp_customize )
{
$wp_customize->add_panel( 'featured_categories', [
'title' => 'Featured Categories',
'description' => 'I\'m looking for a lady',
'priority' => 100
] );
}
public function add_sections( $wp_customize )
{
$wp_customize->add_section( 'featured_category_0', [
'title' => 'Featured Category 1',
'panel' => 'featured_categories',
'description' => 'Highlight categories on your front page.'
] );
$wp_customize->add_section( 'featured_category_1', [
'title' => 'Featured Category 2',
'panel' => 'featured_categories',
'description' => 'Highlight categories on your front page.'
] );
$wp_customize->add_section( 'featured_category_2', [
'title' => 'Featured Category 3',
'panel' => 'featured_categories',
'description' => 'Highlight categories on your front page.'
] );
}
public function add_settings( $wp_customize )
{
$wp_customize->add_setting( 'category_slug_0', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
$wp_customize->add_setting( 'category_slug_1', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
$wp_customize->add_setting( 'category_slug_2', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
$wp_customize->add_setting( 'category_image_0', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
$wp_customize->add_setting( 'category_image_1', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
$wp_customize->add_setting( 'category_image_2', [
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_filter_nohtml_kses'
] );
}
public function add_controls( $wp_customize )
{
$wp_customize->add_control( 'category_slug_2', [
'section' => 'featured_category_0',
'label' => 'Category slug',
// 'description' => 'Not the animal',
'type' => 'text'
] );
$wp_customize->add_control( 'category_slug_1', [
'section' => 'featured_category_1',
'label' => 'Category slug',
// 'description' => 'Not the animal',
'type' => 'text'
] );
$wp_customize->add_control( 'category_slug_0', [
'section' => 'featured_category_2',
'label' => 'Category slug',
// 'description' => 'Not the animal',
'type' => 'text'
] );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'category_image_2', [
'section' => 'featured_category_0',
'label' => 'Featured Category Image 1'
] ) );
}
}
I found the solution by copying and pasting the Customizer classes from the source code of the mentioned theme (AWPS): https://github.com/Alecaddd/awps/blob/master/inc/Api/Customizer/Footer.php