Strona główna (static front page) z PostX/Kadence nie serwuje Markdown #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Strona główna webporadnik.pl (static front page, ID 2421, typ
page) nie zwraca Markdown przy?format=mdani przezAccept: text/markdown. Zwraca normalny HTML.Diagnoza
Headery z
curl -sI 'https://webporadnik.pl/?format=md':Content-Type: text/html; charset=UTF-8— plugin nie zadziałałVary: User-Agent— brakVary: Acceptod pluginuX-Markdown-Tokens—handle_markdown_request()nie został wykonany lub nie trafił w żaden warunekKonfiguracja:
Co już sprawdzono
template_redirectzmieniony z 5 na 0 — nie pomogło (commit11ea481)$_GET['format']fallback — już istnieje (commitce8f9c0),is_markdown_requested()działa poprawnietemplate_redirectlubtemplate_includei wywołujeexitprzed pluginem, LUB...is_singular()zwracafalsena static front page — WordPress może nie traktować static front page jakois_singular()w kontekście PostX template overridePotrzebna diagnostyka
Dodać debug logging na początku
handle_markdown_request():Możliwe scenariusze:
is_singular()= false → potrzebna dodatkowa obsługais_front_page()get_queried_object()= null → potrzebny fallback naget_option('page_on_front')Możliwe rozwiązania
is_front_page()whandle_markdown_request()get_post(get_option('page_on_front'))jako fallback gdyget_queried_object()nie zwraca WP_Postparse_requestlubwp)template_includefilter zadziała lepiej niżtemplate_redirectactionPliki
markdown-for-agents/includes/class-content-negotiation.php—handle_markdown_request()linia 30