Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows how to set the readonly status of a Participants Database field based on the field data
<?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