Adds the given data to the given script, and handles it in case the script has been enqueued already.
public add_script_data ( Inpsyde\MultilingualPress\Asset\Script | string $script, string $object_name, array $data ) : Inpsyde\MultilingualPress\Asset\Script | null | ||
$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. |
return | Inpsyde\MultilingualPress\Asset\Script | null | Script object if it exists, null if not. |