Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('ABSPATH') or die('What are you looking for?');
- function form_id_show_wp321(){
- ob_start();
- //This is to pass gform ID
- // Global variable for current user ID
- // More information: http://codex.wordpress.org/Function_Reference/get_currentuserinfo
- $user_ID = get_current_user_id();
- // You need to create a new WP query object
- // More info: http://codex.wordpress.org/Class_Reference/WP_Query
- $post = get_posts( array(
- 'author' => $id,
- 'orderby' => 'date',
- 'numberposts' => 1
- ));
- // You get all the current user posts from the query object
- $post = $post[0];
- // You get the post ID from post object and store it to $gform_post_id variable
- $gform_post_id = $post->ID;
- ?>
- <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>
- <?php
- return ob_get_clean();
- }
- add_shortcode('show-id','form_id_show_wp321');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement