$argsarrayoptional
singular stringplural string$is_plural to true.translations arraycontext stringtranslator_comments stringextracted_comments stringreferences arrayflags arrayDefault:array()
public function __construct( $args = array() ) {
// If no singular -- empty object.
if ( ! isset( $args['singular'] ) ) {
return;
}
// Get member variable values from args hash.
foreach ( $args as $varname => $value ) {
$this->$varname = $value;
}
if ( isset( $args['plural'] ) && $args['plural'] ) {
$this->is_plural = true;
}
if ( ! is_array( $this->translations ) ) {
$this->translations = array();
}
if ( ! is_array( $this->references ) ) {
$this->references = array();
}
if ( ! is_array( $this->flags ) ) {
$this->flags = array();
}
}
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/Translation_Entry/__construct