Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions functions/options/class-sunflowereventsettingspage.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ public function create_sunflower_events_options_page(): void {
?>
<div class="wrap">
<h1><?php esc_attr_e( 'Sunflower Settings', 'sunflower' ); ?></h1>
<div class="notice-info sunflower-settings">
<p><strong><?php esc_html_e( 'Documentation', 'sunflower' ); ?></strong></p>
<ul>
<li>
<a href="https://sunflower-theme.de/documentation/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'General Sunflower documentation', 'sunflower' ); ?></a>
</li>
<li>
<a href="https://sunflower-theme.de/documentation26/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Documentation for the Sunflower26 theme', 'sunflower' ); ?></a>
</li>
</ul>
</div>
<form method="post" action="options.php">
<?php
// This prints out all hidden setting fields.
Expand Down
11 changes: 9 additions & 2 deletions functions/options/class-sunflowerfirststepspage.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ public function create_sunflower_admin_page(): void {

<h2><?php esc_html_e( 'First steps', 'sunflower' ); ?></h2>
<div class="notice-info sunflower-settings">
Eine ausführliche Dokumentation gibt es unter
<a href="https://sunflower-theme.de/documentation26/" target="_blank">https://sunflower-theme.de/documentation26/</a>.
<p><strong><?php esc_html_e( 'Documentation', 'sunflower' ); ?></strong></p>
<ul>
<li>
<a href="https://sunflower-theme.de/documentation/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'General Sunflower documentation', 'sunflower' ); ?></a>
</li>
<li>
<a href="https://sunflower-theme.de/documentation26/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Documentation for the Sunflower26 theme', 'sunflower' ); ?></a>
</li>
</ul>
</div>

<form method="post" action="options.php">
Expand Down
40 changes: 11 additions & 29 deletions functions/options/class-sunflowersettingspage.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ public function create_sunflower_settings_page(): void {
?>
<div class="wrap sunflower-setting-admin">
<h1><?php esc_html_e( 'Sunflower Settings', 'sunflower' ); ?></h1>
<div class="notice-info sunflower-settings">
<p><strong><?php esc_html_e( 'Documentation', 'sunflower' ); ?></strong></p>
<ul>
<li>
<a href="https://sunflower-theme.de/documentation/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'General Sunflower documentation', 'sunflower' ); ?></a>
</li>
<li>
<a href="https://sunflower-theme.de/documentation26/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Documentation for the Sunflower26 theme', 'sunflower' ); ?></a>
</li>
</ul>
</div>
<form method="post" action="options.php">
<?php
// This prints out all hidden setting fields.
Expand Down Expand Up @@ -238,15 +249,6 @@ public function sunflower_settings_page_init(): void {
)
);

add_settings_field(
'sunflower_header_social_media',
__( 'Show social media icons in header', 'sunflower' ),
$this->sunflower_header_social_media( ... ),
'sunflower-setting-admin',
'sunflower_layout',
array( 'sunflower_header_social_media', __( 'Show social media icons in header', 'sunflower' ) )
);

add_settings_field(
'sunflower_categories_archive',
__( 'Show list of categories on category archive', 'sunflower' ),
Expand Down Expand Up @@ -515,26 +517,6 @@ public function sunflower_media_creator(): void {

echo '</select>';
}

/**
* Show social media icons in header, too.
*
* @param Array $args The forms argument.
*/
public function sunflower_header_social_media( $args ): void {
$field = $args[0];
$label = $args[1];

printf(
'<label>
<input type="checkbox" id="%1$s" name="sunflower_options[%1$s]" value="checked" %2$s />
%3$s
</label>',
esc_attr( $field ),
isset( $this->options[ $field ] ) ? 'checked' : '',
esc_attr( $label )
);
}
}

if ( is_admin() ) {
Expand Down
52 changes: 49 additions & 3 deletions functions/options/class-sunflowersocialmediasettingspage.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ public function create_sunflower_social_media_page(): void {
?>
<div class="wrap">
<h1><?php esc_html_e( 'Sunflower Settings', 'sunflower' ); ?></h1>
<div class="notice-info sunflower-settings">
<p><strong><?php esc_html_e( 'Documentation', 'sunflower' ); ?></strong></p>
<ul>
<li>
<a href="https://sunflower-theme.de/documentation/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'General Sunflower documentation', 'sunflower' ); ?></a>
</li>
<li>
<a href="https://sunflower-theme.de/documentation26/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Documentation for the Sunflower26 theme', 'sunflower' ); ?></a>
</li>
</ul>
</div>
<form method="post" action="options.php">
<?php
// This prints out all hidden setting fields.
Expand All @@ -72,7 +83,7 @@ public function sunflower_social_media_page_init(): void {

add_settings_section(
'sunflower_social_media',
__( 'Social Media Profiles', 'sunflower' ),
__( 'Social Media Buttons', 'sunflower' ),
$this->print_section_info( ... ),
'sunflower-setting-social-media-options'
);
Expand All @@ -85,9 +96,17 @@ public function sunflower_social_media_page_init(): void {
'sunflower_social_media'
);

add_settings_field(
'sunflower_header_social_media',
__( 'Show social media icons in header', 'sunflower' ),
$this->sunflower_header_social_media_callback( ... ),
'sunflower-setting-social-media-options',
'sunflower_social_media'
);

add_settings_section(
'sunflower_social_media_sharers',
__( 'Social Sharers', 'sunflower' ),
__( 'Share Buttons', 'sunflower' ),
$this->print_section_info_sharers( ... ),
'sunflower-setting-social-media-options'
);
Expand Down Expand Up @@ -172,7 +191,8 @@ public function sanitize( $input ) {
/**
* Print the Section text
*/
public function print_section_info() {
public function print_section_info(): void {
esc_html_e( 'Configure the linked social media buttons shown in the footer and optionally in the header.', 'sunflower' );
}

/**
Expand Down Expand Up @@ -202,6 +222,32 @@ public function sunflower_checkbox_callback( $args ): void {
);
}

/**
* Show social media icons in the header.
*
* Existing values from sunflower_options are used until this setting is
* saved on the Social Media page for the first time.
*/
public function sunflower_header_social_media_callback(): void {
$field = 'sunflower_header_social_media';
$legacy_options = get_option( 'sunflower_options' );
$has_new_value = isset( $this->options[ $field ] );
$is_checked = $has_new_value
? 'checked' === $this->options[ $field ]
: is_array( $legacy_options ) && isset( $legacy_options[ $field ] );

printf(
'<input type="hidden" name="sunflower_social_media_options[%1$s]" value="" />
<label>
<input type="checkbox" id="%1$s" name="sunflower_social_media_options[%1$s]" value="checked" %2$s />
%3$s
</label>',
esc_attr( $field ),
checked( $is_checked, true, false ),
esc_attr__( 'Show social media icons in header', 'sunflower' )
);
}

/**
* Get the settings option array and print one of its values
*/
Expand Down
Binary file modified languages/de_DE.mo
Binary file not shown.
39 changes: 34 additions & 5 deletions languages/de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: sunflower 2.1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/sunflower26\n"
"POT-Creation-Date: 2026-07-01T16:38:57+02:00\n"
"PO-Revision-Date: \n"
"PO-Revision-Date: 2026-08-08 22:47+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de_DE\n"
Expand Down Expand Up @@ -811,16 +811,16 @@ msgstr "deaktiviert"
#: functions/options/class-sunflowersocialmediasettingspage.php:34
#: functions/options/class-sunflowersocialmediasettingspage.php:35
msgid "Social Media"
msgstr "Profile in Sozialen Medien"
msgstr ""

#: functions/options/class-sunflowersocialmediasettingspage.php:75
#: functions/options/class-sunflowersocialmediasettingspage.php:82
msgid "Social Media Profiles"
msgstr "Profile in Sozialen Medien"
msgstr "Social-Media-Profile"

#: functions/options/class-sunflowersocialmediasettingspage.php:90
msgid "Social Sharers"
msgstr "Teile in Sozialen Medien"
msgid "Share Buttons"
msgstr "Teilen-Buttons"

#: functions/options/class-sunflowersocialmediasettingspage.php:97
msgid "Open Graph Fallback Image"
Expand Down Expand Up @@ -1289,6 +1289,35 @@ msgctxt "Font family name"
msgid "GrueneType Neue"
msgstr ""

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "Documentation"
msgstr "Dokumentation"

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "General Sunflower documentation"
msgstr "Allgemeine Sunflower-Dokumentation"

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "Documentation for the Sunflower26 theme"
msgstr "Dokumentation für das Sunflower26-Theme"

#: functions/options/class-sunflowersocialmediasettingspage.php
msgid "Social Media Buttons"
msgstr "Social-Media-Buttons"

#: functions/options/class-sunflowersocialmediasettingspage.php
msgid "Configure the linked social media buttons shown in the footer and optionally in the header."
msgstr "Konfiguriere die verlinkten Social-Media-Buttons, die in der Fußzeile und optional im Header angezeigt werden."

#~ msgid "Form not sent. Captcha wrong. Please try again."
#~ msgstr ""
#~ "Das Formular konnte nicht gesendet werden, weil die Rechnung (Captcha) "
Expand Down
34 changes: 32 additions & 2 deletions languages/sunflower.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-07-01T16:38:57+02:00\n"
"POT-Creation-Date: 2026-08-08T22:47:32+02:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: sunflower\n"
Expand Down Expand Up @@ -762,7 +762,7 @@ msgid "Social Media Profiles"
msgstr ""

#: functions/options/class-sunflowersocialmediasettingspage.php:90
msgid "Social Sharers"
msgid "Share Buttons"
msgstr ""

#: functions/options/class-sunflowersocialmediasettingspage.php:97
Expand Down Expand Up @@ -1218,3 +1218,33 @@ msgstr ""
msgctxt "Font family name"
msgid "GrueneType Neue"
msgstr ""

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "Documentation"
msgstr ""

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "General Sunflower documentation"
msgstr ""

#: functions/options/class-sunflowerfirststepspage.php
#: functions/options/class-sunflowersettingspage.php
#: functions/options/class-sunflowersocialmediasettingspage.php
#: functions/options/class-sunflowereventsettingspage.php
msgid "Documentation for the Sunflower26 theme"
msgstr ""

#: functions/options/class-sunflowersocialmediasettingspage.php
msgid "Social Media Buttons"
msgstr ""

#: functions/options/class-sunflowersocialmediasettingspage.php
msgid "Configure the linked social media buttons shown in the footer and optionally in the header."
msgstr ""