@@ -40,14 +40,14 @@ public function __construct( $parent = null ) {
40
40
* Get the data.
41
41
*
42
42
* @param string|array $type Type.
43
- * @param array $args Args.
43
+ * @param array|string $args Args.
44
44
* @param string $opt_name Opt name.
45
45
* @param string|int $current_value Current value.
46
46
* @param bool $ajax Tells if this is an AJAX call.
47
47
*
48
48
* @return array|mixed|string
49
49
*/
50
- public function get ( $ type , array $ args = array (), string $ opt_name = '' , $ current_value = '' , bool $ ajax = false ) {
50
+ public function get ( $ type , $ args = array (), string $ opt_name = '' , $ current_value = '' , bool $ ajax = false ) {
51
51
$ opt_name = $ this ->opt_name ;
52
52
53
53
// We don't want to run this, it's not a string value. Send it back!
@@ -222,13 +222,13 @@ private function order_data( array $data = array(), string $sort = 'value', stri
222
222
/**
223
223
* Fetch the data for a given type.
224
224
*
225
- * @param string $type The data type we're fetching.
226
- * @param array $args Arguments to pass.
227
- * @param mixed|array $current_value If a current value already set in the database.
225
+ * @param string $type The data type we're fetching.
226
+ * @param array|string $args Arguments to pass.
227
+ * @param mixed|array $current_value If a current value already set in the database.
228
228
*
229
229
* @return array
230
230
*/
231
- private function get_data ( string $ type , array $ args , $ current_value ): array {
231
+ private function get_data ( string $ type , $ args , $ current_value ): array {
232
232
$ args = $ this ->get_arg_defaults ( $ type , $ args );
233
233
234
234
$ opt_name = $ this ->opt_name ;
@@ -486,11 +486,11 @@ private function get_data( string $type, array $args, $current_value ): array {
486
486
/**
487
487
* Router for translation based on the given post type.
488
488
*
489
- * @param string $type Type of data request.
490
- * @param mixed|array $current_value Current value stored in DB.
491
- * @param array $args Arguments for the call.
489
+ * @param string $type Type of data request.
490
+ * @param mixed|array $current_value Current value stored in DB.
491
+ * @param array|string $args Arguments for the call.
492
492
*/
493
- private function maybe_get_translation ( string $ type , &$ current_value = '' , array $ args = array () ) {
493
+ private function maybe_get_translation ( string $ type , &$ current_value = '' , $ args = array () ) {
494
494
switch ( $ type ) {
495
495
case 'categories ' :
496
496
case 'category ' :
@@ -602,12 +602,12 @@ private function get_current_data_args( string $type, array $args, $current_valu
602
602
/**
603
603
* Get default arguments for a given data type.
604
604
*
605
- * @param string $type Type of data request.
606
- * @param array $args Arguments for the call.
605
+ * @param string $type Type of data request.
606
+ * @param array|string $args Arguments for the call.
607
607
*
608
- * @return array
608
+ * @return array|string
609
609
*/
610
- private function get_arg_defaults ( string $ type , array $ args = array () ): array {
610
+ private function get_arg_defaults ( string $ type , $ args = array () ) {
611
611
// In this section we set the default arguments for each data type.
612
612
switch ( $ type ) {
613
613
case 'categories ' :
0 commit comments