Skip to content

Instantly share code, notes, and snippets.

View jmslbam's full-sized avatar
💭
Available for (WordPress) work

Jaime Martínez jmslbam

💭
Available for (WordPress) work
View GitHub Profile
@ashwebstudio
ashwebstudio / custom-featured-image-size.php
Last active August 22, 2023 10:23
WordPress: Make unique custom image size ONLY for featured image of a post
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
#!/bin/bash
# This script backs up files using restic and sends emails on success or errors.
#
# Files that the script expects:
# /usr/local/etc/restic/repo.env: shell variables that define the restic repository
# /usr/local/etc/restic/include.txt: paths to back up
# /usr/local/etc/restic/exclude.txt: paths to not include in the backup, even if they are in include.txt
#
# Inspired by https://gist.github.com/perfecto25/18abbd6cfbaa4e9eb30251470e9b7504
@yanknudtskov
yanknudtskov / functions.php
Created November 5, 2020 20:37
A relatively simple way to replace URL for media files in WordPress when running a Staging environment
<?php
define( 'STAGING_URL', 'https://staging.mysiteurl.com');
define( 'PRODUCTION_URL', 'https://www.mysiteurl.com');
add_filter( 'wp_get_attachment_url', 'yanco_staging_wp_get_attachment_url', 1000000, 2 );
function yanco_staging_wp_get_attachment_url( $url, $attachment )
{
if( strpos( $url, STAGING_URL ) !== false ) {
$url = str_replace( STAGING_URL, PRODUCTION_URL, $url );
@statickidz
statickidz / functions.php
Last active February 24, 2024 04:35
Woocommerce - Show Custom Filter and Admin Column for Catalog Visibility
<?php
/**
* @snippet Show Custom Filter and Admin Column for Catalog Visibility @ WooCommerce Products Admin
* @sourcecode https://gist.github.com/statickidz/6a539550d8e0d13d2c3d12318672e816
* @author Adrián Barrio Andrés (statickidz.com)
*/
add_filter('woocommerce_product_filters', 'skidz_filter_by_catalog_visibility_dashboard_products');
<?php
namespace YourPlugin\Blocks;
abstract class Block{
/**
* Block title
*
* @var string
@soderlind
soderlind / run-wp-cron.sh
Last active February 23, 2022 20:16 — forked from bjornjohansen/run-wp-cron.sh
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
# Modified by Per Søderlind
WP_PATH="/path/to/wp"
MAIN_SITE="http://www.domain.tld" # --url="$MAIN_SITE" below, prevents the Undefined index: HTTP_HOST error.
@bekarice
bekarice / user-switching-notice-for-wc.php
Created February 12, 2019 01:40
Uses the "demo store" notice to show a switch back link for WC customer accounts with User Switching: http://cloud.skyver.ge/c50cbcd4c5e7
<?php
/**
* Plugin Name: User Switching Notice for WooCommerce
* Plugin URI: https://gist.github.com/bekarice/7785293fb60d7d5297a245b1c1271272
* Description: Adds a frontend notice to switch back to your user on WooCommerce sites with User Switching.
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: user-switching-notice-for-woocommerce
*
@mgibbs189
mgibbs189 / facetwp.php
Created October 24, 2018 13:01
Listable - inc/integrations/facetwp.php
<?php
/**
* Custom functions that deal with various plugin integrations of WP Job Manager.
*
* @package Listable
*/
/**
* ====== FacetWP - https://facetwp.com/ ======
*/
@AliceWonderMiscreations
AliceWonderMiscreations / neuter_community_events.php
Last active May 23, 2018 14:36
Neuters the community events admin privacy leak in WordPress
<?php
/**
* Plugin Name: Neuter Community Events
* Plugin URI: https://gist.github.com/AliceWonderMiscreations/4a8e177f837ebe26c59a9766d626769f
* Description: Strips information from the WordPress community events request
* Version: 0.2
* Author: Alice Wonder Miscreations
* Author URI: https://notrackers.com
* License: MIT
*/