functions.php
58 lines
| 1 | <?php |
| 2 | // phpcs:ignoreFile |
| 3 | |
| 4 | // Exit if accessed directly. |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | if ( ! function_exists( 'kirki_get_option' ) ) { |
| 10 | /** |
| 11 | * Get the value of a field. |
| 12 | * This is a deprecated function that we used when there was no API. |
| 13 | * Please use get_theme_mod() or get_option() instead. |
| 14 | * @see https://developer.wordpress.org/reference/functions/get_theme_mod/ |
| 15 | * @see https://developer.wordpress.org/reference/functions/get_option/ |
| 16 | * |
| 17 | * @return mixed |
| 18 | */ |
| 19 | function kirki_get_option( $option = '' ) { |
| 20 | _deprecated_function( __FUNCTION__, '1.0.0', sprintf( esc_html__( '%1$s or %2$s', 'kirki' ), 'get_theme_mod', 'get_option' ) ); |
| 21 | return Kirki::get_option( '', $option ); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | if ( ! function_exists( 'kirki_sanitize_hex' ) ) { |
| 26 | function kirki_sanitize_hex( $color ) { |
| 27 | _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'hex\' )' ); |
| 28 | return Kirki_Color::sanitize_hex( $color ); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | if ( ! function_exists( 'kirki_get_rgb' ) ) { |
| 33 | function kirki_get_rgb( $hex, $implode = false ) { |
| 34 | _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgb\' )' ); |
| 35 | return Kirki_Color::get_rgb( $hex, $implode ); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | if ( ! function_exists( 'kirki_get_rgba' ) ) { |
| 40 | function kirki_get_rgba( $hex = '#fff', $opacity = 100 ) { |
| 41 | _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgba\' )' ); |
| 42 | return Kirki_Color::get_rgba( $hex, $opacity ); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | if ( ! function_exists( 'kirki_get_brightness' ) ) { |
| 47 | function kirki_get_brightness( $hex ) { |
| 48 | _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->lightness' ); |
| 49 | return Kirki_Color::get_brightness( $hex ); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | if ( ! function_exists( 'Kirki' ) ) { |
| 54 | function Kirki() { |
| 55 | return \Kirki\Compatibility\Framework::get_instance(); |
| 56 | } |
| 57 | } |
| 58 |