This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!
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 | |
// Various links | |
// https://serverfault.com/questions/488767/how-do-i-enable-php-s-flush-with-nginxphp-fpm | |
// https://stackoverflow.com/questions/72394213/nginx-configuration-for-server-sent-event | |
// https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate | |
// https://qiita.com/okumurakengo/items/cbe6b3717b95944083a1 (in Japanese) | |
// If '?SSE' is set, send Server-Sent events, otherwise we'll display the page. | |
if ( isset( $_GET['SSE'] ) ) { |
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_entry_detail_meta_boxes', 'add_delete_attachment_meta_box', 10, 3 ); | |
function add_delete_attachment_meta_box( $meta_boxes, $entry, $form ) { | |
$my_form_id = 3; | |
if ( $form['id'] == $my_form_id ) { | |
if ( ! isset( $meta_boxes['payment'] ) ) { | |
$meta_boxes['payment'] = array( | |
'title' => esc_html__( 'Delete Attachments', 'gravityforms' ), |
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
<?php | |
// [update : sécurité des sorties] | |
add_filter( 'gform_field_content', 'tp_subsection_field', 10, 5 ); | |
function tp_subsection_field( $content, $field, $value, $lead_id, $form_id ) | |
{ | |
// Limiter les balises HTML autorisées dans les labels (gras, images, etc.) | |
$allowed_html = array( | |
'strong' => array(), | |
'em' => array(), | |
'b' => 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 | |
/** | |
* 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 | |
/** | |
* Convert date/time format between `date()` and `strftime()` | |
* | |
* Timezone conversion is done for Unix. Windows users must exchange %z and %Z. | |
* | |
* Unsupported date formats : S, n, t, L, B, G, u, e, I, P, Z, c, r | |
* Unsupported strftime formats : %U, %W, %C, %g, %r, %R, %T, %X, %c, %D, %F, %x | |
* |
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