json[ 'position_title' ] = esc_html__( 'left top, x% y%, xpos ypos (px)', 'gp-premium' );
$this->json[ 'position_placeholder' ] = esc_html__( 'Position', 'gp-premium' );
foreach ( $this->settings as $setting_key => $setting_id ) {
$this->json[ $setting_key ] = array(
'link' => $this->get_link( $setting_key ),
'value' => $this->value( $setting_key ),
'default' => isset( $setting_id->default ) ? $setting_id->default : '',
'id' => isset( $setting_id->id ) ? $setting_id->id : ''
);
if ( 'repeat' === $setting_key ) {
$this->json[ $setting_key ]['choices'] = $this->get_repeat_choices();
}
if ( 'size' === $setting_key ) {
$this->json[ $setting_key ]['choices'] = $this->get_size_choices();
}
if ( 'attachment' === $setting_key ) {
$this->json[ $setting_key ]['choices'] = $this->get_attachment_choices();
}
}
}
public function content_template() {
?>
<# if ( '' !== data.label ) { #>
{{ data.label }}
<# } #>
<# if ( 'undefined' !== typeof ( data.repeat ) ) { #>
<# } #>
<# if ( 'undefined' !== typeof ( data.size ) ) { #>
<# } #>
<# if ( 'undefined' !== typeof ( data.attachment ) ) { #>
<# } #>
<# if ( 'undefined' !== typeof ( data.position ) ) { #>
<# } #>
esc_html__( 'Repeat', 'gp-premium' ),
'repeat-x' => esc_html__( 'Repeat x', 'gp-premium' ),
'repeat-y' => esc_html__( 'Repeat y', 'gp-premium' ),
'no-repeat' => esc_html__( 'No Repeat', 'gp-premium' )
);
}
public function get_size_choices() {
return array(
'' => esc_html__( 'Size (Auto)', 'gp-premium' ),
'100' => esc_html__( '100% Width', 'gp-premium' ),
'cover' => esc_html__( 'Cover', 'gp-premium' ),
'contain' => esc_html__( 'Contain', 'gp-premium' )
);
}
public function get_attachment_choices() {
return array(
'' => esc_html__( 'Attachment', 'gp-premium' ),
'fixed' => esc_html__( 'Fixed', 'gp-premium' ),
'local' => esc_html__( 'Local', 'gp-premium' ),
'inherit' => esc_html__( 'Inherit', 'gp-premium' )
);
}
}
}