Created
July 11, 2017 20:09
-
-
Save spivurno/5cc99da16d877ba32616a368d1a60c88 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Get Form ID by Form Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms // Get Form ID by Form Name | |
* | |
* @param $name string The name of the form. | |
* | |
* @return int The form ID. | |
*/ | |
function gw_get_form_id_by_name( $name ) { | |
global $wpdb; | |
$form_id = $wpdb->get_var( $wpdb->prepare( 'select id from wp_rg_form where title = \'%s\'', $name ) ); | |
return (int) $form_id; | |
} |
@Jadine-ibay This code snippet is outdated. Gravity Forms now has a function for this functionality. Below is a link to the updated version of the code snippet that makes use of this function.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
please help? I can't get this to work.