'', 'background-image' => '', 'background-repeat' => '', 'background-attachment' => '', 'background-position' => '', 'background-pattern' => '' ); $value = wp_parse_args( $value, $defaults ); // collecting colorpicker attributes $atts = array(); $atts['class'] = 'field'; $atts['type'] = 'text'; $atts['id'] = esc_attr( $id . '-colorpicker' ); $atts['name'] = esc_attr( $item['name'] . '[background-color]' ); if( $value['background-color'] ) $atts['value'] = esc_attr( $value['background-color'] ); $style = ''; if( $value['background-color'] ) $style = ' style="background:' . $value['background-color'] . ';border-color:' . $value['background-color'] . '"'; // collecting upload attributes $upload_attrs = array(); $upload_attrs['class'] = 'field upload' . ( ( $value != '' ) ? ' has-file' : '' ); $upload_attrs['type'] = 'text'; $upload_attrs['id'] = esc_attr( $id ); $upload_attrs['name'] = esc_attr( $item['name'] . '[background-image]' ); if( $value['background-image'] ) $upload_attrs['value'] = esc_attr( $value['background-image'] ); ?>
>
', spyropress_build_atts( $atts ) ); printf( '
', $style ); ?>
', spyropress_build_atts( $upload_attrs ) ); printf( '', $id); if ( is_array( @getimagesize( $value['background-image'] ) ) ) { ?>
Remove'; $image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value['background-image'] ); if ( $image ) { echo ''.$remove.''; } else { $parts = explode( "/", $value['background-image'] ); for( $i = 0; $i < sizeof($parts); ++$i ) { $title = $parts[$i]; } echo '
'.$title.''.$remove.'
'; } } ?>

%2$s//%2$s', $js, "\n" ); return $ui_content; } else { echo $ui_content; add_jquery_ready($js); } } function spyropress_widget_background( $item, $id, $value, $is_builder = false ) { return spyropress_ui_background( $item, $id, $value, true, $is_builder ); } /** * Background Repeat */ function spyropress_panel_background_repeat() { return array( '' => '', 'no-repeat' => __( 'No Repeat', 'spyropress' ), 'repeat' => __( 'Repeat All', 'spyropress' ), 'repeat-x' => __( 'Repeat Horizontally', 'spyropress' ), 'repeat-y' => __( 'Repeat Vertically', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Background Attachment */ function spyropress_panel_background_attachment() { return array( '' => '', 'fixed' => __( 'Fixed', 'spyropress' ), 'scroll' => __( 'Scroll', 'spyropress' ), 'inherit' => __( 'Inherit', 'spyropress' ) ); } /** * Background Position */ function spyropress_panel_background_position() { return array( '' => '', 'left top' => __( 'Left Top', 'spyropress' ), 'left center' => __( 'Left Center', 'spyropress' ), 'left bottom' => __( 'Left Bottom', 'spyropress' ), 'center top' => __( 'Center Top', 'spyropress' ), 'center center' => __( 'Center Center', 'spyropress' ), 'center bottom' => __( 'Center Bottom', 'spyropress' ), 'right top' => __( 'Right Top', 'spyropress' ), 'right center' => __( 'Right Center', 'spyropress' ), 'right bottom' => __( 'Right Bottom', 'spyropress' ) ); } ?>