Skip to content

Presets - removes undefined subparam #2064

@Ninos

Description

@Ninos

If you have a custom field like:

array(
    'id'                    => 'typography_h1',
    'type'                  => 'typography',
    'title'                 => 'H1',
    'font-backup'           => true,
    'text-transform'        => true,
    'default'               => array(
        'color'                 => '#888888',
        'font-family'           => 'Montserrat',
        'font-backup'           => 'Arial, Helvetica, sans-serif',
        'font-size'             => '26px',
        'font-weight'           => '400',
        'text-align'            => 'left',
        'text-transform'        => 'none',
        'line-height'           => '32px'
    )
)

and you're using following preset:

'typography_h1' => array(
    'color' => '#efefef'
)

the in the preset undefined param will also be removed. So after using the preset you get:

'typography_h1' => array(
    'color' => '#efefef'
)

and not

'typography_h1' => array(
    'color'                 => '#efefef',
    'font-family'           => 'Montserrat',
    'font-backup'           => 'Arial, Helvetica, sans-serif',
    'font-size'             => '26px',
    'font-weight'           => '400',
    'text-align'            => 'left',
    'text-transform'        => 'none',
    'line-height'           => '32px'
)

as expected.

I think this should be fixed :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions