Skip to content

Commit

Permalink
fix: setting showOpenButton for onlyoffice-wordpress block
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandrfedorov97 committed Apr 15, 2024
1 parent b503cd8 commit cee33f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/class-onlyoffice-plugin-frontend-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ private function render_link( $atts, $instance ) {

$output = '<div class="wp-block-onlyoffice-wordpress-onlyoffice ' . $align . '">';
$output .= '<a id="linkToOnlyofficeEditor-' . $instance . '" href="' . Onlyoffice_Plugin_Url_Manager::get_editor_url( $atts['id'] ) . '" ' . $target . '>' . $atts['fileName'] . '</a>';
$output .= '<a href="' . Onlyoffice_Plugin_Url_Manager::get_editor_url( $atts['id'] ) . '" ' . $target . ' class="wp-block-onlyoffice-wordpress__button wp-element-button">' . $atts['openButtonText'] . '</a>';

if ( $atts['showOpenButton'] ) {
$output .= '<a href="' . Onlyoffice_Plugin_Url_Manager::get_editor_url( $atts['id'] ) . '" ' . $target . ' class="wp-block-onlyoffice-wordpress__button wp-element-button">' . $atts['openButtonText'] . '</a>';
}

$output .= '</div>';

return apply_filters( 'wp_onlyoffice_shortcode', $output, $atts );
Expand Down

0 comments on commit cee33f1

Please sign in to comment.