From f7fea7554d455bfce40cfc037623404b504f101d Mon Sep 17 00:00:00 2001 From: Marcus Quinn Date: Fri, 14 Mar 2025 04:35:03 +0000 Subject: [PATCH] Fix theme author display: - Add proper author data handling - Fix author data structure parsing - Add missing API fields - Remove unnecessary strip_tags --- admin/settings.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/admin/settings.php b/admin/settings.php index 67f1ee4..f304ab6 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -280,6 +280,8 @@ function wpa_superstar_ajax_get_theme() { 'requires' => true, 'requires_php' => true, 'active_installs' => true, + 'author' => true, + 'preview_url' => true, ) )); @@ -291,6 +293,14 @@ function wpa_superstar_ajax_get_theme() { error_log('WPA Superstar: Successfully fetched theme data'); + // Format author data + $author = ''; + if (is_string($theme_data->author)) { + $author = $theme_data->author; + } elseif (is_array($theme_data->author)) { + $author = isset($theme_data->author['display_name']) ? $theme_data->author['display_name'] : ''; + } + // Generate custom HTML for the theme ob_start(); ?> @@ -300,7 +310,7 @@ function wpa_superstar_ajax_get_theme() {
-
author))); ?>
+

name); ?>

@@ -335,7 +345,7 @@ function wpa_superstar_ajax_get_theme() {

name); ?>

-

author))); ?>

+

description); ?>

version)); ?>