Changeset 3464359
- Timestamp:
- 02/18/2026 01:21:47 PM (6 weeks ago)
- Location:
- ringier-bus/trunk
- Files:
-
- 6 edited
-
CHANGELOG.md (modified) (1 diff)
-
README.md (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
ringier-bus.php (modified) (2 diffs)
-
src/Core/Bus/ArticleEvent.php (modified) (2 diffs)
-
src/Core/Bus/ArticlesEvent.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ringier-bus/trunk/CHANGELOG.md
r3453810 r3464359 13 13 * (dependency) Fully remove Guzzle/Symfony dependencies 14 14 * (dependency) Fully remove Timber/Twig 15 16 17 ## [3.6.0] - 2026-02-18 ## 18 19 ### Added ### 20 * (payload) Added `taxon_tags[]` (array of TranslationObject) to the Article payload, populated with all tags associated with the article. 21 * For standard `post` type: includes the built-in `post_tag` taxonomy. 22 * For custom post types: includes any non-hierarchical (tag-like) custom taxonomy registered for that post type. 23 24 ### Changed ### 25 * (code) Aligned `ArticlesEvent` date methods (`getOgArticlePublishedDate`, `getOgArticleModifiedDate`) with the 3.5.2 hardening applied to `ArticleEvent`: uses native `WP_Post` properties as source of truth and guards against null/zeroed GMT timestamps with a local-date fallback. 15 26 16 27 -
ringier-bus/trunk/README.md
r3453810 r3464359 7 7 **Requires at least:** 6.0 8 8 **Tested up to:** 6.9 9 **Stable tag:** 3. 5.29 **Stable tag:** 3.6.0 10 10 **Requires PHP:** 8.1 11 11 **License:** GPLv2 or later -
ringier-bus/trunk/readme.txt
r3453810 r3464359 4 4 Requires at least: 6.0 5 5 Tested up to: 6.9 6 Stable tag: 3. 5.26 Stable tag: 3.6.0 7 7 Requires PHP: 8.1 8 8 License: GPLv2 or later … … 161 161 162 162 == Changelog == 163 164 ### [3.6.0] - 2026-02-18 ### 165 166 #### Added #### 167 * (payload) Added `taxon_tags[]` (array of TranslationObject) to the Article payload, populated with all tags associated with the article. 168 * For standard `post` type: includes the built-in `post_tag` taxonomy. 169 * For custom post types: includes any non-hierarchical (tag-like) custom taxonomy registered for that post type. 170 171 #### Changed #### 172 * (code) Aligned `ArticlesEvent` date methods with the 3.5.2 hardening: uses native `WP_Post` properties as source of truth and guards against null/zeroed GMT timestamps with a local-date fallback. 173 163 174 164 175 ### [3.5.2] - 2026-02-04 ### -
ringier-bus/trunk/ringier-bus.php
r3453810 r3464359 11 11 * Plugin URI: https://github.com/RingierIMU/mkt-plugin-wordpress-bus 12 12 * Description: A plugin to push events to Ringier CDE via the BUS API whenever an article is created, updated or deleted 13 * Version: 3. 5.213 * Version: 3.6.0 14 14 * Requires at least: 6.0 15 15 * Author: Ringier SA, Wasseem Khayrattee … … 50 50 */ 51 51 define('RINGIER_BUS_DS', DIRECTORY_SEPARATOR); 52 define('RINGIER_BUS_PLUGIN_VERSION', '3. 5.2');52 define('RINGIER_BUS_PLUGIN_VERSION', '3.6.0'); 53 53 define('RINGIER_BUS_PLUGIN_MINIMUM_WP_VERSION', '6.0'); 54 54 define('RINGIER_BUS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__)); //has trailing slash at end -
ringier-bus/trunk/src/Core/Bus/ArticleEvent.php
r3453810 r3464359 250 250 'parent_category' => $this->getParentCategoryArray($post_ID), 251 251 'categories' => $this->getAllCategoryListArray($post_ID), 252 'taxon_tags' => $this->getTaxonTags($post_ID), 252 253 'sailthru_tags' => $this->getSailthruTags($post_ID), 253 254 'sailthru_vars' => $this->getSailthruVars($post_ID), … … 840 841 841 842 /** 843 * Get all tags associated with a post as TranslationObjects. 844 * 845 * For standard posts this includes the built-in `post_tag` taxonomy. 846 * For custom post types it includes any non-hierarchical (tag-like) custom 847 * taxonomy registered for that post type, excluding irrelevant ones. 848 * 849 * @param int $post_ID 850 * 851 * @return array 852 */ 853 private function getTaxonTags(int $post_ID): array 854 { 855 $tags = []; 856 $post_type = get_post_type($post_ID); 857 $taxonomies = get_object_taxonomies($post_type, 'objects'); 858 859 if (empty($taxonomies)) { 860 return $tags; 861 } 862 863 $blacklist = [ 864 'post_format', 865 'sailthru_user_type', 866 'sailthru_user_status', 867 'sailthru_property_type', 868 'sailthru_experience_level', 869 'sailthru_functions', 870 'content_style', 871 'content_author', 872 'article_intent', 873 ]; 874 875 foreach ($taxonomies as $taxonomy => $taxonomy_obj) { 876 // Only process flat (non-hierarchical) taxonomies — i.e. tag-like ones 877 if ($taxonomy_obj->hierarchical || in_array($taxonomy, $blacklist, true)) { 878 continue; 879 } 880 881 $terms = get_the_terms($post_ID, $taxonomy); 882 if (is_wp_error($terms) || empty($terms)) { 883 continue; 884 } 885 886 foreach ($terms as $term) { 887 $tags[] = [ 888 'id' => $term->term_id, 889 'title' => [ 890 [ 891 'culture' => ringier_getLocale(), 892 'value' => $term->name, 893 ], 894 ], 895 'slug' => [ 896 [ 897 'culture' => ringier_getLocale(), 898 'value' => $term->slug, 899 ], 900 ], 901 ]; 902 } 903 } 904 905 return $tags; 906 } 907 908 /** 842 909 * Get all hierarchical taxonomies for the post type 843 910 * This will be used to fetch all terms for the post type -
ringier-bus/trunk/src/Core/Bus/ArticlesEvent.php
r3447091 r3464359 229 229 'parent_category' => $this->getParentCategoryArray($post_ID), 230 230 'categories' => $this->getAllCategoryListArray($post_ID), 231 'taxon_tags' => $this->getTaxonTags($post_ID), 231 232 'sailthru_tags' => $this->getSailthruTags($post_ID), 232 233 'sailthru_vars' => $this->getSailthruVars($post_ID), … … 700 701 * @return string 701 702 */ 702 private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post) 703 { 704 if (class_exists('YoastSEO') && (function_exists('YoastSEO'))) { 705 $yoast = YoastSEO(); 706 if(isset($yoast->meta) && method_exists($yoast->meta, 'for_post')) { 707 return $yoast->meta->for_post($post_ID)->open_graph_article_modified_time; 708 } 709 } 710 711 return Utils::formatDate($post->post_modified_gmt); 703 private function getOgArticleModifiedDate(int $post_ID, \WP_Post $post): string 704 { 705 // Ensure we have a valid GMT modified date; fallback to local modified if GMT is empty 706 $date = !empty($post->post_modified_gmt) && $post->post_modified_gmt !== '0000-00-00 00:00:00' 707 ? $post->post_modified_gmt 708 : $post->post_modified; 709 710 return Utils::formatDate($date); 712 711 } 713 712 … … 721 720 * @return string 722 721 */ 723 private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post) 724 { 725 if (class_exists('YoastSEO') && (function_exists('YoastSEO'))) { 726 $yoast = YoastSEO(); 727 if(isset($yoast->meta) && method_exists($yoast->meta, 'for_post')) { 728 return $yoast->meta->for_post($post_ID)->open_graph_article_published_time; 729 } 730 } 731 732 return Utils::formatDate($post->post_date_gmt); 722 private function getOgArticlePublishedDate(int $post_ID, \WP_Post $post): string 723 { 724 // Ensure we have a valid GMT date; fallback to local date if GMT is empty 725 $date = !empty($post->post_date_gmt) && $post->post_date_gmt !== '0000-00-00 00:00:00' 726 ? $post->post_date_gmt 727 : $post->post_date; 728 729 return Utils::formatDate($date); 733 730 } 734 731 … … 773 770 774 771 return get_the_excerpt($post_ID); 772 } 773 774 /** 775 * Get all tags associated with a post as TranslationObjects. 776 * 777 * For standard posts this includes the built-in `post_tag` taxonomy. 778 * For custom post types it includes any non-hierarchical (tag-like) custom 779 * taxonomy registered for that post type, excluding irrelevant ones. 780 * 781 * @param int $post_ID 782 * 783 * @return array 784 */ 785 private function getTaxonTags(int $post_ID): array 786 { 787 $tags = []; 788 $post_type = get_post_type($post_ID); 789 $taxonomies = get_object_taxonomies($post_type, 'objects'); 790 791 if (empty($taxonomies)) { 792 return $tags; 793 } 794 795 $blacklist = [ 796 'post_format', 797 'sailthru_user_type', 798 'sailthru_user_status', 799 'sailthru_property_type', 800 'sailthru_experience_level', 801 'sailthru_functions', 802 'content_style', 803 'content_author', 804 'article_intent', 805 ]; 806 807 foreach ($taxonomies as $taxonomy => $taxonomy_obj) { 808 // Only process flat (non-hierarchical) taxonomies — i.e. tag-like ones 809 if ($taxonomy_obj->hierarchical || in_array($taxonomy, $blacklist, true)) { 810 continue; 811 } 812 813 $terms = get_the_terms($post_ID, $taxonomy); 814 if (is_wp_error($terms) || empty($terms)) { 815 continue; 816 } 817 818 foreach ($terms as $term) { 819 $tags[] = [ 820 'id' => $term->term_id, 821 'title' => [ 822 [ 823 'culture' => ringier_getLocale(), 824 'value' => $term->name, 825 ], 826 ], 827 'slug' => [ 828 [ 829 'culture' => ringier_getLocale(), 830 'value' => $term->slug, 831 ], 832 ], 833 ]; 834 } 835 } 836 837 return $tags; 775 838 } 776 839
Note: See TracChangeset
for help on using the changeset viewer.