First of all. The question is a little misleading. What you actually want is “post id(s) for current user”.
Here we go:
// Global variable for current user ID
// More information: http://codex.wordpress.org/Function_Reference/get_currentuserinfo
$user_ID;
// You need to create a new WP query object
// More info: http://codex.wordpress.org/Class_Reference/WP_Query
$my_query = new WP_Query( array(
'post_type' => 'farmers',
'author' => $user_ID
));
// You get all the current user posts from the query object
$posts = $my_query->posts;
// You get the first post from the posts array
$first_post = $posts[0];
// You get the post ID from post object and store it to $gform_post_id variable
$gform_post_id = $first_post->ID;
Now you can echo that $gform_post_id in your URL
echo 'http://example.com/dashboard/form_page?gform_post_id='.$gform_post_id;
Cheers
Related Posts:
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- How to trigger $_GET request within admin plugin page?
- Wp favorite posts get user favorites in profile using buddypress [closed]
- Storing Options in a Shortcode
- Why isn’t admin_notices displaying my text? [Simple Plugin, Beginner]
- How to generate video out of images via WordPress plugin
- How can I get WordPress to save comments in markdown format?
- add_query_arg not working
- problems with wordpress and php version 5.3.3-1
- WooCommerce get_price returning wrong price when used via ajax
- How to ‘clone’ a wp plugin to make small changes
- Open Post Thumbnail in New Child Theme File in WordPress
- add mediaelement.js plugins into WordPress video player control bar
- Shortcode button dosent work for all posts. Work for first post only
- Where should I save an API key of my user when installing my plugin?
- Prevent a plugin from being automatically activated
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- Accessing post’s meta data based on user’s click of a post
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Preferred way of cacheing a value in php
- Redirecting to home page after login as custom role WordPress
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- How to Use Parameters with a Do_Action Function Within PHP Tags
- Add keywords meta to index.php page
- Custom form action to handle data inside a plugin
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- Add Product Subtitle to Woocommerce Product Page
- Self deactivate plugins after an action occurs
- wp_redirect() not working in Insert PHP plugin in WordPress
- Download any file after submitting a form [closed]
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- woocommerce 3.2.1 not sending order notification emails
- WordPress takes too much time (100 seconds) to load – Front end and back end
- WordPress on AWS with ELB
- Saving changes in wp_editor
- Executing my function once on a specific time
- Set Post Format if find a string in title or post content
- Display data on Word Press site posts and pages from mysql table
- Notepad sticky plugin
- Output array into one table cell
- WooCommerce Custom Product to checkout
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- How to stop or remove an action being called inside a function of an extended class
- Automatically add attributes to woocommerce product?
- WP Post Template – Templates in own folder
- Apple push notification doesn’t work
- Avoid class name collision when using third party libraries in plugins?
- Adding an Options Page to a Plugin
- how to change the verification url of pie register plugin of wordpress?
- How do I “get the next 10 posts after post_id == x”?
- wordpress plugin is not activating from widget
- How to access data in wordpress database externally using php
- How make a php script run only with wp-cron
- How to add equivalent of php include to one page (as plugin?)
- Theme my Login plugin, how to update fields
- Edit Yoast SEO breadcrumbs output [closed]
- CSS from textarea in options page to frontend what to do
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Adding a slider captcha to the comment system
- Date calculations from 2 custom fields
- How to sanitize uploaded file filename from a plugin?
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- How to put JQuery/Ajax inside shortcode?
- Plugins Page invisible / white
- Error with Image Slide plug-in/ s3slider in WP
- How would I go about creating a user ranked post popularity page?
- WordPress: PHP code rendering in the wrong place
- New to wordpress, Question about editing PHP
- wordpress site | All-in-one-cufon IE Issue
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- Redirection of users away from wp-admin (but not administrators)
- Using a custom plugin to capture input data via Ajax and PHP
- Query all customers/users and check for duplicate information
- WordPress function not being called from jQuery method
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Set and access global variable
- Easiest way to add dropdown to a page
- Using meta_query to get date type values from post_meta table WordPress
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- How to enable specific plugin only based around shop manager role?
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- How can I add hyperlink in WP_Error message?
- code is working properly in Core PHP but writing coding in WordPress
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- wp_get_post_terms is difference obj model than the one in rest api response
- Add a CSS class based on categroy id to archive pages
- Changing “elapsed time” to “time remaining” on MP3-jPlayer audio player with CSS or PHP changes
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- WpDataTables – View Image Directory
- Most efficient way to use classes to create admin pages using Settings API
- CMB2 toolkit: Compare 2 Dates and validate the Time
- Image upload and download from front-end
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- WordPress WPforms customization
- PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback Error without any function name
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Adding a new field to the address field type in gravity forms