|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
60 | <meta name="viewport" content="width=device-width, initial-scale=1"> | viewport, meta, метатег | 9800 | Метатег viewport |
59 | $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | protocol, https | 650 | Определить протокол |
58 | UPDATE table_name SET `column_name` = LOWER( `column_name` ) | замена, mysql, строчные, нижний регистр | 907 | Приведение, замена записей mysql к нижнему регистру |
57 | require_once("wp-load.php"); | wp, native functions, include | 980 | All important WordPress file that I needed to include in my custom PHP file was "wp-load.php" |
56 | time = new Date().getHours() + ":" + new Date().getMinutes() | время, яваскрипт, время сейчас, js, time now, time | 90 | Время сейчас — часы : минуты |
55 | var d = date_form.replace(/(d+)-(d+)-(d+)/, '$3.$2.$1') | дата, конверт, яваскрипт, дата по-русски, convert, javascript, js, date lat to rus | 250 | Яваскрипт преобразование (конверт) даты евро в русскую "2018-08-15" в "15.08.2018" |
54 | //Если с английского на русский, то передаём вторым параметром true. var transliterate = ( function() { var rus = "щ ш ч ц ю я ё ж ъ ы э а б в г д е з и й к л м н о п р с т у ф х ь".split(/ +/g), eng = "shh sh ch cz yu ya yo zh `` y e a b v g d e z i j k l m n o p r s t u f x ``".split(/ +/g); return function(text, engToRus) { var x; for(x = 0; x < rus.length; x++) { text = text.split(engToRus ? eng[x] : rus[x]).join(engToRus ? rus[x] : eng[x]); text = text.split(engToRus ? eng[x].toUpperCase() : rus[x].toUpperCase()).join(engToRus ? rus[x].toUpperCase() : eng[x].toUpperCase()); } return text; } } )(); | транслит, translit, латинский-русский, lat-cyr, javascript, js | 350 | Транслитерация с английского в русский Яваскрипт |
53 | remove_image_size('large'); remove_image_size('medium'); add_filter( 'wp_calculate_image_srcset_meta', '__return_null' ); Другое решение, сработало в другом месте add_filter( 'max_srcset_image_width', create_function( '', 'return 1;' ) ); | srcset, отменить srcset, wp | 590 | Отменить srcset в Вордпрессе |
52 | add_filter( 'jpeg_quality', function ( $arg ) { return 100; } ); | качество jpg, wp, jpg quality | 670 | Отменить кадрирование в вордпресс, установить качество 100: |
51 | var ALERT_TITLE = ""; var ALERT_BUTTON_TEXT = "×"; if(document.getElementById) { window.alert = function(txt) { createCustomAlert(txt); } } function createCustomAlert(txt) { var d = document; if(d.getElementById("modalContainer")) return; var mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div")); mObj.id = "modalContainer"; //mObj.style.height = d.documentElement.scrollHeight + "px"; var alertObj = mObj.appendChild(d.createElement("div")); alertObj.id = "alertBox"; if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px"; alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px"; alertObj.style.visiblity="visible"; //h1 = alertObj.appendChild(d.createElement("h1")); //h1.appendChild(d.createTextNode(ALERT_TITLE)); var msg = alertObj.appendChild(d.createElement("p")); //msg.appendChild(d.createTextNode(txt)); msg.innerHTML = txt; var btn = alertObj.appendChild(d.createElement("a")); btn.id = "closeBtn"; btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT)); btn.href = "#"; btn.focus(); btn.onclick = function() { removeCustomAlert(); return false; } alertObj.style.display = "block"; } function removeCustomAlert() { document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer")); } | алерт, alert, custom alert | 120 | Функция замены обычного alert на кастомный |