This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 8 posts - 31 through 38 (of 38 total)
  • Author
    Posts
  • nickchomey18nickchomey18
    Participant

    disregard this comment – i figured it out.

    • This reply was modified 4 years, 8 months ago by nickchomey18nickchomey18.
    nickchomey18nickchomey18
    Participant

    Thanks! You can please close this ticket now.

    nickchomey18nickchomey18
    Participant

    Thanks! Is there anything I can do to allow functions – such as bbp_get_forum_id – to work within the ajax context? I assume that I will need to do other things like this in future snippets.

    nickchomey18nickchomey18
    Participant

    As it turns out, I was able to get this to work by using the $options[‘current_page_id’] field and the following snippet. You’re welcome to share it with the community – it seems to me that it is very useful for anyone using ASP with bbpress. Do you see anything about it that could be changed/improved?

    add_filter('asp_query_args', 'asp_filter_forum', 10, 3);
    function asp_filter_forum ( $args, $search_id, $options) {
      if ($search_id == 4) {
        $forum_id = (int)$options['current_page_id'];
        $args['post_meta_filter'][] = array(
          'key' => '_bbp_forum_id',
          'value' => array ($forum_id),
          'operator' => '=',
          'allow_missing' => false
        );
      }
      return $args;    
    }

    Anyway, I am still curious as to whether it is possible to pass a custom variable/parameter/argument to an ASP shortcode? Would it involve editing the ASP source code to add another parameter to the filter, or is there another way?

    in reply to: Filter by Author #34619
    nickchomey18nickchomey18
    Participant

    FYI, this snippet appears to work to create a post author metafield for use with custom field filtering.

    function add_post_author_metafield ( $post_id, $post) {
    update_post_meta($post_id, ‘post_author_meta’, get_userdata($post->post_author)->user_nicename);
    }
    add_action( ‘wp_insert_post’, ‘add_post_author_metafield’, 10, 2 );

    Perhaps you’d like to share it with the community, given that it has been a requested feature?

    And, while I have your attention here, I sent a few follow-up questions to you regarding my pre-sale inquiry email. I’m sure you’re busy, but I would appreciate if you could take a look and respond. On that note, are tickets the best way to reach you?

    in reply to: Filter by Author #34618
    nickchomey18nickchomey18
    Participant

    Thanks! I was able to create a function and hook to generate a metafield for one post type, but am struggling with all post types. It worked though, and I’ll keep working to figure it out. You can close this ticket now.

    in reply to: Bug when using ASP with BuddyBoss Group-associated Forums #34527
    nickchomey18nickchomey18
    Participant

    My previous snippet to add reply titles was using an action hook after the reply was created to run wp_update_post, so it was not interfering with ASP. But I just found a somewhat hidden filter that runs immediately prior to wp_insert_post and was able to modify it to create a post_title, which is far better as it also doesn’t create a revision post. The problem with ASP has now gone away – so this killed two birds with one stone! Thanks very much for the prompt to look into this some more!

    I suppose you can close the ticket now.

    in reply to: Bug when using ASP with BuddyBoss Group-associated Forums #34526
    nickchomey18nickchomey18
    Participant

    Thanks, that’s fantastic! Is there some code that I can add to a snippet to fix this on my site prior to your next release?

    Also, I had recently noticed that the reply titles are empty and submitted a support ticket to BuddyBoss about it. It seems to me that there should definitely be a title – both for compatibility with plugins that would be expecting one, as well as for the fact that when you move a reply to a different topic, it actually creates a title! It is clearly an oversight by them.

    I also messed around with a snippet to add a title to replies – I forget if I kept it or not, but I will investigate to see if that is causing a conflict with ASP.

Viewing 8 posts - 31 through 38 (of 38 total)