| 1 |
<?php |
| 2 |
|
| 3 |
use Carbon_Fields\Helper\Helper; |
| 4 |
use Carbon_Fields\Helper\Color; |
| 5 |
|
| 6 |
if ( ! function_exists( 'carbon_field_exists' ) ) { |
| 7 |
function carbon_field_exists( $name, $container_type, $container_id = '' ) { |
| 8 |
return Helper::get_field( $container_type, $container_id, $name ) !== null; |
| 9 |
} |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! function_exists( 'carbon_get' ) ) { |
| 13 |
function carbon_get( $object_id, $name, $container_type, $container_id = '' ) { |
| 14 |
return Helper::get_value( $object_id, $container_type, $container_id, $name ); |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
if ( ! function_exists( 'carbon_set' ) ) { |
| 19 |
function carbon_set( $object_id, $name, $value, $container_type, $container_id = '' ) { |
| 20 |
Helper::set_value( $object_id, $container_type, $container_id, $name, $value ); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
if ( ! function_exists( 'carbon_get_the_post_meta' ) ) { |
| 25 |
function carbon_get_the_post_meta( $name, $container_id = '' ) { |
| 26 |
return Helper::get_the_post_meta( $name, $container_id ); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
if ( ! function_exists( 'carbon_get_post_meta' ) ) { |
| 31 |
function carbon_get_post_meta( $id, $name, $container_id = '' ) { |
| 32 |
return Helper::get_post_meta( $id, $name, $container_id ); |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
if ( ! function_exists( 'carbon_set_post_meta' ) ) { |
| 37 |
function carbon_set_post_meta( $id, $name, $value, $container_id = '' ) { |
| 38 |
Helper::set_post_meta( $id, $name, $value, $container_id ); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
if ( ! function_exists( 'carbon_get_theme_option' ) ) { |
| 43 |
function carbon_get_theme_option( $name, $container_id = '' ) { |
| 44 |
return Helper::get_theme_option( $name, $container_id ); |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
if ( ! function_exists( 'carbon_set_theme_option' ) ) { |
| 49 |
function carbon_set_theme_option( $name, $value, $container_id = '' ) { |
| 50 |
Helper::set_theme_option( $name, $value, $container_id ); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
if ( ! function_exists( 'carbon_get_the_network_option' ) ) { |
| 55 |
function carbon_get_the_network_option( $name, $container_id = '' ) { |
| 56 |
return Helper::get_the_network_option( $name, $container_id ); |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
if ( ! function_exists( 'carbon_get_network_option' ) ) { |
| 61 |
function carbon_get_network_option( $id, $name, $container_id = '' ) { |
| 62 |
return Helper::get_network_option( $id, $name, $container_id ); |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
if ( ! function_exists( 'carbon_set_network_option' ) ) { |
| 67 |
function carbon_set_network_option( $id, $name, $value, $container_id = '' ) { |
| 68 |
Helper::set_network_option( $id, $name, $value, $container_id ); |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
if ( ! function_exists( 'carbon_get_term_meta' ) ) { |
| 73 |
function carbon_get_term_meta( $id, $name, $container_id = '' ) { |
| 74 |
return Helper::get_term_meta( $id, $name, $container_id ); |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
if ( ! function_exists( 'carbon_set_term_meta' ) ) { |
| 79 |
function carbon_set_term_meta( $id, $name, $value, $container_id = '' ) { |
| 80 |
Helper::set_term_meta( $id, $name, $value, $container_id ); |
| 81 |
} |
| 82 |
} |
| 83 |
|
| 84 |
if ( ! function_exists( 'carbon_get_user_meta' ) ) { |
| 85 |
function carbon_get_user_meta( $id, $name, $container_id = '' ) { |
| 86 |
return Helper::get_user_meta( $id, $name, $container_id ); |
| 87 |
} |
| 88 |
} |
| 89 |
|
| 90 |
if ( ! function_exists( 'carbon_set_user_meta' ) ) { |
| 91 |
function carbon_set_user_meta( $id, $name, $value, $container_id = '' ) { |
| 92 |
Helper::set_user_meta( $id, $name, $value, $container_id ); |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
if ( ! function_exists( 'carbon_get_comment_meta' ) ) { |
| 97 |
function carbon_get_comment_meta( $id, $name, $container_id = '' ) { |
| 98 |
return Helper::get_comment_meta( $id, $name, $container_id ); |
| 99 |
} |
| 100 |
} |
| 101 |
|
| 102 |
if ( ! function_exists( 'carbon_set_comment_meta' ) ) { |
| 103 |
function carbon_set_comment_meta( $id, $name, $value, $container_id = '' ) { |
| 104 |
Helper::set_comment_meta( $id, $name, $value, $container_id ); |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 108 |
if ( ! function_exists( 'carbon_get_nav_menu_item_meta' ) ) { |
| 109 |
function carbon_get_nav_menu_item_meta( $id, $name, $container_id = '' ) { |
| 110 |
return Helper::get_nav_menu_item_meta( $id, $name, $container_id ); |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 114 |
if ( ! function_exists( 'carbon_set_nav_menu_item_meta' ) ) { |
| 115 |
function carbon_set_nav_menu_item_meta( $id, $name, $value, $container_id = '' ) { |
| 116 |
Helper::set_nav_menu_item_meta( $id, $name, $value, $container_id ); |
| 117 |
} |
| 118 |
} |
| 119 |
|
| 120 |
if ( ! function_exists( 'carbon_hex_to_rgba' ) ) { |
| 121 |
function carbon_hex_to_rgba( $hex ) { |
| 122 |
return Color::hex_to_rgba( $hex ); |
| 123 |
} |
| 124 |
} |
| 125 |
|