After years of running fine, I am suddenly getting this dreaded message after updating to 5.42. However it only happens in the Admin:
Warning: strpos() expects parameter 1 to be string, array given in Warning/home/content/55/html/example/wp-includes/media.php on line 3141
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/8933555/html/example/wp-includes/media.php:3141) in /home/content/55/8933555/html/example/wp-includes/functions.php on line 6221
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/8933555/html/example/wp-includes/media.php:3141) in /home/content/55/8933555/html/example/wp-admin/includes/misc.php on line 1282
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/8933555/html/example/wp-includes/media.php:3141) in /home/content/55/8933555/html/example/wp-admin/admin-header.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/8933555/html/example/wp-includes/media.php:3141) in /home/content/55/8933555/html/example/wp-includes/option.php on line 961
Warning: Cannot modify header information - headers already sent by (output started at /home/content/55/8933555/html/example/wp-includes/media.php:3141) in /home/content/55/8933555/html/example/wp-includes/option.php on line 962
The code at line 3140 of media.php is
if ('attachment' === $object_type || 0 === strpos( $object_type, 'attachment:' ) ) {
It appears that the problem is a custom taxonomy I have. Which is created here in functions().php
function songs_init() {
// create a new taxonomy
register_taxonomy(
'songs',
array(
'label' => __( 'Songs_Tax' ),
'sort' => true,
'args' => array( 'orderby' => 'term_order' ),
)
);
}
add_action( 'init', 'songs_init' );
When I test for the offending $object_type in media.pho and get a var_dump(), it comes back that $object_type is an array:
'orderby' => 'term_order'
I've tried looking for white space and stray characters in functions.php but I don't see anything.
Any ideas on what next to try? Again, this worked fine for almost a decade until 5.42