Title: Post Type Spotlight
Author: Jonathan Desrosiers
Published: <strong>2013 年 2 月 25 日</strong>
Last modified: 2024 年 1 月 24 日

---

搜索插件

![](https://ps.w.org/post-type-spotlight/assets/banner-772x250.png?rev=2955747)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/post-type-spotlight/assets/icon-256x256.png?rev=2955747)

# Post Type Spotlight

 作者：[Jonathan Desrosiers](https://profiles.wordpress.org/desrosj/)

[下载](https://downloads.wordpress.org/plugin/post-type-spotlight.zip)

 * [详情](https://cn.wordpress.org/plugins/post-type-spotlight/#description)
 * [评价](https://cn.wordpress.org/plugins/post-type-spotlight/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/post-type-spotlight/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/post-type-spotlight/#developers)

 [支持](https://wordpress.org/support/plugin/post-type-spotlight/)

## 描述

The plugin displays a checkbox in the publish meta box to feature a post. The checkbox
only appears on admin selected post types which can be selected in the Settings-
>Writing screen.

When a post is designated as featured:

 * It receives ‘featured’ and `featured-{$posttype}` classes via the post_class 
   filter.
 * Shows featured posts as such in the post type’s admin screen
 * Assigns a post a hidden taxonomy term (featured) that can easily be queried.

_Note: For the plugin to work on attachments, you must be using 3.5 or above. All
other features will work on 3.1.0 and up._

## 屏幕截图

 * [[
 * The publish area with the featured toggle.
 * [[
 * The featured list block
 * [[
 * The settings page
 * [[
 * Options on the edit screen
 * [[
 * Markup example when using `post_class();`
 * [[
 * Classic Editor Checkbox Toggle

## 安装

 1. Upload the plugin folder to the `/wp-content/plugins/` directory
 2. 通过WordPress的的“Plugins”菜单激活插件
 3. Navigate to the Settings->Writing section and select the post types you would like
    to have the featured abilities.

## 常见问题

### Isn’t this the same as sticky posts?

This is not the same as sticky posts. Sticky functionality can only be applied to
the core ‘post’ post type. [More information on why](https://core.trac.wordpress.org/ticket/12702#comment:28)

### How do I find just my featured posts?

This snippet of code will fetch the 10 most recent posts that are featured.

    ```
    <?php
    $featured_posts = new WP_Query( array(
        'post_type' => 'post',
        'posts_per_page' => 10,
        'tax_query' => array(
            array(
                'taxonomy' => 'pts_feature_tax',
                'field' => 'slug',
                'terms' => array( 'featured' ),
            )
        )
    ) );

    if ( $featured_posts->have_posts() ) : while ( $featured_posts->have_posts() ) : $featured_posts->the_post();

        //output featured posts here

    endwhile; endif;
    ```

?>“

## 评价

此插件暂无评价。

## 贡献者及开发者

「Post Type Spotlight」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Jonathan Desrosiers ](https://profiles.wordpress.org/desrosj/)
 *   [ Linchpin ](https://profiles.wordpress.org/linchpin_agency/)
 *   [ Aaron Ware ](https://profiles.wordpress.org/aware/)

「Post Type Spotlight」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/post-type-spotlight/contributors)
为本插件所做的贡献。

[帮助将「Post Type Spotlight」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/post-type-spotlight)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/post-type-spotlight/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/post-type-spotlight/)，或通过[RSS](https://plugins.trac.wordpress.org/log/post-type-spotlight/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/post-type-spotlight/)。

## 更新日志

#### 3.0.0

 * Improved compatibility with the Block Editor and the enhancements it brings
 * Added npm as base package manager
 * Added ESLint for JS linting
 * Added Stylelint for CSS linting
 * Added EditorConfig for consistent coding styles
 * Added Husky for pre-commit hooks
 * Added Prettier for code formatting
 * Added PHPCS for PHP linting
 * Added WPCS for WordPress PHP linting
 * Added Composer for PHP package management
 * Added wp-scripts for WordPress build scripts
 * Added webpack for JS module bundling
 * Added a new Featured Posts Variation of the Query Loop
 * Added the ability to filter teh Featured Posts Query Loop to only show featured
   posts
 * Added the ability to filter the Featured Posts Query Loop to show all posts excluding
   featured posts
 * Added the ability to filter the Featured Posts Query Loop to show all posts and
   show featured posts first (similar to sticky)
 * Added the ability to sort post lists by featured posts.
 * Removed Babel for js transpiling as it wasn’t needed any more
 * Removed Yarn as package manager
 * Removed Gulp as build tool
 * Numerous bug fixes, minor security updates within build process (non frontend
   facing) and improvements

#### 2.2.0

 * Updated the build process
 * Updated PHPCS and WPCS
 * Updated Branding
 * Updated readme by making it more readable
 * Added Gutenberg/Block Editor support

#### 2.1.5

 * Add support for translate.wordpress.org.

#### 2.1.4

 * Don’t show the featured taxonomy on nav menu edit areas.

#### 2.1.3

 * Fix another potential PHP notice.

#### 2.1.2

 * Fix PHP warning when checking for the old method of querying for featured posts.

#### 2.1.1

 * Fix deprecated widget instantiation method.

#### 2.1

 * Don’t erase other terms in the pts_feature_tax assigned to the post on save. 
   This opens up potential to have more than one type of “featured”, (e.g. recommended).

#### 2.0

 * Changing how featured posts are designated. Instead of post meta, the plugin 
   now uses a hidden taxonomy.
 * Added a widget for showing featured posts.
 * Fixed the post_class filter to work properly on secondary loops.
 * Fixed bug where the featured column would not show when viewing Media in the 
   admin with list view.
 * Fixed bug where saving settings did not always work.
 * Changed the featured star in the admin to use the WordPress Dashicon font.

#### 1.0

 * 世界，您好！
 * Add settings to the Settings->Writing page allowing admins to select the post
   types that can be featured.
 * Add a check box in the publish meta box for marking a post as featured.
 * Featured posts receive a featured and featured-{$posttype} class on them via 
   the post_class filter.
 * Admin post type screens have a column for Featured noting which posts are in 
   fact featured.

## 额外信息

 *  版本 **3.0.3**
 *  最后更新：**2 年前**
 *  活跃安装数量 **30+**
 *  WordPress 版本 ** 5.1 或更高版本 **
 *  已测试的最高版本为 **6.3.8**
 *  语言
 * [English (Canada)](https://en-ca.wordpress.org/plugins/post-type-spotlight/) 
   和 [English (US)](https://wordpress.org/plugins/post-type-spotlight/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/post-type-spotlight)
 * 标签
 * [custom post types](https://cn.wordpress.org/plugins/tags/custom-post-types/)
   [featured](https://cn.wordpress.org/plugins/tags/featured/)[post type](https://cn.wordpress.org/plugins/tags/post-type/)
   [posts](https://cn.wordpress.org/plugins/tags/posts/)[sticky](https://cn.wordpress.org/plugins/tags/sticky/)
 *  [高级视图](https://cn.wordpress.org/plugins/post-type-spotlight/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/post-type-spotlight/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/post-type-spotlight/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/post-type-spotlight/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/post-type-spotlight/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/post-type-spotlight/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/post-type-spotlight/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/post-type-spotlight/reviews/)

## 贡献者

 *   [ Jonathan Desrosiers ](https://profiles.wordpress.org/desrosj/)
 *   [ Linchpin ](https://profiles.wordpress.org/linchpin_agency/)
 *   [ Aaron Ware ](https://profiles.wordpress.org/aware/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/post-type-spotlight/)