<?php
/**
 * Dynamic Features compatibility dummy.
 * The old version of of the Dynamic Features exposed three static functions that are used by Theme and Plugins.
 * Those are re-created here and re-routed to their versions within the new namespaces.
 */

if( ! defined( 'ABSPATH' ) ) exit;

if ( ! class_exists('dynamic') ) {
	class dynamic {

		public static function add_dynamic($atts=[], $content=null) {
			return method_exists( '\Greyd\Dynamic\Admin', 'add_dynamic' ) ? \Greyd\Dynamic\Admin::add_dynamic($atts, $content) : null;
		}

		public static function get_enqueue_content() {
			return method_exists( '\Greyd\Dynamic\Render', 'get_enqueue_content' ) ? \Greyd\Dynamic\Render::get_enqueue_content() : null;
		}
		public static function check_enqueue_template($content, $sc) {
			return method_exists( '\Greyd\Dynamic\Render', 'check_enqueue_template' ) ? \Greyd\Dynamic\Render::check_enqueue_template($content, $sc) : null;
		}

		public static function content_match_dynamic($dynamic_values, $content) {
			return method_exists( '\Greyd\Dynamic\Render', 'content_match_dynamic' ) ? \Greyd\Dynamic\Render::content_match_dynamic($dynamic_values, $content) : null;
		}
		public static function match_tags($post, $tags, $value) {
			return method_exists( '\Greyd\Dynamic\Render', 'match_tags' ) ? \Greyd\Dynamic\Render::match_tags($post, $tags, $value) : null;
		}

		public static function get_dynamic_name() {
			return method_exists( '\Greyd\Dynamic\Admin', 'get_dynamic_name' ) ? \Greyd\Dynamic\Admin::get_dynamic_name() : null;
		}
		public static function get_template($template_name) {
			return method_exists( '\Greyd\Dynamic\Admin', 'get_template' ) ? \Greyd\Dynamic\Admin::get_template($template_name) : null;
		}

	}
}