Skip to content

Commit

Permalink
Support for allowing multiple choices on one field
Browse files Browse the repository at this point in the history
  • Loading branch information
timiwahalahti committed Feb 15, 2022
1 parent b87b634 commit 199a64c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Removed
### Changed

## [1.2.0] - 2022-02-15
### Added
* Support for allowing multiple choices on one field

## [1.1.1] - 2022-01-04
### Fixed
- Loading the saved field value if sites are restricted, use the same filter everywhwre needed
Expand Down
4 changes: 2 additions & 2 deletions acf-field-network-post-select.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields: Network posts select field
Plugin URI: https://github.com/timiwahalahti/acf-field-post-object-network/
Description: Adds a ACF field that allows selecting posts across the network sites.
Version: 1.1.1
Version: 1.2.0
Author: Timi Wahalahti
Author URI: https://sipp.is
License: GPLv3 or later
Expand All @@ -21,7 +21,7 @@ class sippis_acf_plugin_network_post_select {

function __construct() {
$this->settings = array(
'version' => '1.1.1',
'version' => '1.2.0',
'url' => plugin_dir_url( __FILE__ ),
'path' => plugin_dir_path( __FILE__ )
);
Expand Down
10 changes: 9 additions & 1 deletion class-sippis-acf-field-network-post-select.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function get_posts( $value, $field ) {
*/
function render_field( $field ) {
$field['type'] = 'select';
$field['multiple'] = false;
// $field['multiple'] = false;
$field['ui'] = true;
$field['ajax'] = true;
$field['choices'] = [];
Expand Down Expand Up @@ -426,6 +426,14 @@ function render_field_settings( $field ) {
'type' => 'true_false',
'ui' => true,
] );

acf_render_field_setting( $field, [
'label' => __( 'Select multiple values?', 'acf' ),
'instructions' => '',
'name' => 'multiple',
'type' => 'true_false',
'ui' => true,
] );
} // end render_field_settings
} // end class

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/timiwahalahti/acf-field-network-post-select",
"keywords": ["wordpress", "plugin"],
"license": "GPLv3",
"version": "1.1.1",
"version": "1.2.0",
"authors": [
{
"name": "Timi Wahalahti",
Expand Down

0 comments on commit 199a64c

Please sign in to comment.