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

Add extra fields #762

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Add extra fields #762

wants to merge 19 commits into from

Conversation

pfefferle
Copy link
Member

Make extra fields editable

@pfefferle pfefferle marked this pull request as ready for review May 20, 2024 18:50
@pfefferle pfefferle requested a review from mattwiebe May 20, 2024 18:50
Copy link
Contributor

@mattwiebe mattwiebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having these available will be nice! Left a few comments to clarify.

And it would be good to have these available for the Blog User as well!

includes/class-activitypub.php Show resolved Hide resolved
*/
public static function filter_get_posts_query( $query ) {
if ( $query->get( 'post_type' ) === 'ap_extrafield' ) {
$query->set( 'author', get_current_user_id() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to understand why we need this? The author field is already specified in the only two WP_Query instances trying to get this data.

Copy link
Member Author

@pfefferle pfefferle May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows only the extra field of a user and hides the extra fields from the others on /wp-admin/edit.php?post_type=ap_extrafield.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! Then it would probably be good to either 1) check that author isn't already set before setting it, or 2) only add this filter on that page? Again, not that important, we can revisit if it's a problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I moved the filters around a bit.

includes/model/class-user.php Show resolved Hide resolved
mattwiebe
mattwiebe previously approved these changes May 30, 2024
Copy link
Contributor

@mattwiebe mattwiebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshots in the PR description would be nice!

As we discussed, it'd be nice to have some form of migration and do display the defaults here:
Screenshot 2024-06-04 at 10 20 39

To me it was surprising to arrive in the Gutenberg editor when I clicked "Add new", it felt like a bug. What about just adding another row for quickly adding a new entry and the Edit link gives you full-text editing?

Mockup:
Screenshot 2024-06-04 at 10 23 40

<p>
<input class="regular-text" type="text" size="5" value="" placeholder="Field">
<input class="regular-text" type="text" value="" placeholder="Value">
</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants