WordPress.org

Forums

YOP Poll
[resolved] How do the poll answers load? (4 posts)

  1. flagman5
    Member
    Posted 1 year ago #

    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?

    https://wordpress.org/plugins/yop-poll/

  2. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    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

    Regards,

    YOP Team

  3. flagman5
    Member
    Posted 1 year ago #

    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?

  4. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.