BP_Group_Extension::setup_legacy_properties()
Set up legacy properties.
Description
This method is responsible for ensuring that all legacy config properties are stored in an array $this->legacy_properties, so that they remain available to plugins that reference the variables at their old locations.
See also
Source
File: bp-groups/classes/class-bp-group-extension.php
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 | protected function setup_legacy_properties() { // Only run this one time. if ( ! empty ( $this ->legacy_properties ) ) { return ; } $properties = $this ->get_legacy_property_list(); $params = $this ->params; $lp =& $this ->legacy_properties; foreach ( $properties as $property ) { switch ( $property ) { case 'enable_create_step' : $lp [ 'enable_create_step' ] = $params [ 'screens' ][ 'create' ][ 'enabled' ]; break ; case 'enable_edit_item' : $lp [ 'enable_edit_item' ] = $params [ 'screens' ][ 'edit' ][ 'enabled' ]; break ; case 'enable_admin_item' : $lp [ 'enable_admin_item' ] = $params [ 'screens' ][ 'admin' ][ 'enabled' ]; break ; case 'create_step_position' : $lp [ 'create_step_position' ] = $params [ 'screens' ][ 'create' ][ 'position' ]; break ; // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'. case 'admin_name' : $lp [ 'admin_name' ] = $params [ 'screens' ][ 'edit' ][ 'name' ]; break ; case 'admin_slug' : $lp [ 'admin_slug' ] = $params [ 'screens' ][ 'edit' ][ 'slug' ]; break ; case 'create_name' : $lp [ 'create_name' ] = $params [ 'screens' ][ 'create' ][ 'name' ]; break ; case 'create_slug' : $lp [ 'create_slug' ] = $params [ 'screens' ][ 'create' ][ 'slug' ]; break ; case 'admin_metabox_context' : $lp [ 'admin_metabox_context' ] = $params [ 'screens' ][ 'admin' ][ 'metabox_context' ]; break ; case 'admin_metabox_priority' : $lp [ 'admin_metabox_priority' ] = $params [ 'screens' ][ 'admin' ][ 'metabox_priority' ]; break ; default : // All other items get moved over. $lp [ $property ] = $params [ $property ]; // Also reapply to the object, for backpat. $this ->{ $property } = $params [ $property ]; break ; } } } |
Changelog
Version | Description |
---|---|
BuddyPress 1.8.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.