Skip to content

Instantly share code, notes, and snippets.


Sergey Mochalov proweb

Block or report user

Report or block proweb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ivandoric / wl-api.php
Created May 5, 2019
Creating WordPress Rest API Custom Endpoints
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
Created Nov 27, 2018
Заменяет битые ссылки на кратинки в 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..."
stesab92 / .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';
MatthieuScarset / gist:47b57f2e3bd4afee39a81ae5a7c3dc28
Created Dec 27, 2016
Drupal 8 - Get canonical node URL in TWIG
View gist:47b57f2e3bd4afee39a81ae5a7c3dc28
{{ path('entity.node.canonical', {'node': }) }}
You can’t perform that action at this time.