public function dynamicConfAdmin(array $conf) { if (Other::getCurrentScreen()->base !== 'post') { return $conf; } global $post; $conf[static::getOptID()] = ['id' => Functions::buildActionName(static::getOptID()), 'lang' => ['typeAuthorNameForSearch' => L10n::__('Type author name for search'), 'authorId' => L10n::__('Author ID')], 'postId' => $post->ID, 'authorId' => $post->post_author, 'authorName' => User::getTheAuthorMeta('display_name', $post->post_author)]; return $conf; }
private function ajaxGetUser() { $userId = filter_input(INPUT_GET, 'userId', FILTER_VALIDATE_INT); if (!$userId) { return; } $user = User::getUserBy('id', $userId); if (!$user) { return; } Functions::jsonOutput(['status' => 'success', 'user' => ['name' => User::getTheAuthorMeta('display_name', $user->ID)]], true); }