• Resolved Bob Easton

    (@bobeaston)


    Or, in other words, if I were to write a shortcode to be used inside a popup, to display information related to the underlying page/post, how would I get the ID?

    FWIW, the popup is being opened by class-name from the little js on-click method you offered a few days ago. i.e.

    jQuery('.my-classname').on('click', function (event) {
      jQuery('#popmake-6').popmake('open');

    and .. target condition = On Entire Site

    Thanks!

    https://wordpress.org/plugins/popup-maker/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    I will have to do some testing, but using get_the_ID() may work. Though our loop may return the popups ID there instead. If that is the case I may either modify our loop appropriately, or create a new function that can be used inside our loop that will give the current page ID.

    Test it and see what you come up with.

    Thread Starter Bob Easton

    (@bobeaston)

    My tests come up with the popup’s ID.

    Plugin Author Daniel Iser

    (@danieliser)

    Hmm, ok try global $post; $post->ID.

    Thread Starter Bob Easton

    (@bobeaston)

    Nope. Still gets the popup’s ID.

    Plugin Author Daniel Iser

    (@danieliser)

    Ok I will see what I can come up with. It may take an update or a new helper function to get this working.

    You could try

    global $wp_query;
    $wp_query->queried_object_id;
    Thread Starter Bob Easton

    (@bobeaston)

    WooHoo! That will work. A bit imprecise; it brings back a big array. Yet, the information I want is in that array.

    THANKS once again!

    Plugin Author Daniel Iser

    (@danieliser)

    @bobeaston – Yea I will work that out. Probably change our loop to not override the global $post in the first place.

    Plugin Author Daniel Iser

    (@danieliser)

    Please take a moment to rate and review the plugin and or support.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘What is the popup's relationship to a page/post?’ is closed to new replies.