- Timestamp:
- 06/25/2023 05:18:41 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core-bp-options-nav-backcompat.php
r13504 r13507 4 4 * 5 5 * @since 2.6.0 6 * @deprecated 12.0.0 6 7 */ 7 8 … … 16 17 * 17 18 * @since 2.6.0 19 * @deprecated 12.0.0 18 20 */ 19 21 class BP_Core_BP_Options_Nav_BackCompat extends BP_Core_BP_Nav_BackCompat { … … 31 33 * 32 34 * @since 2.6.0 35 * @deprecated 12.0.0 33 36 * 34 37 * @param mixed $offset Array offset. … … 41 44 '2.6.0' 42 45 ); 43 44 if ( empty( $this->backcompat_nav[ $offset ] ) ) { 45 $nav = $this->get_nav( $offset ); 46 if ( $nav ) { 47 $subnavs = $this->get_component_nav( $offset )->get_secondary( array( 'parent_slug' => $offset ) ); 48 $subnav_keyed = array(); 49 if ( $subnavs ) { 50 foreach ( $subnavs as $subnav ) { 51 $subnav_keyed[ $subnav->slug ] = (array) $subnav; 52 } 53 } 54 55 $subnav_object = new self( $subnav_keyed ); 56 $subnav_object->set_component( $this->get_component() ); 57 $subnav_object->set_parent_slug( $offset ); 58 59 $this->backcompat_nav[ $offset ] = $subnav_object; 60 } 61 } 62 63 if ( isset( $this->backcompat_nav[ $offset ] ) ) { 64 return $this->backcompat_nav[ $offset ]; 65 } 66 67 return false; 46 _deprecated_function( __METHOD__, '12.0.0' ); 68 47 } 69 48 … … 72 51 * 73 52 * @since 2.6.0 53 * @deprecated 12.0.0 74 54 * 75 55 * @param mixed $offset Array offset. … … 81 61 '2.6.0' 82 62 ); 83 84 $this->get_component_nav( $offset )->delete_nav( $offset, $this->get_parent_slug() ); 85 86 // Clear the cached nav. 87 unset( $this->backcompat_nav[ $offset ] ); 63 _deprecated_function( __METHOD__, '12.0.0' ); 88 64 } 89 65 … … 92 68 * 93 69 * @since 2.6.0 70 * @deprecated 12.0.0 94 71 * 95 72 * @return string 96 73 */ 97 74 public function get_parent_slug() { 98 return $this->parent_slug;75 _deprecated_function( __METHOD__, '12.0.0' ); 99 76 } 100 77 … … 103 80 * 104 81 * @since 2.6.0 82 * @deprecated 12.0.0 105 83 */ 106 84 public function set_parent_slug( $slug ) { 107 $this->parent_slug = $slug;85 _deprecated_function( __METHOD__, '12.0.0' ); 108 86 } 109 87 … … 112 90 * 113 91 * @since 2.6.0 92 * @deprecated 12.0.0 114 93 * 115 94 * @param mixed $offset Array offset. … … 117 96 */ 118 97 public function get_nav( $offset ) { 119 $nav = parent::get_nav( $offset ); 120 121 if ( ! $nav ) { 122 $component_nav = $this->get_component_nav( $offset ); 123 $secondary_nav = $component_nav->get_secondary( array( 'slug' => $offset ), false ); 124 125 $nav = array(); 126 127 if ( empty( $secondary_nav ) ) { 128 return $nav; 129 } 130 131 foreach ( $secondary_nav as $item ) { 132 $nav[ $item->slug ] = (array) $item; 133 } 134 } 135 136 return $nav; 98 _deprecated_function( __METHOD__, '12.0.0' ); 137 99 } 138 100 }
Note: See TracChangeset
for help on using the changeset viewer.