Skip to content

Commit

Permalink
Add post-search-field search feature. Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Dec 24, 2016
1 parent 06aa5a5 commit ffd808f
Show file tree
Hide file tree
Showing 7 changed files with 662 additions and 153 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ Once you have the post data for the post ID, you can proceed with the desired fu
1. Field display
![Field display](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-field.png)`

1. Post search
![Post search](https://raw.githubusercontent.com/WebDevStudios/cmb2-attached-posts/master/attached-posts-search.gif)`

## Changelog

### 1.2.5
* Combined the best bits from the [CMB2 Post Search field](https://github.com/WebDevStudios/CMB2-Post-Search-field) type and this field type, so now you can search for additional posts/pages/etc to be attached. User search is not currently supported. ([#7](https://github.com/WebDevStudios/cmb2-attached-posts/pull/7)).

### 1.2.4
* Add support for attaching Users instead of Posts/Custom Posts. Props [mckernanin](https://github.com/mckernanin) ([#27](https://github.com/WebDevStudios/cmb2-attached-posts/pull/27)).

Expand Down
Binary file added attached-posts-search.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions cmb2-attached-posts-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: CMB2 Field Type: Attached Posts
* Plugin URI: https://github.com/WebDevStudios/cmb2-attached-posts
* Description: Attached posts field type for CMB2.
* Version: 1.2.4
* Version: 1.2.5
* Author: WebDevStudios
* Author URI: http://webdevstudios.com
* License: GPLv2+
Expand All @@ -19,7 +19,7 @@
* @author WebDevStudios <[email protected]>
* @copyright 2016 WebDevStudios <[email protected]>
* @license GPL-2.0+
* @version 1.2.4
* @version 1.2.5
* @link https://github.com/WebDevStudios/cmb2-attached-posts
* @since 1.2.3
*/
Expand All @@ -46,7 +46,7 @@
* Loader versioning: http://jtsternberg.github.io/wp-lib-loader/
*/

if ( ! class_exists( 'WDS_CMB2_Attached_Posts_Field_124', false ) ) {
if ( ! class_exists( 'WDS_CMB2_Attached_Posts_Field_125', false ) ) {

/**
* Versioned loader class-name
Expand All @@ -57,18 +57,18 @@
* @package WDS_CMB2_Attached_Posts_Field
* @author WebDevStudios <[email protected]>
* @license GPL-2.0+
* @version 1.2.4
* @version 1.2.5
* @link https://github.com/WebDevStudios/cmb2-attached-posts
* @since 1.2.3
*/
class WDS_CMB2_Attached_Posts_Field_124 {
class WDS_CMB2_Attached_Posts_Field_125 {

/**
* WDS_CMB2_Attached_Posts_Field version number
* @var string
* @since 1.2.3
*/
const VERSION = '1.2.4';
const VERSION = '1.2.5';

/**
* Current version hook priority.
Expand All @@ -77,7 +77,7 @@ class WDS_CMB2_Attached_Posts_Field_124 {
* @var int
* @since 1.2.3
*/
const PRIORITY = 9998;
const PRIORITY = 9997;

/**
* Starts the version checking process.
Expand Down Expand Up @@ -155,5 +155,5 @@ public function include_lib() {
}

// Kick it off.
new WDS_CMB2_Attached_Posts_Field_124;
new WDS_CMB2_Attached_Posts_Field_125;
}
5 changes: 5 additions & 0 deletions css/attached-posts-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,8 @@
ul.hide-selected li.added{
display: none;
}

.cmb2-attached-posts-search-button span {
color: #999;
margin: .2em -.2em 0 1px;
}
5 changes: 4 additions & 1 deletion example-field-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function cmb2_attached_posts_field_metaboxes_example() {
'options' => array(
'show_thumbnails' => true, // Show thumbnails on the left
'filter_boxes' => true, // Show a text box for filtering the results
'query_args' => array( 'posts_per_page' => 10 ), // override the get_posts args
'query_args' => array(
'posts_per_page' => 10,
'post_type' => 'page',
), // override the get_posts args
),
) );

Expand Down
Loading

0 comments on commit ffd808f

Please sign in to comment.