How to post a message from pending status

wp_publish_post () the function does not work properly because you have to generate the URL and set the author. Poster added via the User Frontend Pro plugin. The publication via the administration panel works correctly.