Support » Plugin: BP Attachments » bp_attachments_tracking_get_table has wrong approach

  • Resolved shawfactor

    (@shawfactor)


    bp_attachments_tracking_get_table by default uses the activity table right?

    function bp_attachments_tracking_get_table() {
    global $bp
    return $bp->activity->table_name
    }

    That way if you filter the activity table location, which is possible, the data does not get get out of sync.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mathieu Viet

    (@imath)

    BP Attachments uses the right approach: it can be used without the Activity component active. Using the global like you did is the wrong approach.

    Moreover it’s better to use different filters as I can imagine some users might prefer to use different tables for activity & attachments.

    I’ve added filters to let plugin authors/advanced users use other tables, see: https://github.com/buddypress/bp-attachments/commit/e6812b44d6a3f6ae63b5632ddfbc203d5bc2332e

    Thread Starter shawfactor

    (@shawfactor)

    That makes sense, is a better approach, and will allow for these to be stored in their own table in the future

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bp_attachments_tracking_get_table has wrong approach’ is closed to new replies.