Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Generated CSS file do not removed #384

Open
allensph opened this issue Jan 6, 2017 · 0 comments
Open

Auto Generated CSS file do not removed #384

allensph opened this issue Jan 6, 2017 · 0 comments

Comments

@allensph
Copy link

allensph commented Jan 6, 2017

The UPLOAD option generated css file in uploads directory,
but when I remove image from customizer, the css file still exist.
How can I remove / change css bind on option change ?

$titan = TitanFramework::getInstance( 'my-theme-id' );

$imageID = $titan->getOption( 'my_upload_option' );
$imageSrc = $imageID; // For the default value

if ( is_numeric( $imageID ) ) {
	$imageAttachment = wp_get_attachment_image_src( $imageID );
	$imageSrc = $imageAttachment[0];
}

$section = $titan->createThemeCustomizerSection( array(
	'id' => 'background_image',
) );

$section->createOption( array(
	'name' => 'My Upload Option',
	'id' => 'my_upload_option',
	'type' => 'upload',
	'desc' => 'Upload your image',
	'livepreview' => '$("header").css("background",value)'
	'css' => 'header { background: value }'
) ); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants