Skip to content

Instantly share code, notes, and snippets.

View isuke01's full-sized avatar

Łukasz ISU Biedroń isuke01

View GitHub Profile
@isuke01
isuke01 / WP_Asset_Version_Manager
Created April 16, 2025 07:42
WordPress Asset Version Manager A class to manage asset versioning in WordPress by replacing version strings with customizable alternatives like file modification times.
<?php
/**
* WordPress Asset Version Manager
*
* A class to manage asset versioning in WordPress by replacing version strings
* with customizable alternatives like file modification times.
*/
class WP_Asset_Version_Manager {
@isuke01
isuke01 / google_fonts.md
Created April 11, 2025 10:22 — forked from cvan/google_fonts.md
get ttf, woff, woff2 from Google Fonts

ttf

curl 'https://fonts.googleapis.com/css?family=Karla'

woff2

curl 'https://fonts.googleapis.com/css?family=Karla' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'User-Agent: AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116'

woff

@isuke01
isuke01 / release.sh
Created March 20, 2025 12:25
Automation for git release
#!/bin/bash
# Check version
if [ -z "$1" ]; then
echo "Add version as an argument! Eg: release 1.2.3"
exit 1
fi
VERSION=$1
@isuke01
isuke01 / yoast_seo_breadcrumb_add_woo_shop.php
Created October 23, 2024 18:11 — forked from amboutwe/yoast_seo_breadcrumb_add_woo_shop.php
Multiple examples of how to customize the Yoast SEO breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@isuke01
isuke01 / t2-check-feature-exists.php
Last active February 3, 2023 11:56
(WordPress/T2) Helper function to check if T2 feature is activated.
<?php
/**
* Helper functio nto check if there is T2 feature activated.
* Example usage: t2_is_feature_activated( 't2/newsletter' )
*
* @param string $feature The t2 feature e.g t2/newsletter.
* @return bool
*/
function t2_is_feature_activated( string $feature ): bool {
@isuke01
isuke01 / class-customizer.php
Last active February 2, 2023 11:33
WP add option to Customizer
<?php
/**
* Customizer additional settings.
* To retrive the setting use get_theme_mod( 'setting_name' )
*/
class Customizer {
/**
* Class instance.
*
* @var self
@isuke01
isuke01 / core-media-text.backend.inspector-control.js
Created January 11, 2023 13:17
Test Extend Core paragraph with footnote (just attribute)
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { PanelBody, PanelRow, TextControl } from '@wordpress/components';
// eslint-disable-next-line import/no-extraneous-dependencies
import { InspectorControls } from '@wordpress/block-editor';
function InspectorControl({ attributes, setAttributes }) {
const { footnote } = attributes;
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array nota
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" lang="pl">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<!--[if IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<![endif]-->
<script type="text/javascript" src="//static.cda.pl/js/layout_pack/layout_pack_no_uplv3.js?v=203bcd"></script>
<script type="text/javascript" src="//static.cda.pl/js/jquery.cookie.js"></script>
@isuke01
isuke01 / markdown-text-101.md
Created January 27, 2022 13:07 — forked from matthewzring/markdown-text-101.md
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__