W3cubDocs

/WordPress

WP_Translations::__get( string $name ): mixed

Magic getter for backward compatibility.

Parameters

$namestringrequired
Property name.

Return

mixed

Source

public function __get( string $name ) {
	if ( 'entries' === $name ) {
		$entries = $this->controller->get_entries( $this->textdomain );

		$result = array();

		foreach ( $entries as $original => $translations ) {
			$result[] = $this->make_entry( $original, $translations );
		}

		return $result;
	}

	if ( 'headers' === $name ) {
		return $this->controller->get_headers( $this->textdomain );
	}

	return null;
}

Changelog

Version Description
6.5.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_translations/__get