Please or Register to create posts and topics.

List of available Hooks (Actions & Filters)

PreviousPage 2 of 2

Hello @alcandau

I suggest you to use theĀ asgarosforum_after_post_author action to show additional information below the username and its first argument is the ID of the post-author. I am not exactly sure how the ACF filters are working, but I guess you can use the filter above to build something.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Hello,

Thank you !

Could please lead me just for the beginning with ‘asgarosforum_after_post_author‘ ?

If I want to use it like here with ‘asgarosforum_filter_post_username’ :

$username = apply_filters(‘asgarosforum_filter_post_username’, $this->getUsername($post->author_id), $post->author_id);
echo ‘<span class=”post-username”>’.$username.'</span>’;

What to if I want to display, for example the “age” (simple ACF profile field = ‘age’) just under the username in the presentation box displayed on every posts/messages ?

It will help me for the other fields.

Thanks a lot,

Regards,
Al

Hello @alcandau

For this purpose you can use the get_field function of ACF:

https://www.advancedcustomfields.com/resources/get_field/

An action can be used like the following:

function your_function() {
  // your code
}
add_action('asgarosforum_after_post_author', 'your_function');

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!
Hello, can I ask a question here?

thank you

I tried to make a new function, and paste it in the Asgaros forum … in that function,

I want to take the author id variable from each new topic,

I tried entering the $author_id variable, but it displays something that is not appropriate is there an example to get the variable I want?

 

Thank you very much

++ EDIT: Moved to support section, I will update this post with an working example once I solved this issue ++

Hi there,

I am looking for a hook, that fires after a topic was generated by saving a post and allows me to get the ID or a permalink to that topic.

Background:

For a team, I created a custom post type “Tasks” to create tasks with some additional ACF fields. In case a specific task needs further discussion, I added the Asgaros topic_metabox to that post type. Since the forum is used anyway by the team, I do not want to mix WP comments and forum conversations in the same environment, all discussion is handled inside the forum.

I already filter the topic content, to add a link to the specific task (custom post type) in the new forum topic. So whenever a topic is created by creating a task, this topic will contain a link to the specific task.

Additionally I want to add a link back to that forum topic to the specific task. So, what I need, is the ID or something unique right after the topic was created and add that information to the corresponding post.

Since I could not find a documentation of what each hook is really doing, I am posting this question here. I played around with asgarosforum_after_add_topic_submit and asgarosforum_after_post_message already, but could not find a solution.

Any ideas?

PreviousPage 2 of 2