Replace Field On An Element

Use upb_replace_element_attribute( $id, $attribute, $attributes ) helper function with upb_element_{$tag}_attributes filter hook to replace field on existing element.

Example:

add_filter('upb_element_{$tag}_attributes', function( $attributes ){
    return upb_replace_element_attribute('space', array(
        'id'      => 'margin',
        'title'   => esc_html__( 'Margin', 'ultimate-page-builder' ),
        'desc'    => esc_html__( 'Margin between two section', 'ultimate-page-builder' ),
        'type'    => 'spacing',
        'value'   => array( '10px', 'initial', '10px', 'auto' ),
        'unit'    => 'px',
        'options' => array(
            'top'    => TRUE,
            'right'  => FALSE,
            'bottom' => TRUE,
            'left'   => FALSE,
            )
        ), $attributes);
});

results matching ""

    No results matching ""