This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: test | |
*/ | |
function test_filter( $test ) { | |
$current_day = intval( date( 'j' ) ); | |
$change = false; | |
$new_array = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Don't change anything on this line EXCEPT for "hide_widget_pages". You can change that if you want, but you don't | |
// have to. But if you do, be sure to change it... | |
add_filter( 'widget_display_callback', 'hide_widget_pages', 10, 3 ); | |
// ... here as well! And don't worry about changing anything else in this line. | |
function hide_widget_pages( $instance, $widget, $args ) { | |
// This is where you would enter the widget ID that you want to hide. Get this by using the Chrome inspector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* These are all of the files (both javascript and css) that needed to be registered and enqueued. | |
* | |
* In order to use this system, create an array similar to this example and create a new "DynamicScripts" class, passing | |
* that array into it (like done below). Your files should use the naming convention of "{filename}.css|js" for development | |
* files and "{filename}.min.css|js" for the minified production files (though feel free to modify the class below | |
* to suit your file naming convention needs). | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.6) | |
// Compass (v1.0.1) | |
// ---- | |
@mixin icon($icon, $top, $left, $color, $atts: null) { | |
.icon-#{$icon} { | |
top: $top; | |
left: $left; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function (grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
grunt.initConfig({ | |
// Define the package | |
pkg: grunt.file.readJSON('package.json'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ProjectName", | |
"version": "1.0.0", | |
"description": "This plugin is incredible.", | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/username/repository" | |
}, | |
"author": "Thats you!", | |
"license": "GPLv2 or later", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Apply Chosen | |
var $chosen = $('.chosen'), | |
container = '.container-class'; | |
$chosen.chosen(); | |
// Extend functionality to allow custom text input (if enabled on input) | |
if ($chosen.hasClass('allow-custom-input')) { | |
// When hiding the dropdown (submitting the field), use our custom input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Easy way to register a new post type! | |
* | |
* Example: easy_register_post_type( 'book', 'Book', 'Books', array( 'menu_icon' => 'dashicons-book' ) ); | |
* | |
* @param string $name The name of the post type (not the label, must be lowercase and no spaces or dashes). | |
* @param string $label The label of the post type. This is public facing. | |
* @param string $label_plural The plural version of the label. | |
* @param array $_args An array of args to overwrite or add to the register_post_type() args. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* First, we need to actually add our new options to each selectbox. | |
*/ | |
add_filter( 'render_att_pre_loop', function( $atts, $code ) { | |
// Make sure we only do this for the Logic shortcode | |
if ( $code == 'render_logic' ) { | |
// Here's an option for the first argument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extension: | |
Paypal | |
Shortcode Templates | |
Stylebox for TinyMCE | |
Custom shortcode creater (integrates directly into the modal, maybe) | |
Integration: | |
WooCommerce | |
Gravity Forms | |
Mini Loops |
OlderNewer