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: Front-end Media Example | |
* Plugin URI: http://derekspringer.wordpress.com | |
* Description: An example of adding the media loader on the front-end. | |
* Version: 0.1 | |
* Author: Derek Springer | |
* Author URI: http://derekspringer.wordpress.com | |
* License: GPL-2.0+ |
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 | |
// When not running a sale, just RETURN here. (but if you forget, no problem...) | |
# return; | |
// Pass the coupon code that you want applied as the global sale coupon | |
new GV_Theme_Sale( 'SOLSTICE2019' ); | |
class GV_Theme_Sale { |
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 | |
/** | |
* Register plugin icons. | |
* | |
* WordPress 4.9 introduced icons in the list table on the Manage Plugins | |
* screen. The icons are pulled from the W.org update API. If an icon isn't | |
* available, a generic plugin Dashicon is shown instead. | |
* | |
* @param array $value Plugin update data. | |
* @return 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
add_filter( 'gform_field_content', 'tp_subsection_field', 10, 5 ); | |
function tp_subsection_field( $content, $field, $value, $lead_id, $form_id ) | |
{ | |
return htmlspecialchars_decode( $content ); | |
} |
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
// credits: https://github.com/CFXd | |
function gf_make_submit_input_into_a_button_element($button_input, $form) { | |
//save attribute string to $button_match[1] | |
preg_match("/<input([^\/>]*)(\s\/)*>/", $button_input, $button_match); | |
//remove value attribute | |
$button_atts = str_replace("value='".$form['button']['text']."' ", "", $button_match[1]); | |
return '<button '.$button_atts.'>'.$form['button']['text'].'<i class="fa fa-refresh"></i></button>'; |
NewerOlder