Ticket #1079: 1079.2.diff
File 1079.2.diff, 1.9 KB (added by , 9 years ago) |
---|
-
classes/tagregator.php
114 114 add_action( 'init', array( $this, 'upgrade' ), 11 ); 115 115 add_action( 'wp_enqueue_scripts', __CLASS__ . '::load_resources' ); 116 116 add_action( 'admin_enqueue_scripts', __CLASS__ . '::load_resources' ); 117 add_filter ( 'wp_link_query_args', array( $this, 'exclude_from_search_results' ) ); 117 118 } 118 119 119 120 /** 121 * Filters CPTs from search results so it won't clutter up link insert list. 122 * 123 * @param WP_Query $query 124 * 125 * @return $query 126 */ 127 public static function exclude_from_search_results($query) { 128 foreach ( self::get_instance()->media_sources as $source ) { 129 $exclude_post_types[] = $source::POST_TYPE_SLUG; 130 } 131 132 $query = array_diff($query['post_type'], $exclude_post_types); 133 return $query; 134 } 135 136 /** 120 137 * Initializes variables 121 138 * @mvc Controller 122 139 */ -
classes/tggr-media-source.php
337 337 338 338 return $post_timestamp_local; 339 339 } 340 340 341 341 /** 342 342 * Retrieves the latest post mapped to a given hashtag 343 343 * @mvc Model 344 * 344 * 345 345 * @param $hashtag 346 * @return object|false 346 * @return object|false 347 347 */ 348 348 protected static function get_latest_hashtagged_post( $post_type, $hashtag ) { 349 349 $latest_post = false; … … 362 362 ), 363 363 ) 364 364 ) ); 365 365 366 366 if ( isset( $latest_post[0]->ID ) ) { 367 367 $latest_post = $latest_post[0]; 368 368 } 369 369 } 370 370 371 371 return $latest_post; 372 372 } 373 373 … … 461 461 462 462 return $length > self::POST_CONTENT_LENGTH_DISPLAY_LIMIT; 463 463 } 464 464 465 } // end TGGRModule 465 466 } 467 No newline at end of file