';
$html_switcher .= '
'; // End .wplng-filter
/**
* Filter : Status
*/
$filter_status = '
';
$filter_status .= '
';
$filter_status .= '
';
$filter_status .= '';
$filter_status .= '
'; // End .wplng-filter-select
$filter_status .= '
'; // End .wplng-filter
/**
* Filter : Order
*/
$filter_order = '
';
$filter_order .= '
';
$filter_order .= '
';
$filter_order .= '';
$filter_order .= '
'; // End .wplng-filter-select
$filter_order .= '
'; // End .wplng-filter
/**
* Modal
*/
$html = '
';
$html .= '
';
/**
* Modal header
*/
$html .= ''; // End #wplng-modal-header
/**
* Extract SEO title and description
*/
$translations = $args['translations'];
$seo_title = '';
$seo_description = '';
$translation_seo_title = array();
$translation_seo_description = array();
foreach ( $dom->find( 'title' ) as $element ) {
$seo_title = wplng_text_esc( $element->innertext );
break;
}
foreach ( $dom->find( 'meta[name="description"]' ) as $element ) {
if ( isset( $element->attr['content'] ) ) {
$seo_description = wplng_text_esc( $element->attr['content'] );
break;
}
}
foreach ( $translations as $key => $translation ) {
if ( empty( $translation['post_id'] )
|| empty( $translation['source'] )
|| empty( $translation['translation'] )
) {
continue;
}
if ( $seo_title === $translation['translation'] ) {
$translation_seo_title = $translation;
$translation_seo_title['tag'] = __( 'SEO - Title:', 'wplingua' );
unset( $translations[ $key ] );
} elseif ( $seo_description === $translation['translation'] ) {
$translation_seo_description = $translation;
$translation_seo_description['tag'] = __( 'SEO - Description:', 'wplingua' );
unset( $translations[ $key ] );
}
}
if ( ! empty( $translation_seo_description ) ) {
$translations = array_merge(
array( $translation_seo_description ),
$translations
);
}
if ( ! empty( $translation_seo_title ) ) {
$translations = array_merge(
array( $translation_seo_title ),
$translations
);
}
/**
* Make the Modal items
*/
$html .= '
';
$html .= '
';
$html .= esc_html__( 'No translation found.', 'wplingua' );
$html .= '
'; // End #wplng-modal-no-item-found
foreach ( $translations as $key => $translation ) {
if ( empty( $translation['post_id'] )
|| empty( $translation['source'] )
|| empty( $translation['translation'] )
) {
continue;
}
$class = 'wplng-modal-item';
if ( ! empty( $translation['review'] ) ) {
$class .= ' wplng-is-review';
}
$html .= '
find( 'body' ) as $body ) {
$body->innertext = $body->innertext . $html;
}
return $dom;
}