10up/post-finder

Adds a UI for curating and ordering posts

Installs: 642

Dependents: 0

Suggesters: 0

Stars: 11

Watchers: 77

Forks: 20

Open Issues: 0

Language:JavaScript

Type:wordpress-plugin

0.3.0 2017-07-05 21:15 UTC

README

Creates a rich input field that allows a user to curate and rank content items (posts or other custom post types)

Installation

Clone the plugin to your wp-content/plugins/ directory

Usage

In your theme, you can call pf_render( $name, $value, $options ) where you want to display a Post Finder field.

$name : Name you want to use on the input field

$value : Currently selected value(s). Should be a comma-separated string of post_ids

$options (optional) : Array of options that will be used to build the input

Current options

  • show_numbers - Whether to show a positional number next to each item. Makes it easy to see which position each item has. Default true.
  • show_recent - Whether to show the Recent Post select input. Default true.
  • limit - Limit how many items can be selected. Default 10.
  • args - Array of arguments passed to our WP_Query instances. Allows customizations of these queries, like setting a specific post type. See the WordPress Developer Reference for supported arguments.
  • include_script - Whether to include the init script for the input. Default true. If false, you'll have to include this yourself in order for it to work.
jQuery( document ).ready( function( $ ) {
	$( '.post-finder' ).postFinder();
} );