How-to and Troubleshooting
8
Posts
3
Users
1
Reactions
1,025
Views
Jul 24, 2023 10:00 am
I can get the post title, username and post URL as below, but not the body.
Please give me advice on how to write it.
$author_id = $post['userid']; $author_name = get_the_author_meta('display_name', $author_id); $topic = wpforo_topic($post['topicid']); $topic_url = $topic['url']; $send_title = esc_html( $post['title'] );
7 Replies
Jul 24, 2023 10:30 am
Hi @gocchimama
try
esc_html( wpforo_text( $post['body']) )
or
esc_html( wpforo_content_filter( $post['body']) )
Jul 25, 2023 1:46 pm
Thank you !
i tried it ,but it didn't work...
Jul 26, 2023 9:15 am
Thank you !
But,I couldn't get it. When I look at the debug, the body does not exist in the array.
Array ( [topicid] => 37 [forumid] => 2 [first_postid] => 42 [userid] => 1 [title] => this title [slug] => %e3%81%95%e3%82%89%e3%81%ab%e3 [created] => 2023-07-2608:55:34 [modified] => 2023-07-2608:55:34 [last_post] => 42 [posts] => 1 [votes] => 0 [answers] => 0 [views] => 0 [meta_key] => [meta_desc] => [type] => 0 [solved] => 0 [closed] => 0 [has_attach] => 0 [private] => 0 [status] => 0 [name] => [email] => [prefix] => [tags] => [url] => http://forum.local/xxx [full_url] => http://forum.local/xxx [short_url] => http://forum.local/topicid/37/ )
How can I add the 'body' to the array?
Jul 26, 2023 1:34 pm
@gocchimama
You can use this function e.g.
wpforo_topic( $post['topicid'], 'body' )
Page 1 / 2
Next