Ticket #29803: 29803.diff
| File 29803.diff, 2.5 KB (added by , 12 years ago) |
|---|
-
wp-includes/class-wp-embed.php
97 97 * @param string $regex The regex that will be used to see if this handler should be used for a URL. 98 98 * @param callback $callback The callback function that will be called if the regex is matched. 99 99 * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action. 100 * @return bool True if the callback is currently callable, false otherwise. Note - the callback will be registered regardless. 100 101 */ 101 102 public function register_handler( $id, $regex, $callback, $priority = 10 ) { 102 103 $this->handlers[$priority][$id] = array( 103 104 'regex' => $regex, 104 105 'callback' => $callback, 105 106 ); 107 return is_callable( $callback ); 106 108 } 107 109 108 110 /** -
wp-includes/media.php
2058 2058 /** 2059 2059 * Register an embed handler. This function should probably only be used for sites that do not support oEmbed. 2060 2060 * 2061 * This function will always register the requested handler, but will return false if the requested callback 2062 * is currently uncallable. 2063 * 2061 2064 * @since 2.9.0 2062 2065 * @see WP_Embed::register_handler() 2066 * 2067 * @param string $id An internal ID/name for the handler. Needs to be unique. 2068 * @param string $regex The regex that will be used to see if this handler should be used for a URL. 2069 * @param callback $callback The callback function that will be called if the regex is matched. 2070 * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action. 2071 * @return bool True if the callback is currently callable, false otherwise. Note - the callback will be registered regardless. 2063 2072 */ 2064 2073 function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) { 2065 2074 global $wp_embed; 2066 $wp_embed->register_handler( $id, $regex, $callback, $priority );2075 return $wp_embed->register_handler( $id, $regex, $callback, $priority ); 2067 2076 } 2068 2077 2069 2078 /**
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)