voceconnect/voce-featured-posts 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

voceconnect/voce-featured-posts

Composer 安装命令:

composer require voceconnect/voce-featured-posts

包简介

Easily define multiple featured-type instances for post types.

README 文档

README

Contributors: kevinlangleyjr, voceplatforms
Tags: featured
Requires at least: 3.2
Tested up to: 4.0
Stable tag: 2.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Description

Allows a developer to easily define multiple featured-type instances for post types. These featured-type instances do not necessarily need to be named Featured, but is just another way to single out specific posts of a post type under a common label. When defining a featured type, a page will be added to the submenu of the post type you registered it for. This page is used to manage the order of the featured items and remove items that no longer should be featured.

Installation

As theme or plugin dependency:

After dropping the plugin into the containing theme or plugin, add the following:

<?php
if( ! class_exists( 'Voce_Featured_Posts' ) ) {
	require_once( $path_to_voce_featured_posts . '/voce-featured-posts.php' );
}
?>

Usage

Registering a Featured Type

Parameters

  • $type_key (string) - A unique string used as the featured type key
  • $type_name (string) - A string used as the title of the featured type
  • $post_type (string) - Post type the featured type is being registered for
  • $sortable (boolean) - Adds the ability to drag/drop sort the featured items on the management page
<?php
	Voce_Featured_Posts::add_type('new-featured-type', 'New Featured Type', 'post', )
?>

Getting the Featured Post ID's

Using the get_featured_ids() method of the Voce_Featured_Posts, you can retreive the featured ids of a specific featured type and either a single post type or an array of post types

<?php
	$featured_ids = Voce_Featured_Posts::get_featured_ids( 'post', 'new-featured-type' );
?>

Changelog

2.7
Fixing sortable by adding jquery-ui-sortable js dependency

2.6
Adding minified images

2.5
Moving nonce check to earlier in the save_post method

2.4
VIP escaping fixes

2.3
Adding filter to default "Featured" label

2.2
Fixing image source to sort.png

2.1
Adding support for featured 'attachment'.

1.0
Initial release.

统计信息

  • 总下载量: 1.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 12
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPLv2
  • 更新时间: 2013-12-18