Support » Plugin: YOP Poll » How do the poll answers load?

  • Resolved flagman5


    I am trying to understand how the poll answers load on the page. It seems that the public-admin.php function “return_yop_poll” gets the poll answers but then it puts the answers into a $yop_poll_public_config variable for use in the yop-poll-public.js. But I cannot find anywhere in yop-poll-public.js that calls out the answers and replaces %POLL-ANSWER-LABEL% with the poll answers.

    Can you please tell me how the answers are loaded through the %POLL-ANSWER-LABEL% template variable?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YOP


    Hi flagman5,

    The replacement of %POLL-ANSWER-LABEL% is done in the answer_replace_callback and answer_result_replace_callback functions, both located in inc/yop_poll_model.php


    YOP Team

    Thanks for the quick reply.

    Then what does return_yop_poll function do in public-admin.php? It looks like it loads the poll answers as well but does not use it?

    Plugin Author YOP



    That function is called when we replace the shortcode and the widgets.
    It’s not used when we load the answers.

    Best wishes,

    YOP Team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do the poll answers load?’ is closed to new replies.