Added Meta Boxes to Students - #14
Open
Kristiqan wants to merge 2 commits into
Open
Conversation
Custom Meta boxes for storing information about students https://app.asana.com/0/1202801577682628/1202801610143067/f Added meta boxes to students
Neychok
requested changes
Aug 25, 2022
Comment on lines
+121
to
+131
| function dx_location_box() { | ||
| $screens = [ 'students' ]; | ||
| foreach ( $screens as $screen ) { | ||
| add_meta_box( | ||
| 'dxloc_box_id', | ||
| 'Location', | ||
| 'dx_lo_box_html', | ||
| $screen | ||
| ); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
You don't need to put add_meta_box inside an arrays, as the $screen arguments accepts arrays.
Although, it's nice you thought about that.
https://developer.wordpress.org/reference/functions/add_meta_box/
| function dx_acin_box_html( $post ) { | ||
| ?> | ||
| <label for="dx_field">Is the student active or not</label> | ||
| <input type="text" id="dx_axin" name="dx_acin" value="<?php echo esc_attr(get_post_meta(get_the_ID(), 'dx_acin', true))?>"> |
Collaborator
There was a problem hiding this comment.
This field should be a checkbox and not text. Checked = active, not checked = inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom Meta boxes for storing information about students
https://app.asana.com/0/1202801577682628/1202801610143067/f
Added meta boxes to students