Skip to content

Instantly share code, notes, and snippets.

View chrispian's full-sized avatar

Chrispian chrispian

View GitHub Profile
@awcodes
awcodes / BlockSettings.php
Created November 13, 2022 14:52
Filament Block Settings
<?php
namespace App\Forms\Components;
use Filament\Forms\Components\Group;
class BlockSettings extends Group
{
protected string $view = 'filament.forms.components.block-settings';
@AAbosham
AAbosham / FilamentCardTableLayout.php
Last active June 18, 2024 03:24
Filament Card Table Layout
<?php
namespace App\Filament\Resources\Trip;
//...
class PlaceResource extends Resource
{
public static function table(Table $table): Table
{
return $table
@GarrettWeinberg
GarrettWeinberg / index.js
Last active March 6, 2020 14:22
latest posts block
import { registerBlockType } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { InspectorControls } from "@wordpress/block-editor";
import { PanelBody, SelectControl } from "@wordpress/components";
registerBlockType( 'create-block/better-latest-posts', {
title: __( 'Better Latest Posts', 'create-block' ),
description: __(
'Example block written with ESNext standard and JSX support – build step required.',
@seezee
seezee / webp.php
Last active November 25, 2022 22:28
WEBP for WordPress
<?php
/**
* Support for WEBP.
*
* @package myplugin
*/
// Security.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, you are not allowed to access this page directly.' );
@salcode
salcode / wp-cli-test-stop-emails.php
Created May 2, 2018 03:14
WordPress plugin proof of concept for disabling the Stop Emails plugin from logging emails when run from the command line. See https://github.com/salcode/stop-emails/issues/15
<?php
/**
* Plugin Name: WP CLI Test Stop Emails
* Plugin URI: https://github.com/salcode/stop-emails/issues/15
* Description: Test plugin for <a href="https://github.com/salcode/stop-emails/issues/15">Issue 15</a>
* Author: Sal Ferrarello
* Author URI: https://salferrarello.com/
* Text Domain: wp-cli-test-stop-emails
* Domain Path: /languages
* Version: 0.1.0
@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@salcode
salcode / .gitignore
Last active July 10, 2024 14:28
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@salcode
salcode / test-add-query-arg-output.php
Created December 9, 2014 03:24
mu-plugin file that replaces the content of a page with an example demonstrating add_query_arg() does not urlencode parameters.
<?php
add_action( 'the_content', 'test_add_query_arg_output' );
function test_add_query_arg_output( $content ) {
return add_query_arg(
array(
'var_key' => 'key_value',
'another_var' => 'My Value'
),
home_url()
@technosailor
technosailor / ab-duplicate-blog-ms.php
Last active December 14, 2015 12:59
Class to duplicate one Multisite blog to another
<?php
/*
Plugin Name: AB Duplicate Blog
Author: Aaron Brazell
Version: 1.0-beta
Description: Duplicate a WordPress Multisite blog into a new one, transferring options, taxonomies, etc
*/
class AB_Duplicate_Blog {