Skip to content

[SUPPORT-3131] FIX: Target Post Types 설정에 따라 본문 위젯이 동작하도록 수정#19

Merged
heeeyoung merged 1 commit intomasterfrom
fix/SUPPORT-3131/add-content-wrapper
Dec 3, 2025
Merged

[SUPPORT-3131] FIX: Target Post Types 설정에 따라 본문 위젯이 동작하도록 수정#19
heeeyoung merged 1 commit intomasterfrom
fix/SUPPORT-3131/add-content-wrapper

Conversation

@heeeyoung
Copy link
Copy Markdown
Contributor

@heeeyoung heeeyoung commented Dec 3, 2025

배경

  • https://teamdable.atlassian.net/browse/SUPPORT-3131
  • 워드프레스 블로그에서 설정과 달리 위젯이 본문뿐 아니라 메인에도 노출되는 이슈가 발생하였는데, 아래와 같은 원인이 유력해보여 수정해두었습니다.

기존 동작

  • add_content_wrapper()가 is_singular()만 사용하여, Target Post Types와 관계없이 모든 단일 포스트 타입(post, page 등) 에 위젯을 삽입함
    • 예: Target Post Types에 Posts만 설정해도, page 타입에서도 본문 아래 데이블 위젯이 노출되는 문제 발생

변경 내용

  • add_content_wrapper() 조건을 아래와 같이 변경
    • 변경 전: if ( is_feed() || ! is_singular() ) { ... }
    • 변경 후: if ( is_feed() || ! Dable::is_eligible_post_type() ) { ... }
  • 헤더 메타/스크립트 출력(print_header())과 동일하게, Dable::is_eligible_post_type() 내부에서 Target Post Types(dable-target-post-types) 옵션을 기반으로 is_singular()를 평가하도록 통일

결과

  • Target Post Types = post 인 경우
    스크린샷 2025-12-03 오후 6 38 47
  • single post 화면: 본문 위젯 삽입 (기존과 동일)
    스크린샷 2025-12-03 오후 6 38 31
  • page 타입: 본문 위젯 미삽입 (기존과 달리, 설정과 일치하는 동작)
    스크린샷 2025-12-03 오후 6 38 18

@heeeyoung heeeyoung self-assigned this Dec 3, 2025
Copy link
Copy Markdown

@sungcheol-dable sungcheol-dable left a comment

Choose a reason for hiding this comment

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

워드프레스😱 희영님! 고생 많으셨습니다! 👍👍👍🌻

@heeeyoung heeeyoung merged commit fe7d645 into master Dec 3, 2025
3 checks passed
@heeeyoung heeeyoung deleted the fix/SUPPORT-3131/add-content-wrapper branch December 3, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants