Advertisement
Guest User

Untitled

a guest
Jun 13th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2.  
  3. defined('ABSPATH') or die('What are you looking for?');
  4. function form_id_show_wp321(){
  5. ob_start();
  6.  
  7. //This is to pass gform ID
  8. // Global variable for current user ID
  9. // More information: http://codex.wordpress.org/Function_Reference/get_currentuserinfo
  10.  
  11. $user_ID = get_current_user_id();
  12.  
  13. // You need to create a new WP query object
  14. // More info: http://codex.wordpress.org/Class_Reference/WP_Query
  15. $post = get_posts( array(
  16. 'author' => $id,
  17. 'orderby' => 'date',
  18. 'numberposts' => 1
  19. ));
  20.  
  21. // You get all the current user posts from the query object
  22. $post = $post[0];
  23.  
  24. // You get the post ID from post object and store it to $gform_post_id variable
  25. $gform_post_id = $post->ID;
  26.  
  27. ?>
  28.  
  29. <a href="<?php echo 'https://admin.ukoama.com/become-a-client-existing-user/?gform_post_id='.$gform_post_id;?>">UPLOAD YOUR LETTER OF AUTHORITY HERE</a>
  30. <?php
  31.  
  32. return ob_get_clean();
  33.  
  34. }
  35.  
  36. add_shortcode('show-id','form_id_show_wp321');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement