covertURLs( $post -> ID ); } } add_filter( 'the_content', 'filterByType' ); /** * This function is to filter the post whose post type is specified * * Anylink covert all external links at all time, * but only filter the specified ones, the benefit of this is you needn't * regenerate slug any time you changed the post type * * @param object $content provided by hook * @return object $content * * @since version 0.1.4 */ function filterByType( $content ) { $type = get_post_type(); $types = get_option( 'anylink_options' ); $types = $types['postType']; if( empty( $types ) ){ return $content; } if( ( is_string( $types ) && ( $types == $type ) ) || ( is_array( $types ) && array_search( $type, $types ) !== false ) ){ $filter = new al_filter(); return $filter -> applyFilter( $content ); } else { return $content; } } add_filter('query_vars', array( &$filter, 'addQueryVars' ) ); add_action( 'parse_request', array( &$filter, 'alter_the_query' ) ); add_action( 'plugins_loaded', 'al_load_textdomain' ); ?>