Changeset 28510 for trunk/src/wp-includes/class-wp-embed.php
- Timestamp:
- 05/19/2014 05:46:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-embed.php
r28378 r28510 8 8 */ 9 9 class WP_Embed { 10 var$handlers = array();11 var$post_ID;12 var$usecache = true;13 var$linkifunknown = true;10 public $handlers = array(); 11 public $post_ID; 12 public $usecache = true; 13 public $linkifunknown = true; 14 14 15 15 /** 16 16 * Constructor 17 17 */ 18 function __construct() {18 public function __construct() { 19 19 // Hack to get the [embed] shortcode to run before wpautop() 20 20 add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 ); … … 48 48 * @return string Content with shortcode parsed 49 49 */ 50 function run_shortcode( $content ) {50 public function run_shortcode( $content ) { 51 51 global $shortcode_tags; 52 52 … … 70 70 * an AJAX request that will call WP_Embed::cache_oembed(). 71 71 */ 72 function maybe_run_ajax_cache() {72 public function maybe_run_ajax_cache() { 73 73 $post = get_post(); 74 74 … … 96 96 * @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. 97 97 */ 98 function register_handler( $id, $regex, $callback, $priority = 10 ) {98 public function register_handler( $id, $regex, $callback, $priority = 10 ) { 99 99 $this->handlers[$priority][$id] = array( 100 100 'regex' => $regex, … … 109 109 * @param int $priority Optional. The priority of the handler to be removed (default: 10). 110 110 */ 111 function unregister_handler( $id, $priority = 10 ) {111 public function unregister_handler( $id, $priority = 10 ) { 112 112 if ( isset($this->handlers[$priority][$id]) ) 113 113 unset($this->handlers[$priority][$id]); … … 140 140 * @return string The embed HTML on success, otherwise the original URL. 141 141 */ 142 function shortcode( $attr, $url = '' ) {142 public function shortcode( $attr, $url = '' ) { 143 143 $post = get_post(); 144 144 … … 241 241 * @param int $post_ID Post ID to delete the caches for. 242 242 */ 243 function delete_oembed_caches( $post_ID ) {243 public function delete_oembed_caches( $post_ID ) { 244 244 $post_metas = get_post_custom_keys( $post_ID ); 245 245 if ( empty($post_metas) ) … … 257 257 * @param int $post_ID Post ID to do the caching for. 258 258 */ 259 function cache_oembed( $post_ID ) {259 public function cache_oembed( $post_ID ) { 260 260 $post = get_post( $post_ID ); 261 261 … … 291 291 * @return string Potentially modified $content. 292 292 */ 293 function autoembed( $content ) {293 public function autoembed( $content ) { 294 294 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content ); 295 295 } … … 303 303 * @return string The embed HTML on success, otherwise the original URL. 304 304 */ 305 function autoembed_callback( $match ) {305 public function autoembed_callback( $match ) { 306 306 $oldval = $this->linkifunknown; 307 307 $this->linkifunknown = false; … … 318 318 * @return string Linked URL or the original URL. 319 319 */ 320 function maybe_make_link( $url ) {320 public function maybe_make_link( $url ) { 321 321 $output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url; 322 322
Note: See TracChangeset
for help on using the changeset viewer.