Changeset 13436 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 03/15/2023 08:16:46 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r13433 r13436 96 96 97 97 /** 98 * Output Groups directory's URL. 99 * 100 * @since 12.0.0 101 */ 102 function bp_groups_directory_url() { 103 echo esc_url( bp_get_groups_directory_url() ); 104 } 105 106 /** 107 * Returns the Groups directory's URL. 108 * 109 * @since 12.0.0 110 * 111 * @param array $path_chunks { 112 * An array of arguments. Optional. 113 * 114 * @type int $create_single_item `1` to get the create a group URL. 115 * @type array $directory_type The group type slug. 116 * } 117 * @return string The URL built for the BP Rewrites URL parser. 118 */ 119 function bp_get_groups_directory_url( $path_chunks = array() ) { 120 $supported_chunks = array_fill_keys( array( 'create_single_item', 'directory_type' ), true ); 121 122 $path_chunks = bp_parse_args( 123 array_intersect_key( $path_chunks, $supported_chunks ), 124 array( 125 'component_id' => 'groups' 126 ) 127 ); 128 129 $url = bp_rewrites_get_url( $path_chunks ); 130 131 /** 132 * Filters the Groups directory's URL. 133 * 134 * @since 12.0.0 135 * 136 * @param string $url The Groups directory's URL. 137 * @param array $path_chunks { 138 * An array of arguments. Optional. 139 * 140 * @type int $create_single_item `1` to get the create a group URL. 141 * @type array $directory_type The group type slug. 142 * } 143 */ 144 return apply_filters( 'bp_get_groups_directory_url', $url, $path_chunks ); 145 } 146 147 /** 98 148 * Output group directory permalink. 99 149 * 100 150 * @since 1.5.0 151 * @deprecated 12.0.0 101 152 */ 102 153 function bp_groups_directory_permalink() { 103 echo esc_url( bp_get_groups_directory_permalink() ); 154 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_groups_directory_url()' ); 155 bp_groups_directory_url(); 104 156 } 105 157 /** … … 107 159 * 108 160 * @since 1.5.0 161 * @deprecated 12.0.0 109 162 * 110 163 * @return string 111 164 */ 112 165 function bp_get_groups_directory_permalink() { 166 /* 167 * This function is used at many places and we need to review all this 168 * places during the 12.0 development cycle. Using BP Rewrites means we 169 * cannot concatenate URL chunks to build our URL anymore. We now need 170 * to use `bp_get_groups_directory_url( $array )` and make sure to use 171 * the right arguments inside this `$array`. Morevover as this function 172 * is also used to build a single group URL, we need to create a new 173 * function to create single group URLs using BP Rewrites. 174 * 175 * @todo Once every link reviewed, we'll be able to remove this check 176 * and let PHPUnit tell us the one we forgot, eventually! 177 */ 178 if ( ! buddypress()->is_phpunit_running ) { 179 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_groups_directory_url()' ); 180 } 181 182 $url = bp_get_groups_directory_url(); 113 183 114 184 /** … … 116 186 * 117 187 * @since 1.5.0 118 * 119 * @param string $value Permalink for the group directory. 120 */ 121 return apply_filters( 'bp_get_groups_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) ); 188 * @deprecated 12.0.0 189 * 190 * @param string $url Permalink for the group directory. 191 */ 192 return apply_filters_deprecated( 'bp_get_groups_directory_permalink', array( $url ), '12.0.0', 'bp_get_groups_directory_url' ); 122 193 } 123 194
Note: See TracChangeset
for help on using the changeset viewer.