' . esc_html__( 'Connect this site to see what to change so AI answers name this business.', 'outercite' ) . '

'; if ( current_user_can( Admin::CAP_CONNECT ) ) { echo '

' . esc_html__( 'Connect with Outercite', 'outercite' ) . '

'; } return; } $ledger = Ledger::changes(); if ( ! $ledger['ok'] ) { echo '

' . esc_html( $ledger['error'] ) . '

'; return; } $proposed = array_slice( (array) ( $ledger['data']['proposed'] ?? array() ), 0, 3 ); $shipped = (array) ( $ledger['data']['shipped'] ?? array() ); usort( $shipped, static function ( $a, $b ) { return strcmp( (string) ( $b['shippedAt'] ?? '' ), (string) ( $a['shippedAt'] ?? '' ) ); } ); echo '

' . esc_html__( 'Open changes', 'outercite' ) . '

'; if ( $proposed ) { echo ''; } else { echo '

' . esc_html__( 'Nothing open right now.', 'outercite' ) . '

'; } echo '

' . esc_html__( 'Last change live', 'outercite' ) . '

'; if ( $shipped ) { $last = $shipped[0]; $ts = ! empty( $last['shippedAt'] ) ? strtotime( (string) $last['shippedAt'] ) : false; echo '

' . esc_html( (string) $last['title'] ) . ( $ts ? ' (' . esc_html( wp_date( get_option( 'date_format' ), $ts ) ) . ', ' . esc_html( (string) ( $last['state'] ?? '' ) ) . ')' : '' ) . '

'; } else { echo '

' . esc_html__( 'No change marked live yet.', 'outercite' ) . '

'; } echo '

' . esc_html__( 'See all changes', 'outercite' ) . '

'; } }