Fixes user metadata type not fetching all values due to pagination.
This commit is contained in:
parent
0e16445141
commit
1a6128c01b
|
@ -107,10 +107,14 @@ export default {
|
||||||
this.$emit('blur');
|
this.$emit('blur');
|
||||||
},
|
},
|
||||||
loadCurrentUsers() {
|
loadCurrentUsers() {
|
||||||
if ((Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value.length) || (!Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value)) {
|
if (
|
||||||
|
(Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value.length) ||
|
||||||
|
(!Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value)
|
||||||
|
) {
|
||||||
|
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
let query = qs.stringify({ include: this.itemMetadatum.value });
|
let perPage = isNaN(this.itemMetadatum.value) ? this.itemMetadatum.value.length + 1 : 100;
|
||||||
|
let query = qs.stringify({ include: this.itemMetadatum.value, per_page: perPage });
|
||||||
let endpoint = '/users/';
|
let endpoint = '/users/';
|
||||||
|
|
||||||
wpApi.get(endpoint + '?' + query)
|
wpApi.get(endpoint + '?' + query)
|
||||||
|
|
Loading…
Reference in New Issue