Skip to content

Instantly share code, notes, and snippets.


Rodolfo Buaiz brasofilo

View GitHub Profile
brasofilo / download.php
Created Jun 3, 2012
Force File Download with PHP
View download.php
* Foce File Download
* Usage:
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary
// grab the requested file's name
brasofilo / gist:3302470
Created Aug 9, 2012
5G Blacklist 2012 - Adapted to work with WordPress
View gist:3302470
# @
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (localhost|mosconfig|scanner) [NC,OR]
# RewriteCond %{QUERY_STRING} (environ|localhost|mosconfig|scanner) [NC,OR]
# too many pieces of legitimate content with the word "environment" in the URL
brasofilo / wpse_70758.php
Created Nov 19, 2012
WordPress plugin : Prevent Categories Deletion
View wpse_70758.php
Plugin Name: Prevent Category Deletion
Plugin URI:
Description: Prevent deletion of categories. Modify the $undeletable array to suit your setup. Use Category SLUGS.
Author: brasofilo
Version: 1.0
Author URI:
brasofilo / authorized-acf-access.php
Created Dec 8, 2012
Hide ACF Menu from Clients
View authorized-acf-access.php
* A method to really block access to ACF menu
* Remove ACF menu item from the admin menu
add_action( 'admin_menu', 'acf_remove_menu_page', 15 );
brasofilo / install.php
Last active Aug 11, 2020
WP Install Defaults - Dropin Plugin
View install.php
!defined( 'ABSPATH' ) AND exit;
Plugin Name: Custom Installation Script
Plugin URI:
Description: Create our own content on WP install
License: GPL
brasofilo / so_13646200.php
Created Dec 11, 2012
Repeatable upload field
View so_13646200.php
add_action('admin_init', 'so_13646200_add_post_gallery');
add_action('save_post' , 'so_13646200_update_post_gallery');
function so_13646200_add_post_gallery() {
'Clients Logo Options',
brasofilo / wpse_76593.php
Last active Aug 17, 2017
Hide wp-content/themes path
View wpse_76593.php
// Rewrites DO NOT happen for child themes
// Add .htaccess rewrite rules to convert urls
// like "" into ""
in case your wordpress is in a folder,
and you change the site_url to the root of the domain,
add the folder name in lines 29 to 34,
brasofilo / gist:4367116
Last active Dec 10, 2015
Values in $wp_admin_bar
View gist:4367116
* Value of $nodes in the following:
* global $wp_admin_bar;
* $nodes = $wp_admin_bar->get_nodes();
[user-actions] => stdClass Object
[id] => user-actions
brasofilo / press-this-thickbox.php
Last active Dec 10, 2015
Dealing with PressThis inside an administrative thickbox
View press-this-thickbox.php
Auxiliary menu and page with a button to open the thickbox
add_action('admin_menu', 'add_auxiliary_menu');
function add_auxiliary_menu()
brasofilo / old-upload-method.php
Last active Oct 5, 2018
Replace the New WP 3.5 Uploader with the Old Thickbox
View old-upload-method.php
* Plugin Name: Old Upload Method
* Plugin URI:
* Description: Replace the new media upload with the old thickbox
* Author: A.Morita, brasofilo
* Version: 1.2
* License: GPLv2 or later
You can’t perform that action at this time.