ID ] = $user->display_name; } $blocks[] = array( 'name' => 'canvas/contributors', 'title' => esc_html__( 'Contributors', 'powerkit' ), 'description' => '', 'category' => 'canvas', 'keywords' => array(), 'icon' => ' ', 'supports' => array( 'className' => true, 'anchor' => true, 'html' => false, 'canvasSpacings' => true, 'canvasBorder' => true, 'canvasResponsive' => true, ), 'styles' => array(), 'location' => array(), 'sections' => array( 'general' => array( 'title' => esc_html__( 'Block Settings', 'powerkit' ), 'priority' => 5, 'open' => true, ), ), 'layouts' => array(), 'fields' => array( array( 'key' => 'contributors', 'label' => esc_html__( 'Contributors', 'powerkit' ), 'section' => 'general', 'type' => 'react-select', 'choices' => $users_choices, 'multiple' => true, 'default' => array(), 'items' => array( 'type' => 'integer', ), ), array( 'key' => 'showAvatar', 'label' => esc_html__( 'Display Avatar', 'powerkit' ), 'section' => 'general', 'type' => 'toggle', 'default' => true, ), array( 'key' => 'showSocialAccounts', 'label' => esc_html__( 'Display Social Links', 'powerkit' ), 'section' => 'general', 'type' => 'toggle', 'default' => true, ), array( 'key' => 'showBio', 'label' => esc_html__( 'Display Bio', 'powerkit' ), 'section' => 'general', 'type' => 'toggle', 'default' => true, ), array( 'key' => 'showRecentPosts', 'label' => esc_html__( 'Display Recent Posts', 'powerkit' ), 'section' => 'general', 'type' => 'toggle', 'default' => false, ), array( 'key' => 'countRecentPosts', 'label' => esc_html__( 'Number of Recent Posts', 'powerkit' ), 'section' => 'general', 'type' => 'number', 'step' => 1, 'min' => 0, 'max' => 1000, 'default' => 3, 'active_callback' => array( array( 'field' => 'showRecentPosts', ), ), ), ), 'template' => dirname( __FILE__ ) . '/block/render.php', // enqueue registered scripts/styles. 'editor_style' => 'powerkit-contributors-block-editor-style', ); return $blocks; } } new Powerkit_Contributors_Block();