Skip to content

Instantly share code, notes, and snippets.

@bainternet
bainternet / elementor-page.php
Created December 7, 2017 12:23 — forked from luizeof/elementor-page.php
Wordpress page template to use Elementor with any template
<?php
/**
* Template Name: Elementor
*
* @package WordPress
* @subpackage Orangeweb
* @since 1.0.0
*
* 2016 - Desenvolvido por Agência Orangeweb - www.orangeweb.com.br
*/
@bainternet
bainternet / class.php
Created December 7, 2017 12:21 — forked from igorbenic/class.php
Extending Elementor: Custom Button Field & Skin | https://www.ibenic.com/extending-elementor-custom-button-field-skin
<?php
add_action( 'elementor/widget/before_render_content', 'custom_render_button' );
/**
* Adding a new attribute to our button
*
* @param \Elementor\Widget_Base $button
*/
function custom_render_button( $button ) {
@bainternet
bainternet / deleteFromImgur.js
Created July 17, 2017 12:04 — forked from bmcbride/deleteFromImgur.js
Upload image from HTML form to http://imgur.com/
function deleteFromImgur() {
$.ajax({
url: "https://api.imgur.com/3/image/{id}",
type: "DELETE",
headers: {
"Authorization": "Client-ID YOUR-CLIEND-ID-GOES-HERE"
},
success: function(response) {
//console.log(response);
}
@bainternet
bainternet / simple-admin-page.php
Created May 29, 2017 10:39 — forked from stephenh1988/simple-admin-page.php
A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
<?php
/*
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
Author: Stephen Harris
Author URI: http://www.stephenharris.info
*/
/* Copyright 2011 Stephen Harris (contact@stephenharris.info)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@bainternet
bainternet / User-Specific-Content.php
Created August 14, 2016 19:09 — forked from coagmano/User-Specific-Content.php
Changes to User-Specific-Content WP plugin to remove unauthorised posts from The Loop
<?php
/*
These changes are for the plugin User-Specific-Content by Bainternet: https://wordpress.org/support/plugin/user-specific-content
Add the below funciton inside the class bainternet_U_S_C
*/
/* Change Init */
public function U_S_C_init(){
$options = $this->U_S_C_get_option();
if ($options['run_on_the_content']){
@bainternet
bainternet / new_gist_file.js
Last active June 15, 2016 07:20
IPE_timer - A Real time Timer //usage: var tt = IPE_timer.getT(); tt.start(function(CurrentTime){ console.log('current Time in seconds ' + CurrentTime); });
var IPE_Timer = (function(){
// Self calling function
// Private property for holding the only existing instance
var T;
var createTimer = function(){
// Private properties
var stop_flag = false;
var speed = 1000;
@bainternet
bainternet / CustomWidgetFile.php
Last active August 29, 2015 14:27 — forked from jonathonbyrdziak/CustomWidgetFile.php
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
// js/editor_plugin.js
/**
* an example tinyMCE Plugin
*/
tinymce.create(
'tinymce.plugins.myPlugin',
{
/**
* @param tinymce.Editor editor
* @param string url
@bainternet
bainternet / index.php
Last active February 20, 2020 12:40 — forked from SGudbrandsson/index.php
wp clone
<?php
/**
*
* This script will copy your wordpress from public_html (or wherever)
* and place it in a staging folder.
* It will then clone the database, reconfigure the config file
* and replace URL's from the original URL to your staging URL.
* It will then make sure to NOT allow search engines to index the page.
*
* Use this script to clone your main wp in order to test maintenance work
@bainternet
bainternet / export.php
Last active August 29, 2015 14:23 — forked from tott/export.php
<?php
WP_CLI::addCommand('export', 'ExportCommand');
/**
* Implement export command
*
* @package wp-cli
* @subpackage commands/internals
*/