Skip to content

Instantly share code, notes, and snippets.

work from home

Sergey Mochalov proweb

work from home
View GitHub Profile
ivandoric / wl-api.php
Last active Aug 3, 2020
Creating WordPress Rest API Custom Endpoints Video Tutorial Note. - Check out the video:
View wl-api.php
* Plugin Name: Custom API
* Plugin URI:
* Description: Crushing it!
* Version: 1.0
* Author: Art Vandelay
* Author URI:
View minimal-analytics-snippet.js
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
mihdan / wp-image-placeholder.php
Last active Jan 8, 2020
Заменяет битые ссылки на кратинки в WordPress на заглушки. Удобно, например на тестовом сайте, чтобы не переносить фотки с боевого.
View wp-image-placeholder.php
* Plugin Name: Mihdan: Image Placeholder
namespace Mihdan\Image_Placeholder;
$images = array(
// Обычные
leurdo / gist:c81f10472cfdd403cf608068b0f054d7
Last active Sep 9, 2018
wiki post type and taxonomy registration, gives permalink structure
View gist:c81f10472cfdd403cf608068b0f054d7
// don't load directly
if (!defined('ABSPATH')) die('-1');
class CreditznatokAddwiki
private static $_instance;
static function getInstance()
knowler /
Last active Aug 12, 2019
Regolith aka Un-Bedrock | "But what if we need to hand it off to another agency?" No more!
# Regolith aka Un-Bedrock
# "But what if we need to hand it off to another agency?" No more!
# This script converts a Bedrock site to a normal WordPress structure.
# Run it from the root of a Bedrock project.
# Created by Nathan Knowler and Daniel Roe
echo "Converting Bedrock to a normal WordPress file structure..."
srikat / test.html
Created May 8, 2018
Dummy Content for Gutenberg
View test.html
<!-- wp:heading -->
<h2>Heading Block (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading -->
<h3>You are looking at one. (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>Subhead Block</h2>
stephensabatini / .htaccess
Created Jul 17, 2017
Snippet of Security Tweaks for the .htaccess.
View .htaccess
# Deny access to include files.
<Files ~ "\.inc$">
Order Allow,Deny
Deny from All
# Deny access to hidden files.
RedirectMatch 403 /\..*$
# Deny access to folders.
View gist:090d857c58f555fe0af966ec5cd9431f
jQuery(document).ready(function () {
// calendar
// button
uikit_jcalendar_btn('#news_created_btn', 'uk-button-primary', 'calendar');
uikit_jcalendar_btn('#news_publish_up_btn', 'uk-button-secondary', 'future');
// calendar
soderlind / change-theme-root.php
Last active Jan 21, 2017
Change WordPress theme root to a folder in your plugin (src/assets)
View change-theme-root.php
* Sample use:
* WordPres Customizer is dependant on functionality in the theme. Just in case
* the current theme doesn't support WordPress Customizer we'll use a theme
* that supports it.
class NN {
private $theme_name = 'twentysixteen';
You can’t perform that action at this time.