Changeset 1190423
- Timestamp:
- 06/30/2015 05:29:06 PM (11 years ago)
- Location:
- automatic-post-tagger
- Files:
-
- 2 edited
-
tags/1.8.1/automatic-post-tagger.php (modified) (3 diffs)
-
trunk/automatic-post-tagger.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
automatic-post-tagger/tags/1.8.1/automatic-post-tagger.php
r1176395 r1190423 3218 3218 ### ADDING TERMS TO THE POST according to the taxonomies they belong to 3219 3219 foreach($apt_taxonomies_with_found_terms_array as $apt_single_taxonomy_with_found_terms_array){ 3220 $apt_current_taxonomy_terms = wp_get_post_terms($apt_post_id, $apt_single_taxonomy_with_found_terms_array[0], array('fields' => 'names')); 3221 $apt_current_taxonomy_term_count = count($apt_current_taxonomy_terms); 3222 3220 3223 if($apt_number_of_added_terms_total > 0 and ($apt_settings['apt_old_terms_handling'] == 1 or $apt_settings['apt_old_terms_handling'] == 3)){ //if terms were found by the plugin; if the post has no terms, we should add them - if it already has some, it won't pass one of the first conditions in the function if $apt_settings['apt_old_terms_handling'] == 3 3221 3224 wp_set_object_terms($apt_post_id, $apt_single_taxonomy_with_found_terms_array[1], $apt_single_taxonomy_with_found_terms_array[0], true); //append terms … … 3226 3229 } 3227 3230 else{ //no new terms/keywords were found 3228 if(($apt_settings['apt_old_terms_handling_2_remove_old_terms'] == 1) and ($apt_ post_current_term_count > 0)){ //if no new terms were found and there are old terms, remove them all3231 if(($apt_settings['apt_old_terms_handling_2_remove_old_terms'] == 1) and ($apt_current_taxonomy_term_count > 0)){ //if no new terms were found and there are old terms, remove them all 3229 3232 wp_delete_object_term_relationships($apt_post_id, $apt_single_taxonomy_with_found_terms_array[0]); //remove all terms 3230 3233 } … … 4501 4504 die($apt_invalid_nonce_message); 4502 4505 } 4506 4503 4507 } 4504 4508 -
automatic-post-tagger/trunk/automatic-post-tagger.php
r1176395 r1190423 3218 3218 ### ADDING TERMS TO THE POST according to the taxonomies they belong to 3219 3219 foreach($apt_taxonomies_with_found_terms_array as $apt_single_taxonomy_with_found_terms_array){ 3220 $apt_current_taxonomy_terms = wp_get_post_terms($apt_post_id, $apt_single_taxonomy_with_found_terms_array[0], array('fields' => 'names')); 3221 $apt_current_taxonomy_term_count = count($apt_current_taxonomy_terms); 3222 3220 3223 if($apt_number_of_added_terms_total > 0 and ($apt_settings['apt_old_terms_handling'] == 1 or $apt_settings['apt_old_terms_handling'] == 3)){ //if terms were found by the plugin; if the post has no terms, we should add them - if it already has some, it won't pass one of the first conditions in the function if $apt_settings['apt_old_terms_handling'] == 3 3221 3224 wp_set_object_terms($apt_post_id, $apt_single_taxonomy_with_found_terms_array[1], $apt_single_taxonomy_with_found_terms_array[0], true); //append terms … … 3226 3229 } 3227 3230 else{ //no new terms/keywords were found 3228 if(($apt_settings['apt_old_terms_handling_2_remove_old_terms'] == 1) and ($apt_ post_current_term_count > 0)){ //if no new terms were found and there are old terms, remove them all3231 if(($apt_settings['apt_old_terms_handling_2_remove_old_terms'] == 1) and ($apt_current_taxonomy_term_count > 0)){ //if no new terms were found and there are old terms, remove them all 3229 3232 wp_delete_object_term_relationships($apt_post_id, $apt_single_taxonomy_with_found_terms_array[0]); //remove all terms 3230 3233 } … … 4501 4504 die($apt_invalid_nonce_message); 4502 4505 } 4506 4503 4507 } 4504 4508
Note: See TracChangeset
for help on using the changeset viewer.