Changeset 9550
- Timestamp:
- 02/24/2015 03:32:34 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-embed.php
r9517 r9550 55 55 } 56 56 57 /** 58 * Filters the BuddyPress Core oEmbed setup. 59 * 60 * @since BuddyPress (1.5.0) 61 * 62 * @param BP_Embed $this Current instance of the BP_Embed. Passed by reference. 63 */ 57 64 do_action_ref_array( 'bp_core_setup_oembed', array( &$this ) ); 58 65 } … … 95 102 if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) { 96 103 if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) ) { 104 105 /** 106 * Filters the oEmbed handler result for the provided URL. 107 * 108 * @since BuddyPress (1.5.0) 109 * 110 * @param string $return Handler callback for the oEmbed. 111 * @param string $url URL attempting to be embedded. 112 * @param array $attr Shortcode attributes. 113 */ 97 114 return apply_filters( 'embed_handler_html', $return, $url, $attr ); 98 115 } … … 101 118 } 102 119 103 // Get object ID 120 /** 121 * Filters the embed object ID. 122 * 123 * @since BuddyPress (1.5.0) 124 * 125 * @param int $value Value of zero. 126 */ 104 127 $id = apply_filters( 'embed_post_id', 0 ); 105 128 106 // Is oEmbed discovery on? 129 /** 130 * Filters whether or not oEmbed discovery is on. 131 * 132 * @since BuddyPress (1.5.0) 133 * 134 * @param bool $value Current status of oEmbed discovery. 135 */ 107 136 $attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) ); 108 137 … … 157 186 // Let components / plugins grab their cache 158 187 $cache = ''; 188 189 /** 190 * Filters the cache value to be used in the oEmbed, if exists. 191 * 192 * @since BuddyPress (1.5.0) 193 * 194 * @param string $cache Empty initial cache value. 195 * @param int $id ID that the caching is for. 196 * @param string $cachekey Key to use for the caching in the database. 197 * @param string $url The URL attempting to be embedded. 198 * @param array $attr Parsed shortcode attributes. 199 * @param array $rawattr Unparsed shortcode attributes. 200 */ 159 201 $cache = apply_filters( 'bp_embed_get_cache', $cache, $id, $cachekey, $url, $attr, $rawattr ); 160 202 161 203 // Grab cache and return it if available 162 204 if ( !empty( $cache ) ) { 205 206 /** 207 * Filters the found cache for the provided URL. 208 * 209 * @since BuddyPress (1.5.0) 210 * 211 * @param string $cache Cached HTML markup for embed. 212 * @param string $url The URL being embedded. 213 * @param array $attr Parsed shortcode attributes. 214 * @param array $rawattr Unparased shortcode attributes. 215 */ 163 216 return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr ); 164 217 … … 168 221 $cache = ( $html ) ? $html : $url; 169 222 170 // Let components / plugins save their cache 223 /** 224 * Fires if there is no existing cache and triggers cache setting. 225 * 226 * Lets components / plugins save their cache. 227 * 228 * @since BuddyPress (1.5.0) 229 * 230 * @param string $cache Newly cached HTML markup for embed. 231 * @param string $cachekey Key to use for the caching in the database. 232 * @param int $id ID to do the caching for. 233 */ 171 234 do_action( 'bp_embed_update_cache', $cache, $cachekey, $id ); 172 235 173 236 // If there was a result, return it 174 if ( $html ) 237 if ( $html ) { 238 239 /** This filter is documented in bp-core/classes/class-bp-embed.php */ 175 240 return apply_filters( 'bp_embed_oembed_html', $html, $url, $attr, $rawattr ); 241 } 176 242 } 177 243 }
Note: See TracChangeset
for help on using the changeset viewer.