This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Преобразует дату '28 Jan 2017' в '2017-01-28', a mysql работает с форматом 0000-00-00 00:00:00 | |
echo date("Y-m-d",strtotime("28 Jan 2017")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
чтобы качественно отрисовать малеьнкую иконку,лучше это сделать в больше размере например 64х64 | |
а уже затем после сведения всех слоев уменьшить до 16х16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
===================================================================== | |
========= ошибка связанная с mysql: "Got error 'this version of PCRE is compiled without UTF support at offset 0' from regexp..." === | |
xampp/lampp Решение: | |
download ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz | |
enter the folder with extracted PCRE and run the following commands | |
# /home/jetfire/www/pcre-8.40/configure --prefix=/opt/lampp/lib/ --enable-utf8 --enable-unicode-properties make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========= делать push без ввода пароля и логина LINUX ================ | |
ls -al ~/.ssh | |
ssh-keygen -t rsa -b 4096 -C "freerun-2012@yandex.ru" | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
# check urls | |
git remote show origin | |
Push URL: https://github.com/jetfire21/bp-group-calendar.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directive = value | |
error_log = /opt/lampp/logs/php_error_log | /opt/lampp/logs/php_error_log | |
log_errors = On On | |
track_errors On On | |
================ | |
запись php ошибок в указанный файл,в wordrpess надо сделать define('WP_DEBUG', false) | |
полезен когда на хостинг-сервере не созадется wp-content/debug.php | |
============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** проверка активирован ли плагин ******* */ | |
/* Check if should include install file */ | |
public function check_install() { | |
$current_version = get_option( 'wp_job_manager_field_editor_version' ); | |
$plugin_activated = get_option( 'wp_job_manager_field_editor_activated' ); | |
$force_install = isset( $_GET['jmfe_force_install'] ) ? TRUE : FALSE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Grabbing locations depending on the page | |
if ( is_page( 'facilities' ) ) { | |
$metaValue = 'facility'; | |
} elseif ( is_page( 'dropoff' ) ) { | |
$metaValue = "dropoff"; | |
} else { | |
$metaValue = "event"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Динамическая карта показывающая все точки(маркеры) с заданными координатами и группирующие кластеры,можно выводить | |
подсказки для марекров и кластеров --> | |
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<link rel="profile" href="http://gmpg.org/xfn/11" /> | |
<link rel="pingback" href="https://jobify-demos.astoundify.com/extended/xmlrpc.php" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------- MUST BE ----------------------------------------------------------------- | |
плагин для friendly url - Cyr to Lat enhanced | |
---------------------------------------------------------- SEO --------------------------------------------------------------------- | |
Плагин для SEO - Yoast SEO | |
---------------------------------------------------------- SECURITY ---------------------------------------------------------------- | |
Плагины для защиты вордпресса бесплатные (связка) - Ithemes Secutiry и Wordfence Security | |
Плагин для аудита изменений на сайте WP Security Audit Log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ****** обновление сразу нескольких строк за 1 запрос *********** */ | |
if( !empty($_POST['data']) ){ | |
foreach ($_POST['data'] as $v) { | |
$post_title .= $wpdb->prepare("WHEN %d THEN %s ",(int)$v['timel_id'],sanitize_text_field($v['timel_title'])); | |
$post_content .= $wpdb->prepare("WHEN %d THEN %s ",(int)$v['timel_id'],sanitize_text_field($v['timel_content'])); | |
$post_date .= $wpdb->prepare("WHEN %d THEN %s ",(int)$v['timel_id'],sanitize_text_field($v['timel_date'])); | |
$post_id .= (int)$v['timel_id'].","; | |
} | |
$post_id = substr($post_id, 0,-1); |
NewerOlder