[wordpress插件] Custom Post Type Parents自定义帖子类型的父母

wordpress 插件 文章 2020-04-09 07:30 361 0 全屏看文

AI助手支持GPT4.0

评分
80
描述

Like this plugin?

喜欢这个插件吗?

Please consider leaving a 5-star review.

请考虑留下5星评价

>

>

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.

它与自定义菜单输出以及使用 page_css_class nav_menu_css_class 过滤器的 wp_list_pages()之类的任何功能的输出集成在一起。

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.

查看自定义帖子类型时,将在导航菜单和页面列表中使用标准的WordPress类(例如current_page_item)指示分配的“父页面”。

Usage

用法

    1. In the admin, navigate to Settings > Custom Post Type Parents
    2. 在管理员中,导航至设置>自定义帖子类型的父母

    3. For each custom post type, use the dropdown to select a “parent page”
    4. 对于每种自定义帖子类型,请使用下拉菜单选择一个“父页面”

    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.<

    此外,如果已安装插件,则“自定义帖子类型的父母”会将这些类应用于简单节导航小部件。

    /p>

    / p>

    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).

    “自定义帖子类型”父母将以下类应用于父页面和祖先页面(所有类均与默认WordPress类一致并且向后兼容)。

    Parent

    父母

    * current-menu-parent

    * current-menu-parent

    * current_page_parent

    * current_page_parent

    * current-custom-post-type-parent

    * current-custom-post-type-parent

    * current-{post type}-parent

    *当前-{帖子类型}-父母

    Ancestor

    祖先

    * current-menu-ancestor

    *当前菜单祖先

    * current_page_ancestor

    * current_page_ancestor

    * current-custom-post-type-ancestor

    *当前自定义帖子类型的祖先

    * current-{post type}-ancestor

    *当前-{post type}-祖先

安装步骤

Manual Installation

手动安装

    1. Upload the entire /custom-post-type-parents directory to the /wp-content/plugins/ directory.
    2. 将整个 / custom-post-type-parents 目录上传到 / wp-content / plugins / 目录。

    3. Activate Custom Post Type Parents through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活自定义帖子类型的父母。

下载地址
https://downloads.wordpress.org/plugin/custom-post-type-parents.1.1.2.zip
-EOF-

AI助手支持GPT4.0