WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

NOOP_Translations{} WP 1.0

Provides the same interface as Translations, but doesn't do anything

Хуков нет.

Возвращает

Null. Ничего.

Использование

$NOOP_Translations = new NOOP_Translations();
// use class methods

Методы

  1. add_entry( $entry )
  2. get_header( $header )
  3. get_plural_forms_count()
  4. merge_with( &$other )
  5. select_plural_form( $count )
  6. set_header( $header, $value )
  7. set_headers( $headers )
  8. translate( $singular, $context = null )
  9. translate_entry( &$entry )
  10. translate_plural( $singular, $plural, $count, $context = null )

Код NOOP Translations: wp-includes/pomo/translations.php WP 5.2.4

<?php
class NOOP_Translations {
	var $entries = array();
	var $headers = array();

	function add_entry( $entry ) {
		return true;
	}

	/**
	 * @param string $header
	 * @param string $value
	 */
	function set_header( $header, $value ) {
	}

	/**
	 * @param array $headers
	 */
	function set_headers( $headers ) {
	}

	/**
	 * @param string $header
	 * @return false
	 */
	function get_header( $header ) {
		return false;
	}

	/**
	 * @param Translation_Entry $entry
	 * @return false
	 */
	function translate_entry( &$entry ) {
		return false;
	}

	/**
	 * @param string $singular
	 * @param string $context
	 */
	function translate( $singular, $context = null ) {
		return $singular;
	}

	/**
	 * @param int $count
	 * @return bool
	 */
	function select_plural_form( $count ) {
		return 1 == $count ? 0 : 1;
	}

	/**
	 * @return int
	 */
	function get_plural_forms_count() {
		return 2;
	}

	/**
	 * @param string $singular
	 * @param string $plural
	 * @param int    $count
	 * @param string $context
	 */
	function translate_plural( $singular, $plural, $count, $context = null ) {
		return 1 == $count ? $singular : $plural;
	}

	/**
	 * @param object $other
	 */
	function merge_with( &$other ) {
	}
}