Skip to content

Added Meta Boxes to Students - #14

Open
Kristiqan wants to merge 2 commits into
mainfrom
feature/added-meta-boxes-to-students
Open

Added Meta Boxes to Students#14
Kristiqan wants to merge 2 commits into
mainfrom
feature/added-meta-boxes-to-students

Conversation

@Kristiqan

Copy link
Copy Markdown
Owner

Custom Meta boxes for storing information about students

https://app.asana.com/0/1202801577682628/1202801610143067/f

Added meta boxes to students

Custom Meta boxes for storing information about students

https://app.asana.com/0/1202801577682628/1202801610143067/f

 Added meta boxes to students
@Kristiqan
Kristiqan requested review from Neychok and metodiew August 25, 2022 11:42
@Kristiqan Kristiqan self-assigned this 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
);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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/

Comment thread wp-content/themes/wpdemo/functions.php Outdated
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))?>">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This field should be a checkbox and not text. Checked = active, not checked = inactive

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants