<?php
/**
 * This class handles WordPress custom fields.
 *
 * @package FANCIFY\Framework\API\Customizer
 *
 * @since 1.0.0
 */

final class Fancify_Lite_ACF {

	/**
	 * Construct the class.
	 *
	 * @since 1.0.0
	 */
	public function __construct(){}

	/**
	 * Important callbacks.
	 *
	 * @since 1.0.0
	 */
	public function register_hook_callback(){}

	/**
	 * Check acf and get value.
	 *
	 * @since 1.0.0
	 */
	public static function get_field( $field, $default = false, $post_id = false, $format_value = true ) {
		$value = null;

		// Check acf
		if ( self::check_acf() ) {
			$value = get_field( $field, $post_id, $format_value );
		}

		if ( is_null( $value ) && $value === null ) {

			return $default;

		}

		return $value;
	}

	public static function check_acf() {
		if ( class_exists( 'acf' ) ) {
			return true;
		}

		return false;
	}

}

// Run customizer class.
new Fancify_Lite_ACF();
