Remove all link title attributes

After reading this and this, I want to remove the title attribute from all links of my blog, as that is good from accessibility point of view. How this can be achieved? UPDATE I found a solution how to remove title attribute from images, but it doesn't work for me.
Category: Web

How to Restrict Access to all wp-admin pages for subscriber users

Here is summary of the problem and required solution: Access to mywebsite.com/wp-admin is blocked for subscribers [which is good] However, if i enter the link manually on the browser as follows: https://mywebsite.com/wp-admin/user-edit.php?user_id=113 then the user has access to his user settings Problem with that is that they can then create an API key (through application passwords plugin which is accessible from that page). This is undesirable as I dont want the users to have API keys where they can fetch/post …
Category: Web

How to add screen reader text to links inserted in the block editor?

Background When user adds a link to a paragraph block (or some other richtext block where links can be added) and sets the Open in new window flag, the block editor produces the following markup. <p> This is a text paragraph, which has <a href="#" target="_blank">an external link</a> in it. </p> To my understanding WCAG 2.0 criterion recommends adding a warning text to links that have the target="_blank" attribute. So the end result should be something like this, <p> This …
Category: Web

Benefits to using semantic HTML in post content?

I've been reading up on semantic HTML as a means of improving accessibility and SEO, but I'm still learning about the implications of semantic HTML. One question I have is whether there's any point to making sure that semantic HTML is used as much as possible in post content. Example: I have a post type for research projects. The write-up for a single research project can have any number of abbreviations for academic credentials, prefixes and suffixes (e.g., Mr., Sr., …
Category: Web

get_search_form() and aria_label

How do you pass the aria_label parameter to get_search_form()? I can't seem to pass the 'aria_label' parameter to get_search_form() in the correct way and can't find any examples. Lots with the first parameter 'echo' which works as in the documentation, but nothing I've tried for aria_label has made the search form add aria labels.
Category: Web

How do I access the contents of Wordpress Classic editor in admin area with JavaScript?

I am working on a small Wordpress plugin which uses JavaScript to add html tags with a css class to the visual text view in the Wordpress editor. I use the Classic Editor. According to Chrome Developer tools, the visual text editor consists of a few div elements, and then an iframe element with the id "content_ifr" which loads a second body element which then contains all html tags pertaining to the post: <body id="tinymce" class="mce-content-body content post-type-post post-status-publish post-format-standard …
Category: Web

how to make accessible menu with WordPress for those people with disabilities?

i want to develop a wordpress navigation with default wp_nav_menu() but i am succeeded yet. i tried a lot of example and tips but its not match the requirement, sometimes i got solution in such its working but in other hand it fails, I have tried following example in my coding: https://www.wpexplorer.com/superfish-wordpress/ this is my default wp_nav_menu(): wp_nav_menu(array( 'theme_location' => 'primary', 'sort_column' => 'menu_order', 'menu_class' => 'sf-menu', 'fallback_cb' => 'default_menu', 'walker' => new CSS_Menu_Walker() )); and if i used below …
Category: Web

URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site

I have a site that needs to only allow people who are logged in and have at least one of 3 possible roles to have access to the pages of the site. I'm not new to programming, but am new to both php and web development. I would prefer an "in-house" solution instead of a plugin, but at this point I will take what I can get. So how it would ideally work was that a user from our main …
Category: Web

How to make WP page accessile only to specific user roles

I am creating a website that consists of a "Home Page" (public) that has a login link to the WP login page, then, there will be different pages that are only accessible to specific logged members depending on their user roles. For example, home page (public), Page 1 (role x), Page 2 & 3 & 4 (role Y), Page 5&6 (Role 3). Is there a method/plugin to match different WP pages to specific user roles? Also, I know some basic …
Category: Web

Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function

I'm using the wp_list_categories() function which generates an unordered list with list items and anchor tags for the categories. Is there any way to add HTML attributes to the <a> tags which hold the category links? I'd like to add a title attribute which is the same as the category, and a class attribute, but looking at the docs, in the list of associative array properties I can't see how to do this? The code I'm using is: <?php echo …
Category: Web

