Skip to content

Instantly share code, notes, and snippets.

@enejb
enejb / do-not-email-subsriber-checbox.php
Created November 18, 2016 19:59
Jetpack Subscription plugin checkbox.
<?php
/*
Plugin Name: Do not email checkbox
Description: Show a checkbox to let the user choose if a post should go out to the subscribers.
Author: enej
Version: 1
Lisence: GPL +2
*/
add_filter('jetpack_allow_per_post_subscriptions', '__return_true' );
<?php
/*
Plugin Name: Sandbox Jetpack
Description: Point your jetapack to .com sandbox
Version: 1
Author: Enej
License: GPLv2 or later
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
define( 'JETPACK__API_BASE', 'https://enejtest.wordpress.com/jetpack.' );
@enejb
enejb / jetpack-wigets-mosted-visited-timeframe-10.php
Last active August 29, 2015 14:20
Jetpack Wigets Mosted Visited Timeframe 10 days
<?php
/**
* Plugin Name: Jetpack Wigets Mosted Visited Timeframe 10 days
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Version: 1.0
* Author: Enej
* License: GPL2
*/
add_filter( 'jetpack_top_posts_days', 'jetpack_wigets_mosted_visited_timeframe_10' );
@enejb
enejb / eb-network-activate-plugin.php
Created December 14, 2014 19:10
This is a test plugin that can only be network activated.
<?php
/*
Plugin Name: Network Activated Plugin Only
Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
Description: This plugin can only be network activated. And therefore it doesn't show up single site network admin page.
Author: Enej Bajgoric
Version: 1
Network: true
*/
@enejb
enejb / broken-wordpress-plugin.php
Created December 2, 2014 20:28
Broken WordPress Plugin
<?php
/*
Plugin Name: Broken WordPress plugin
Plugin URI: https://gist.github.com/
Description: Broken plugin, don't activate it.
Author: Enej Bajgoric
Version: 1.0
*/
fun_ction test_(){
@enejb
enejb / post-formats-for-jetpack-portfolio.php
Last active August 29, 2015 14:06
Add post formats for Jetpack's portfolio post type
<?php
/**
* Plugin Name: Post formats for Jetpack's portfolio
* Description: Add post formats to Jetpack's portfolio post type
* Version: 1.0
* Author: Enej
* License: GPL2
*/
function jetpack_portfolio_add_portfolio_post_formats() {
add_post_type_support( 'jetpack-portfolio', 'post-formats' );
@enejb
enejb / gist:37c1cf33bed400946309
Created July 18, 2014 20:07
transparent-latext.php
<?php
/**
* Plugin Name: Transparent latext
* Plugin URI:
* Description: Makes your latext images transparent.
* Version: 1.0
* Author: Enej
* License: GPL 2
*/
/* Detect-zoom
* -----------
* Cross Browser Zoom and Pixel Ratio Detector
* Version 1.0.4 | Apr 1 2013
* dual-licensed under the WTFPL and MIT license
* Maintained by https://github/tombigel
* Original developer https://github.com/yonran
*/
//AMD and CommonJS initialization copied from https://github.com/zohararad/audio5js
<?php
/**
* Generates a Photon URL.
*
* @see http://developer.wordpress.com/docs/photon/
*
* @param string $image_url URL to the publicly accessible image you want to manipulate
* @param array|string $args An array of arguments, i.e. array( 'w' => '300', 'resize' => array( 123, 456 ) ), or in string form (w=123&h=456)
* @return string The raw final URL. You should run this through esc_url() before displaying it.
@enejb
enejb / class-example-my_map.php
Created March 25, 2014 18:01
Example Plugin that extend the profile cct plugin
Class My_Profile_CCT_Map extends Profile_CCT_Field {
var $default_options = array(
'type' => 'my_map',
'label' => 'map',
'description' => '',
'width' => 'full',
'before' => '',
'empty' => '',