false,
'id' => 0,
'attachment' => 'scroll',
'pos-x' => 'center',
'pos-y' => 'top',
'repeat' => 'no-repeat',
'color' => '#F0F0F0',
'foreground' => false,
'wrap' => false
);
}
update_option('arras_custom_bg_options', maybe_serialize($arras_custom_bg_options));
function arras_custom_background_scripts() {
wp_enqueue_script('farbtastic');
}
function arras_custom_background_styles() {
?> false,
'id' => 0,
'attachment' => 'scroll',
'pos-x' => 'center',
'pos-y' => 'center',
'repeat' => 'no-repeat',
'color' => '#F0F0F0',
'foreground' => false,
'wrap' => false
);
update_option('arras_custom_bg_options', maybe_serialize($arras_custom_bg_options));
$notices = '
' . __('Your settings have been reverted to the defaults.', 'arras') . '
';
}
if ( isset($_REQUEST['save']) ) {
check_admin_referer('arras-custom-background');
if ($_FILES['import']['error'] != 4) {
$overrides = array('test_form' => false);
$file = wp_handle_upload($_FILES['import'], $overrides);
if ( isset($file['error']) )
die( $file['error'] );
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$filename = basename($file);
// Construct the object array
$object = array(
'post_title' => $filename,
'post_content' => $url,
'post_mime_type' => $type,
'guid' => $url);
// Save the data
$arras_custom_bg_options['id'] = wp_insert_attachment($object, $file);
}
$arras_custom_bg_options['enable'] = (boolean)(isset($_POST['bg-enable']));
$arras_custom_bg_options['attachment'] = stripslashes($_POST['bg-attachment']);
$arras_custom_bg_options['pos-x'] = stripslashes($_POST['bg-pos-x']);
$arras_custom_bg_options['pos-y'] = stripslashes($_POST['bg-pos-y']);
$arras_custom_bg_options['repeat'] = stripslashes($_POST['bg-repeat']);
$arras_custom_bg_options['color'] = stripslashes($_POST['bg-color']);
$arras_custom_bg_options['foreground'] = (boolean)(isset($_POST['foreground']));
$arras_custom_bg_options['wrap'] = (boolean)(isset($_POST['wrap']));
update_option('arras_custom_bg_options', maybe_serialize($arras_custom_bg_options));
$notices = '' . __('Your settings have been saved to the database.', 'arras') . '
';
}
if ( isset($_GET['page']) && $_GET['page'] == 'arras-custom-background' ) : ?>
{ background: !important; }
#main { background: url(/images/foreground.png) !important; }