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 | |
... | |
if ( version_compare( '5.3', phpversion(), '>' ) ) { | |
add_action( 'admin_notices', '_myplugin_php_notice' ); | |
// Do what you need to stop your plugin from loading | |
} | |
/** | |
* Displays an admin error about needing to update the server's PHP version. |
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
IT |
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 | |
// Add our action | |
add_action( 'wp_enqueue_scripts', 'joelworsham_add_shortcode_styles' ); | |
/** | |
* Dynamically calls scripts and styles based on the presence | |
* of shortcodes in the post content. | |
*/ | |
function joelworsham_add_shortcode_styles() { |
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 |
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
<?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
// 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
{ | |
"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
'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
// ---- | |
// Sass (v3.4.6) | |
// Compass (v1.0.1) | |
// ---- | |
@mixin icon($icon, $top, $left, $color, $atts: null) { | |
.icon-#{$icon} { | |
top: $top; | |
left: $left; |