Skip to content

Commit

Permalink
Function only exists since 5.3
Browse files Browse the repository at this point in the history
Need to maintain back compat
  • Loading branch information
joedolson committed Dec 17, 2020
1 parent 8f79f10 commit db80268
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/wp-accessibility-longdesc.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,16 @@ function wpa_longdesc_add_attr( $html, $id, $caption, $title, $align, $url, $siz
return $html;
}

/**
* Core function. Add reference style for long description.
*/
register_block_style(
'core/image',
array(
'name' => 'longdesc',
'label' => __( 'Has Long Description', 'wp-accessibility' ),
'style_handle' => 'longdesc-style',
)
);
if ( function_exists( 'register_block_style' ) ) {
/**
* Core function. Add reference style for long description.
*/
register_block_style(
'core/image',
array(
'name' => 'longdesc',
'label' => __( 'Has Long Description', 'wp-accessibility' ),
'style_handle' => 'longdesc-style',
)
);
}

0 comments on commit db80268

Please sign in to comment.