Skip to content

Instantly share code, notes, and snippets.

import { TextBlock, RectShape } from 'react-placeholder/lib/placeholders';
import ReactPlaceholder from 'react-placeholder';
const GhostPlaceholder = () => (
<div className='my-placeholder'>
<RectShape color='gray' style={{width: 25, height: 70}} />
<TextBlock rows={6} color='blue'/>
</div>
);
<ReactPlaceholder ready={ready} customPlaceholder={<GhostPlaceholder />}>
<!-- селект для выбора языка -->
<select id="langs">
<option value="rus" selected>Русский</option>
<option value="eng">English</option>
</select>
<!-- инпут для загрузки файла изображения -->
<input type="file" id="file" />
<!-- лог процесса обработки и вывод результата -->
<?php
add_action('admin_init', 'add_options_section');
function add_options_section() {
add_settins_section(
'section_name',
'Section Title',
'section_callback',
'reading'
<?php
add_action('wp_head', function() {
$css = "body { background: lightblue; }";
echo "<style>$css</style>";
});
<?php
add_action('add_meta_boxes', function() {
add_meta_box('metabox_name', 'Metabox Title', 'metaboxCallback', array('post', 'page'), 'normal', 'default');
}, 1);
function metaboxCallback($post) {
$value1 = get_post_meta($post->ID, 'meta_prefix_'.'meta_field_name_1', 1);
$value2 = get_post_meta($post->ID, 'meta_prefix_'.'meta_field_name_2', 1);
?>
<?php
add_action('add_meta_boxes', function() {
add_meta_box('metabox_name', 'Metabox Title', 'metaboxCallback', array('post', 'page'), 'normal', 'default')
}, 1);
function metaboxCallback($post) {
$value = get_post_meta($post->ID, 'meta_field_name', 1);
?>
.btn {
padding: 0;
border: none;
font: inherit;
color: inherit;
background-color: transparent;
cursor: pointer;
outline: none;
display: inline-block;
{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"loose": true,
"useBuiltIns": "usage"
}
]
@mohnatus
mohnatus / .stylelintrc.js
Created February 1, 2020 21:23
stylelint configuration
/**
* Stylelint configuration
* https://stylelint.io/
*
* plugins:
*
* stylelint-order
* https://github.com/hudochenkov/stylelint-order
*
* TODO Stylelint rules
@mohnatus
mohnatus / package.json
Last active April 9, 2020 11:07
SCSS handle
{
"devDependencies": {
"autoprefixer": "^9.7.3",
"node-sass": "^4.13.0",
"postcss-cli": "^6.1.3"
},
"scripts": {
"css:dev": "node-sass src/scss/style.scss style.css -w",
"css:prebuild": "node-sass src/scss/style.scss style.css",
"css:postcss": "postcss style.css -r --use autoprefixer -c postcss.config.js",