$key = $args[ $key ]; } $this->manager = $manager; $this->section = $section; } /** * Returns the json array. * * @since 2.0.0 * @access public * @return array */ public function json() { $this->to_json(); return $this->json; } /** * Adds custom data to the json array. This data is passed to the Underscore template. * * @since 2.0.0 * @access public * @return void */ public function to_json() { // Is the role editable? $is_editable = $this->manager->role ? members_is_role_editable( $this->manager->role->name ) : true; // Set up the ID and class. $this->json['id'] = $this->section; $this->json['class'] = 'members-tab-content' . ( $is_editable ? ' editable-role' : '' ); } }