The social media platform formerly known as Twitter, which Elon Musk rebranded X, has agreed to settle a lawsuit brought by President Donald Trump, The Wall Street Journal reported on Wednesday.