Skip to content

Commit

Permalink
gpro-readonly-on-edit.php: Added a snippet to provide disable editi…
Browse files Browse the repository at this point in the history
…ng functionality on GPEB, GravityView and Gravity Flow User Input.
  • Loading branch information
saifsultanc committed Nov 2, 2023
1 parent 7f290d2 commit d45100b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gp-read-only/gpro-readonly-on-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ function gpeb_set_readonly_on_edit( $form ) {
$is_block = class_exists( 'WP_Block_Supports' ) && rgar( WP_Block_Supports::$block_to_render, 'blockName' ) === 'gp-entry-blocks/edit-form';

Check failure on line 28 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 2 tabs, found 1
}

Check failure on line 29 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 1 tabs, found 0

$is_gravityview = function_exists( 'gravityview' ) && gravityview()->request->is_edit_entry();

Check failure on line 31 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 1 tabs, found 0
$is_gravity_flow = rgget( 'lid' ) && rgget( 'page' ) == 'gravityflow-inbox';

Check failure on line 32 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 1 tabs, found 0

// disable the target field for GPEB, GravityView and Gravity Flow User Input step.

Check failure on line 34 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected at least 1 tabs, found 0
if ( $is_block || ( function_exists( 'gravityview' ) && gravityview()->request->is_edit_entry() ) || ( rgget( 'lid' ) && rgget( 'page' ) == 'gravityflow-inbox' ) ) {
if ( $is_block || $is_gravityview || $is_gravity_flow ) {

Check failure on line 35 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 1 tabs, found 0
foreach ( $form['fields'] as &$field ) {

Check failure on line 36 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 2 tabs, found 1
if ( strpos( $field->cssClass, 'gpeb-readonly-on-edit' ) !== false ) {

Check failure on line 37 in gp-read-only/gpro-readonly-on-edit.php

View workflow job for this annotation

GitHub Actions / PHPCS (Files Changed)

Line indented incorrectly; expected 3 tabs, found 2
$field->gwreadonly_enable = true;
Expand Down

0 comments on commit d45100b

Please sign in to comment.