Skip to content

Instantly share code, notes, and snippets.

View fxbenard's full-sized avatar
🏠
Working from home

FX Bénard fxbenard

🏠
Working from home
View GitHub Profile
@zackkatz
zackkatz / gf-validate-edd-license-key.php
Last active May 3, 2021 09:10
Validate Easy Digital Downloads License Key Field in a Gravity Forms Submission
/**
* Validate a Gravity Forms license submission against EDD remote validation
*
* In Gravity Forms, for the text field you want to use as the license key entry,
* go to Advanced tab, check the "Allow field to be populated dynamically" checkbox,
* then enter the value as `edd-{download_id}`, where {download_id} is the, you guessed
* it, EDD Download ID.
*
* @param array $is_valid_and_form_array Gravity Forms passes an array with two keys: `is_valid` (boolean) and `form` (Gravity Forms form array)
* @return array Same format as incoming.
@benhuson
benhuson / my_plugin_row_meta.php
Created May 1, 2014 17:24
Add a link to your GitHub repo and translation link to your WordPress plugin.
<?php
/**
* Plugin Row Meta
*
* Adds GitHub and translate links below the plugin description on the plugins page.
* Replace references to 'my-plugin' to reflect your plugin folder and file name.
* Update the GitHub Repo and Translation links.
*
* @param array $plugin_meta Plugin meta display array.

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc or .bash_profile file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@johnpbloch
johnpbloch / README.md
Created August 23, 2012 13:55
A bash script to make .pot files for WordPress plugins

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"