Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #162 from jmr06005/master

Removing blank alt tag notification
  • Loading branch information
jmr06005 committed Sep 6, 2018
2 parents 4f58cfd + 396bfd4 commit ef59b52a8e3a50ce8191ca8effd48c36865b6909
Showing with 14 additions and 14 deletions.
  1. +5 −5 functions.php
  2. +9 −9 js/cs.js
@@ -315,8 +315,8 @@ function cs_title_tag() {
}
}

function report_blank_alt() {
mail('joshua.roy@uconn.edu', 'Empty Alt Tag', 'Image with empty alt tag found at '.$_POST['location'].' on image '.$_POST['image']);
}
add_action( 'wp_ajax_report_blank_alt', 'report_blank_alt' );
add_action( 'wp_ajax_nopriv_report_blank_alt', 'report_blank_alt' );
//function report_blank_alt() {
// mail('joshua.roy@uconn.edu', 'Empty Alt Tag', 'Image with empty alt tag found at '.$_POST['location'].' on image '.$_POST['image']);
//}
//add_action( 'wp_ajax_report_blank_alt', 'report_blank_alt' );
//add_action( 'wp_ajax_nopriv_report_blank_alt', 'report_blank_alt' );
@@ -195,16 +195,16 @@ jQuery(document).ready(function($) {
$('#page img').each(function(){
var alt = $(this).attr('alt')
if (undefined != alt){
if(alt.length == 0 && (undefined == $(this).attr('role') || $(this).attr('role')!='presentation')){
var data = {
'action': 'report_blank_alt',
'location': window.location.href,
'image': $(this).attr('src')
};
//if(alt.length == 0 && (undefined == $(this).attr('role') || $(this).attr('role')!='presentation')){
// var data = {
// 'action': 'report_blank_alt',
// 'location': window.location.href,
// 'image': $(this).attr('src')
// };
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
jQuery.post(ajax_object.ajax_url, data, function(response) {
});
}
//jQuery.post(ajax_object.ajax_url, data, function(response) {
//});
//}
alt = alt.toLowerCase()
//console.log('alt='+alt)
if (alt.indexOf('.jpg') >= 0 || alt.indexOf('.png') >= 0 || alt.indexOf('.gif') >= 0 ){

0 comments on commit ef59b52

Please sign in to comment.
You can’t perform that action at this time.