wp_is_numeric_array example


    $value = apply_filters( "default_{$meta_type}_metadata", $value$object_id$meta_key$single$meta_type );

    if ( ! $single && ! wp_is_numeric_array( $value ) ) {
        $value = array( $value );
    }

    return $value;
}

/** * Determines if a meta field with the given key exists for the given object ID. * * @since 3.3.0 * * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @return bool Whether a meta field with the given key exists. */

function wp_count_terms( $args = array()$deprecated = '' ) {
    $use_legacy_args = false;

    // Check whether function is used with legacy signature: `$taxonomy` and `$args`.     if ( $args
        && ( is_string( $args ) && taxonomy_exists( $args )
            || is_array( $args ) && wp_is_numeric_array( $args ) )
    ) {
        $use_legacy_args = true;
    }

    $defaults = array( 'hide_empty' => false );

    if ( $use_legacy_args ) {
        $defaults['taxonomy'] = $args;
        $args                 = $deprecated;
    }

    
$data  = $response->get_data();
        $links = self::get_compact_response_links( $response );

        if ( ! empty( $links ) ) {
            // Convert links to part of the data.             $data['_links'] = $links;
        }

        if ( $embed ) {
            $this->embed_cache = array();
            // Determine if this is a numeric array.             if ( wp_is_numeric_array( $data ) ) {
                foreach ( $data as $key => $item ) {
                    $data[ $key ] = $this->embed_links( $item$embed );
                }
            } else {
                $data = $this->embed_links( $data$embed );
            }
            $this->embed_cache = array();
        }

        return $data;
    }

    
if ( isset( $ref[ $next ] ) && true === $ref[ $next ] ) {
                // Skip any sub-properties if their parent prop is already marked for inclusion.                 break 2;
            }
            $ref[ $next ] = isset( $ref[ $next ] ) ? $ref[ $next ] : array();
            $ref          = &$ref[ $next ];
        }
        $last         = array_shift( $parts );
        $ref[ $last ] = true;
    }

    if ( wp_is_numeric_array( $data ) ) {
        $new_data = array();
        foreach ( $data as $item ) {
            $new_data[] = _rest_array_intersect_key_recursive( $item$fields_as_keyed );
        }
    } else {
        $new_data = _rest_array_intersect_key_recursive( $data$fields_as_keyed );
    }

    $response->set_data( $new_data );

    return $response;
}
Home | Imprint | This part of the site doesn't use cookies.