You can use the .phar
for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.
cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
<?php | |
/** | |
* Shortcode to retrieve information about a user startdate/enddate | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* www.paidmembershipspro.com - A membership plugin for WordPress. | |
*/ | |
function pmpro_member_data_shortcode( $atts, $content=null, $code='' ) { | |
global $current_user; |
<?php | |
function get_ip_address() { | |
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'); | |
foreach ($ip_keys as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
// trim for safety measures | |
$ip = trim($ip); | |
// attempt to validate IP | |
if (validate_ip($ip)) { |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
[ | |
{name: 'Afghanistan', code: 'AF'}, | |
{name: 'Åland Islands', code: 'AX'}, | |
{name: 'Albania', code: 'AL'}, | |
{name: 'Algeria', code: 'DZ'}, | |
{name: 'American Samoa', code: 'AS'}, | |
{name: 'AndorrA', code: 'AD'}, | |
{name: 'Angola', code: 'AO'}, | |
{name: 'Anguilla', code: 'AI'}, | |
{name: 'Antarctica', code: 'AQ'}, |
/** | |
* The function my_pmpro_levels_array is an arbitrarily named function, which | |
* you can rename to something more meaningful, as long as it is uniquely | |
* named on this site. | |
* | |
* @param array $levels Input the array of levels from your site | |
* @return array Output all paid levels, ie NOT the free level(s) | |
*/ | |
function my_pmpro_levels_array( $levels ) { | |
$newlevels = array(); |
var countryCodes = { | |
'Afghanistan': '93', | |
'Albania': '355', | |
'Algeria': '213', | |
'American Samoa': '684', | |
'Andorra': '376', | |
'Angola': '244', | |
'Antigua and Barbuda': '1-268', | |
'Argentina': '54', | |
'Armenia': '374', |
{ | |
"icons": [ | |
{ | |
"name": "Glass", | |
"id": "glass", | |
"unicode": "f000", | |
"created": 1, | |
"categories": [ | |
"Web Application Icons" | |
] |
Development-related files that might be found in version-controlled projects. Doesn't include editor-specific files.
.editorconfig
- EditorConfig define and maintain consistent coding styles between different editors and IDEs..gitignore
- ignore files from version control. Note, don't add system files - contributors should be globally ignoring these on their local machines. Only use for files created during project build, credentials files etc.