SlickNav - Google Lighthouse Accessibility issue for collapsed menu button

I use Slicknav for my mobile menu, and Lighthouse flags up the following: Links do not have a discernible name - a.slicknav_btn.slicknav_collapsed I assume it means this element <a href="#" aria-haspopup="true" tabindex="0" class="slicknav_btn slicknav_collapsed"><span class="slicknav_menutxt">MENU</span><span class="slicknav_icon"><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span></span></a> Diving into the slicknav.js, I was thinking this is the correct portion of the code? I am trying to work out how to modify this to produce the correct label but so far I just get errors. iconClass = prefix + …
Category: Web

Block Editor: add an aria-label to an option inside a SelectControl

I'm building a block that has, among other things, a FontAwesome icon. I'm currently letting users choose which icon by using a WP <SelectControl>. For individual <option>s, there is a built-in way to add a label. For example: <SelectControl value={ icon } options={[ { label: '', value: 'fa-address-book' } ]} /> Combined with CSS this works great - the dropdown shows the icon itself, making it easy to select for those with good vision. However, I'd like to make this …
Category: Web

Make alt text required when setting a featured image

In the EU it will shortly be a requirement for public sector websites to have alt text for uploaded images. My organisation's users are rubbish at adding alt text, however, and I'm trying to find a way to force them to do so. The only way I've come across so far is to automatically fill the alt text with the image's title - which is not great if an image is called "shutterstock_45363627" - and could encourage laziness. Ways I …
Category: Web

All Images not calling alt text

I am having trouble with the alt text on my wordpress.com website. I am using a theme I coded myself. From what I recall, if I added alt text to an image in the Media Library it would insert into the DOM. Whether I'm mistaken or not, I do know no alt text is being added to the DOM now. Below is a code sample of a image I am calling. I do not call alt because I believed WordPress …
Category: Web

one time visit to the page

I want to set up a page with PayPal subscription gate away to my members area. It's a simple page with PayPal button which offer discounted subscription price for the chosen customers only. Therefore I want to give one time access to it. So when the visitor leaves the page to go to PayPal to start subscription and then return to the page - access will be denied. The new access will be denied even if he/she do not subscribe. …
Category: Web

WPforms plugin modification for accessibility

I'm looking for a way to add aria-labelledby attributes to my wpforms plugin form. I emailed their support and they said it was not supported. I've got to believe there is a way to modify the plugin to allow for this attribute. Does anyone have any recos? Thanks, J
Category: Web

What are some of your favorite methods for creating an accessible menu?

I have a series of tricks that I use to add things like aria tags, keyboard navigation, screen reader text, and other features. I would love to see some of yours. Assume this is a multi-tiered menu meeting WCAG 2.1 AA guidelines or better. Assume this is a typical WordPress menu and we're requiring as little content manager knowledge as you can. Assume the menu is responsive. wp_nav_menu( array( 'theme_location' => 'main', 'depth' => 2, ) ); I look forward …
Category: Web

RSS icons have the same Alt tag. Lighthouse is failing these elements. How do I display different alt tags for each icon?

I am making my websites accessible by mostly using Lighthouse in Chrome Devtools. I have fixed everything but this one issue. Lighthouse is failing these elements because the alt tags need discernible names: <a class="rsswidget" href="https://blog.mysite.org/formative-assessment/feed"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="https://blog.mysite.org/wp-includes/images/rss.png" alt="RSS"></a> <a class="rsswidget" href="https://blog.mysite.org/technology/feed/"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="https://blog.mysite.org/wp-includes/images/rss.png" alt="RSS"></a> <a class="rsswidget" href="https://blog.mysite.org/licensure/feed/"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="https://blog.mysite.org/wp-includes/images/rss.png" alt="RSS"></a> How do I change the alt text for the image to reflect which feed it is related to? I am …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.