Skip to content

Instantly share code, notes, and snippets.

View gmazzap's full-sized avatar

Giuseppe Mazzapica gmazzap

View GitHub Profile
@gmazzap
gmazzap / revoke-profile-access.php
Last active February 6, 2020 18:50
Simple WordPress plugin that allow administrators to revoke access to profile to some users. Wrote to anwer a question on WPSE: http://wordpress.stackexchange.com/q/141743/35541
<?php
/**
* Plugin Name: Revoke Profile Access
* Description: Allow administrators to revoke access to profile to some users
* Plugin URI: http://wordpress.stackexchange.com/q/141743/
* Author: G. M.
* Author URI: http://wordpress.stackexchange.com/users/35541/g-m
* License: GPLv2
*
*/
@gmazzap
gmazzap / amu.php
Created April 17, 2014 03:37
Attach My Upload is a WordPress plugin that allow to create an attachment post from a file already uploaded to uploads folder. Was wrote to answer a WPSE question here: http://wordpress.stackexchange.com/questions/141509/
<?php
/**
* Plugin Name: Attach My Upload
* Description: Allow to create an attachment post from a file already uploaded to uploads folder.
* Plugin URI: http://wordpress.stackexchange.com/questions/141509/
* Author: G. M.
* Author URI: http://wordpress.stackexchange.com/users/35541/g-m
*
*/
/*
<?php
// require the class
@require_once __DIR__ . '/mycaptcha.php';
// defaults
$w = 110;
$h = 35;
$random_dots = 0;
$random_lines = 20;
$captcha_text_color = "0x#B9B098";
@gmazzap
gmazzap / Custom_Reg.php
Last active April 22, 2024 12:16
Just a rough plugin example to answer a WPSE question: How to display Wordpress User Registration Form in front-end of the website?
<?php
namespace Custom_Reg;
class Custom_Reg {
protected $form;
protected $saver;
function __construct( Form $form, Saver $saver ) {
@gmazzap
gmazzap / PrivatePostAccess.php
Created January 24, 2014 13:05
A WordPress plugin that generate and handle urls that allow access to posts in non-public status.
<?php
/**
* Plugin Name: Private Post Access
* Plugin URI: http://wordpress.stackexchange.com/questions/130967/get-full-page-html-for-a-non-public-wordpress-page
* Description: Generate and handle urls that allow access to posts in non-public status.
* Author: G. M.
* Author URI: http://wordpress.stackexchange.com/users/35541/g-m
*
*/
@gmazzap
gmazzap / CptInMainQueryByMeta.php
Created January 10, 2014 14:42
Simlpe plugin coded to refactor the code posted on a WPSE anwser
<?php
/**
* Plugin Name: Cpt In Main Query By Meta
* Plugin URI: http://wordpress.stackexchange.com/questions/129236/
* Description: Allow mixing a post type with another on main query, only if the second match some meta query args
* Author: Giuseppe Mazzapica
* Author URI: http://wordpress.stackexchange.com/users/35541/g-m
*/
@gmazzap
gmazzap / GMCustomEditorHeight.php
Last active December 21, 2015 11:49
WordPress plugin that gives to users of WP 3.6 chance to change wysiwyg editor height by setting options in the user profile page. Two options: one for desktops, one for mobile.
<?php
/**
* Plugin Name: GM Custom Editor Height
*
* Description: Gives to users of WP 3.6 chance to change wysiwyg editor height by setting options in the user profile page. Two options: one for desktops, one for mobile
* Version: 0.1.0
* Author: Giuseppe Mazzapica
* Requires at least: 3.6
* Tested up to: 3.6
*
@gmazzap
gmazzap / GMNextGenPreviewImage
Last active December 20, 2015 12:59
A plugin for Wordpress and NexGen Gallery that use a metabox to select a NextGEN Gallery and use this gallery Preview Image as Post Featured Image
<?php
/**
* @package GMNextGenPreviewImage
* @version 0.1.0
*/
/**
Plugin Name: GM NextGen Preview Image
*
Author: Giuseppe Mazzapica
Version: 0.1.0