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-require.sh
Last active October 8, 2025 11:33
Automation for Composer require WP plugin from wpackagist so you don't need to copy slugs bla bla bal
#!/bin/bash
# wp-require — quickly require WP plugins/themes via wpackagist
# Usage:
# wp-require https://wordpress.org/plugins/onesignal-free-web-push-notifications/
# wp-require https://pl.wordpress.org/plugins/onesignal-free-web-push-notifications/ "^0.4"
# wp-require https://wordpress.org/themes/twentytwelve/
# wp-require onesignal-free-web-push-notifications
# wp-require twentytwelve --theme
# wp-require my-cool-plugin "^1.2" --plugin
@isuke01
isuke01 / demo.php
Created September 18, 2025 14:11 — forked from thinhbg59/demo.php
Add ux builder shortcode - Flatsome Theme
<?php
/*
Plugin Name: OT Flatsome Ultimate Addons
Plugin URI: https://ninewp.com
Description: OT Flatsome Ultimate Addons
Version: 1.0.0
Author: thinhbg59
Text Domain: OT_FL_Ultimate_Addons
Domain Path: /languages
@isuke01
isuke01 / regsiter_multiple_post_meta.php
Created July 3, 2025 09:41
Simple Wordpress Helper to register multiple post meta based on Associative array. register_multiple_post_meta is wrapping around register_post_meta
<?php
/**
* Register multiple post meta fields with default args.
*
* @param string $post_type The post type to register meta for.
* @param array $fields Associative array of meta_key => args.
*/
function register_multiple_post_meta( $post_type, array $fields ) {
$default_args = [
'single' => true,
@isuke01
isuke01 / Function.php
Last active May 20, 2025 12:22
Wordpress add extra checkbox to nav item to toggle to transform item into button. Button will act as an sub-menu toggle button, should cover aria-haspopup and aria-expanded
<?php
namespace SubmenuAccessibility;
/**
* Add a checkbox to the menu item settings to set it as a button.
*
* @param int $item_id The menu item ID.
* @param object $item The menu item object.
* @param int $depth The depth of the menu item.
* @param object $args The menu arguments.
@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