Skip to content

Instantly share code, notes, and snippets.

carlodaniele

Block or report user

Report or block carlodaniele

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@carlodaniele
carlodaniele / kinsta_users.php
Last active Jan 21, 2020
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 / custom-queries.php
Last active Jan 21, 2020
An example plugin showing how to add custom query vars, rewrite tags and rewrite rules to WordPress
View custom-queries.php
<?php
/**
* @package Custom_queries
* @version 1.0
*/
/*
Plugin Name: Custom queries
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-filter.php
Last active Jan 1, 2020
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 Dec 10, 2019
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
@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,
@carlodaniele
carlodaniele / add-query-vars.php
Last active Oct 6, 2019
Register custom query vars
View add-query-vars.php
<?php
/**
* Register custom query vars
*
* @param array $vars The array of available query variables
*
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/query_vars
*/
function myplugin_register_query_vars( $vars ) {
$vars[] = 'key1';
@carlodaniele
carlodaniele / text-editor.php
Last active Oct 1, 2019
This is an example of usage of the WordPress Quicktags API, quicktags_settings filter and wp_editor function. This is not a ready-to-use plugin
View text-editor.php
<?php
/**
* Add scripts to admin page footer
*
* @since 2.8.0
*
*/
function my_quicktags() {
if ( wp_script_is( 'quicktags' ) ) {
@carlodaniele
carlodaniele / custom_menu_admin.php
Last active Sep 29, 2019
A basic plugin showing how to add menu metaboxes to admin menu page
View custom_menu_admin.php
<?php
/**
* @package Custom_menu_admin
* @version 1.0
*/
/*
Plugin Name: Custom menu admin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
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
You can’t perform that action at this time.