Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Yep! Easiest way to do might be to just link to the latest version of the script hosted on the moment.js site:

    add_action( 'wp_enqueue_scripts', function () {
    	$url = 'https://momentjs.com/downloads/moment.js';
    	$ver = '2.29.1';
    
    	wp_enqueue_script( 'momentjs', $url, [], $ver, true );
    } );

    Change the last parameter from true to false if you want the script loaded in the site header rather than the body area.

Viewing 1 replies (of 1 total)
  • The topic ‘how to use moment.js script ?’ is closed to new replies.