/var/www/wp2.qr4y.com/www/wp-content/plugins/elementor-pro/modules/attributes
Edit: /var/www/wp2.qr4y.com/www/wp-content/plugins/elementor-pro/modules/attributes/module.php (2875B)
is_attributes_active() || $this->is_license_expired() ) {
add_action(
'elementor/atomic-widgets/settings/transformers/register',
function ( $transformers ) {
$attributes_key = Attributes_Prop_Type::get_key();
$transformers->register(
$attributes_key,
new Pro_Attributes_Transformer()
);
},
20
);
add_filter(
'elementor/atomic-widgets/controls',
fn( $element_controls, $atomic_element ) => $this->inject_attrs_control( $element_controls, $atomic_element ),
10,
2
);
}
}
private function inject_attrs_control( $element_controls, $atomic_element ) {
$schema = $atomic_element::get_props_schema();
if ( ! array_key_exists( 'attributes', $schema ) ) {
return $element_controls;
}
foreach ( $element_controls as $item ) {
if ( $item instanceof Section && $item->get_id() === 'settings' ) {
$is_empty_controls = empty( $item->get_items() );
$control = Repeatable_Attributes_Control::bind_to( 'attributes' )
->set_meta( [ 'topDivider' => ! $is_empty_controls ] )
->set_repeaterLabel( __( 'Attributes', 'elementor-pro' ) )
->set_initialValues(
[
'key' => [
'$$type' => 'string',
'value' => '',
],
'value' => [
'$$type' => 'string',
'value' => '',
],
]
)
->set_child_control_props( (object) [] )
->set_patternLabel( '${value.key.value}="${value.value.value}"' )
->set_placeholder( 'Empty attribute' )
->set_child_control_type( 'attributes' )
->hide_duplicate()
->hide_toggle();
if ( method_exists( $control, 'set_prop_key' ) ) {
$control->set_prop_key( 'attributes' );
}
if ( $this->is_license_expired() || ! $this->is_attributes_active() ) {
$control
->set_addItemTooltipProps( [
'disabled' => true,
] )
->set_child_control_props( (object) [ 'readOnly' => true ] );
}
$item->add_item( $control );
break;
}
}
return $element_controls;
}
}