Skip to content

Instantly share code, notes, and snippets.

View proweb's full-sized avatar

Sergey Mochalov proweb

View GitHub Profile
@mihdan
mihdan / wp-image-placeholder.php
Last active December 12, 2022 23:59
Заменяет битые ссылки на кратинки в WordPress на заглушки. Удобно, например на тестовом сайте, чтобы не переносить фотки с боевого.
<?php
/**
* Plugin Name: Mihdan: Image Placeholder
*/
namespace Mihdan\Image_Placeholder;
$images = array(
// Обычные
'https://placeimg.com/640/480/animals',
@leurdo
leurdo / gist:c81f10472cfdd403cf608068b0f054d7
Last active September 9, 2018 14:03
wiki post type and taxonomy registration, gives permalink structure http://site.ru/wiki/category/subcategory/post
<?php
// don't load directly
if (!defined('ABSPATH')) die('-1');
class CreditznatokAddwiki
{
private static $_instance;
static function getInstance()
#!/bin/bash
# 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..."
@bph
bph / psl-theme-test.txt
Last active October 19, 2023 15:21
Blocks for Themes Test
<!-- wp:paragraph -->
<p><a href="https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e">https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading {"className":"eplus-oOhLNH"} -->
<h2 class="eplus-oOhLNH">Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2>
<!-- /wp:heading -->
<!-- wp:list {"className":"eplus-eI3gin"} -->
<ul class="eplus-eI3gin"><li><a href="#images">Images</a> (Single image, cover image, gallery </li><li><a href="#quotes">Pull Quote / Quote</a></li><li><a href="#verse">Verse</a></li><li><a href="#buttons">Buttons</a></li><li><a href="#socialicons" data-type="internal" data-id="#socialicons">Social Icons</a></li><li><a href="#columns">Columns </a> Text (only) columns / Columns experimental</li><li><a href="#cover" data-type="internal" data-id="#cover">Cover</a> with CAT + button</li><li><a href="#paragraphs">Paragraph</a> </li><li><a href="#audio">Audio</a> </li><li><a href="#video">Video</a></li><li><a href="#w
@srikat
srikat / test.html
Created May 8, 2018 06:48
Dummy Content for Gutenberg
<!-- 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>
var isIE = /*@cc_on!@*/false || !!document.documentMode, // Internet Explorer 6-11
isEdge = !isIE && !!window.StyleMedia; // Edge 20+
if(isIE || isEdge) {
// do something...
}
@stephensabatini
stephensabatini / .htaccess
Created July 17, 2017 18:22
Snippet of Security Tweaks for the .htaccess.
# Deny access to include files.
<Files ~ "\.inc$">
Order Allow,Deny
Deny from All
</Files>
# Deny access to hidden files.
RedirectMatch 403 /\..*$
# Deny access to folders.
@denysdesign
denysdesign / gist:090d857c58f555fe0af966ec5cd9431f
Last active May 11, 2017 07:46
Joomla! calendar + UIKIT 3
jQuery(document).ready(function () {
// calendar
uikit_jcalendar();
// button
uikit_jcalendar_btn('#news_created_btn', 'uk-button-primary', 'calendar');
uikit_jcalendar_btn('#news_publish_up_btn', 'uk-button-secondary', 'future');
});
// calendar
@soderlind
soderlind / change-theme-root.php
Last active April 2, 2022 15:50
Change WordPress theme root to a folder in your plugin (src/assets)
<?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';