Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance user magictag #7153

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Enhance user magictag #7153

wants to merge 4 commits into from

Conversation

JoryHogeveen
Copy link
Member

@JoryHogeveen JoryHogeveen commented Sep 4, 2023

Description

Currently the {@user.##} magic tag is quite limited to the WP_User object only.
This won't properly support multiple metedata values and also doesn't consider the a possible User Pod.
This PR fixes this by fixing two things:

  • pods_v() > Proper order of getting user properties or metadata
  • pods_evaluate_tag() > If a user Pod exists, it will run the tag through this Pod first.

Related GitHub issue(s)

Fixes #7150

Changelog text for these changes

PR checklist

WP_User class implements magic methods which also handles metadata, though it it forced as single values which is incompatible with our intent for pods_v().
@JoryHogeveen JoryHogeveen added Type: Bug Type: Enhancement Enhancements to features that already exist, but are not major additions Status: PR > Pending Code Review PR is pending code review by core developers Status: PR > QA pending QA needs to be done labels Sep 4, 2023
@JoryHogeveen JoryHogeveen added this to the Pods 3.0 milestone Sep 4, 2023
@JoryHogeveen JoryHogeveen self-assigned this Sep 4, 2023
@what-the-diff
Copy link

what-the-diff bot commented Sep 4, 2023

PR Summary

  • Improved Handling of Variables in Data Logic
    The code has been enhanced to better handle variables, specifically the 'role' and 'var' variables, in our data structure. This improves the flexibility and robustness of the data processing system.
  • Enhanced Functionality for User Special Magic Tag
    The system now incorporates additional logic to manage special user triggers. These improvements to the 'pods_evaluate_tag' function enables our system to more easily manage specific user-related activities.

@JoryHogeveen
Copy link
Member Author

Needs doc update: https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/#Usage_and_Caveats

While not entirely invalid, this bottom part isn't 100% correct in regards to metadata (whether a user pod exists or not)

@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.0, Pods 3.2 Sep 12, 2023
Base automatically changed from release/3.0 to main September 13, 2023 14:43
@sc0ttkclark sc0ttkclark modified the milestones: Pods 3.2, Pods 3.3 Dec 11, 2023
@JoryHogeveen JoryHogeveen modified the milestones: Pods 3.3, Pods 3.2 Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: PR > Pending Code Review PR is pending code review by core developers Status: PR > QA pending QA needs to be done Type: Bug Type: Enhancement Enhancements to features that already exist, but are not major additions
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

{@user} taxonomy relationship magic tags output only first ID or pass false
2 participants