-
Notifications
You must be signed in to change notification settings - Fork 566
Example functions clean up #866
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
Conversation
example-functions.php
Outdated
| // Don't show this metabox if it's not the front page template | ||
| if ( $cmb->object_id !== get_option( 'page_on_front' ) ) { | ||
| // Don't show this metabox if it's not the front page template. | ||
| if ( get_option( 'page_on_front' !== $cmb->object_id ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct (and is broken)
example-functions.php
Outdated
| <p class="description"><?php echo $description; ?></p> | ||
| <div class="custom-field-row <?php echo esc_attr( $classes ); ?>"> | ||
| <p><label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $label ); ?></label></p> | ||
| <p><input id="<?php echo esc_attr( $id ); ?>" type="text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>"/></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$value is already escaped, as it's taken from $field->escaped_value()
example-functions.php
Outdated
| <p><?php echo $field->escaped_value(); ?></p> | ||
| <p class="description"><?php echo $field->args( 'description' ); ?></p> | ||
| <div class="custom-column-display <?php echo esc_attr( $field->row_classes() ); ?>"> | ||
| <p><?php echo esc_html( $field->escaped_value() ); ?></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esc_html is not needed on a call to $field->escaped_value()
jtsternberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the requested lines.
|
The update was corrected |
PavelK27
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
It works, thanks! |
Some PHPCS fixes for example-functions file