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

Show unnamed title #1533

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions includes/admin/reporting/class-sales-logs-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public function column_default( $item, $column_name ) {

switch ( $column_name ) {
case 'form' :
return '<a href="' . esc_url( add_query_arg( 'form', $item[ $column_name ] ) ) . '" >' . get_the_title( $item[ $column_name ] ) . '</a>';
$form_title = get_the_title( $item[ $column_name ] );
$form_title = empty( $form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $item[ $column_name ] ) : $form_title;
return '<a href="' . esc_url( add_query_arg( 'form', $item[ $column_name ] ) ) . '" >' . $form_title . '</a>';

case 'user_id' :
return '<a href="' .
Expand Down Expand Up @@ -304,7 +306,9 @@ public function give_forms_filter() {
echo '<select name="form" id="give-log-form-filter">';
echo '<option value="0">' . esc_html__( 'All', 'give' ) . '</option>';
foreach ( $give_forms as $form ) {
echo '<option value="' . $form . '"' . selected( $form, $this->get_filtered_give_form() ) . '>' . esc_html( get_the_title( $form ) ) . '</option>';
$form_title = get_the_title( $form );
$form_title = empty( $form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $form ) : $form_title;
echo '<option value="' . $form . '"' . selected( $form, $this->get_filtered_give_form() ) . '>' . esc_html( $form_title ) . '</option>';
}
echo '</select>';
}
Expand Down