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

    (@blue-liquid-designs)

    Hi,

    Yes. This is possible. You just need to manually initialise the PDF plugin before the GF notifications function is called.

    For instance:

    global $gfpdf;
    	if(!is_object($gfpdf))
    	{
    		$gfpdf = new GFPDF_Core();
    	}

    This will hook into Gravity Form’s notifications filter and attach the PDF (if configured).

    Thread Starter adrianlittee

    (@adrianlittee)

    When I use the above code I get the following error:

    PHP Fatal error: Class ‘GFPDF_Core_Model’ not found in /var/www/wordpress/wp-content/plugins/gravity-forms-pdf-extended/pdf.php on line 180

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    The GFPDF_Core_Model class gets called during WordPress’s standard ‘init’ action hook. Just make sure you call it after that – e.g.

    add_action('init', 'pdf_init', 15); /* note the non-standard call number '15' */
    
    function pdf_init()
    {
      /* place code in here */
    }
    Thread Starter adrianlittee

    (@adrianlittee)

    Apologies for being a bit thick but does the below code go in the function you specified?

    global $gfpdf;
    	if(!is_object($gfpdf))
    	{
    		$gfpdf = new GFPDF_Core();
    	}

    If so then I am getting this error:

    PHP Fatal error: Call to undefined method stdClass::assign_index()

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Correct. The full code would be:

    add_action('init', 'pdf_init', 15); /* note the non-standard call number '15' */
    
    function pdf_init()
    {
      /* place code in here */
    	global $gfpdf;
    	if(!is_object($gfpdf) && class_exists('RGForms')) /* small extra check so no error is thrown when GF is disabled */
    	{
    		$gfpdf = new GFPDF_Core();
    	}
    }

    Please ensure you are using the latest version of the plugin (3.5.4).

    Thread Starter adrianlittee

    (@adrianlittee)

    This worked perfectly. I had the order mixed up when I was trying. thank you very much!

    EXcellent. Works great.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Resending PDF's’ is closed to new replies.