| 1 |
<?php |
| 2 |
namespace StreamCast; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 5 |
|
| 6 |
class Functions { |
| 7 |
public static function get_meta( $id, $key, $default = null ) { |
| 8 |
$value = get_post_meta( $id, $key, true ); |
| 9 |
return $value ?: $default; |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
// Global wrapper for convenience and backward compatibility |
| 14 |
if ( ! function_exists( 'streamcast_get_meta' ) ) { |
| 15 |
function streamcast_get_meta( $id, $key, $default = null ) { |
| 16 |
return \StreamCast\Functions::get_meta( $id, $key, $default ); |
| 17 |
} |
| 18 |
} |
| 19 |
|