Thank you, I added this filter with the conditions and it all works properly.
add_filter( 'acf/validate_field_group', 'add_custom_location_dynamic', 10, 1 );
function add_custom_location_dynamic( $field_group ) {
if ( $field_group['key'] == 'group_5e998df494b16' && isset( $field_group['local'] ) && $field_group['local'] == 'php' ) {
$field_group['location'][0][] = array(
'param' => 'page',
'operator' => '!=',
'value' => get_field( 'custom_page', 'options' ),
);
}
}
Do you think I can improve it or do you have any more suggestions?
Thank you!