<?php

add_action('wp_head', function () {
    $scripts = get('scripts-header', true);
    if (!empty($scripts)) {
        echo $scripts;
    }
}, 100);

add_action('wp_body_open', function () {
    $scripts = get('scripts-body-top', true);
    if (!empty($scripts)) {
        echo $scripts;
    }
}, 10);

add_action('wp_footer', function () {
    $scripts = get('scripts-footer', true);
    if (!empty($scripts)) {
        echo $scripts;
    }
}, 10);

add_action('wp_footer', function () {
    $scripts = get('scripts-body-bottom', true);
    if (!empty($scripts)) {
        echo $scripts;
    }
}, PHP_INT_MAX);
