{"id":19020195,"date":"2026-09-15T02:19:58","date_gmt":"2026-09-15T02:19:58","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/warning-undefined-variable-sale_percentage_val\/"},"modified":"2026-09-15T02:19:58","modified_gmt":"2026-09-15T02:19:58","slug":"warning-undefined-variable-sale_percentage_val","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/warning-undefined-variable-sale_percentage_val\/","title":{"rendered":"Warning: Undefined variable $sale_percentage_val `"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Under <strong>PHP 8.3<\/strong>, <code>core\/helpers\/trip-pricing-categories.php<\/code> throws an undefined property\/variable warning because it lacks a null fallback check for <code>$sale_percentage_val<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Error disappears when patching line 75 and 92 in <code>core\/helpers\/trip-pricing-categories.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ $sale_percentage_val    = $result-&gt;sale_percentage_val;<br \/>$sale_percentage        = $result-&gt;sale_percentage_val ?? 0;<br \/><br \/>\/\/ $categories&#091; $index ]&#091;'sale_percentage_val']   = $sale_percentage_val;<br \/>$categories&#091; $index ]&#091;'sale_percentage_val']   = $sale_percentage_val ?? 0;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-19020195","topic","type-topic","status-publish","hentry","topic-tag-warning"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19020195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19020195\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19020195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}