esc_html__( 'Ads.txt saved', 'ads-txt' ), 'error_message' => esc_html__( 'Your Ads.txt contains the following issues:', 'ads-txt' ), 'unknown_error' => esc_html__( 'An unknown error occurred.', 'ads-txt' ), ); wp_localize_script( 'adstxt', 'adstxt', $strings ); } add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\admin_enqueue_scripts' ); /** * Output some CSS directly in the head of the document. * * Should there ever be more than ~25 lines of CSS, this should become a separate file. * * @return void */ function admin_head_css() { ?> post_content; $errors = get_post_meta( $post->ID, 'adstxt_errors', true ); } ?>

' . esc_html( $error['value'] ) . '' ); $message = sprintf( /* translators: Error message output. 1: Line number, 2: Error message */ __( 'Line %1$s: %2$s', 'ads-txt' ), esc_html( $error['line'] ), $message // This is escaped piece-wise above and may contain HTML (code tags) at this point ); return $message; } /** * Get all non-generic error messages, translated and with placeholders intact. * * @return array Associative array of error messages. */ function get_error_messages() { $messages = array( 'invalid_variable' => __( 'Unrecognized variable' ), 'invalid_record' => __( 'Invalid record' ), 'invalid_account_type' => __( 'Third field should be RESELLER or DIRECT' ), /* translators: %s: Subdomain */ 'invalid_subdomain' => __( '%s does not appear to be a valid subdomain' ), /* translators: %s: Exchange domain */ 'invalid_exchange' => __( '%s does not appear to be a valid exchange domain' ), /* translators: %s: Alphanumeric TAG-ID */ 'invalid_tagid' => __( '%s does not appear to be a valid TAG-ID' ), ); return $messages; }