Skip to content

[DT-180]FEATURE: 워드프레스 블로그 플러그인 개선 (v4.0.0)#23

Draft
heeeyoung wants to merge 3 commits intomasterfrom
feature/DT-180/improve-wordpress-plugin
Draft

[DT-180]FEATURE: 워드프레스 블로그 플러그인 개선 (v4.0.0)#23
heeeyoung wants to merge 3 commits intomasterfrom
feature/DT-180/improve-wordpress-plugin

Conversation

@heeeyoung
Copy link
Copy Markdown
Contributor

@heeeyoung heeeyoung commented Apr 22, 2026

Summary

  • 위젯 지원 페이지 유형 확대 (Post, Page, Archive)
  • 위젯 영역 변경: Left/Right 제거, Top/In-Article/Bottom2 신규 추가
  • Widget Setting UI를 카테고리 탭(Post/Page/Archive)으로 개선
  • v3→v4 마이그레이션 함수 추가 (기존 설정 자동 변환)
  • 버전 3.3.5 → 4.0.0

Changes

지원 페이지 유형 확대

페이지 유형 위젯 지원
Post (개별 글) O
Page (고정 페이지) O
Archive (홈/카테고리/태그) O (bottom, bottom2만)

위젯 영역 변경

위젯 Post Page Archive 비고
Top (신규) O O X 본문 상단
In-Article (신규) O X X 두번째 </p> 뒤 삽입
Bottom O O O 본문 하단
Bottom 2 (신규) O O O Bottom 바로 아래

In-Article 위젯 정책

  • 본문 HTML에서 </p> 태그를 기준으로 두번째 문단 뒤에 위젯을 삽입한다.
  • <p> 태그가 아닌 요소(<div>, <figure>, <blockquote> 등)만으로 구성된 글에서는 삽입 위치를 찾지 못해 In-Article 위젯이 렌더링되지 않는다.
    • Gutenberg 블록 에디터에서 이미지, 갤러리, 커스텀 HTML 등 <p>가 아닌 블록만 사용한 글이 해당됨
  • 문단이 2개 미만인 글에서도 위젯이 삽입되지 않는다 (본문 레이아웃 깨짐 방지)

Widget Setting UI

  • Post / Page / Archive 카테고리 탭으로 분리
  • 카테고리별로 다른 위젯 코드 입력 가능
  • 설정 키 구조: widget_code_{platform}_{category}_{position}

마이그레이션 (v3 → v4)

dable_migrate_from_3_to_4() 함수 (lib/migration.php)가 plugins_loaded hook에서 자동 실행된다.

변환 내용:

기존 키 (v3) 변환 후 키 (v4) 비고
widget_code_{platform}_bottom widget_code_{platform}_post_bottom Post에만 적용 (기존 버전이 Post만 지원했으므로)
display_widget_{platform}_bottom display_widget_{platform}_post_bottom 동일
widget_code_{platform}_left (삭제) Left 위젯 영역 제거
widget_code_{platform}_right (삭제) Right 위젯 영역 제거
  • {platform}responsive, pc, mobile 3가지
  • Page/Archive 카테고리의 위젯 설정은 빈 상태로 시작 (신규 기능이므로)
  • 멀티사이트 환경도 지원 (get_sites() 순회)

Test plan

  • Local by Flywheel 환경에서 Post/Page/Archive 각각 위젯 정상 렌더링 확인
  • 카테고리별(Post/Page/Archive) 위젯 설정 저장·표시 확인
  • Responsive / PC+Mobile 전환 시 정상 동작 확인
  • v3 설정 상태에서 v4 마이그레이션 동작 확인 (bottom → post_bottom, left/right 삭제)
  • In-Article 위젯 두번째 문단 이후 삽입 확인
  • In-Article: <p> 태그 없는 글에서 위젯이 삽입되지 않는지 확인
  • In-Article: 문단 1개 이하인 글에서 위젯이 삽입되지 않는지 확인
  • Archive 페이지에서 bottom/bottom2만 표시되는지 확인
  • 미디어팀 추가 요구사항 반영 여부 확인

Jira

DT-180

heeeyoung and others added 3 commits April 21, 2026 17:19
…support

- Support Post, Page, Archive page types (previously Post only)
- Add new widget positions: Top, In-Article, Bottom 2 (remove Left/Right)
- In-Article widget inserts after 2nd paragraph (Post only)
- Archive pages load Dable script and bottom widgets via wp_footer
- Reorganize Widget Settings UI with category tabs (Post/Page/Archive)
- Dynamic sanitize keys for all platform/category/position combos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Migrate old widget keys to new category-based keys (post/page/archive)
- Remove deprecated left/right widget keys
- Update version to 4.0.0 and changelog in readme.txt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Old version only supported Post pages, so migrating bottom widget
settings to all categories would cause unintended widgets on Page
and Archive pages after update.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@heeeyoung heeeyoung self-assigned this Apr 22, 2026
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.

1 participant