• Resolved kirkward

    (@kirkward)


    I have a post using php to get user_meta. Here is the code.

    By <?php
    // Get the user ID
    $user_id = get_current_user_id();
      // echo $user_id ;
      $key1 = 'first_name';
      $key2 = 'last_name';
      $single = true;
      $user_first = get_user_meta( $user_id, $key1, $single );
      $user_last = get_user_meta( $user_id, $key2, $single );
      echo $user_first . ' ' . $user_last;
    ?>

    The text prints properly in the wordpress post showing my information. However, when the pdf is created, the php looks for data for user 0 (zero) and omits the dynamic text.

    I have set
    define('DISABLE_PDF_CACHE', true);
    in the wp-config.php file, and it has been working properly (I tested by change some text in the template).

    Any suggestions? So far I’m really excited about this plugin. It looks like it may have some flexibility that I have been looking for.

    https://wordpress.org/plugins/wp-pdf-templates/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Viljami Kuosmanen

    (@zuige)

    Hi! Sorry for the late response.

    You’re experiencing this probably because cookie headers that contain user login information are not being forwarded to the template.

    You could try if define('FETCH_COOKIES_ENABLED', true); solves your problem.

    Let me know if you still need assistance.

    Cheers!

    Thread Starter kirkward

    (@kirkward)

    No problem Antti – Thanks for the respnse.

    I’ll be a week or two getting back to testing. We are going ahead and delivering our document in MSWord in the meantime, so as to get the subscribers something, at least.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Another Dynamic Content Problem’ is closed to new replies.