# wplingua/2.10.0/inc/admin/admin.php

Translate and Go multilingual – Automatic AI translation – wpLingua, version 2.10.0. 70 lines.

- Page: https://pluginprobe.com/plugins/wplingua/2.10.0/code/inc/admin/admin.php
- Raw: https://pluginprobe.com/plugins/wplingua/2.10.0/raw/inc/admin/admin.php
- Modified: 2025-10-30T08:14:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wplingua/2.10.0/code/inc/admin/admin.php#L10-L20`.

```php
<?php

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}


/**
 * Add a link for edit translations on page and post list
 *
 * @param array   $actions An array of row action links (string)
 * @param WP_Post $post The post object
 * @return array
 */
function wplng_row_edit_translation_link( $actions, $post ) {

	/**
	 * Check the current page
	 */

	if ( 'post' !== $post->post_type && 'page' !== $post->post_type ) {
		return $actions;
	}

	/**
	 * Check if a target language is defined
	 */

	$languages_target_ids = wplng_get_languages_target_ids();

	if ( empty( $languages_target_ids[0] ) ) {
		return $actions;
	}

	/**
	 * Make the edit translations link
	 */

	$url = get_permalink( $post );

	if ( empty( $url ) || ! wplng_url_is_translatable( $url ) ) {
		return $actions;
	}

	$url = add_query_arg(
		'wplng-mode',
		'list',
		wplng_url_translate(
			$url,
			$languages_target_ids[0]
		)
	);

	$html  = '<a';
	$html .= ' href="' . esc_url( $url ) . '"';
	$html .= ' aria-label="' . esc_attr__( 'Edit translations', 'wplingua' ) . '"';
	$html .= '>';
	$html .= esc_html__( 'Translations', 'wplingua' );
	$html .= '</a>';

	/**
	 * Add link and return updated actions
	 */

	$actions['wplng-edit-link'] = $html;

	return $actions;
}

```
