Skip to content

Commit

Permalink
settings updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasashi committed Sep 21, 2024
1 parent 5f4ea8d commit 54a4c39
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions includes/class-wordpress-plugin-template-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,15 @@ public function settings_page() {
$tab_link = remove_query_arg( 'settings-updated', $tab_link );
}

// Output tab.
$html .= '<a href="' . $tab_link . '" class="' . esc_attr( $class ) . '">' . esc_html( $data['title'] ) . '</a>' . "\n";
// Output tab
$html .= '<a href="' . $tab_link . '" class="' . esc_attr( $class ) . '">' . ( !empty($data['logo']) ? '<img src="'.$data['logo'].'" alt="" style="margin-top: 4px;margin-right: 7px;float: left;">' : '' ) . wp_kses_normalize_entities($data['title']) . '</a>' . "\n";

++$c;
}

$html .= '</h2>' . "\n";
}

if( $this->settings[$tab]['fields'] ){

$html .= '<form method="post" action="options.php" enctype="multipart/form-data">' . "\n";

// Get settings fields.
Expand All @@ -449,14 +447,17 @@ public function settings_page() {
do_settings_sections( $this->parent->_token . '_settings' );
$html .= ob_get_clean();

$html .= '<p class="submit">' . "\n";
$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings', 'wordpress-plugin-template' ) ) . '" />' . "\n";
$html .= '</p>' . "\n";
$html .= '</form>' . "\n";
}

$html .= '</div>' . "\n";
if( $this->settings[$tab]['fields'] ){

$html .= '<p class="submit">' . "\n";
$html .= '<input type="hidden" name="tab" value="' . esc_attr( $tab ) . '" />' . "\n";
$html .= '<input name="Submit" type="submit" class="button-primary" value="' . esc_attr( __( 'Save Settings', 'wordpress-plugin-template' ) ) . '" />' . "\n";
$html .= '</p>' . "\n";
}

$html .= '</form>' . "\n";

$html .= '</div>' . "\n";

echo wp_kses_normalize_entities($html); //phpcs:ignore
}
Expand Down

0 comments on commit 54a4c39

Please sign in to comment.