' . sprintf( /* translators: %s: organisation name. */ esc_html__( '%s wants everyone to be able to use this website, including people who use screen readers, keyboards or other assistive tools.', 'easyable' ), esc_html( $org ) ) . '

'; $parts[] = '

' . esc_html__( 'What we aim for', 'easyable' ) . '

'; $parts[] = '

' . sprintf( /* translators: %1$s: WCAG level, %2$s: date of last check. */ esc_html__( 'We aim to meet the %1$s rules. Our last check was on %2$s. This website is partially in line with those rules: we check regularly and fix problems as we find them.', 'easyable' ), esc_html( $level ), esc_html( $date ) ) . '

'; if ( $issues ) { $parts[] = '

' . esc_html__( 'What we are still working on', 'easyable' ) . '

'; $lis = ''; foreach ( array_slice( $issues, 0, 10 ) as $issue ) { $lis .= '
  • ' . esc_html( $issue ) . '
  • '; } $parts[] = ''; } $parts[] = '

    ' . esc_html__( 'Found a problem?', 'easyable' ) . '

    '; $parts[] = '

    ' . sprintf( /* translators: %s: contact email address. */ esc_html__( 'Email us at %s and tell us which page you were on and what went wrong. We will help you another way while we fix it, and we aim to reply within 5 working days.', 'easyable' ), esc_html( $email ) ) . '

    '; $parts[] = '

    ' . sprintf( /* translators: %s: date this statement was prepared. */ esc_html__( 'This statement was prepared on %s and is reviewed whenever we run a new check.', 'easyable' ), esc_html( $date ) ) . '

    '; return implode( "\n\n", $parts ); } /** * Create (or update) the statement draft page. * * @param array $data Same keys as build_content(). * @return int|WP_Error Page ID. */ public static function create_page( $data ) { $content = self::build_content( $data ); $settings = get_option( 'accscan_statement', array() ); $page_id = isset( $settings['page_id'] ) ? (int) $settings['page_id'] : 0; $postarr = array( 'post_title' => __( 'Accessibility Statement', 'easyable' ), 'post_content' => $content, 'post_status' => 'draft', 'post_type' => 'page', ); if ( $page_id && get_post( $page_id ) ) { $postarr['ID'] = $page_id; $result = wp_update_post( $postarr, true ); } else { $result = wp_insert_post( $postarr, true ); } if ( is_wp_error( $result ) ) { return $result; } $settings['page_id'] = (int) $result; update_option( 'accscan_statement', $settings ); return (int) $result; } }