';
protected function register_components() {
return array(
'content' => array(
'type' => 'PrefilledHTML',
'default_value' => '© [current_year] [site_title] - WordPress theme by Brandy.',
'description' => sprintf( __( 'Arbitrary HTML code or shortcode. Available tags: %s', 'brandy' ), StringVariablesService::get_string_list_variables() ),
'value_path' => array( 'content' ),
'prefilleds' => array(
array(
'label' => '© [current_year]. Make with [heart_icon] by [theme_author]',
'value' => '© [current_year]. Make with [heart_icon] by [theme_author]',
),
array(
'label' => '© [current_year] All Rights Reserved. Made with by [theme_author]',
'value' => '© [current_year] All Rights Reserved. Made with by [theme_author]',
),
array(
'label' => '© [current_year], [theme_author]. All Rights Reserved.',
'value' => '© [current_year], [theme_author]. All Rights Reserved.',
),
array(
'label' => '© [current_year], [theme_author]',
'value' => '© [current_year], [theme_author]',
),
array(
'label' => '© copyright [current_year], [theme_author], Inc',
'value' => '© copyright [current_year], [theme_author], Inc',
),
array(
'label' => 'All rights reserved © [theme_author] [current_year], Make it better.',
'value' => 'All rights reserved © [theme_author] [current_year], Make it better.',
),
array(
'label' => 'Copyright [current_year] [theme_author], all rights reserved.',
'value' => 'Copyright [current_year] [theme_author], all rights reserved.',
),
),
'render_options' => array(
'type' => 'content',
'data' => array(
array(
'selector' => '.brandy-element-wrapper',
'value_path' => array( 'content' ),
),
),
),
),
'content_alignment' => array(
'title' => array(
'text' => __( 'Content Alignment', 'brandy' ),
'type' => 'bold',
'show_devices' => true,
),
'type' => 'Alignment',
'value_path' => array( 'content_alignment' ),
'default_value' => array(
'desktop' => 'left',
'tablet' => null,
'mobile' => null,
),
'render_options' => array(
'type' => 'variable',
'data' => array(
array(
'type' => 'custom_variables',
'selector' => '.brandy-element-wrapper',
'value_path' => array( 'content_alignment' ),
'mapping_variables' => array_merge(
array_map(
function( $device ) {
return array(
'condition' => array(
'operator' => 'equal',
'value' => 'left',
),
'path' => array( $device ),
'mapping' => array(
$device => array(
'text-align' => 'left',
),
),
);
},
brandy_get_devices()
),
array_map(
function( $device ) {
return array(
'condition' => array(
'operator' => 'equal',
'value' => 'center',
),
'path' => array( $device ),
'mapping' => array(
$device => array(
'text-align' => 'center',
),
),
);
},
brandy_get_devices()
),
array_map(
function( $device ) {
return array(
'condition' => array(
'operator' => 'equal',
'value' => 'right',
),
'path' => array( $device ),
'mapping' => array(
$device => array(
'text-align' => 'right',
),
),
);
},
brandy_get_devices()
)
),
),
),
),
),
'text_reset' => array(
'title' => array(
'text' => __( 'Text', 'brandy' ),
'type' => 'bold',
'show_devices' => true,
),
'type' => 'Reset',
'reset_paths' => array(
array( 'text' ),
),
),
'text_color' => array(
'title' => array(
'text' => __( 'Text color', 'brandy' ),
'type' => 'normal',
),
'type' => 'ColorGroup',
'default_value' => array(
'normal' => array(
'desktop' => 'var(--wp--preset--color--brandy-primary-text)',
'tablet' => null,
'mobile' => null,
),
'hover' => array(
'desktop' => 'var(--wp--preset--color--brandy-primary-text)',
'tablet' => null,
'mobile' => null,
),
),
'value_path' => array( 'text_color' ),
'render_options' => array(
'type' => 'variable',
'data' => array(
array(
'type' => 'color',
'name' => '--b-text-color',
'value_path' => array( 'text_color' ),
),
),
),
),
'link_color' => array(
'title' => array(
'text' => __( 'Link color', 'brandy' ),
'type' => 'normal',
),
'type' => 'ColorGroup',
'default_value' => array(
'normal' => array(
'desktop' => 'var(--wp--preset--color--brandy-accent)',
'tablet' => null,
'mobile' => null,
),
'hover' => array(
'desktop' => 'var(--wp--preset--color--brandy-accent)',
'tablet' => null,
'mobile' => null,
),
),
'value_path' => array( 'link_color' ),
'render_options' => array(
'type' => 'variable',
'data' => array(
array(
'type' => 'color',
'name' => '--b-link-color',
'value_path' => array( 'link_color' ),
),
),
),
),
'margin' => array(
'title' => array(
'text' => __( 'Margin', 'brandy' ),
'type' => 'bold',
),
'value_path' => array( 'margin' ),
'type' => 'Spacing',
'default_value' => array(
'desktop' => array(
'unit' => 'px',
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
'is_constraints' => false,
),
'tablet' => null,
'mobile' => null,
),
'render_options' => array(
'type' => 'variable',
'data' => array(
array(
'type' => 'spacing',
'selector' => '.brandy-element-wrapper',
'name' => 'margin',
'value_path' => array( 'margin' ),
),
),
),
),
'padding' => array(
'title' => array(
'text' => __( 'Padding', 'brandy' ),
'type' => 'bold',
),
'value_path' => array( 'padding' ),
'type' => 'Spacing',
'default_value' => array(
'desktop' => array(
'unit' => 'px',
'top' => 0,
'right' => 0,
'bottom' => 0,
'left' => 0,
'is_constraints' => false,
),
'tablet' => null,
'mobile' => null,
),
'render_options' => array(
'type' => 'variable',
'data' => array(
array(
'type' => 'spacing',
'selector' => '.brandy-element-wrapper',
'name' => 'padding',
'value_path' => array( 'padding' ),
),
),
),
),
);
}
public function add_layout( $layouts = array() ) {
$layout = array(
'general' => array(
'sections' => array(
array(
'components' => array( 'content' ),
),
array(
'components' => array( 'content_alignment' ),
),
),
),
'designs' => array(
'sections' => array(
array(
'components' => array( 'text_reset', 'text_color', 'link_color' ),
),
array(
'components' => array( 'margin' ),
),
array(
'components' => array( 'padding' ),
),
),
),
);
$mapped_layout = $this->map_layout( $layout );
$layouts[ $this->element_id ] = $mapped_layout;
return $layouts;
}
}