Warning: array_map(): Argument #2 should be an array in
-
I get two warnings when insterting a custom post in a normal post. The custom post type was created using the “Toolset Types” plugin (https://ww.wp.xz.cn/plugins/types/).
The warnings are as follows:
Warning: array_map(): Argument #2 should be an array in /app/public/wp-content/plugins/insert-pages/insert-pages.php on line 315Warning: implode(): Invalid arguments passed in /app/public/wp-content/plugins/insert-pages/insert-pages.php on line 316
I have not done any thorough testing but I assume get_post_custom_values( $key ) returns a string (not an array) when the only custom field is a single text field.
Possible Fix – insert-pages.php on line 315 (Check if array):
$value = get_post_custom_values( $key ); if ( is_array( $value ) ) { $values = array_map( 'trim', $value ); $value = implode( $values, ', ' ); }
The topic ‘Warning: array_map(): Argument #2 should be an array in’ is closed to new replies.