see [wpmlcore-3855] /** * WPML_LS_Menu_Item constructor. * @param array $language * @param string $item_content */ public function __construct( $language, $item_content ) { $this->decorate_object( $language, $item_content ); } /** * @param array $lang * @param string $item_content */ private function decorate_object( $lang, $item_content ) { $this->ID = isset( $lang['db_id'] ) ? $lang['db_id'] : null; $this->object_id = isset( $lang['db_id'] ) ? $lang['db_id'] : null; $this->db_id = isset( $lang['db_id'] ) ? $lang['db_id'] : null; $this->menu_item_parent = isset( $lang['menu_item_parent'] ) ? $lang['menu_item_parent'] : null; $this->attr_title = isset( $lang['display_name'] ) ? $lang['display_name'] : ( isset( $lang['native_name'] ) ? $lang['native_name'] : '' ); $this->title = $item_content; $this->post_title = $item_content; $this->url = isset( $lang['url'] ) ? $lang['url'] : null; if ( isset( $lang['css_classes'] ) ) { $this->classes = $lang['css_classes']; if ( is_string( $lang['css_classes'] ) ) { $this->classes = explode( ' ', $lang['css_classes'] ); } } } /** * @param string $property * * @return mixed */ public function __get( $property ) { return isset( $this->{$property} ) ? $this->{$property} : null; } }