Created
December 21, 2019 01:52
-
-
Save xnau/22a3b0f4314ae61f2726fec1198eb81c to your computer and use it in GitHub Desktop.
Shows how to set the readonly status of a Participants Database field based on the field data
This file contains 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 | |
// set the first_name field to read only | |
add_filter( 'pdb-before_field_added_to_iterator', function ($field) { | |
/** @var PDb_Field_Item $field */ | |
if ( $field->name() === 'first_name' ) { | |
$field->make_readonly(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment