public function add_shared_data($key, $value = null)
    {
        if (\is_array($key)) {
            static::$global_data = \array_merge(static::$global_data, $key);
            return;
        }

        static::$global_data[ $key ] = $value;
    }
public function add_shared_data($key, $value = null)
    {
        if (\is_array($key)) {
            static::$global_data = \array_merge(static::$global_data, $key);
            return;
        }

        static::$global_data[ $key ] = $value;
    }
public function add_shared_data ( $ key , $ value = null ) { if ( \ is_array ( $ key ) ) { static :: $ global_data = \ array_merge ( static :: $ global_data , $ key ) ; return ; } static :: $ global_data [ $ key ] = $ value ; }
Adds shared data which is passed to all templates.

@since  1.0.0

@param string|array $key   The key of the data to add.
Can also be an array of key => values to set multiple data at once.
@param mixed        $value Data value if a single key is being added.
Adds shared data which is passed to all templates .