Custom Post Type Parents

설명

Compatible with PHP 8.2

Like this plugin? Please consider leaving a 5-star review.

This plugin is meant to solve the problem of highlighting “parent” pages for Custom Post Types in the menu and lists of pages. It integrates with custom menu output as well as output for any functions like wp_list_pages() that utilize the page_css_class or nav_menu_css_class filters. When viewing a custom post type, the assigned “parent page” will be indicated with standard WordPress classes (e.g. current_page_item) in navigation menus and lists of pages.

Usage

  1. In the admin, navigate to Settings > Custom Post Type Parents
  2. For each custom post type, use the dropdown to select a “parent page”

Menus and lists of pages will now have the appropriate classes applied to the specified parent pages. Additionally, Custom Post Type Parents will apply these classes to Simple Section Navigation widgets, if the plugin is installed.

Classes

Custom Post Type Parents applies the following classes to parent and ancestor pages (all classes are consistent with default WordPress classes and are backwards compatible).

Parent
* current-menu-parent
* current_page_parent
* current-custom-post-type-parent
* current-{post type}-parent

Ancestor
* current-menu-ancestor
* current_page_ancestor
* current-custom-post-type-ancestor
* current-{post type}-ancestor

스크린샷

설치

Manual Installation

  1. Upload the entire /custom-post-type-parents directory to the /wp-content/plugins/ directory.
  2. Activate Custom Post Type Parents through the ‘Plugins’ menu in WordPress.

FAQ

How can I report security bugs?

You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. Report a security vulnerability.

후기

2021년 4월 23일
It looks like this is the perfect match for my issue but it’s not working. Using WP 5.7 and Custom Post Type UI 1.9.0
2018년 7월 21일
This issue (no way to set a parent to a custom post type) had been driving me crazy for ages until now! Thanks guys 🙂
2017년 7월 6일 답글 2개
Just what i need! My case: Modified breadcrumbs based on Really Simple Breadcrumbs plugin. Have page – shops, where i have pods widget with list of CPT(shops). With this plugin i finally make breadcrumbs structure correctly, without (very) dirty hacks, just set parent page “shops” to pods post type, and modified breadcrumbs code. Thanks!
모든 6 평가 읽기

기여자 & 개발자

“Custom Post Type Parents”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Custom Post Type Parents”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

1.1.3

  • Change CSS classname (from custom- to current-) to match documentation and keep the same format for all classes.

1.1.2

  • Fix: memory issue infinitely calling constructor.

1.1.1

  • Fix: widget constructor call throwing deprecated notice.

1.1.0

  • Include posts and pages in customizeable list.
  • Update parent select to show hierarchy indenting for easier use.

1.0.1

  • Fix issue in which custom post types weren’t appearing – code was incorrectly referencing slug
  • Add admin text to indicate if no custom post types are available to edit

1.0.0

  • First release