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
35 changes: 18 additions & 17 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?php
<?php

defined( 'ABSPATH' ) || exit;

/*
* functions.php is only needed to enable WordPress Features we would like to use later for our REST API
*/

function blank_wordpress_theme_support() {

#Enables RSS Feed Links
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
// Enables RSS Feed Links
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );

add_theme_support( 'custom-logo' );
add_theme_support(
'custom-logo',
array(
'height' => 256,
'width' => 256,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
)
);
}
add_theme_support(
'custom-logo',
array(
'height' => 256,
'width' => 256,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
)
);
}

add_action( 'after_setup_theme', 'blank_wordpress_theme_support' );

Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Füge einen Fallback für wp_body_open() hinzu.

Wie bereits bei style.css erwähnt: wp_body_open() ist erst ab WordPress 5.2 verfügbar. Falls die Mindestversion bei 4.7 bleibt, sollte hier ein Fallback eingefügt werden.

🛡️ Vorgeschlagene Änderung
-    <?php wp_body_open(); ?>
+    <?php
+    if ( function_exists( 'wp_body_open' ) ) {
+        wp_body_open();
+    }
+    ?>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@index.php` at line 17, wp_body_open() ist erst ab WP 5.2 verfügbar und der
Aufruf in index.php kann auf älteren Installationen fatale Fehler verursachen;
füge einen Fallback-Polyfill hinzu, der vor der Verwendung definiert wird (z. B.
in index.php oder besser in functions.php) mit if
(!function_exists('wp_body_open')) { function wp_body_open() {
do_action('wp_body_open'); } } oder rufe wp_body_open() nur bedingt auf, um
sicherzustellen, dass der Hook weiterhin ausgelöst wird ohne auf neuere
WP-Versionen angewiesen zu sein.


<?php wp_footer(); ?>
</body>
</html>
8 changes: 4 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Theme URI: https://github.com/GrowthWizard/blank-wordpress-theme
Author: Dominik Stein
Author URI: https://steindominik.de/
Description: A WordPress Theme which doesn't show any content in the frontend and is completely blank. Since the Backend (exampledomain.de/wp-content) is still available, you can use this WordPress Theme as headless CMS for any Javascript Framework you like (i.e. via RestAPI). Enjoy!
Version: 1.0.0
Version: 1.1.0
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: featured-images, theme-options,
Text Domain: blank-wordpress-theme
Requires at least: 4.6
Tested up to: 6.3
Requires PHP: 5.6
Requires at least: 4.7
Tested up to: 6.7
Requires PHP: 7.4
Comment on lines +12 to +14
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

WordPress wp_body_open function version introduced

💡 Result:

The wp_body_open function was introduced in WordPress version 5.2.0.

Citations:


🏁 Script executed:

# Check repository structure and find relevant files
find . -type f -name "*.php" -o -name "style.css" | head -20

Repository: GrowthWizard/blank-wordpress-theme

Length of output: 117


🏁 Script executed:

# Look for index.php and check if wp_body_open is used
rg "wp_body_open" --type php

Repository: GrowthWizard/blank-wordpress-theme

Length of output: 116


🏁 Script executed:

# Find where version requirements are defined
rg "Requires at least|Requires PHP" --type php --type css -A 2 -B 2

Repository: GrowthWizard/blank-wordpress-theme

Length of output: 272


Erhöhe die WordPress-Mindestversion auf 5.2 oder füge einen Fallback für wp_body_open() hinzu.

In index.php wird wp_body_open() verwendet, diese Funktion wurde jedoch erst in WordPress 5.2 eingeführt. Mit der aktuellen Mindestanforderung von 4.7 führt dies zu Fehlern auf älteren Installationen.

Erhöhe die Mindestversion in style.css auf 5.2 oder ergänze den Aufruf mit einem Fallback:

if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@style.css` around lines 12 - 14, Update the WordPress minimum version or add
a backward-compatible fallback for wp_body_open: either change the header
"Requires at least:" in style.css from 4.7 to 5.2, or modify the index.php where
wp_body_open() is invoked (the wp_body_open() call) to guard it with a
function_exists check so older WP installs won’t fatal.

*/