Open moscatovida opened 3 months ago
I just discovered this post Let me add an additional resource
As you can see currently Pods Sync associated taxonomy is not working and if it is fixed it, the snippet code should see the terms attached, otherwise it is another bug that we should find, I have not managed to find where it comes from
Thanks for your reply … looking forward to the fix :)
I was getting crazy because my pages for custom taxonomies made with Pods always returned 0. I have just realized that they were not been sincronized. I go to test this solution while this gets solved https://wordpress.org/support/topic/how-to-use-sync-associated-taxonomy-with-this-relationship/
At the end, I used your snippet in https://docs.pods.io/code-snippets/update-taxonomy-value-stored-relationship-field/ and its working in the database. I hope you can give time to solve this. Thanks
Also in my custom taxonomy I don't get the option to "Show in taxonomy archives" https://docs.pods.io/files/2021/08/Screen-Shot-2021-08-22-at-10.48.38-AM-1024x623.png I get at the bottom: Add new connection with the link to Create a new Custom Post Type
If I go to the taxonomy in admin wp-admin/edit-tags.php?taxonomy=taxonomyname the count for each term doesn't work and shows 0. I have tested and the table that gets updated with your site snippet is postmeta and not in term_taxonomy, cell count.
@rosa2 Custom taxonomies already show any associated post type on their archive pages so that option in Pods only shows if you choose to associate a custom post type with Category or Post Tags taxonomies.
I've got the syncing confirmed working in Pods 3.2.7 with the latest testing. Let's check that on your side after the release goes out today and we can close this if that is resolved for you now.
hello, I confirm with having tested on 3 clean installations (local wp app)
I have a strange error, i will try to capture it in video for you as you can probably notice , it is totally unpredictable it can happen randomly
https://github.com/user-attachments/assets/0238a439-0a20-404d-a769-1112c381544e
everything works normally but you have to click on refresh this error screen which is scary and everything works as expected, until you make another choice or you create another entry i paste you all the log
`
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\fields\pick.php on line 1974
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\fields\pick.php on line 1975
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\fields\pick.php on line 2003
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\fields\pick.php on line 2003
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6296
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6296
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6299
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6302
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6302
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6305
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6305
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6320
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6322
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6331
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6338
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6364
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6376
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6430
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 6431
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8137
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8137
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8147
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8147
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8159
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8166
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8192
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8219
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8220
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8224
Warning: Trying to access array offset on value of type null in C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php on line 8225
Warning: Cannot modify header information - headers already sent by (output started at C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php:8137) in C:\Users\nrelj\Local Sites\test\app\public\wp-includes\pluggable.php on line 1435
Warning: Cannot modify header information - headers already sent by (output started at C:\Users\nrelj\Local Sites\test\app\public\wp-content\plugins\pods\classes\PodsAPI.php:8137) in C:\Users\nrelj\Local Sites\test\app\public\wp-includes\pluggable.php on line 1438`
I hope that the error can be found and corrected 🙏 thank you for your time and making pods better 💪
Hi,
I think the ultimate fix for this bug will be for version 3.2.9 ,
sorry to remind you again I had the feeling that this detail could be easily forgotten , so I confirm it again
in fact it is not a detail, it is even the ultimate interest of Sync associated taxonomy
normally to check if the bug has been fixed correctly , do the test , we should see the same result that ACF does with the same code snippet
to reproduce :
Create a CPT "property" or other and similar taxonomies or other
Install Rankmath Free
Apply the code snippet (change values acrroding to your test conditions)
/**
* Function to update Rank Math Focus Keywords for properties using specified taxonomies
*/
function update_property_focus_keywords() {
$properties = get_posts(array(
'post_type' => 'property', // Replace 'property' with your actual CPT name
'posts_per_page' => -1,
'post_status' => 'publish'
));
$taxonomies = array('property-status', 'property-type', 'property-city');
foreach ($properties as $property) {
$keywords = array();
// Get terms for each taxonomy
foreach ($taxonomies as $taxonomy) {
$terms = get_the_terms($property->ID, $taxonomy);
if ($terms && !is_wp_error($terms)) {
foreach ($terms as $term) {
$keywords[] = strtolower($term->name);
}
}
}
// Update Focus Keyword even if it exists
$focus_keyword = implode(', ', array_unique($keywords));
update_post_meta($property->ID, 'rank_math_focus_keyword', $focus_keyword);
}
}
// Hook the function to run when WordPress initializes
add_action('init', 'update_property_focus_keywords');
Create a post and save
You should see your focus keywords
I hope i was able to provide enough data to diagnose the source of the problem
Thanks a lot for your so well related experience.
Description
The feature "Sync associated taxonomy with this relationship" does not seem to work properly. When editing a post, the term chosen in the relationship field is ignored.
Also: The option field is actually an empty plain text field. There is no explanation on how to use it and which value should be used to enable the sync.
Version
3.2.6
Testing Instructions
Screenshots / Screencast
No response
Possible Workaround
No response
Site Health Information
No response
Pods Package
No response