Skip to content

Commit be2d51b

Browse files
author
Marco Pereirinha
committed
Still try to use the current language on cases where we do not provide the attachment ID — this are the generic use cases
1 parent 6b13e29 commit be2d51b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/integrations/class-wpml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function setup_cron() {
144144
* @return string|null
145145
*/
146146
public function add_wpml_context( $context, $attachment_id ) {
147-
if ( 'attachment' === get_post_type( $attachment_id ) ) {
147+
if ( is_null( $attachment_id ) || 'attachment' === get_post_type( $attachment_id ) ) {
148148
$context = apply_filters( 'wpml_current_language', null );
149149
}
150150

0 commit comments

Comments
 (0)