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

Added a filter for image helper $image_data #137

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

Liblastic
Copy link
Contributor

This adds a filter for image helper $image_data.

This way we can add attributes for the images added with @image helper.
After the changes this issue will be fixed.
#136

loading attribute can added like so for all the images at once.

/**
 * Filter image helper data.
 *
 * @param array $image_data DustPress image helper data.
 *
 * @return mixed
 */
function filter_image_helper_data( $image_data ) {

    $image_data['attrs']['loading'] = 'lazy';

    return $image_data;
}

\add_action( 'dustpress/image/image_data', 'filter_image_helper_data', 1 );

@Liblastic Liblastic changed the title Added a filter for image helper Added a filter for image helper $image_data Dec 3, 2019
@Nomafin Nomafin merged commit 1b474b8 into master Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants