Changeset 773032
- Timestamp:
- 09/16/2013 02:27:59 AM (13 years ago)
- File:
-
- 1 edited
-
post-by-email/trunk/class-post-by-email.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-by-email/trunk/class-post-by-email.php
r773031 r773032 336 336 337 337 338 /* categories*/338 /* shortcode: categories. [category cat1 cat2...] */ 339 339 340 340 $shortcode_categories = $this->find_shortcode( 'category', $post_content ); … … 357 357 } 358 358 359 /* get tags from shortcode */ 359 /* shortcode: tags. [tag tag1 tag2...] */ 360 360 361 $tags_input = $this->find_shortcode( 'tag', $post_content ); 361 362 362 363 $original_post_content = $post_content; 363 364 $post_content = $this->filter_valid_shortcodes( $post_content ); 364 365 … … 380 381 // save original message sender as post_meta, in case we want it later 381 382 add_post_meta( $post_ID, 'original_author', $from_email ); 383 384 385 /* shortcode: custom taxonomies. [taxname term1 term2 ...] */ 386 $tax_input = array(); 387 388 // get all registered custom taxonomies 389 $args = array( 390 'public' => true, 391 '_builtin' => false 392 ); 393 $registered_taxonomies = get_taxonomies( $args, 'names', 'and' ); 394 395 if ( $registered_taxonomies ) { 396 foreach ( $registered_taxonomies as $taxonomy_name ) { 397 $tax_shortcodes = $this->find_shortcode( $taxonomy_name, $original_post_content ); 398 if ( count( $tax_shortcodes ) > 0 ) { 399 // pending bug fix: http://core.trac.wordpress.org/ticket/19373 400 //$tax_input[] = array( $taxonomy_name => $tax_shortcodes ); 401 wp_set_post_terms( $post_ID, $tax_shortcodes, $taxonomy_name ); 402 } 403 } 404 } 382 405 383 406 /* attachments */ … … 768 791 */ 769 792 protected function filter_valid_shortcodes( $text ) { 770 foreach ( array( 'tag', 'category', 'pin' ) as $shortcode ) { 793 $valid_shortcodes = array( 'tag', 'category', 'pin' ); 794 795 // get all registered custom taxonomies 796 $args = array( 797 'public' => true, 798 '_builtin' => false 799 ); 800 $registered_taxonomies = get_taxonomies( $args, 'names', 'and' ); 801 802 if ( $registered_taxonomies ) { 803 foreach ( $registered_taxonomies as $taxonomy ) { 804 $valid_shortcodes[] = $taxonomy; 805 } 806 } 807 808 foreach ( $valid_shortcodes as $shortcode ) { 771 809 $text = preg_replace( "/\[$shortcode\s(.*?)\]/i", '', $text ); 772 810 }
Note: See TracChangeset
for help on using the changeset viewer.