model->get_languages_list() as $language ) { if ( $language->term_id === $lang->term_id ) { continue; } $translation_id = $this->model->post->get_translation( $post->ID, $language ); if ( ! $translation_id || $translation_id === $post->ID ) { // $translation_id == $post->ID happens if the post has been (auto)saved before changing the language. $translation_id = 0; } if ( ! empty( $from_post_id ) ) { $translation_id = $this->model->post->get( $from_post_id, $language ); } $add_link = $this->links->get_new_post_link_html( $post, $language ); $link = $add_link; $translation = null; if ( $translation_id ) { $translation = get_post( $translation_id ); if ( $translation instanceof WP_Post ) { $link = $this->links->get_edit_post_link_html( $translation ); } } ?> slug, $post->post_type ); ?>
flag ?: esc_html( $language->slug ); // phpcs:ignore WordPress.Security.EscapeOutput ?> %2$s ', esc_attr( $language->slug ), /* translators: accessibility text */ esc_html__( 'Translation', 'polylang' ), ( empty( $translation ) ? '0' : esc_attr( (string) $translation->ID ) ), ( empty( $translation ) ? '' : esc_attr( $translation->post_title ) ), esc_attr( $language->get_locale( 'display' ) ), ( $language->is_rtl ? 'rtl' : 'ltr' ) ); ?>