Skip to content

Instantly share code, notes, and snippets.

@carlodaniele
carlodaniele / author-plugin.php
Last active Apr 9, 2022
An example Gutenberg dynamic block
View author-plugin.php
<?php
/**
* Plugin Name: An example block for Kinsta readers
* Description: Businessperson
* Requires at least: 5.8
* Requires PHP: 7.0
* Version: 0.1.0
* Author: Carlo
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@carlodaniele
carlodaniele / block.json
Last active Jun 12, 2022
An example Gutenberg block (not for production)
View block.json
{
"apiVersion": 2,
"name": "my-affiliate-plugin/my-affiliate-block",
"version": "0.1.0",
"title": "Affiliate Block",
"category": "design",
"icon": "money",
"keywords": [ "kinsta", "affiliate", "money" ],
"description": "An example block for Kinsta readers",
"supports": {
@carlodaniele
carlodaniele / frammenti.php
Last active Mar 16, 2021
This is an example plugin showing how to register custom post types and custom taxonomies
View frammenti.php
<?php
/**
* @package frammenti
* @version 1.0
*
* Plugin Name: Frammenti
* Plugin URI: http://wordpress.org/extend/plugins/#
* Description: This is a development plugin
* Author: Carlo Daniele
* Version: 1.0
@carlodaniele
carlodaniele / kinsta_users.php
Last active Dec 14, 2021
A plugin for registering a custom post type with a specific set of capabilities
View kinsta_users.php
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@carlodaniele
carlodaniele / kinsta-widget.php
Created May 15, 2017
This is an example plugin for Kinsta blog readers
View kinsta-widget.php
<?php
/**
* @package Kinsta_widget
* @version 1.0
*/
/*
Plugin Name: Kinsta Widget
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Your Name
View kinsta-widget.php
<?php
/**
* @package Kinsta_widget
* @version 1.0
*/
/*
Plugin Name: Kinsta Widget
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Your Name
@carlodaniele
carlodaniele / plugin-filter.php
Last active Jun 7, 2022
A Must-use plugin to filter active plugins in on a per-page basis.
View plugin-filter.php
<?php
/**
* @package active-plugins
* @version 1.0
*
* Plugin Name: Active Plugins
* Plugin URI: http://wordpress.org/extend/plugins/#
* Description: This is a development plugin
* Author: Carlo Daniele
* Version: 1.0
@carlodaniele
carlodaniele / media-hacks.php
Last active May 22, 2022
An example WP plugin which adds functionalities to the WordPress Media Library
View media-hacks.php
<?php
/**
* @package Media_hacks
* @version 1.0
*/
/*
Plugin Name: Media hacks
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
View smashing-plugin.php
<?php
/**
* @package Smashing_plugin
* @version 1.0
*/
/*
Plugin Name: Smashing plugin
Plugin URI: https://www.smashingmagazine.com/2016/03/advanced-wordpress-search-with-wp_query/
Description: This is an example plugin for Smashing Magazine readers.
Author: Carlo Daniele
@carlodaniele
carlodaniele / plugin.js
Created Dec 3, 2016
A TinyMCE plugin which adds a custom dropdown menu.
View plugin.js
(function() {
var languages = ['css', 'php', 'html', 'javascript'];
tinymce.PluginManager.add( 'prism', function( editor ){
var items = [];
tinymce.each( languages, function( languageName ){
items.push({
text: languageName,