• Resolved tanmaymeh

    (@tanmaymeh)


    Hi there, so there is no any issues about the plugin. It is a nice plugin. I was trying to check the code for my study purpose. So, It may be funny question but I am really confused about it. My question is there is this file inside your plugin: public/class-ays-pb-public.php. In this file in line number 179 there is function called ays_generate_popup. So from where this function is getting that $attr values? I know that this is callback from add_shortcode which have three params by default: attributes array, content and shortcode tag. But from where that $attr array is getting all the ids of the popups posts?

    I var_dump the atts array and it outputs: array(3) { [“id”]=> string(1) “1” [“w”]=> string(3) “700” [“h”]=> string(3) “400” }. From where these are passed? I am really confused.

    I think I described as well as I can. If it is possible to answer my question, I will be grateful to you. Thank you in advance.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tanmaymeh

    (@tanmaymeh)

    Hi there, I think I got my answer to above question: The shortcode atts came from line 2160 in same file :

    if (strpos($current_url, $elementor_editor_slug) === false) {

    $shortcode2 = “[ays_pb id={$i[‘id’]} w={$i[‘width’]} h={$i[‘height’]} ]”;

    $ays_search_shortcode = $this->ays_has_shortcode_in_posts($i[‘id’]);

    if ($ays_search_shortcode !== true){

    echo do_shortcode($shortcode2);

    }

    }

    But now what I want to know is how this shortcode in inserted into each post? In which file can I get that code? Can you point me to the right direction?

    Plugin Support Jasmine

    (@hyenokian)

    Dear @tanmaymeh,

    Thank you for the topic.

    I want to mention, that this code works during the WordPress wp_footer hook. The hook is created in the following file:
    \wp-content\plugins\ays-popup-box\includes\class-ays-pb.php
    $this->loader->add_action( 'wp_footer', $plugin_public, 'ays_shortcodes_show_all');

    See the screenshot below:

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using your plugin code for reference’ is closed to new replies.