We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gpeb-remove-fields-on-edit.php
1 parent 58314e5 commit d3236d4Copy full SHA for d3236d4
gp-entry-blocks/gpeb-remove-fields-on-edit.php
@@ -31,6 +31,21 @@ function gpeb_remove_fields_on_edit( $form ) {
31
if ( strpos( $field->cssClass, 'gpeb-remove-on-edit' ) !== false ) {
32
$field->visibility = 'administrative';
33
}
34
+
35
+ // For pages, we add conditional logic if its marked for removal.
36
+ if ( $field->type == 'page' && strpos( $field->cssClass, 'gpeb-remove-on-edit' ) !== false ) {
37
+ $field->conditionalLogic = array(
38
+ 'actionType' => 'show',
39
+ 'logicType' => 'all',
40
+ 'rules' => array(
41
+ array(
42
+ 'fieldId' => 9999, // A dummy field ID that will never match.
43
+ 'operator' => 'is',
44
+ 'value' => 'hide'
45
+ )
46
47
+ );
48
+ }
49
50
51
return $form;
0 commit comments