Skip to content

Instantly share code, notes, and snippets.

<?php
// $sock = fsockopen("localhost",80);
// if (!$sock) {
// echo "$errstr ($errno)<br>\n";
// }
// else {
// fputs ($sock, "GET /startHtml.html HTTP/1.0\n\n");
@eto4detak
eto4detak / jQ.js
Last active July 30, 2019 13:13
jQ стандарт
//<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>
(function($) {
"use strict";
})(jQuery);
;jQuery(document).ready(function ($) {
"use strict";
var $ = jQuery;
});
@eto4detak
eto4detak / wp_plugin_plus_code.php
Created June 15, 2017 18:07
wp данные для плагина
<?php
/*
Plugin Name: MiniWidget
Plugin URI: http ://example.com/wordpress-plugins/halloween-plugin
Description: This is a brief description of my plugin
Version: 1.0
Author: ANATOLI
Author URI: http://example.com
License: GPLv2
*/
@eto4detak
eto4detak / wp-start-plugin.php
Last active May 29, 2018 07:36
wp плагин старт
<?php
/**
* Plugin Name: Halloween Store
* Plugin URI: https://wordimpress.com/
* Description: Rollback (or forward) any WordPress.org plugin or theme like a boss.
* Author: WordImpress
* Author URI: https://wordimpress.com/
* Version: 1.5
* Text Domain: wp-rollback
@eto4detak
eto4detak / less_functionColor.less
Last active April 6, 2019 18:41
less цветовые функции
@color: #3d82d1;.left_box {
background: spin(@color, 25%);
}
.middle_box {
background: @color;
}
.right_box {
background: spin(@color, -25%);
}
@eto4detak
eto4detak / wp-query.php
Last active December 26, 2019 20:59
wp php wp-query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@eto4detak
eto4detak / wp php get_posts WC_Product_Variation
Created November 22, 2017 12:40
wp php get_posts WC_Product_Variation
<?php
$args = array(
'post_type' => 'product_variation',
'post_status' => array( 'private', 'publish' ),
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_parent' => get_the_ID() // get parent post-ID
);
$variations = get_posts( $args );
@eto4detak
eto4detak / css flex
Last active April 6, 2019 17:44
css flex
.block1{
display: flex;
flex-direction: row;
justify-content:space-around; /* выравнивание по главной оси */
align-items: stretch; /* выравнивание по поперечной оси. */
flex-wrap: wrap; /* Многострочная организация блоков */
align-content: flex-start; /* каким образом образовавшиеся ряды блоков будут выровнены */
}
@eto4detak
eto4detak / drupal php sql excel addProduct
Created February 2, 2018 13:06
drupal php excel sql addProduct
<?php
/**
* Submit function for calculator_page_form.
*/
function import_excel_page_form_submit($form, &$form_state) {
$uri = $form_state['values']['file']->uri;
$data = import_excel_parse_csv_file($uri);
$data = import_excel_filterData($data);
$db_product = import_excel_getProductDB($data);
@eto4detak
eto4detak / wp php taxonomy.php
Last active February 13, 2018 11:08
wp php taxonomy.php
<?php get_header(); ?>
<div class="wrapper">
<div class="middle">
<div class="breadcrumbs">
<?php if (function_exists('yoast_breadcrumb')) {
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
} ?>
</div><!-- .breadcrumbs-->