• Resolved marianssen

    (@marianssen)


    Hi! I’m have a few “gform_form_post_get_meta” functions that I can’t run when generating Gravity PDF. Is there any PHP true/false boolean that I could use to test whether the function is currently running during generating Gravity PDF?

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi there,

    The gform_form_post_get_meta filter is run when Gravity PDF generates PDFs, so any function(s) you have hooked onto this filter will also be run.

    > Is there any PHP true/false boolean that I could use to test whether the function is currently running during generating Gravity PDF

    The quick and dirty way to check is to hook into the above filter and in your function include echo 'running'; exit;.

    • This reply was modified 1 year, 11 months ago by Jake Jackson.
    Thread Starter marianssen

    (@marianssen)

    Hi @blue-liquid-designs,

    thanks for the reply. I have used the hook above to run some functions, but I do not want to run these functions inside Gravity PDF.

    Your suggestion above will exit the hook everywhere. How can I make an exclusion to not run the hook only inside Gravity PDF?

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Thanks for clarifying what you are trying to do (I had misunderstood your initial question).

    In short, no. There isn’t a constant or function you can check to see if a PDF is currently being generated when the gform_form_post_get_meta filter is run.

    Rather than use the gform_form_post_get_meta filter (which applies any time the form object is retrieved from the database), I’d suggest using one of (or a combination of) these context-specific form filters:

    * gform_pre_render
    * gform_pre_validation
    * gform_pre_submission_filter
    * gform_admin_pre_render

    The above filters execute at various stages of the form display and submission processes.

    Thread Starter marianssen

    (@marianssen)

    @blue-liquid-designs thanks for the clarification. Is there a filter I could use to define field ID to be excluded from the PDF? I know there is the class of “exclude” that can be used, but can this be done programatically using specific IDs?

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Thread Starter marianssen

    (@marianssen)

    @blue-liquid-designs thank you, this worked.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP true/false if in Gravity PDF’ is closed to new replies.