• Resolved zenframe

    (@zenframe)


    Hi I’m trying to embed music players via a custom field and shortcode. The field returns the file URL correctly and the plugin embeds but I get the following error in the console.

    Uncaught ReferenceError: pn_msv_ajax_url is not defined

    Shortcode call looks like this:

    $id = $product->get_id();
    	$score = get_field('music_score_file'); //returns file url as string
    	
    	if ($score) {
    		echo do_shortcode('[pn_msv file="' . $score . '"/]');
    	} else {
    		echo "No score file found";
    	}

    Hope you can help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author efreja

    (@efreja)

    Hi zenframe,

    As far as I can see the page in question works well.
    I guess it was just to point to your work.

    But for having the code in your example working, you should put it in a php file called each time a page or post of your website must be displayed.
    I don’t know in your case but for example it could be in a custom version of the footer.php of your theme.
    That will make that the pn_msv_ajax_url variable in question is added to your page when the plugin finds that it contains the pn_msv shortcode.

    Hope it helps.

    Etienne

    Plugin Author efreja

    (@efreja)

    Hi zenframe,

    As I see no answer, I guess that my answer solved your problem.
    Therefore I mark it as resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AJAX error pn_msv_ajax_url not defined’ is closed to new replies.