Skip to content

Commit 531d7b2

Browse files
committed
gw-conditional-logic-entry-meta.php: Updated logic to only pull meta for the current form when on various form-specific Gravity Forms pages such as Form Settings, Notifications, etc.
1 parent 4499935 commit 531d7b2

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

gravity-forms/gw-conditional-logic-entry-meta.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Plugin URI: https://gravitywiz.com/
1414
* Description: Use the entry meta in conditional logic (e.g. payment status, approval status, etc).
1515
* Author: Gravity Wiz
16-
* Version: 0.2
16+
* Version: 0.3
1717
* Author URI: https://gravitywiz.com
1818
*/
1919
class GW_CL_Entry_Meta {
@@ -87,12 +87,18 @@ public function get_conditional_logic_options() {
8787

8888
$form_ids = 0;
8989

90-
// Scope entry meta to the current form for GP Email Users.
91-
if ( is_admin() && rgget( 'page' ) === 'gp-email-users' ) {
92-
$form_ids = rgpost( '_gform_setting_form' );
93-
if ( ! $form_ids ) {
94-
$draft = gp_email_users()->get_draft();
95-
$form_ids = $draft['form'];
90+
// Scope entry meta to the current form for GP Email Users and other admin screens
91+
if ( is_admin() ) {
92+
if ( rgget( 'page' ) === 'gp-email-users' ) {
93+
$form_ids = rgpost( '_gform_setting_form' );
94+
if ( ! $form_ids ) {
95+
$draft = gp_email_users()->get_draft();
96+
$form_ids = $draft['form'];
97+
}
98+
}
99+
100+
if ( GFForms::get_page() && rgget( 'id' ) ) {
101+
$form_ids = rgget( 'id' );
96102
}
97103
}
98104

0 commit comments

Comments
 (0)