ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

class-kirki-output-property-background-image.php (731B)


      1 <?php
      2 /**
      3  * Handles CSS output for background-image.
      4  *
      5  * @package     Kirki
      6  * @subpackage  Controls
      7  * @copyright   Copyright (c) 2016, Aristeides Stathopoulos
      8  * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
      9  * @since       2.2.0
     10  */
     11 
     12 if ( ! class_exists( 'Kirki_Output_Property_Background_Image' ) ) {
     13 
     14 	/**
     15 	 * Output overrides.
     16 	 */
     17 	class Kirki_Output_Property_Background_Image extends Kirki_Output_Property {
     18 
     19 		/**
     20 		 * Modifies the value.
     21 		 *
     22 		 * @access protected
     23 		 */
     24 		protected function process_value() {
     25 
     26 			if ( false === strrpos( $this->value, 'url(' ) ) {
     27 				if ( empty( $this->value ) ) {
     28 					return;
     29 				}
     30 				$this->value = 'url("' . $this->value . '")';
     31 			}
     32 		}
     33 	}
     34 }