BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #45042

    @sbrajesh Here are a few other suggestions for improvements to this plugin that I think would make it much more efficient and pleasing to use.

    1. In the Moderation History page, show the action taken (Restored, Deleted, etc…)
    2. Some function or mode to make it easier to move from one item in the cue to the next. Either when you take an action it moves you to the next item automatically, or add “Next” and “Previous” buttons to advance.
    3. Add Restore or Delete buttons/links to the Queue, so that you can take action without opening the item.
    4. As described before, ability to talk bulk actions using the existing checkboxes and action dropdown.

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #44991

    Thanks very much! I’ll give that a try.

    Though as it turns out, I found this code which worked nicely! I’m sure it’ll be a good function to just have as a general utility snippet on my site.

    
    function remove_class_action ($action,$class,$method) {
        global $wp_filter ;
        if (isset($wp_filter[$action])) {
            $len = strlen($method) ;
            foreach ($wp_filter[$action] as $pri => $actions) {
                foreach ($actions as $name => $def) {
                    if (substr($name,-$len) == $method) {
                        if (is_array($def['function'])) {
                            if (get_class($def['function'][0]) == $class) {
                                if (is_object($wp_filter[$action]) && isset($wp_filter[$action]->callbacks)) {
                                    unset($wp_filter[$action]->callbacks[$pri][$name]) ;
                                } else {
                                    unset($wp_filter[$action][$pri][$name]) ;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    

    https://wordpress.stackexchange.com/a/289426

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #44989

    No, I only want to disable it for very particular activity updates. I have all the conditional code that I need, but can’t figure out how to do remove_action because of the namespace/class structure. I know that you can sometimes do something like

    $myclass = new Class
    remove_action(‘hook’, array($myclass, ‘function’),10);

    But I can’t figure out how to even get the variable that contains the instance of the class.

    Or, if it were a public static function, it would be possible to do something like:

    remove_action(‘hook’, array(‘ClassName’, ‘function’),10);

    Any suggestions would be appreciated!

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #44962

    Sorry, I just saw your reply now. Sure, that would be great if you could share the update with the email address that you have on file. I will be sure to let you know if I need the coupon. Thanks very much for the great service, as usual!

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #44934

    It is also no longer showing in my plugin download page on this website.

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #43918

    Thanks!

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #43733

    Good points. It now looks like this for me.

    
    return apply_filters ('bpdgt_modify_tabs', $new_tabs);
    
  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #43703

    There’s nothing to apologize for! The filter I added works for my purposes, so it would be great if you can add it in your update.

    
    $new_tabs = apply_filters('bpdgt_remove_tabs', $new_tabs);
    
  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #43697

    Apologies, my mistake! I saw the prices on the Blog Categories page and wrongly assumed it was part of the paid packages. So, please disregard this request – you have more important things to worry about! I’ll figure something out at some point and share the code here.

  • Participant
    Level: Enlightened
    Posts: 68
    Nick on #43693
    
    public function get_group_tabs() {
    
    // Find current group
    // $current_group = new BP_Groups_Group( $current_group_id );
    
    // We need slug to access the nav items
    // $current_group_slug = $current_group->slug;
    // Get all nav items.
    
    $new_tabs = array();
    
    $tabs = buddypress()->groups->nav->get_secondary( array( 'parent_slug' => bp_get_current_group_slug() ) );
    // bp_get_nav_menu_items('groups');
    
    foreach ( $tabs as $tab ) {
    $new_tabs[ $tab['slug'] ] = $tab['name'];
    }
    
    $new_tabs = apply_filters('bpdgt_remove_tabs', $new_tabs);
    
    // Let us reset the admin option from the tab.
    foreach ( $new_tabs as $key => $tab ) {
    if ( $key == 'admin' ) {
    unset( $tabs[ $key ] );
    break;
    }
    }
    
    // Reset the empty items.
    $new_tabs = array_filter( $new_tabs );
    
    return $new_tabs;
    }