A WordPress plugin that adds lang and dir attributes to Group, Columns, Cover, and other specific WordPress Blocks, or to the whole page/post for improved accessibility.
This plugin provides a way to ensure that language changes are correctly indicated to assistive technologies, helping a website comply with WCAG guidelines. It works at two levels: at the block level (Group, Columns, Cover, and other container blocks) for sections within a page written in a different language (WCAG 3.1.2), and at the page/post level to override the HTML lang and dir attributes for an entire page written in a different language (WCAG 3.1.1).
- Node.js (version 16 or higher)
- npm or yarn package manager
- WordPress development environment
-
Clone or download the plugin to your WordPress plugins directory:
cd wp-content/plugins/ git clone [repository-url] lang-attribute-blocks cd lang-attribute-blocks
-
Install dependencies:
npm install
-
Start development mode with hot reloading:
npm run start
-
Create a production build:
npm run build
-
The built files will be generated in the
build/directory:build/index.js- Compiled JavaScriptbuild/index.css- Compiled CSS
npm run start- Start development mode with file watchingnpm run build- Create production buildnpm run make-pot- Update .pot file
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage and handle any security vulnerabilities. Report a security vulnerability.