Skip to content

Instantly share code, notes, and snippets.

View Fobiya's full-sized avatar
:octocat:
I may be slow to respond.

Fobiya

:octocat:
I may be slow to respond.
  • Kiev Ukraine
View GitHub Profile
@Fobiya
Fobiya / Configuration
Last active June 23, 2019 22:45
WP Configuration
// type='text/javascript' none -------------
wp-includes\class.wp-scripts.php
$tag = "{$cond_before}{$before_handle}<script type='text/javascript' src='$src'></script>\n{$after_handle}{$cond_after}";
// type='text/javascript' none -------------
// ===========================================================
// @media element 1201 style <--
// ===========================================================
@media only screen and (min-width: 1201px) {
@Fobiya
Fobiya / Manual in WP
Last active March 12, 2020 16:42
Manual in WP
$categories = get_the_category(); echo name categories
if ( !empty( $categories ) ) {
$caty = esc_html( $categories[1]->name );
}
-> echo $caty;
echo name categories
https://developer.wordpress.org/reference/functions/get_the_category/
@Fobiya
Fobiya / send email
Last active August 8, 2019 20:20
send
$(document).ready(function() {
$(function() {
$("[class*='oul'][name=submit]").click(function() {
$(":input.error").removeClass('error');
$(".allert").remove();
var error;
var btn = $(this);
var ref = btn.closest('form').find('[required]');
var msg = btn.closest('form').find('input, textarea');
var send_btn = btn.closest('form').find('[name=submit]');
@Fobiya
Fobiya / send google form
Created August 12, 2019 06:24
send google form
<?php
if (!$_POST) die(); // если глобальный массив POST не передан - выход
if ($_POST['glut'] != "") die(); // если spam - выход
// иначе продолжаем
$response = array();
$field1 = isset($_POST['name']) ? $_POST['name'] : false;
$field2 = isset($_POST['custom_telephone']) ? $_POST['custom_telephone'] : false;
@Fobiya
Fobiya / Js Native
Last active July 20, 2020 12:18
Js Native
document.querySelectorAll('.fish-characteristic li').forEach(function(item){
item.addEventListener('click',function(){
document.querySelectorAll('.fish-characteristic li').forEach(function(item){
item.classList.remove('active');
});
var id = item.getAttribute('data-id');
document.querySelectorAll('.content__text').forEach(function(item2){
item2.style.display = "none";
@Fobiya
Fobiya / MutationObserver
Created December 13, 2019 13:09
MutationObserver
let socket = new WebSocket("wss://trade-crm.eu.excentral.com/socket.io/?EIO=3&transport=websocket");
let firstmessage = false;
let json_data;
socket.onopen = function(e) {
function remove_scripts() {
wp_dequeue_script( 'script-name' );
}
function remove_styles() {
wp_dequeue_style( 'style-name' );
}
add_action( 'wp_print_scripts', 'remove_scripts' );
add_action( 'wp_print_styles', 'remove_styles' );
@Fobiya
Fobiya / WP AJAX CALENDAR
Created February 5, 2020 19:27
WP AJAX CALENDAR
/------------------------------------------------- PHP --------------------------------------------------/
<div id="conclusion_concludion">
<?php ml_calendar(false); ?>
</div>
<script type='text/javascript'>
var ajax_url = "<?= admin_url('admin-ajax.php'); ?>";