Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transport => auto - Image field outputs invalid background image value #963

Closed
vladcosorg opened this issue May 5, 2016 · 2 comments
Closed
Labels

Comments

@vladcosorg
Copy link
Contributor

Issue description:

The generated rule is
background-image: http://link/to/image
but should be
background-image: url(http://link/to/image)

Version used:

2.3.2

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

               'settings' => 'header_background_image',
               'label' => esc_html__('Background image', 'cf47rs'),
               'type' => 'image',
               'default' => '',
               'transport' => 'auto',
               'output' => [
                   [
                       'element' => '.header:not(.header--overlay)',
                       'property' => 'background-image'
                   ]
               ]
@Rayken
Copy link

Rayken commented May 9, 2016

I tend to use the prefix and suffix for background-image, see https://kirki.org/docs/arguments/output.html

Example:

'settings'  => 'header_background_image',
'label'     => esc_html__('Background image', 'cf47rs'),
'type'      => 'image',
'default'   => '',
'transport' => 'auto',
'output'    => array(
    array(
        'element'   => '.header:not(.header--overlay)',
        'property'  => 'background-image',
        'postfix'   => 'url(',
        'suffix'    => ')',
   ),
),
...

@aristath
Copy link
Contributor

aristath commented May 9, 2016

@chetzof hey there!
I believe this was just fixed, can you please check the develop branch?

@aristath aristath added the bug label May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants