~vcs-imports/buddypress/trunk

Viewing all changes in revision 9344.

  • Committer: boonebgorges
  • Date: 2018-11-15 20:14:01 UTC
  • Revision ID: svn-v4:cdf35c40-ae34-48e0-9cc9-0c9da1808c22:trunk:12288
Nav: Dynamically load component screen file when changing nav default.

BP 3.0.0 moved most screen controllers into files that are loaded only when
viewing the component. This introduced a regression into
`bp_core_new_nav_default()`, since the `screen_function` would not be available
(ie `! is_callable()`) at the time that the nav item is modified.

We resolve this by loading the component's screen functions in
`bp_core_new_nav_default()` when we detect that they're not present. To work
around cases where component slugs don't match the official component ID,
which corresponds to the file path, we introduce a new 'component_id' parameter
to be used when registering a new nav item.

Props imath, r-a-y.
Fixes #7935.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: