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 / food-example-plugin-2.php
Created Nov 15, 2016
An example for WPMU readers
View food-example-plugin-2.php
<?php
/**
* @package Food_example_plugin_2
* @version 1.0
*/
/*
Plugin Name: Food example plugin 2
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for WPMU DEV readers
Author: Carlo Daniele
@carlodaniele
carlodaniele / custom-queries.php
Last active Sep 26, 2019
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
@carlodaniele
carlodaniele / kinsta-share-users.php
Last active May 28, 2019
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
View kinsta-share-users.php
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@carlodaniele
carlodaniele / REST-API-my-meta-fields.php
Created Aug 17, 2016
Adds latitude and longitude post meta field values to REST API response.
View REST-API-my-meta-fields.php
<?php
/**
* @package REST_API_my_meta_fields
* @version 1.0
*/
/*
Plugin Name: REST API my meta fields
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@carlodaniele
carlodaniele / cd-hide-wordpress-version.php
Last active May 21, 2016
This plugin hides all WP versions from the head of the document and anables auto updates. It could be placed in /wp-content/mu-plugin folder
View cd-hide-wordpress-version.php
<?php
/**
* @package CD Hide WordPress Version
* @version 1.0
*/
/*
Plugin Name: CD Hide WordPress Version
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This plugin removes the version number from WordPress pages
Author: Carlo Daniele
@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 require_statement_02
require( dirname( __FILE__ ) . '/wp_install/wp-blog-header.php' );
View require_statement_01
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
View print_usermeta_shortcode.php
<?php
/**
* Create [usermeta] shortcode
*
* @param $atts An array of attributes
*
* @return string A single user meta field
*
* @link https://codex.wordpress.org/Shortcode_API
* @link https://codex.wordpress.org/Function_Reference/shortcode_atts
View register_usermeta_shortcode.php
<?php
/**
* Plugin init
*
* @link https://codex.wordpress.org/Function_Reference/add_shortcode
*/
function wpmu_user_init(){
add_shortcode( 'usermeta', 'wpmu_user_meta_shortcode' );
}
add_action( 'init', 'wpmu_user_init' );
You can’t perform that action at this time.