Inpsyde\MultilingualPress\Asset\AssetManager::enqueue_script_with_data PHP Method

enqueue_script_with_data() public method

Enqueues the script with the given handle.
Since: 3.0.0
public enqueue_script_with_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data, boolean $in_footer = true ) : boolean
$script Inpsyde\MultilingualPress\Asset\Script | string Script object or handle.
$object_name string The name of the JavaScript variable holding the data.
$data array The data to be made available for the script.
$in_footer boolean Optional. Enqueue in the footer? Defaults to true.
return boolean Whether or not the script was enqueued successfully.
    public function enqueue_script_with_data($script, $object_name, array $data, $in_footer = true)
    {
        $handle = (string) $script;
        if (empty($this->scripts[$handle])) {
            return false;
        }
        if (!$this->add_script_data($this->scripts[$handle], $object_name, $data)) {
            return false;
        }
        return $this->enqueue_script($handle, $in_footer);
    }