Skip to content

Commit

Permalink
Merge pull request #19 from pbearne/master
Browse files Browse the repository at this point in the history
added option to hide the selected posts from the main list when added
  • Loading branch information
jtsternberg committed Feb 2, 2016
2 parents 9d46be3 + 2033ee6 commit e7e6849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmb2-attached-posts-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ public function render( $field, $escaped_value, $object_id, $object_type, $field

// Set .has_thumbnail
$has_thumbnail = $field->options( 'show_thumbnails' ) ? ' has-thumbnails' : '';
$hide_selected = $field->options( 'hide_selected' ) ? ' hide-selected' : '';

if ( $filter_boxes ) {
printf( $filter_boxes, 'available-search' );
}

echo '<ul class="retrieved connected', $has_thumbnail ,'">';
echo '<ul class="retrieved connected' . $has_thumbnail . $hide_selected . '">';

// Loop through our posts as list items
foreach ( $posts as $post ) {
Expand Down
4 changes: 4 additions & 0 deletions css/attached-posts-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@
top: 50%;
width: 22px;
}

ul.hide-selected li.added{
display: none;
}

0 comments on commit e7e6849

Please sign in to comment.