diff --git a/class-expressivedate.php b/class-expressivedate.php
index 558ad405..d0b3fc37 100644
--- a/class-expressivedate.php
+++ b/class-expressivedate.php
@@ -798,7 +798,7 @@ public function setTimestampFromString( $string ): ExpressiveDate {
public function isWeekday(): bool {
$day = $this->getDayOfWeek();
- return ! in_array( $day, array( 'Saturday', 'Sunday' ) );
+ return ! in_array( $day, [ 'Saturday', 'Sunday' ] );
}
/**
@@ -837,7 +837,7 @@ public function getDifferenceInMonths( $compare = null ): string {
$difference = $this->diff( $compare );
- list($years, $months) = explode( ':', $difference->format( '%y:%m' ) );
+ [$years, $months] = explode( ':', $difference->format( '%y:%m' ) );
return ( ( $years * 12 ) + $months ) * $difference->format( '%r1' );
}
@@ -895,7 +895,7 @@ public function getDifferenceInSeconds( $compare = null ) {
$difference = $this->diff( $compare );
- list($days, $hours, $minutes, $seconds) = explode( ':', $difference->format( '%a:%h:%i:%s' ) );
+ [$days, $hours, $minutes, $seconds] = explode( ':', $difference->format( '%a:%h:%i:%s' ) );
// Add the total amount of seconds in all the days.
$seconds += ( $days * 24 * 60 * 60 );
@@ -920,8 +920,8 @@ public function getRelativeDate( $compare = null ) {
$compare = new ExpressiveDate( 'now', $this->getTimezone() );
}
- $units = array( 'second', 'minute', 'hour', 'day', 'week', 'month', 'year' );
- $values = array( 60, 60, 24, 7, 4.35, 12 );
+ $units = [ 'second', 'minute', 'hour', 'day', 'week', 'month', 'year' ];
+ $values = [ 60, 60, 24, 7, 4.35, 12 ];
// Get the difference between the two timestamps. We'll use this to cacluate the
// actual time remaining.
@@ -1027,7 +1027,7 @@ public function setWeekStartDay( $weekStartDay ) {
if ( is_numeric( $weekStartDay ) ) {
$this->weekStartDay = $weekStartDay;
} else {
- $this->weekStartDay = array_search( strtolower( $weekStartDay ), array( 'sunday', 'monday' ) );
+ $this->weekStartDay = array_search( strtolower( $weekStartDay ), [ 'sunday', 'monday' ] );
}
return $this;
diff --git a/class-qrcode.php b/class-qrcode.php
index 988031eb..f16b778f 100644
--- a/class-qrcode.php
+++ b/class-qrcode.php
@@ -26,39 +26,39 @@
class QRCode {
- var $typeNumber;
+ public $typeNumber;
- var $modules;
+ public $modules;
- var $moduleCount;
+ public $moduleCount;
- var $errorCorrectLevel;
+ public $errorCorrectLevel;
- var $qrDataList;
+ public $qrDataList;
- function __construct() {
+ public function __construct() {
$this->typeNumber = 1;
$this->errorCorrectLevel = QR_ERROR_CORRECT_LEVEL_H;
- $this->qrDataList = array();
+ $this->qrDataList = [];
}
- function getTypeNumber() {
+ public function getTypeNumber() {
return $this->typeNumber;
}
- function setTypeNumber( $typeNumber ) {
+ public function setTypeNumber( $typeNumber ) {
$this->typeNumber = $typeNumber;
}
- function getErrorCorrectLevel() {
+ public function getErrorCorrectLevel() {
return $this->errorCorrectLevel;
}
- function setErrorCorrectLevel( $errorCorrectLevel ) {
+ public function setErrorCorrectLevel( $errorCorrectLevel ) {
$this->errorCorrectLevel = $errorCorrectLevel;
}
- function addData( $data, $mode = 0 ) {
+ public function addData( $data, $mode = 0 ) {
if ( $mode == 0 ) {
$mode = QRUtil::getMode( $data );
@@ -91,23 +91,23 @@ function addData( $data, $mode = 0 ) {
}
}
- function clearData() {
- $this->qrDataList = array();
+ public function clearData() {
+ $this->qrDataList = [];
}
- function addDataImpl( $qrData ) {
+ public function addDataImpl( $qrData ) {
$this->qrDataList[] = $qrData;
}
- function getDataCount() {
+ public function getDataCount() {
return count( $this->qrDataList );
}
- function getData( $index ) {
+ public function getData( $index ) {
return $this->qrDataList[ $index ];
}
- function isDark( $row, $col ) {
+ public function isDark( $row, $col ) {
if ( $this->modules[ $row ][ $col ] !== null ) {
return $this->modules[ $row ][ $col ];
} else {
@@ -115,25 +115,25 @@ function isDark( $row, $col ) {
}
}
- function getModuleCount() {
+ public function getModuleCount() {
return $this->moduleCount;
}
// used for converting fg/bg colors (e.g. #0000ff = 0x0000FF)
// added 2015.07.27 ~ DoktorJ
- function hex2rgb( $hex = 0x0 ) {
- return array(
+ public function hex2rgb( $hex = 0x0 ) {
+ return [
'r' => floor( $hex / 65536 ),
'g' => floor( $hex / 256 ) % 256,
'b' => $hex % 256,
- );
+ ];
}
- function make() {
+ public function make() {
$this->makeImpl( false, $this->getBestMaskPattern() );
}
- function getBestMaskPattern() {
+ public function getBestMaskPattern() {
$minLostPoint = 0;
$pattern = 0;
@@ -153,19 +153,19 @@ function getBestMaskPattern() {
return $pattern;
}
- function createNullArray( $length ) {
- $nullArray = array();
+ public function createNullArray( $length ) {
+ $nullArray = [];
for ( $i = 0; $i < $length; $i++ ) {
$nullArray[] = null;
}
return $nullArray;
}
- function makeImpl( $test, $maskPattern ) {
+ public function makeImpl( $test, $maskPattern ) {
$this->moduleCount = $this->typeNumber * 4 + 17;
- $this->modules = array();
+ $this->modules = [];
for ( $i = 0; $i < $this->moduleCount; $i++ ) {
$this->modules[] = self::createNullArray( $this->moduleCount );
}
@@ -190,7 +190,7 @@ function makeImpl( $test, $maskPattern ) {
$this->mapData( $data, $maskPattern );
}
- function mapData( &$data, $maskPattern ) {
+ public function mapData( &$data, $maskPattern ) {
$inc = -1;
$row = $this->moduleCount - 1;
@@ -240,7 +240,7 @@ function mapData( &$data, $maskPattern ) {
}
}
- function setupPositionAdjustPattern() {
+ public function setupPositionAdjustPattern() {
$pos = QRUtil::getPatternPosition( $this->typeNumber );
@@ -266,7 +266,7 @@ function setupPositionAdjustPattern() {
}
}
- function setupPositionProbePattern( $row, $col ) {
+ public function setupPositionProbePattern( $row, $col ) {
for ( $r = -1; $r <= 7; $r++ ) {
@@ -285,7 +285,7 @@ function setupPositionProbePattern( $row, $col ) {
}
}
- function setupTimingPattern() {
+ public function setupTimingPattern() {
for ( $i = 8; $i < $this->moduleCount - 8; $i++ ) {
@@ -298,7 +298,7 @@ function setupTimingPattern() {
}
}
- function setupTypeNumber( $test ) {
+ public function setupTypeNumber( $test ) {
$bits = QRUtil::getBCHTypeNumber( $this->typeNumber );
@@ -309,7 +309,7 @@ function setupTypeNumber( $test ) {
}
}
- function setupTypeInfo( $test, $maskPattern ) {
+ public function setupTypeInfo( $test, $maskPattern ) {
$data = ( $this->errorCorrectLevel << 3 ) | $maskPattern;
$bits = QRUtil::getBCHTypeInfo( $data );
@@ -338,7 +338,7 @@ function setupTypeInfo( $test, $maskPattern ) {
$this->modules[ $this->moduleCount - 8 ][8] = ! $test;
}
- function createData( $typeNumber, $errorCorrectLevel, $dataArray ) {
+ public function createData( $typeNumber, $errorCorrectLevel, $dataArray ) {
$rsBlocks = QRRSBlock::getRSBlocks( $typeNumber, $errorCorrectLevel );
@@ -359,12 +359,12 @@ function createData( $typeNumber, $errorCorrectLevel, $dataArray ) {
if ( $buffer->getLengthInBits() > $totalDataCount * 8 ) {
trigger_error(
- 'code length overflow. ('
+ 'code length overflow. ('
. $buffer->getLengthInBits()
. '>'
. $totalDataCount * 8
. ')',
- E_USER_ERROR
+ E_USER_ERROR
);
}
@@ -401,7 +401,7 @@ function createData( $typeNumber, $errorCorrectLevel, $dataArray ) {
*
* @return array
*/
- function createBytes( &$buffer, &$rsBlocks ) {
+ public function createBytes( &$buffer, &$rsBlocks ) {
$offset = 0;
@@ -469,7 +469,7 @@ function createBytes( &$buffer, &$rsBlocks ) {
return $data;
}
- static function getMinimumQRCode( $data, $errorCorrectLevel ) {
+ public static function getMinimumQRCode( $data, $errorCorrectLevel ) {
$mode = QRUtil::getMode( $data );
@@ -495,7 +495,7 @@ static function getMinimumQRCode( $data, $errorCorrectLevel ) {
// added $fg (foreground), $bg (background), and $bgtrans (use transparent bg) parameters
// also added some simple error checking on parameters
// updated 2015.07.27 ~ DoktorJ
- function createImage( $size = 2, $margin = 2, $fg = 0x000000, $bg = 0xFFFFFF, $bgtrans = false ) {
+ public function createImage( $size = 2, $margin = 2, $fg = 0x000000, $bg = 0xFFFFFF, $bgtrans = false ) {
// size/margin EC
if ( ! is_numeric( $size ) ) {
@@ -543,12 +543,12 @@ function createImage( $size = 2, $margin = 2, $fg = 0x000000, $bg = 0xFFFFFF, $b
// update $black to $fgc
imagefilledrectangle(
- $image,
- $margin + $c * $size,
- $margin + $r * $size,
- $margin + ( $c + 1 ) * $size - 1,
- $margin + ( $r + 1 ) * $size - 1,
- $fgc
+ $image,
+ $margin + $c * $size,
+ $margin + $r * $size,
+ $margin + ( $c + 1 ) * $size - 1,
+ $margin + ( $r + 1 ) * $size - 1,
+ $fgc
);
}
}
@@ -557,7 +557,7 @@ function createImage( $size = 2, $margin = 2, $fg = 0x000000, $bg = 0xFFFFFF, $b
return $image;
}
- function printHTML( $size = '2px' ) {
+ public function printHTML( $size = '2px' ) {
$style = 'border-style:none;border-collapse:collapse;margin:0px;padding:0px;';
@@ -600,86 +600,86 @@ public function printSVG( $size = 2 ) {
//---------------------------------------------------------------
define(
- 'QR_G15',
- ( 1 << 10 ) | ( 1 << 8 ) | ( 1 << 5 )
+ 'QR_G15',
+ ( 1 << 10 ) | ( 1 << 8 ) | ( 1 << 5 )
| ( 1 << 4 ) | ( 1 << 2 ) | ( 1 << 1 ) | ( 1 << 0 )
);
define(
- 'QR_G18',
- ( 1 << 12 ) | ( 1 << 11 ) | ( 1 << 10 )
+ 'QR_G18',
+ ( 1 << 12 ) | ( 1 << 11 ) | ( 1 << 10 )
| ( 1 << 9 ) | ( 1 << 8 ) | ( 1 << 5 ) | ( 1 << 2 ) | ( 1 << 0 )
);
define(
- 'QR_G15_MASK',
- ( 1 << 14 ) | ( 1 << 12 ) | ( 1 << 10 )
+ 'QR_G15_MASK',
+ ( 1 << 14 ) | ( 1 << 12 ) | ( 1 << 10 )
| ( 1 << 4 ) | ( 1 << 1 )
);
class QRUtil {
- static $QR_MAX_LENGTH = array(
- array( array( 41, 25, 17, 10 ), array( 34, 20, 14, 8 ), array( 27, 16, 11, 7 ), array( 17, 10, 7, 4 ) ),
- array( array( 77, 47, 32, 20 ), array( 63, 38, 26, 16 ), array( 48, 29, 20, 12 ), array( 34, 20, 14, 8 ) ),
- array( array( 127, 77, 53, 32 ), array( 101, 61, 42, 26 ), array( 77, 47, 32, 20 ), array( 58, 35, 24, 15 ) ),
- array( array( 187, 114, 78, 48 ), array( 149, 90, 62, 38 ), array( 111, 67, 46, 28 ), array( 82, 50, 34, 21 ) ),
- array( array( 255, 154, 106, 65 ), array( 202, 122, 84, 52 ), array( 144, 87, 60, 37 ), array( 106, 64, 44, 27 ) ),
- array( array( 322, 195, 134, 82 ), array( 255, 154, 106, 65 ), array( 178, 108, 74, 45 ), array( 139, 84, 58, 36 ) ),
- array( array( 370, 224, 154, 95 ), array( 293, 178, 122, 75 ), array( 207, 125, 86, 53 ), array( 154, 93, 64, 39 ) ),
- array( array( 461, 279, 192, 118 ), array( 365, 221, 152, 93 ), array( 259, 157, 108, 66 ), array( 202, 122, 84, 52 ) ),
- array( array( 552, 335, 230, 141 ), array( 432, 262, 180, 111 ), array( 312, 189, 130, 80 ), array( 235, 143, 98, 60 ) ),
- array( array( 652, 395, 271, 167 ), array( 513, 311, 213, 131 ), array( 364, 221, 151, 93 ), array( 288, 174, 119, 74 ) ),
- );
-
- static $QR_PATTERN_POSITION_TABLE = array(
- array(),
- array( 6, 18 ),
- array( 6, 22 ),
- array( 6, 26 ),
- array( 6, 30 ),
- array( 6, 34 ),
- array( 6, 22, 38 ),
- array( 6, 24, 42 ),
- array( 6, 26, 46 ),
- array( 6, 28, 50 ),
- array( 6, 30, 54 ),
- array( 6, 32, 58 ),
- array( 6, 34, 62 ),
- array( 6, 26, 46, 66 ),
- array( 6, 26, 48, 70 ),
- array( 6, 26, 50, 74 ),
- array( 6, 30, 54, 78 ),
- array( 6, 30, 56, 82 ),
- array( 6, 30, 58, 86 ),
- array( 6, 34, 62, 90 ),
- array( 6, 28, 50, 72, 94 ),
- array( 6, 26, 50, 74, 98 ),
- array( 6, 30, 54, 78, 102 ),
- array( 6, 28, 54, 80, 106 ),
- array( 6, 32, 58, 84, 110 ),
- array( 6, 30, 58, 86, 114 ),
- array( 6, 34, 62, 90, 118 ),
- array( 6, 26, 50, 74, 98, 122 ),
- array( 6, 30, 54, 78, 102, 126 ),
- array( 6, 26, 52, 78, 104, 130 ),
- array( 6, 30, 56, 82, 108, 134 ),
- array( 6, 34, 60, 86, 112, 138 ),
- array( 6, 30, 58, 86, 114, 142 ),
- array( 6, 34, 62, 90, 118, 146 ),
- array( 6, 30, 54, 78, 102, 126, 150 ),
- array( 6, 24, 50, 76, 102, 128, 154 ),
- array( 6, 28, 54, 80, 106, 132, 158 ),
- array( 6, 32, 58, 84, 110, 136, 162 ),
- array( 6, 26, 54, 82, 110, 138, 166 ),
- array( 6, 30, 58, 86, 114, 142, 170 ),
- );
-
- static function getPatternPosition( $typeNumber ) {
+ public static $QR_MAX_LENGTH = [
+ [ [ 41, 25, 17, 10 ], [ 34, 20, 14, 8 ], [ 27, 16, 11, 7 ], [ 17, 10, 7, 4 ] ],
+ [ [ 77, 47, 32, 20 ], [ 63, 38, 26, 16 ], [ 48, 29, 20, 12 ], [ 34, 20, 14, 8 ] ],
+ [ [ 127, 77, 53, 32 ], [ 101, 61, 42, 26 ], [ 77, 47, 32, 20 ], [ 58, 35, 24, 15 ] ],
+ [ [ 187, 114, 78, 48 ], [ 149, 90, 62, 38 ], [ 111, 67, 46, 28 ], [ 82, 50, 34, 21 ] ],
+ [ [ 255, 154, 106, 65 ], [ 202, 122, 84, 52 ], [ 144, 87, 60, 37 ], [ 106, 64, 44, 27 ] ],
+ [ [ 322, 195, 134, 82 ], [ 255, 154, 106, 65 ], [ 178, 108, 74, 45 ], [ 139, 84, 58, 36 ] ],
+ [ [ 370, 224, 154, 95 ], [ 293, 178, 122, 75 ], [ 207, 125, 86, 53 ], [ 154, 93, 64, 39 ] ],
+ [ [ 461, 279, 192, 118 ], [ 365, 221, 152, 93 ], [ 259, 157, 108, 66 ], [ 202, 122, 84, 52 ] ],
+ [ [ 552, 335, 230, 141 ], [ 432, 262, 180, 111 ], [ 312, 189, 130, 80 ], [ 235, 143, 98, 60 ] ],
+ [ [ 652, 395, 271, 167 ], [ 513, 311, 213, 131 ], [ 364, 221, 151, 93 ], [ 288, 174, 119, 74 ] ],
+ ];
+
+ public static $QR_PATTERN_POSITION_TABLE = [
+ [],
+ [ 6, 18 ],
+ [ 6, 22 ],
+ [ 6, 26 ],
+ [ 6, 30 ],
+ [ 6, 34 ],
+ [ 6, 22, 38 ],
+ [ 6, 24, 42 ],
+ [ 6, 26, 46 ],
+ [ 6, 28, 50 ],
+ [ 6, 30, 54 ],
+ [ 6, 32, 58 ],
+ [ 6, 34, 62 ],
+ [ 6, 26, 46, 66 ],
+ [ 6, 26, 48, 70 ],
+ [ 6, 26, 50, 74 ],
+ [ 6, 30, 54, 78 ],
+ [ 6, 30, 56, 82 ],
+ [ 6, 30, 58, 86 ],
+ [ 6, 34, 62, 90 ],
+ [ 6, 28, 50, 72, 94 ],
+ [ 6, 26, 50, 74, 98 ],
+ [ 6, 30, 54, 78, 102 ],
+ [ 6, 28, 54, 80, 106 ],
+ [ 6, 32, 58, 84, 110 ],
+ [ 6, 30, 58, 86, 114 ],
+ [ 6, 34, 62, 90, 118 ],
+ [ 6, 26, 50, 74, 98, 122 ],
+ [ 6, 30, 54, 78, 102, 126 ],
+ [ 6, 26, 52, 78, 104, 130 ],
+ [ 6, 30, 56, 82, 108, 134 ],
+ [ 6, 34, 60, 86, 112, 138 ],
+ [ 6, 30, 58, 86, 114, 142 ],
+ [ 6, 34, 62, 90, 118, 146 ],
+ [ 6, 30, 54, 78, 102, 126, 150 ],
+ [ 6, 24, 50, 76, 102, 128, 154 ],
+ [ 6, 28, 54, 80, 106, 132, 158 ],
+ [ 6, 32, 58, 84, 110, 136, 162 ],
+ [ 6, 26, 54, 82, 110, 138, 166 ],
+ [ 6, 30, 58, 86, 114, 142, 170 ],
+ ];
+
+ public static function getPatternPosition( $typeNumber ) {
return self::$QR_PATTERN_POSITION_TABLE[ $typeNumber - 1 ];
}
- static function getMaxLength( $typeNumber, $mode, $errorCorrectLevel ) {
+ public static function getMaxLength( $typeNumber, $mode, $errorCorrectLevel ) {
$t = $typeNumber - 1;
$e = 0;
@@ -722,18 +722,18 @@ static function getMaxLength( $typeNumber, $mode, $errorCorrectLevel ) {
return self::$QR_MAX_LENGTH[ $t ][ $e ][ $m ];
}
- static function getErrorCorrectPolynomial( $errorCorrectLength ) {
+ public static function getErrorCorrectPolynomial( $errorCorrectLength ) {
- $a = new QRPolynomial( array( 1 ) );
+ $a = new QRPolynomial( [ 1 ] );
for ( $i = 0; $i < $errorCorrectLength; $i++ ) {
- $a = $a->multiply( new QRPolynomial( array( 1, QRMath::gexp( $i ) ) ) );
+ $a = $a->multiply( new QRPolynomial( [ 1, QRMath::gexp( $i ) ] ) );
}
return $a;
}
- static function getMask( $maskPattern, $i, $j ) {
+ public static function getMask( $maskPattern, $i, $j ) {
switch ( $maskPattern ) {
@@ -764,7 +764,7 @@ static function getMask( $maskPattern, $i, $j ) {
*
* @return float|int
*/
- static function getLostPoint( $qrCode ) {
+ public static function getLostPoint( $qrCode ) {
$moduleCount = $qrCode->getModuleCount();
@@ -874,7 +874,7 @@ static function getLostPoint( $qrCode ) {
return $lostPoint;
}
- static function getMode( $s ) {
+ public static function getMode( $s ) {
if ( self::isAlphaNum( $s ) ) {
if ( self::isNumber( $s ) ) {
return QR_MODE_NUMBER;
@@ -887,7 +887,7 @@ static function getMode( $s ) {
}
}
- static function isNumber( $s ) {
+ public static function isNumber( $s ) {
for ( $i = 0; $i < strlen( $s ); $i++ ) {
$c = ord( $s[ $i ] );
if ( ! ( self::toCharCode( '0' ) <= $c && $c <= self::toCharCode( '9' ) ) ) {
@@ -897,7 +897,7 @@ static function isNumber( $s ) {
return true;
}
- static function isAlphaNum( $s ) {
+ public static function isAlphaNum( $s ) {
for ( $i = 0; $i < strlen( $s ); $i++ ) {
$c = ord( $s[ $i ] );
if ( ! ( self::toCharCode( '0' ) <= $c && $c <= self::toCharCode( '9' ) )
@@ -909,7 +909,7 @@ static function isAlphaNum( $s ) {
return true;
}
- static function isKanji( $s ) {
+ public static function isKanji( $s ) {
$data = $s;
@@ -933,11 +933,11 @@ static function isKanji( $s ) {
return true;
}
- static function toCharCode( $s ) {
+ public static function toCharCode( $s ) {
return ord( $s[0] );
}
- static function getBCHTypeInfo( $data ) {
+ public static function getBCHTypeInfo( $data ) {
$d = $data << 10;
while ( self::getBCHDigit( $d ) - self::getBCHDigit( QR_G15 ) >= 0 ) {
$d ^= ( QR_G15 << ( self::getBCHDigit( $d ) - self::getBCHDigit( QR_G15 ) ) );
@@ -945,7 +945,7 @@ static function getBCHTypeInfo( $data ) {
return ( ( $data << 10 ) | $d ) ^ QR_G15_MASK;
}
- static function getBCHTypeNumber( $data ) {
+ public static function getBCHTypeNumber( $data ) {
$d = $data << 12;
while ( self::getBCHDigit( $d ) - self::getBCHDigit( QR_G18 ) >= 0 ) {
$d ^= ( QR_G18 << ( self::getBCHDigit( $d ) - self::getBCHDigit( QR_G18 ) ) );
@@ -953,7 +953,7 @@ static function getBCHTypeNumber( $data ) {
return ( $data << 12 ) | $d;
}
- static function getBCHDigit( $data ) {
+ public static function getBCHDigit( $data ) {
$digit = 0;
@@ -972,10 +972,10 @@ static function getBCHDigit( $data ) {
class QRRSBlock {
- var $totalCount;
- var $dataCount;
+ public $totalCount;
+ public $dataCount;
- static $QR_RS_BLOCK_TABLE = array(
+ public static $QR_RS_BLOCK_TABLE = [
// L
// M
@@ -983,266 +983,266 @@ class QRRSBlock {
// H
// 1
- array( 1, 26, 19 ),
- array( 1, 26, 16 ),
- array( 1, 26, 13 ),
- array( 1, 26, 9 ),
+ [ 1, 26, 19 ],
+ [ 1, 26, 16 ],
+ [ 1, 26, 13 ],
+ [ 1, 26, 9 ],
// 2
- array( 1, 44, 34 ),
- array( 1, 44, 28 ),
- array( 1, 44, 22 ),
- array( 1, 44, 16 ),
+ [ 1, 44, 34 ],
+ [ 1, 44, 28 ],
+ [ 1, 44, 22 ],
+ [ 1, 44, 16 ],
// 3
- array( 1, 70, 55 ),
- array( 1, 70, 44 ),
- array( 2, 35, 17 ),
- array( 2, 35, 13 ),
+ [ 1, 70, 55 ],
+ [ 1, 70, 44 ],
+ [ 2, 35, 17 ],
+ [ 2, 35, 13 ],
// 4
- array( 1, 100, 80 ),
- array( 2, 50, 32 ),
- array( 2, 50, 24 ),
- array( 4, 25, 9 ),
+ [ 1, 100, 80 ],
+ [ 2, 50, 32 ],
+ [ 2, 50, 24 ],
+ [ 4, 25, 9 ],
// 5
- array( 1, 134, 108 ),
- array( 2, 67, 43 ),
- array( 2, 33, 15, 2, 34, 16 ),
- array( 2, 33, 11, 2, 34, 12 ),
+ [ 1, 134, 108 ],
+ [ 2, 67, 43 ],
+ [ 2, 33, 15, 2, 34, 16 ],
+ [ 2, 33, 11, 2, 34, 12 ],
// 6
- array( 2, 86, 68 ),
- array( 4, 43, 27 ),
- array( 4, 43, 19 ),
- array( 4, 43, 15 ),
+ [ 2, 86, 68 ],
+ [ 4, 43, 27 ],
+ [ 4, 43, 19 ],
+ [ 4, 43, 15 ],
// 7
- array( 2, 98, 78 ),
- array( 4, 49, 31 ),
- array( 2, 32, 14, 4, 33, 15 ),
- array( 4, 39, 13, 1, 40, 14 ),
+ [ 2, 98, 78 ],
+ [ 4, 49, 31 ],
+ [ 2, 32, 14, 4, 33, 15 ],
+ [ 4, 39, 13, 1, 40, 14 ],
// 8
- array( 2, 121, 97 ),
- array( 2, 60, 38, 2, 61, 39 ),
- array( 4, 40, 18, 2, 41, 19 ),
- array( 4, 40, 14, 2, 41, 15 ),
+ [ 2, 121, 97 ],
+ [ 2, 60, 38, 2, 61, 39 ],
+ [ 4, 40, 18, 2, 41, 19 ],
+ [ 4, 40, 14, 2, 41, 15 ],
// 9
- array( 2, 146, 116 ),
- array( 3, 58, 36, 2, 59, 37 ),
- array( 4, 36, 16, 4, 37, 17 ),
- array( 4, 36, 12, 4, 37, 13 ),
+ [ 2, 146, 116 ],
+ [ 3, 58, 36, 2, 59, 37 ],
+ [ 4, 36, 16, 4, 37, 17 ],
+ [ 4, 36, 12, 4, 37, 13 ],
// 10
- array( 2, 86, 68, 2, 87, 69 ),
- array( 4, 69, 43, 1, 70, 44 ),
- array( 6, 43, 19, 2, 44, 20 ),
- array( 6, 43, 15, 2, 44, 16 ),
+ [ 2, 86, 68, 2, 87, 69 ],
+ [ 4, 69, 43, 1, 70, 44 ],
+ [ 6, 43, 19, 2, 44, 20 ],
+ [ 6, 43, 15, 2, 44, 16 ],
// 11
- array( 4, 101, 81 ),
- array( 1, 80, 50, 4, 81, 51 ),
- array( 4, 50, 22, 4, 51, 23 ),
- array( 3, 36, 12, 8, 37, 13 ),
+ [ 4, 101, 81 ],
+ [ 1, 80, 50, 4, 81, 51 ],
+ [ 4, 50, 22, 4, 51, 23 ],
+ [ 3, 36, 12, 8, 37, 13 ],
// 12
- array( 2, 116, 92, 2, 117, 93 ),
- array( 6, 58, 36, 2, 59, 37 ),
- array( 4, 46, 20, 6, 47, 21 ),
- array( 7, 42, 14, 4, 43, 15 ),
+ [ 2, 116, 92, 2, 117, 93 ],
+ [ 6, 58, 36, 2, 59, 37 ],
+ [ 4, 46, 20, 6, 47, 21 ],
+ [ 7, 42, 14, 4, 43, 15 ],
// 13
- array( 4, 133, 107 ),
- array( 8, 59, 37, 1, 60, 38 ),
- array( 8, 44, 20, 4, 45, 21 ),
- array( 12, 33, 11, 4, 34, 12 ),
+ [ 4, 133, 107 ],
+ [ 8, 59, 37, 1, 60, 38 ],
+ [ 8, 44, 20, 4, 45, 21 ],
+ [ 12, 33, 11, 4, 34, 12 ],
// 14
- array( 3, 145, 115, 1, 146, 116 ),
- array( 4, 64, 40, 5, 65, 41 ),
- array( 11, 36, 16, 5, 37, 17 ),
- array( 11, 36, 12, 5, 37, 13 ),
+ [ 3, 145, 115, 1, 146, 116 ],
+ [ 4, 64, 40, 5, 65, 41 ],
+ [ 11, 36, 16, 5, 37, 17 ],
+ [ 11, 36, 12, 5, 37, 13 ],
// 15
- array( 5, 109, 87, 1, 110, 88 ),
- array( 5, 65, 41, 5, 66, 42 ),
- array( 5, 54, 24, 7, 55, 25 ),
- array( 11, 36, 12, 7, 37, 13 ),
+ [ 5, 109, 87, 1, 110, 88 ],
+ [ 5, 65, 41, 5, 66, 42 ],
+ [ 5, 54, 24, 7, 55, 25 ],
+ [ 11, 36, 12, 7, 37, 13 ],
// 16
- array( 5, 122, 98, 1, 123, 99 ),
- array( 7, 73, 45, 3, 74, 46 ),
- array( 15, 43, 19, 2, 44, 20 ),
- array( 3, 45, 15, 13, 46, 16 ),
+ [ 5, 122, 98, 1, 123, 99 ],
+ [ 7, 73, 45, 3, 74, 46 ],
+ [ 15, 43, 19, 2, 44, 20 ],
+ [ 3, 45, 15, 13, 46, 16 ],
// 17
- array( 1, 135, 107, 5, 136, 108 ),
- array( 10, 74, 46, 1, 75, 47 ),
- array( 1, 50, 22, 15, 51, 23 ),
- array( 2, 42, 14, 17, 43, 15 ),
+ [ 1, 135, 107, 5, 136, 108 ],
+ [ 10, 74, 46, 1, 75, 47 ],
+ [ 1, 50, 22, 15, 51, 23 ],
+ [ 2, 42, 14, 17, 43, 15 ],
// 18
- array( 5, 150, 120, 1, 151, 121 ),
- array( 9, 69, 43, 4, 70, 44 ),
- array( 17, 50, 22, 1, 51, 23 ),
- array( 2, 42, 14, 19, 43, 15 ),
+ [ 5, 150, 120, 1, 151, 121 ],
+ [ 9, 69, 43, 4, 70, 44 ],
+ [ 17, 50, 22, 1, 51, 23 ],
+ [ 2, 42, 14, 19, 43, 15 ],
// 19
- array( 3, 141, 113, 4, 142, 114 ),
- array( 3, 70, 44, 11, 71, 45 ),
- array( 17, 47, 21, 4, 48, 22 ),
- array( 9, 39, 13, 16, 40, 14 ),
+ [ 3, 141, 113, 4, 142, 114 ],
+ [ 3, 70, 44, 11, 71, 45 ],
+ [ 17, 47, 21, 4, 48, 22 ],
+ [ 9, 39, 13, 16, 40, 14 ],
// 20
- array( 3, 135, 107, 5, 136, 108 ),
- array( 3, 67, 41, 13, 68, 42 ),
- array( 15, 54, 24, 5, 55, 25 ),
- array( 15, 43, 15, 10, 44, 16 ),
+ [ 3, 135, 107, 5, 136, 108 ],
+ [ 3, 67, 41, 13, 68, 42 ],
+ [ 15, 54, 24, 5, 55, 25 ],
+ [ 15, 43, 15, 10, 44, 16 ],
// 21
- array( 4, 144, 116, 4, 145, 117 ),
- array( 17, 68, 42 ),
- array( 17, 50, 22, 6, 51, 23 ),
- array( 19, 46, 16, 6, 47, 17 ),
+ [ 4, 144, 116, 4, 145, 117 ],
+ [ 17, 68, 42 ],
+ [ 17, 50, 22, 6, 51, 23 ],
+ [ 19, 46, 16, 6, 47, 17 ],
// 22
- array( 2, 139, 111, 7, 140, 112 ),
- array( 17, 74, 46 ),
- array( 7, 54, 24, 16, 55, 25 ),
- array( 34, 37, 13 ),
+ [ 2, 139, 111, 7, 140, 112 ],
+ [ 17, 74, 46 ],
+ [ 7, 54, 24, 16, 55, 25 ],
+ [ 34, 37, 13 ],
// 23
- array( 4, 151, 121, 5, 152, 122 ),
- array( 4, 75, 47, 14, 76, 48 ),
- array( 11, 54, 24, 14, 55, 25 ),
- array( 16, 45, 15, 14, 46, 16 ),
+ [ 4, 151, 121, 5, 152, 122 ],
+ [ 4, 75, 47, 14, 76, 48 ],
+ [ 11, 54, 24, 14, 55, 25 ],
+ [ 16, 45, 15, 14, 46, 16 ],
// 24
- array( 6, 147, 117, 4, 148, 118 ),
- array( 6, 73, 45, 14, 74, 46 ),
- array( 11, 54, 24, 16, 55, 25 ),
- array( 30, 46, 16, 2, 47, 17 ),
+ [ 6, 147, 117, 4, 148, 118 ],
+ [ 6, 73, 45, 14, 74, 46 ],
+ [ 11, 54, 24, 16, 55, 25 ],
+ [ 30, 46, 16, 2, 47, 17 ],
// 25
- array( 8, 132, 106, 4, 133, 107 ),
- array( 8, 75, 47, 13, 76, 48 ),
- array( 7, 54, 24, 22, 55, 25 ),
- array( 22, 45, 15, 13, 46, 16 ),
+ [ 8, 132, 106, 4, 133, 107 ],
+ [ 8, 75, 47, 13, 76, 48 ],
+ [ 7, 54, 24, 22, 55, 25 ],
+ [ 22, 45, 15, 13, 46, 16 ],
// 26
- array( 10, 142, 114, 2, 143, 115 ),
- array( 19, 74, 46, 4, 75, 47 ),
- array( 28, 50, 22, 6, 51, 23 ),
- array( 33, 46, 16, 4, 47, 17 ),
+ [ 10, 142, 114, 2, 143, 115 ],
+ [ 19, 74, 46, 4, 75, 47 ],
+ [ 28, 50, 22, 6, 51, 23 ],
+ [ 33, 46, 16, 4, 47, 17 ],
// 27
- array( 8, 152, 122, 4, 153, 123 ),
- array( 22, 73, 45, 3, 74, 46 ),
- array( 8, 53, 23, 26, 54, 24 ),
- array( 12, 45, 15, 28, 46, 16 ),
+ [ 8, 152, 122, 4, 153, 123 ],
+ [ 22, 73, 45, 3, 74, 46 ],
+ [ 8, 53, 23, 26, 54, 24 ],
+ [ 12, 45, 15, 28, 46, 16 ],
// 28
- array( 3, 147, 117, 10, 148, 118 ),
- array( 3, 73, 45, 23, 74, 46 ),
- array( 4, 54, 24, 31, 55, 25 ),
- array( 11, 45, 15, 31, 46, 16 ),
+ [ 3, 147, 117, 10, 148, 118 ],
+ [ 3, 73, 45, 23, 74, 46 ],
+ [ 4, 54, 24, 31, 55, 25 ],
+ [ 11, 45, 15, 31, 46, 16 ],
// 29
- array( 7, 146, 116, 7, 147, 117 ),
- array( 21, 73, 45, 7, 74, 46 ),
- array( 1, 53, 23, 37, 54, 24 ),
- array( 19, 45, 15, 26, 46, 16 ),
+ [ 7, 146, 116, 7, 147, 117 ],
+ [ 21, 73, 45, 7, 74, 46 ],
+ [ 1, 53, 23, 37, 54, 24 ],
+ [ 19, 45, 15, 26, 46, 16 ],
// 30
- array( 5, 145, 115, 10, 146, 116 ),
- array( 19, 75, 47, 10, 76, 48 ),
- array( 15, 54, 24, 25, 55, 25 ),
- array( 23, 45, 15, 25, 46, 16 ),
+ [ 5, 145, 115, 10, 146, 116 ],
+ [ 19, 75, 47, 10, 76, 48 ],
+ [ 15, 54, 24, 25, 55, 25 ],
+ [ 23, 45, 15, 25, 46, 16 ],
// 31
- array( 13, 145, 115, 3, 146, 116 ),
- array( 2, 74, 46, 29, 75, 47 ),
- array( 42, 54, 24, 1, 55, 25 ),
- array( 23, 45, 15, 28, 46, 16 ),
+ [ 13, 145, 115, 3, 146, 116 ],
+ [ 2, 74, 46, 29, 75, 47 ],
+ [ 42, 54, 24, 1, 55, 25 ],
+ [ 23, 45, 15, 28, 46, 16 ],
// 32
- array( 17, 145, 115 ),
- array( 10, 74, 46, 23, 75, 47 ),
- array( 10, 54, 24, 35, 55, 25 ),
- array( 19, 45, 15, 35, 46, 16 ),
+ [ 17, 145, 115 ],
+ [ 10, 74, 46, 23, 75, 47 ],
+ [ 10, 54, 24, 35, 55, 25 ],
+ [ 19, 45, 15, 35, 46, 16 ],
// 33
- array( 17, 145, 115, 1, 146, 116 ),
- array( 14, 74, 46, 21, 75, 47 ),
- array( 29, 54, 24, 19, 55, 25 ),
- array( 11, 45, 15, 46, 46, 16 ),
+ [ 17, 145, 115, 1, 146, 116 ],
+ [ 14, 74, 46, 21, 75, 47 ],
+ [ 29, 54, 24, 19, 55, 25 ],
+ [ 11, 45, 15, 46, 46, 16 ],
// 34
- array( 13, 145, 115, 6, 146, 116 ),
- array( 14, 74, 46, 23, 75, 47 ),
- array( 44, 54, 24, 7, 55, 25 ),
- array( 59, 46, 16, 1, 47, 17 ),
+ [ 13, 145, 115, 6, 146, 116 ],
+ [ 14, 74, 46, 23, 75, 47 ],
+ [ 44, 54, 24, 7, 55, 25 ],
+ [ 59, 46, 16, 1, 47, 17 ],
// 35
- array( 12, 151, 121, 7, 152, 122 ),
- array( 12, 75, 47, 26, 76, 48 ),
- array( 39, 54, 24, 14, 55, 25 ),
- array( 22, 45, 15, 41, 46, 16 ),
+ [ 12, 151, 121, 7, 152, 122 ],
+ [ 12, 75, 47, 26, 76, 48 ],
+ [ 39, 54, 24, 14, 55, 25 ],
+ [ 22, 45, 15, 41, 46, 16 ],
// 36
- array( 6, 151, 121, 14, 152, 122 ),
- array( 6, 75, 47, 34, 76, 48 ),
- array( 46, 54, 24, 10, 55, 25 ),
- array( 2, 45, 15, 64, 46, 16 ),
+ [ 6, 151, 121, 14, 152, 122 ],
+ [ 6, 75, 47, 34, 76, 48 ],
+ [ 46, 54, 24, 10, 55, 25 ],
+ [ 2, 45, 15, 64, 46, 16 ],
// 37
- array( 17, 152, 122, 4, 153, 123 ),
- array( 29, 74, 46, 14, 75, 47 ),
- array( 49, 54, 24, 10, 55, 25 ),
- array( 24, 45, 15, 46, 46, 16 ),
+ [ 17, 152, 122, 4, 153, 123 ],
+ [ 29, 74, 46, 14, 75, 47 ],
+ [ 49, 54, 24, 10, 55, 25 ],
+ [ 24, 45, 15, 46, 46, 16 ],
// 38
- array( 4, 152, 122, 18, 153, 123 ),
- array( 13, 74, 46, 32, 75, 47 ),
- array( 48, 54, 24, 14, 55, 25 ),
- array( 42, 45, 15, 32, 46, 16 ),
+ [ 4, 152, 122, 18, 153, 123 ],
+ [ 13, 74, 46, 32, 75, 47 ],
+ [ 48, 54, 24, 14, 55, 25 ],
+ [ 42, 45, 15, 32, 46, 16 ],
// 39
- array( 20, 147, 117, 4, 148, 118 ),
- array( 40, 75, 47, 7, 76, 48 ),
- array( 43, 54, 24, 22, 55, 25 ),
- array( 10, 45, 15, 67, 46, 16 ),
+ [ 20, 147, 117, 4, 148, 118 ],
+ [ 40, 75, 47, 7, 76, 48 ],
+ [ 43, 54, 24, 22, 55, 25 ],
+ [ 10, 45, 15, 67, 46, 16 ],
// 40
- array( 19, 148, 118, 6, 149, 119 ),
- array( 18, 75, 47, 31, 76, 48 ),
- array( 34, 54, 24, 34, 55, 25 ),
- array( 20, 45, 15, 61, 46, 16 ),
+ [ 19, 148, 118, 6, 149, 119 ],
+ [ 18, 75, 47, 31, 76, 48 ],
+ [ 34, 54, 24, 34, 55, 25 ],
+ [ 20, 45, 15, 61, 46, 16 ],
- );
+ ];
- function __construct( $totalCount, $dataCount ) {
+ public function __construct( $totalCount, $dataCount ) {
$this->totalCount = $totalCount;
$this->dataCount = $dataCount;
}
- function getDataCount() {
+ public function getDataCount() {
return $this->dataCount;
}
- function getTotalCount() {
+ public function getTotalCount() {
return $this->totalCount;
}
- static function getRSBlocks( $typeNumber, $errorCorrectLevel ) {
+ public static function getRSBlocks( $typeNumber, $errorCorrectLevel ) {
$rsBlock = self::getRsBlockTable( $typeNumber, $errorCorrectLevel );
$length = count( $rsBlock ) / 3;
- $list = array();
+ $list = [];
for ( $i = 0; $i < $length; $i++ ) {
@@ -1258,7 +1258,7 @@ static function getRSBlocks( $typeNumber, $errorCorrectLevel ) {
return $list;
}
- static function getRsBlockTable( $typeNumber, $errorCorrectLevel ) {
+ public static function getRsBlockTable( $typeNumber, $errorCorrectLevel ) {
switch ( $errorCorrectLevel ) {
case QR_ERROR_CORRECT_LEVEL_L:
@@ -1281,11 +1281,11 @@ static function getRsBlockTable( $typeNumber, $errorCorrectLevel ) {
class QRNumber extends QRData {
- function __construct( $data ) {
+ public function __construct( $data ) {
parent::__construct( QR_MODE_NUMBER, $data );
}
- function write( &$buffer ) {
+ public function write( &$buffer ) {
$data = $this->getData();
@@ -1309,7 +1309,7 @@ function write( &$buffer ) {
}
}
- static function parseInt( $s ) {
+ public static function parseInt( $s ) {
$num = 0;
for ( $i = 0; $i < strlen( $s ); $i++ ) {
@@ -1318,7 +1318,7 @@ static function parseInt( $s ) {
return $num;
}
- static function parseIntAt( $c ) {
+ public static function parseIntAt( $c ) {
if ( QRUtil::toCharCode( '0' ) <= $c && $c <= QRUtil::toCharCode( '9' ) ) {
return $c - QRUtil::toCharCode( '0' );
@@ -1334,11 +1334,11 @@ static function parseIntAt( $c ) {
class QRKanji extends QRData {
- function __construct( $data ) {
+ public function __construct( $data ) {
parent::__construct( QR_MODE_KANJI, $data );
}
- function write( &$buffer ) {
+ public function write( &$buffer ) {
$data = $this->getData();
@@ -1368,7 +1368,7 @@ function write( &$buffer ) {
}
}
- function getLength() {
+ public function getLength() {
return floor( strlen( $this->getData() ) / 2 );
}
}
@@ -1379,20 +1379,20 @@ function getLength() {
class QRAlphaNum extends QRData {
- function __construct( $data ) {
+ public function __construct( $data ) {
parent::__construct( QR_MODE_ALPHA_NUM, $data );
}
- function write( &$buffer ) {
+ public function write( &$buffer ) {
$i = 0;
$c = $this->getData();
while ( $i + 1 < strlen( $c ) ) {
$buffer->put(
- self::getCode( ord( $c[ $i ] ) ) * 45
+ self::getCode( ord( $c[ $i ] ) ) * 45
+ self::getCode( ord( $c[ $i + 1 ] ) ),
- 11
+ 11
);
$i += 2;
}
@@ -1402,7 +1402,7 @@ function write( &$buffer ) {
}
}
- static function getCode( $c ) {
+ public static function getCode( $c ) {
if ( QRUtil::toCharCode( '0' ) <= $c
&& $c <= QRUtil::toCharCode( '9' ) ) {
@@ -1443,11 +1443,11 @@ static function getCode( $c ) {
class QR8BitByte extends QRData {
- function __construct( $data ) {
+ public function __construct( $data ) {
parent::__construct( QR_MODE_8BIT_BYTE, $data );
}
- function write( &$buffer ) {
+ public function write( &$buffer ) {
$data = $this->getData();
for ( $i = 0; $i < strlen( $data ); $i++ ) {
@@ -1463,36 +1463,36 @@ function write( &$buffer ) {
abstract class QRData {
- var $mode;
+ public $mode;
- var $data;
+ public $data;
- function __construct( $mode, $data ) {
+ public function __construct( $mode, $data ) {
$this->mode = $mode;
$this->data = $data;
}
- function getMode() {
+ public function getMode() {
return $this->mode;
}
- function getData() {
+ public function getData() {
return $this->data;
}
/**
* @return int
*/
- function getLength() {
+ public function getLength() {
return strlen( $this->getData() );
}
/**
* @param \QRBitBuffer $buffer
*/
- abstract function write( &$buffer);
+ abstract public function write( &$buffer);
- function getLengthInBits( $type ) {
+ public function getLengthInBits( $type ) {
if ( 1 <= $type && $type < 10 ) {
@@ -1555,10 +1555,10 @@ function getLengthInBits( $type ) {
class QRMath {
- static $QR_MATH_EXP_TABLE = null;
- static $QR_MATH_LOG_TABLE = null;
+ public static $QR_MATH_EXP_TABLE = null;
+ public static $QR_MATH_LOG_TABLE = null;
- static function init() {
+ public static function init() {
self::$QR_MATH_EXP_TABLE = self::createNumArray( 256 );
@@ -1580,15 +1580,15 @@ static function init() {
}
}
- static function createNumArray( $length ) {
- $num_array = array();
+ public static function createNumArray( $length ) {
+ $num_array = [];
for ( $i = 0; $i < $length; $i++ ) {
$num_array[] = 0;
}
return $num_array;
}
- static function glog( $n ) {
+ public static function glog( $n ) {
if ( $n < 1 ) {
trigger_error( "log($n)", E_USER_ERROR );
@@ -1597,7 +1597,7 @@ static function glog( $n ) {
return self::$QR_MATH_LOG_TABLE[ $n ];
}
- static function gexp( $n ) {
+ public static function gexp( $n ) {
while ( $n < 0 ) {
$n += 255;
@@ -1620,9 +1620,9 @@ static function gexp( $n ) {
class QRPolynomial {
- var $num;
+ public $num;
- function __construct( $num, $shift = 0 ) {
+ public function __construct( $num, $shift = 0 ) {
$offset = 0;
@@ -1636,20 +1636,20 @@ function __construct( $num, $shift = 0 ) {
}
}
- function get( $index ) {
+ public function get( $index ) {
return $this->num[ $index ];
}
- function getLength() {
+ public function getLength() {
return count( $this->num );
}
// PHP5
- function __toString() {
+ public function __toString() {
return $this->toString();
}
- function toString() {
+ public function toString() {
$buffer = '';
@@ -1663,7 +1663,7 @@ function toString() {
return $buffer;
}
- function toLogString() {
+ public function toLogString() {
$buffer = '';
@@ -1682,7 +1682,7 @@ function toLogString() {
*
* @return \QRPolynomial
*/
- function multiply( $e ) {
+ public function multiply( $e ) {
$num = QRMath::createNumArray( $this->getLength() + $e->getLength() - 1 );
@@ -1702,7 +1702,7 @@ function multiply( $e ) {
*
* @return $this|\QRPolynomial
*/
- function mod( $e ) {
+ public function mod( $e ) {
if ( $this->getLength() - $e->getLength() < 0 ) {
return $this;
@@ -1765,23 +1765,23 @@ function mod( $e ) {
class QRBitBuffer {
- var $buffer;
- var $length;
+ public $buffer;
+ public $length;
- function __construct() {
- $this->buffer = array();
+ public function __construct() {
+ $this->buffer = [];
$this->length = 0;
}
- function getBuffer() {
+ public function getBuffer() {
return $this->buffer;
}
- function getLengthInBits() {
+ public function getLengthInBits() {
return $this->length;
}
- function __toString() {
+ public function __toString() {
$buffer = '';
for ( $i = 0; $i < $this->getLengthInBits(); $i++ ) {
$buffer .= $this->get( $i ) ? '1' : '0';
@@ -1789,19 +1789,19 @@ function __toString() {
return $buffer;
}
- function get( $index ) {
+ public function get( $index ) {
$bufIndex = (int) floor( $index / 8 );
return ( ( $this->buffer[ $bufIndex ] >> ( 7 - $index % 8 ) ) & 1 ) == 1;
}
- function put( $num, $length ) {
+ public function put( $num, $length ) {
for ( $i = 0; $i < $length; $i++ ) {
$this->putBit( ( ( $num >> ( $length - $i - 1 ) ) & 1 ) == 1 );
}
}
- function putBit( $bit ) {
+ public function putBit( $bit ) {
$bufIndex = (int) floor( $this->length / 8 );
if ( count( $this->buffer ) <= $bufIndex ) {
diff --git a/cli_mail.php b/cli_mail.php
index 8ef67d87..e67a5875 100644
--- a/cli_mail.php
+++ b/cli_mail.php
@@ -92,7 +92,7 @@ function mailRead( $iKlimit = '' ) {
return $sEmail;
}
-$arguments = getopt( 'hd:f:', array( 'fast', 'allowed_senders:', 'extra_allowed_senders:', 'groupid:' ) );
+$arguments = getopt( 'hd:f:', [ 'fast', 'allowed_senders:', 'extra_allowed_senders:', 'groupid:' ] );
if ( ( ! isset( $arguments['groupid'] ) && ! isset( $arguments['d'] ) ) || isset( $arguments['h'] ) ) {
help( $argv[0] );
}
@@ -140,7 +140,7 @@ function mailRead( $iKlimit = '' ) {
$on_behalf_of = '(' . sprintf(
/* translators: %s: original email sender name */
__( 'on behalf of %s', 'events-made-easy' ),
- $on_behalf_of
+ $on_behalf_of
) . ')';
}
}
@@ -170,7 +170,7 @@ function mailRead( $iKlimit = '' ) {
exit();
}
-$emails = array();
+$emails = [];
foreach ( $names_emails as $entry ) {
$emails[] = $entry['email'];
}
@@ -207,10 +207,10 @@ function mailRead( $iKlimit = '' ) {
// now create the mailing
$mailing_name = "Forwarding mail from $from_email to $replyto_email to group " . $group['name'];
-$conditions = array(
+$conditions = [
'eme_genericmail_send_peoplegroups' => $group['group_id'],
'action' => 'genericmail',
-);
+];
if ( get_option( 'eme_mail_force_from' ) ) {
// by setting the from address to the forced address, we avoid the sender name from being changed in eme_queue_mail later on (which is needed in this case, to keep the "on behalf of"
diff --git a/eme-actions.php b/eme-actions.php
index 14e9c153..8119d6a6 100644
--- a/eme-actions.php
+++ b/eme-actions.php
@@ -151,7 +151,7 @@ function eme_actions_early_init() {
}
} else {
header( 'Content-type: application/json; charset=utf-8' );
- echo wp_json_encode( array() );
+ echo wp_json_encode( [] );
}
exit;
}
@@ -317,21 +317,21 @@ function eme_add_events_locations_link_search( $results, $query ) {
}
$events = eme_search_events( $query['s'] );
foreach ( $events as $event ) {
- $results[] = array(
+ $results[] = [
'ID' => $event['event_id'],
'title' => trim( eme_esc_html( strip_tags( $event['event_name'] ) . ' (' . eme_localized_datetime( $event['event_start'], $eme_timezone ) . ')' ) ),
'permalink' => eme_event_url( $event ),
'info' => __( 'Event', 'events-made-easy' ),
- );
+ ];
}
$locations = eme_search_locations( $query['s'] );
foreach ( $locations as $location ) {
- $results[] = array(
+ $results[] = [
'ID' => $location['location_id'],
'title' => trim( eme_esc_html( strip_tags( $location['location_name'] ) ) ),
'permalink' => eme_location_url( $location ),
'info' => __( 'Location', 'events-made-easy' ),
- );
+ ];
}
return $results;
}
@@ -363,28 +363,28 @@ function eme_admin_register_scripts() {
$locale_file = $eme_plugin_dir . "js/jquery-select2/select2-4.1.0-rc.0/dist/js/i18n/$language.js";
$locale_file_url = $eme_plugin_url . "js/jquery-select2/select2-4.1.0-rc.0/dist/js/i18n/$language.js";
if ( file_exists( $locale_file ) ) {
- wp_register_script( 'eme-select2-locale', $locale_file_url, array( 'eme-select2' ), EME_VERSION );
+ wp_register_script( 'eme-select2-locale', $locale_file_url, [ 'eme-select2' ], EME_VERSION );
}
}
# wp_register_script( 'eme-jquery-datatables', $eme_plugin_url."js/jquery-datatables-1.10.20/datatables.min.js",array( 'jquery' ),EME_VERSION);
- wp_register_script( 'eme-print', $eme_plugin_url . 'js/jquery.printelement.js', array( 'jquery' ), EME_VERSION );
- wp_register_script( 'eme-jquery-validate', $eme_plugin_url . 'js/jquery-validate-1.19.3/jquery.validate.min.js', array( 'jquery' ), EME_VERSION );
- wp_register_script( 'eme-jquery-jtable', $eme_plugin_url . 'js/jtable-2.5.0/jquery.jtable.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-dialog' ), EME_VERSION );
- wp_register_script( 'eme-jtable-storage', $eme_plugin_url . 'js/jtable-2.5.0/extensions/jquery.jtable.localstorage.js', array( 'eme-jquery-jtable' ), EME_VERSION );
- wp_register_script( 'eme-jtable-search', $eme_plugin_url . 'js/jtable-2.5.0/extensions/jquery.jtable.toolbarsearch.js', array( 'eme-jquery-jtable', 'eme-jtable-storage' ), EME_VERSION );
+ wp_register_script( 'eme-print', $eme_plugin_url . 'js/jquery.printelement.js', [ 'jquery' ], EME_VERSION );
+ wp_register_script( 'eme-jquery-validate', $eme_plugin_url . 'js/jquery-validate-1.19.3/jquery.validate.min.js', [ 'jquery' ], EME_VERSION );
+ wp_register_script( 'eme-jquery-jtable', $eme_plugin_url . 'js/jtable-2.5.0/jquery.jtable.js', [ 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-dialog' ], EME_VERSION );
+ wp_register_script( 'eme-jtable-storage', $eme_plugin_url . 'js/jtable-2.5.0/extensions/jquery.jtable.localstorage.js', [ 'eme-jquery-jtable' ], EME_VERSION );
+ wp_register_script( 'eme-jtable-search', $eme_plugin_url . 'js/jtable-2.5.0/extensions/jquery.jtable.toolbarsearch.js', [ 'eme-jquery-jtable', 'eme-jtable-storage' ], EME_VERSION );
if ( wp_script_is( 'eme-select2-locale', 'registered' ) ) {
- wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', array( 'jquery', 'eme-select2', 'eme-select2-locale' ), EME_VERSION );
+ wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', [ 'jquery', 'eme-select2', 'eme-select2-locale' ], EME_VERSION );
} else {
- wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', array( 'jquery', 'eme-select2' ), EME_VERSION );
+ wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', [ 'jquery', 'eme-select2' ], EME_VERSION );
}
- wp_register_script( 'eme-admin', $eme_plugin_url . 'js/eme_admin.js', array( 'jquery', 'eme-jquery-jtable', 'eme-jtable-storage', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-tabs', 'jquery-ui-sortable', 'eme-jquery-validate', 'eme-print' ), EME_VERSION );
+ wp_register_script( 'eme-admin', $eme_plugin_url . 'js/eme_admin.js', [ 'jquery', 'eme-jquery-jtable', 'eme-jtable-storage', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-tabs', 'jquery-ui-sortable', 'eme-jquery-validate', 'eme-print' ], EME_VERSION );
wp_register_style( 'eme-leaflet-css', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.css', EME_VERSION );
- wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', array( 'jquery' ), EME_VERSION, true );
- wp_register_script( 'eme-admin-maps', $eme_plugin_url . 'js/eme_admin_maps.js', array( 'jquery', 'eme-leaflet-maps' ), EME_VERSION, true );
- wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', array( 'jquery-ui-autocomplete' ), EME_VERSION );
- wp_register_script( 'eme-options', $eme_plugin_url . 'js/eme_admin_options.js', array( 'jquery' ), EME_VERSION );
- wp_register_script( 'eme-formfields', $eme_plugin_url . 'js/eme_admin_fields.js', array( 'jquery' ), EME_VERSION );
+ wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', [ 'jquery' ], EME_VERSION, true );
+ wp_register_script( 'eme-admin-maps', $eme_plugin_url . 'js/eme_admin_maps.js', [ 'jquery', 'eme-leaflet-maps' ], EME_VERSION, true );
+ wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', [ 'jquery-ui-autocomplete' ], EME_VERSION );
+ wp_register_script( 'eme-options', $eme_plugin_url . 'js/eme_admin_options.js', [ 'jquery' ], EME_VERSION );
+ wp_register_script( 'eme-formfields', $eme_plugin_url . 'js/eme_admin_fields.js', [ 'jquery' ], EME_VERSION );
$locale_code = determine_locale();
$locale_code = preg_replace( '/_/', '-', $locale_code );
@@ -402,9 +402,9 @@ function eme_admin_register_scripts() {
}
}
- wp_register_script( 'eme-rsvp', $eme_plugin_url . 'js/eme_admin_rsvp.js', array( 'eme-autocomplete-form' ), EME_VERSION );
+ wp_register_script( 'eme-rsvp', $eme_plugin_url . 'js/eme_admin_rsvp.js', [ 'eme-autocomplete-form' ], EME_VERSION );
wp_register_script( 'eme-sendmails', $eme_plugin_url . 'js/eme_admin_sendmails.js', '', EME_VERSION );
- wp_register_script( 'eme-discounts', $eme_plugin_url . 'js/eme_admin_discounts.js', array( 'eme-jtable-search' ), EME_VERSION );
+ wp_register_script( 'eme-discounts', $eme_plugin_url . 'js/eme_admin_discounts.js', [ 'eme-jtable-search' ], EME_VERSION );
wp_register_script( 'eme-countries', $eme_plugin_url . 'js/eme_admin_countries.js', '', EME_VERSION );
wp_register_script( 'eme-people', $eme_plugin_url . 'js/eme_admin_people.js', '', EME_VERSION );
wp_register_script( 'eme-templates', $eme_plugin_url . 'js/eme_admin_templates.js', '', EME_VERSION );
@@ -440,7 +440,7 @@ function eme_register_scripts_orig() {
}
eme_enqueue_datetimepicker();
- wp_register_script( 'eme-select2', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/js/select2.min.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
+ wp_register_script( 'eme-select2', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/js/select2.min.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
// we enqueue select2 directly and not as a dependance in eme-basic, so people can dequeue it if wanted
wp_enqueue_script( 'eme-select2' );
// for english, no translation code is needed)
@@ -450,11 +450,11 @@ function eme_register_scripts_orig() {
$locale_file = $eme_plugin_dir . "js/jquery-select2/select2-4.1.0-rc.0/dist//js/i18n/$language.js";
$locale_file_url = $eme_plugin_url . "js/jquery-select2/select2-4.1.0-rc.0/dist//js/i18n/$language.js";
if ( file_exists( $locale_file ) ) {
- wp_enqueue_script( 'eme-select2-locale', $locale_file_url, array( 'eme-select2' ), EME_VERSION, $load_js_in_footer );
+ wp_enqueue_script( 'eme-select2-locale', $locale_file_url, [ 'eme-select2' ], EME_VERSION, $load_js_in_footer );
}
}
- wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
- $translation_array = array(
+ wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
+ $translation_array = [
'translate_plugin_url' => $eme_plugin_url,
'translate_ajax_url' => admin_url( 'admin-ajax.php' ),
'translate_selectstate' => __( 'State', 'events-made-easy' ),
@@ -469,16 +469,16 @@ function eme_register_scripts_orig() {
'translate_flanguage' => $language,
'translate_fdateformat' => $eme_wp_date_format,
'translate_ftimeformat' => $eme_wp_time_format,
- );
+ ];
wp_localize_script( 'eme-basic', 'emebasic', $translation_array );
wp_enqueue_script( 'eme-basic' );
if ( get_option( 'eme_use_client_clock' ) && ! isset( $_COOKIE['eme_client_time'] ) ) {
// client clock should be executed asap, so load it in the header, and no defer
- $translation_array = array(
+ $translation_array = [
'translate_ajax_url' => admin_url( 'admin-ajax.php' ),
- );
- wp_register_script( 'eme-client_clock_submit', $eme_plugin_url . 'js/client-clock.js', array( 'jquery' ), EME_VERSION );
+ ];
+ wp_register_script( 'eme-client_clock_submit', $eme_plugin_url . 'js/client-clock.js', [ 'jquery' ], EME_VERSION );
wp_localize_script( 'eme-client_clock_submit', 'emeclock', $translation_array );
wp_enqueue_script( 'eme-client_clock_submit' );
}
@@ -486,41 +486,41 @@ function eme_register_scripts_orig() {
// the frontend also needs the autocomplete (rsvp form)
$search_tables = get_option( 'eme_autocomplete_sources' );
if ( $search_tables != 'none' && is_user_logged_in() ) {
- wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', array( 'jquery-ui-autocomplete' ), EME_VERSION, $load_js_in_footer );
+ wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', [ 'jquery-ui-autocomplete' ], EME_VERSION, $load_js_in_footer );
}
if ( get_option( 'eme_massmail_popup' ) ) {
wp_enqueue_script( 'jquery-ui-dialog' );
}
- wp_enqueue_style( 'eme-jquery-ui-css', $eme_plugin_url . 'css/jquery-ui-theme-smoothness-1.11.3/jquery-ui.min.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme-jquery-ui-autocomplete', $eme_plugin_url . 'css/jquery.autocomplete.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme-jquery-select2-css', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/css/select2.min.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-ui-css', $eme_plugin_url . 'css/jquery-ui-theme-smoothness-1.11.3/jquery-ui.min.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-ui-autocomplete', $eme_plugin_url . 'css/jquery.autocomplete.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-select2-css', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/css/select2.min.css', [], EME_VERSION );
- wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme_stylesheet', $eme_plugin_url . 'css/eme.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme_stylesheet', $eme_plugin_url . 'css/eme.css', [], EME_VERSION );
$eme_css_name = get_stylesheet_directory() . '/eme.css';
if ( file_exists( $eme_css_name ) ) {
- wp_enqueue_style( 'eme_stylesheet_extra', get_stylesheet_directory_uri() . '/eme.css', 'eme_stylesheet', array(), EME_VERSION );
+ wp_enqueue_style( 'eme_stylesheet_extra', get_stylesheet_directory_uri() . '/eme.css', 'eme_stylesheet', [], EME_VERSION );
}
if ( get_option( 'eme_map_is_active' ) ) {
- wp_enqueue_style( 'eme-leaflet-css', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme-leaflet-css', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.css', [], EME_VERSION );
}
- wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', array( 'jquery' ), EME_VERSION, true );
- wp_register_script( 'eme-leaflet-gestures', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.js', array( 'jquery', 'eme-leaflet-maps' ), EME_VERSION, true );
- wp_register_script( 'eme-leaflet-markercluster', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/leaflet.markercluster.js', array( 'eme-leaflet-maps' ), EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', [ 'jquery' ], EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-gestures', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.js', [ 'jquery', 'eme-leaflet-maps' ], EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-markercluster', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/leaflet.markercluster.js', [ 'eme-leaflet-maps' ], EME_VERSION, true );
wp_register_style( 'eme-markercluster-css1', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/MarkerCluster.css', EME_VERSION, false );
wp_register_style( 'eme-markercluster-css2', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/MarkerCluster.Default.css', EME_VERSION, false );
wp_register_style( 'eme-gestures-css', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.css', EME_VERSION, false );
- wp_register_script( 'eme-location-map', $eme_plugin_url . 'js/eme_location_map.js', array( 'jquery', 'eme-leaflet-maps' ), EME_VERSION, true );
+ wp_register_script( 'eme-location-map', $eme_plugin_url . 'js/eme_location_map.js', [ 'jquery', 'eme-leaflet-maps' ], EME_VERSION, true );
if ( get_option( 'eme_recaptcha_for_forms' ) ) {
// using explicit rendering of the captcha would allow to capture the widget id and reset it if needed, but we won't use that ...
//wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js?onload=eme_CaptchaCallback&render=explicit', array('eme-basic'), '',true);
- wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js', array( 'eme-basic' ), '', true );
+ wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js', [ 'eme-basic' ], '', true );
}
if ( get_option( 'eme_hcaptcha_for_forms' ) ) {
- wp_register_script( 'eme-hcaptcha', 'https://js.hcaptcha.com/1/api.js', array( 'eme-basic' ), '', true );
+ wp_register_script( 'eme-hcaptcha', 'https://js.hcaptcha.com/1/api.js', [ 'eme-basic' ], '', true );
}
}
@@ -535,17 +535,17 @@ function eme_register_scripts() {
}
$language = eme_detect_lang();
- wp_register_script( 'eme-select2', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/js/select2.min.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
+ wp_register_script( 'eme-select2', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/js/select2.min.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
if ( $language != 'en' ) {
$eme_plugin_dir = eme_plugin_dir();
$locale_file = $eme_plugin_dir . "js/jquery-select2/select2-4.1.0-rc.0/dist//js/i18n/$language.js";
$locale_file_url = $eme_plugin_url . "js/jquery-select2/select2-4.1.0-rc.0/dist//js/i18n/$language.js";
if ( file_exists( $locale_file ) ) {
- wp_register_script( 'eme-select2-locale', $locale_file_url, array( 'eme-select2' ), EME_VERSION, $load_js_in_footer );
+ wp_register_script( 'eme-select2-locale', $locale_file_url, [ 'eme-select2' ], EME_VERSION, $load_js_in_footer );
}
}
- wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
- $translation_array = array(
+ wp_register_script( 'eme-basic', $eme_plugin_url . 'js/eme.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
+ $translation_array = [
'translate_plugin_url' => $eme_plugin_url,
'translate_ajax_url' => admin_url( 'admin-ajax.php' ),
'translate_selectstate' => __( 'State', 'events-made-easy' ),
@@ -560,15 +560,15 @@ function eme_register_scripts() {
'translate_flanguage' => $language,
'translate_fdateformat' => $eme_wp_date_format,
'translate_ftimeformat' => $eme_wp_time_format,
- );
+ ];
wp_localize_script( 'eme-basic', 'emebasic', $translation_array );
if ( get_option( 'eme_use_client_clock' ) && ! isset( $_COOKIE['eme_client_time'] ) ) {
// client clock should be executed asap, so load it in the header, and no defer
- $translation_array = array(
+ $translation_array = [
'translate_ajax_url' => admin_url( 'admin-ajax.php' ),
- );
- wp_register_script( 'eme-client_clock_submit', $eme_plugin_url . 'js/client-clock.js', array( 'jquery' ), EME_VERSION );
+ ];
+ wp_register_script( 'eme-client_clock_submit', $eme_plugin_url . 'js/client-clock.js', [ 'jquery' ], EME_VERSION );
wp_localize_script( 'eme-client_clock_submit', 'emeclock', $translation_array );
wp_enqueue_script( 'eme-client_clock_submit' );
}
@@ -576,25 +576,25 @@ function eme_register_scripts() {
// the frontend also needs the autocomplete (rsvp form)
$search_tables = get_option( 'eme_autocomplete_sources' );
if ( $search_tables != 'none' && is_user_logged_in() ) {
- wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', array( 'jquery-ui-autocomplete' ), EME_VERSION, $load_js_in_footer );
+ wp_register_script( 'eme-autocomplete-form', $eme_plugin_url . 'js/eme_autocomplete_form.js', [ 'jquery-ui-autocomplete' ], EME_VERSION, $load_js_in_footer );
}
- wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', array( 'jquery' ), EME_VERSION, true );
- wp_register_script( 'eme-leaflet-gestures', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.js', array( 'jquery', 'eme-leaflet-maps' ), EME_VERSION, true );
- wp_register_script( 'eme-leaflet-markercluster', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/leaflet.markercluster.js', array( 'eme-leaflet-maps' ), EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-maps', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.js', [ 'jquery' ], EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-gestures', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.js', [ 'jquery', 'eme-leaflet-maps' ], EME_VERSION, true );
+ wp_register_script( 'eme-leaflet-markercluster', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/leaflet.markercluster.js', [ 'eme-leaflet-maps' ], EME_VERSION, true );
wp_register_style( 'eme-leaflet-css', $eme_plugin_url . 'js/leaflet-1.8.0/leaflet.css', EME_VERSION, false );
wp_register_style( 'eme-markercluster-css1', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/MarkerCluster.css', EME_VERSION, false );
wp_register_style( 'eme-markercluster-css2', $eme_plugin_url . 'js/leaflet-markercluster-1.4.1/MarkerCluster.Default.css', EME_VERSION, false );
wp_register_style( 'eme-gestures-css', $eme_plugin_url . 'js/leaflet-gesturehandling-1.2.1/leaflet-gesture-handling.min.css', EME_VERSION, false );
- wp_register_script( 'eme-location-map', $eme_plugin_url . 'js/eme_location_map.js', array( 'jquery', 'eme-leaflet-maps' ), EME_VERSION, true );
+ wp_register_script( 'eme-location-map', $eme_plugin_url . 'js/eme_location_map.js', [ 'jquery', 'eme-leaflet-maps' ], EME_VERSION, true );
if ( get_option( 'eme_recaptcha_for_forms' ) ) {
// using explicit rendering of the captcha would allow to capture the widget id and reset it if needed, but we won't use that ...
//wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js?onload=eme_CaptchaCallback&render=explicit', array('eme-basic'), '',true);
- wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js', array( 'eme-basic' ), '', true );
+ wp_register_script( 'eme-recaptcha', 'https://www.google.com/recaptcha/api.js', [ 'eme-basic' ], '', true );
}
if ( get_option( 'eme_hcaptcha_for_forms' ) ) {
- wp_register_script( 'eme-hcaptcha', 'https://js.hcaptcha.com/1/api.js', array( 'eme-basic' ), '', true );
+ wp_register_script( 'eme-hcaptcha', 'https://js.hcaptcha.com/1/api.js', [ 'eme-basic' ], '', true );
}
}
add_action( 'wp_enqueue_scripts', 'eme_register_scripts' );
@@ -615,15 +615,15 @@ function eme_enqueue_frontend() {
if ( get_option( 'eme_massmail_popup' ) ) {
wp_enqueue_script( 'jquery-ui-dialog' );
}
- wp_enqueue_style( 'eme-jquery-ui-css', $eme_plugin_url . 'css/jquery-ui-theme-smoothness-1.11.3/jquery-ui.min.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme-jquery-ui-autocomplete', $eme_plugin_url . 'css/jquery.autocomplete.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme-jquery-select2-css', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/css/select2.min.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-ui-css', $eme_plugin_url . 'css/jquery-ui-theme-smoothness-1.11.3/jquery-ui.min.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-ui-autocomplete', $eme_plugin_url . 'css/jquery.autocomplete.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme-jquery-select2-css', $eme_plugin_url . 'js/jquery-select2/select2-4.1.0-rc.0/dist/css/select2.min.css', [], EME_VERSION );
- wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', array(), EME_VERSION );
- wp_enqueue_style( 'eme_stylesheet', $eme_plugin_url . 'css/eme.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', [], EME_VERSION );
+ wp_enqueue_style( 'eme_stylesheet', $eme_plugin_url . 'css/eme.css', [], EME_VERSION );
$eme_css_name = get_stylesheet_directory() . '/eme.css';
if ( file_exists( $eme_css_name ) ) {
- wp_enqueue_style( 'eme_stylesheet_extra', get_stylesheet_directory_uri() . '/eme.css', 'eme_stylesheet', array(), EME_VERSION );
+ wp_enqueue_style( 'eme_stylesheet_extra', get_stylesheet_directory_uri() . '/eme.css', 'eme_stylesheet', [], EME_VERSION );
}
}
}
@@ -657,7 +657,7 @@ function eme_admin_notices() {
}
// only show the notices to admin users
- $allowed_roles = array( 'administrator' );
+ $allowed_roles = [ 'administrator' ];
if ( array_intersect( $allowed_roles, $current_user->roles ) ) {
$single = true;
$eme_hello_notice_ignore = get_user_meta( $user_id, 'eme_hello_notice_ignore', $single );
@@ -668,7 +668,7 @@ function eme_admin_notices() {
$eme_donate_notice_ignore = 0;
}
if ( ! $eme_hello_notice_ignore && preg_match( '/^eme-/', $plugin_page ) ) { ?>
-
Hey,
%1\$s , welcome to
Events Made Easy ! We hope you like it around here.
Now it's time to insert events lists through widgets , template tags or shortcodes .
By the way, have you taken a look at the Settings page ? That's where you customize the way events and locations are displayed.
What? Tired of seeing this advice? I hear you, click here and you won't see this again!
", 'events-made-easy' ), $current_user->display_name, admin_url( 'widgets.php' ), '//www.e-dynamics.be/wordpress/#template-tags', '//www.e-dynamics.be/wordpress/#shortcodes', admin_url( 'admin.php?page=eme-options' ), add_query_arg( array( 'eme_notice_ignore' => 'hello' ), remove_query_arg( 'eme_notice_ignore' ) ) ); ?>
+ Hey,
%1\$s , welcome to
Events Made Easy ! We hope you like it around here.
Now it's time to insert events lists through widgets , template tags or shortcodes .
By the way, have you taken a look at the Settings page ? That's where you customize the way events and locations are displayed.
What? Tired of seeing this advice? I hear you, click here and you won't see this again!
", 'events-made-easy' ), $current_user->display_name, admin_url( 'widgets.php' ), '//www.e-dynamics.be/wordpress/#template-tags', '//www.e-dynamics.be/wordpress/#shortcodes', admin_url( 'admin.php?page=eme-options' ), add_query_arg( [ 'eme_notice_ignore' => 'hello' ], remove_query_arg( 'eme_notice_ignore' ) ) ); ?>
I already donated.', 'events-made-easy' ), add_query_arg( array( 'eme_notice_ignore' => 'donate' ), remove_query_arg( 'eme_notice_ignore' ) ) );
+ echo sprintf( __( 'I already donated. ', 'events-made-easy' ), add_query_arg( [ 'eme_notice_ignore' => 'donate' ], remove_query_arg( 'eme_notice_ignore' ) ) );
?>
@@ -755,7 +755,7 @@ function eme_del_upload_ajax() {
}
$fname = "$random_id-$field_id-$extra_id-$clean.$clean_ext";
- if ( in_array( $type, array( 'bookings', 'people', 'members' ) ) ) {
+ if ( in_array( $type, [ 'bookings', 'people', 'members' ] ) ) {
eme_delete_uploaded_file( $fname, $id, $type );
}
}
@@ -782,10 +782,10 @@ function eme_enqueue_datetimepicker() {
}
$eme_plugin_dir = eme_plugin_dir();
- wp_enqueue_script( 'eme-jquery-timepicker', $eme_plugin_url . 'js/jquery-timepicker/jquery.timepicker.min.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
- wp_enqueue_style( 'eme-jquery-timepicker', $eme_plugin_url . 'js/jquery-timepicker/jquery.timepicker.min.css', array(), EME_VERSION );
- wp_enqueue_script( 'eme-jquery-fdatepicker', $eme_plugin_url . 'js/fdatepicker/js/fdatepicker.min.js', array( 'jquery' ), EME_VERSION, $load_js_in_footer );
- wp_enqueue_style( 'eme-jquery-fdatepicker', $eme_plugin_url . 'js/fdatepicker/css/fdatepicker.min.css', array(), EME_VERSION );
+ wp_enqueue_script( 'eme-jquery-timepicker', $eme_plugin_url . 'js/jquery-timepicker/jquery.timepicker.min.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
+ wp_enqueue_style( 'eme-jquery-timepicker', $eme_plugin_url . 'js/jquery-timepicker/jquery.timepicker.min.css', [], EME_VERSION );
+ wp_enqueue_script( 'eme-jquery-fdatepicker', $eme_plugin_url . 'js/fdatepicker/js/fdatepicker.min.js', [ 'jquery' ], EME_VERSION, $load_js_in_footer );
+ wp_enqueue_style( 'eme-jquery-fdatepicker', $eme_plugin_url . 'js/fdatepicker/css/fdatepicker.min.css', [], EME_VERSION );
// fdatepicker only needs the language (for now)
$language = eme_detect_lang();
// for english, no translation code is needed)
@@ -793,7 +793,7 @@ function eme_enqueue_datetimepicker() {
$locale_file = $eme_plugin_dir . "js/fdatepicker/js/i18n/fdatepicker.$language.js";
$locale_file_url = $eme_plugin_url . "js/fdatepicker/js/i18n/fdatepicker.$language.js";
if ( file_exists( $locale_file ) ) {
- wp_enqueue_script( 'eme-jquery-fdatepick-locale', $locale_file_url, array( 'eme-jquery-fdatepicker' ), EME_VERSION, $load_js_in_footer );
+ wp_enqueue_script( 'eme-jquery-fdatepick-locale', $locale_file_url, [ 'eme-jquery-fdatepicker' ], EME_VERSION, $load_js_in_footer );
}
}
}
diff --git a/eme-attendances.php b/eme-attendances.php
index 0596dcf3..d08f91fb 100644
--- a/eme-attendances.php
+++ b/eme-attendances.php
@@ -8,7 +8,7 @@ function eme_db_insert_attendance( $type, $person_id, $attendance_date = '', $re
global $wpdb,$eme_db_prefix;
$table_name = $eme_db_prefix . ATTENDANCES_TBNAME;
- $line = array();
+ $line = [];
$line['type'] = esc_sql( $type );
$line['person_id'] = intval( $person_id );
if ( ! empty( $attendance_date ) && ( eme_is_date( $attendance_date ) || eme_is_datetime( $attendance_date ) ) ) {
@@ -37,14 +37,14 @@ function eme_delete_old_attendances() {
}
$old_date = $eme_date_obj->minusDays( $remove_old_attendances_days )->getDateTime();
- $wpdb->query( $wpdb->prepare("DELETE FROM $table_name WHERE creation_date<%s",$old_date) );
+ $wpdb->query( $wpdb->prepare("DELETE FROM $table_name WHERE creation_date<%s", $old_date) );
}
function eme_delete_attendances( $ids ) {
global $wpdb,$eme_db_prefix;
$attendances_table = $eme_db_prefix . ATTENDANCES_TBNAME;
if (eme_is_list_of_int($ids) ) {
- $ids_arr = explode(',',$ids);
+ $ids_arr = explode(',', $ids);
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
$sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE id IN ( $commaDelimitedPlaceholders )", $ids_arr);
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
@@ -55,7 +55,7 @@ function eme_delete_person_attendances( $ids ) {
global $wpdb,$eme_db_prefix;
$attendances_table = $eme_db_prefix . ATTENDANCES_TBNAME;
if (eme_is_list_of_int($ids) ) {
- $ids_arr = explode(',',$ids);
+ $ids_arr = explode(',', $ids);
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
$sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE person_id IN ( $commaDelimitedPlaceholders )", $ids_arr);
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
@@ -65,14 +65,14 @@ function eme_delete_person_attendances( $ids ) {
function eme_delete_event_attendances( $event_id ) {
global $wpdb,$eme_db_prefix;
$attendances_table = $eme_db_prefix . ATTENDANCES_TBNAME;
- $sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE type='event' AND related_id=%d",$event_id);
+ $sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE type='event' AND related_id=%d", $event_id);
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
function eme_delete_membership_attendances( $membership_id ) {
global $wpdb,$eme_db_prefix;
$attendances_table = $eme_db_prefix . ATTENDANCES_TBNAME;
- $sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE type='membership' AND related_id=%d",$membership_id);
+ $sql = $wpdb->prepare( "DELETE FROM $attendances_table WHERE type='membership' AND related_id=%d", $membership_id);
$wpdb->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}
@@ -81,7 +81,7 @@ function eme_attendances_page() {
}
function eme_attendance_types() {
- $att_names = array();
+ $att_names = [];
$att_types['any'] = __( 'Any', 'events-made-easy' );
$att_types['event'] = __( 'Events', 'events-made-easy' );
$att_types['membership'] = __( 'Memberships', 'events-made-easy' );
@@ -162,7 +162,7 @@ function eme_ajax_attendances_list() {
global $wpdb,$eme_db_prefix, $eme_timezone;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$table = $eme_db_prefix . ATTENDANCES_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
$search_type = isset( $_REQUEST['search_type'] ) ? esc_sql( eme_sanitize_request( $_REQUEST['search_type'] ) ) : '';
$search_start_date = isset( $_REQUEST['search_start_date'] ) && eme_is_date( $_REQUEST['search_start_date'] ) ? esc_sql( $_REQUEST['search_start_date'] ) : '';
$search_end_date = isset( $_REQUEST['search_end_date'] ) && eme_is_date( $_REQUEST['search_end_date'] ) ? esc_sql( $_REQUEST['search_end_date'] ) : '';
@@ -170,7 +170,7 @@ function eme_ajax_attendances_list() {
$att_types = eme_attendance_types();
$where = '';
- $where_arr = array();
+ $where_arr = [];
if ( ! empty( $search_start_date ) && ! empty( $search_end_date ) ) {
$where_arr[] = "creation_date >= '$search_start_date'";
$where_arr[] = "creation_date <= '$search_end_date'";
@@ -257,7 +257,7 @@ function eme_ajax_manage_attendances() {
if ( ! current_user_can( get_option( 'eme_cap_list_attendances' ) ) ) {
wp_die();
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( isset( $_REQUEST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_REQUEST['do_action'] );
switch ( $do_action ) {
@@ -271,7 +271,7 @@ function eme_ajax_manage_attendances() {
function eme_ajax_action_attendances_delete( $ids ) {
eme_delete_events( $ids );
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Events deleted', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
diff --git a/eme-attributes.php b/eme-attributes.php
index 00289bbc..708338c4 100644
--- a/eme-attributes.php
+++ b/eme-attributes.php
@@ -5,7 +5,7 @@
}
function eme_attributes_form( $eme_array ) {
- $eme_data = array();
+ $eme_data = [];
if ( isset( $eme_array['event_attributes'] ) ) {
$eme_data = $eme_array['event_attributes'];
} elseif ( isset( $eme_array['location_attributes'] ) ) {
@@ -75,7 +75,7 @@ function eme_attributes_form( $eme_array ) {
//We now have one long string of formats
preg_match_all( '/#(ESC|URL)?_ATT\{.+?\}(\{.+?\})?/', $formats, $placeholders );
- $attributes = array();
+ $attributes = [];
//Now grab all the unique attributes we can use in our event or location.
foreach ( $placeholders[0] as $result ) {
$result = str_replace( '#ESC', '#', $result );
diff --git a/eme-calendar.php b/eme-calendar.php
index dd033089..5ffe07ff 100644
--- a/eme-calendar.php
+++ b/eme-calendar.php
@@ -8,8 +8,8 @@ function eme_get_calendar_shortcode( $atts ) {
global $eme_timezone;
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'category' => 0,
'notcategory' => 0,
'full' => 0,
@@ -26,8 +26,8 @@ function eme_get_calendar_shortcode( $atts ) {
'htmltable' => 1,
'htmldiv' => 0,
'weekdays' => '',
- ),
- $atts
+ ],
+ $atts
)
);
@@ -56,7 +56,7 @@ function eme_get_calendar_shortcode( $atts ) {
$month = 1;
}
- $location_id_arr = array();
+ $location_id_arr = [];
// the filter list overrides the settings
if ( ! $ignore_filter && isset( $_REQUEST['eme_eventAction'] ) && eme_sanitize_request( $_REQUEST['eme_eventAction']) == 'filter' ) {
if ( ! empty( $_REQUEST['eme_scope_filter'] ) ) {
@@ -128,7 +128,7 @@ function eme_get_calendar_shortcode( $atts ) {
function eme_get_calendar( $args = '' ) {
global $wp_locale, $eme_timezone;
- $defaults = array(
+ $defaults = [
'category' => 0,
'notcategory' => 0,
'full' => 0,
@@ -144,7 +144,7 @@ function eme_get_calendar( $args = '' ) {
'htmltable' => 1,
'htmldiv' => 0,
'weekdays' => '',
- );
+ ];
$r = wp_parse_args( $args, $defaults );
extract( $r );
$echo = filter_var( $echo, FILTER_VALIDATE_BOOLEAN );
@@ -154,7 +154,7 @@ function eme_get_calendar( $args = '' ) {
if ( ! empty( $weekdays ) ) {
$weekday_arr = explode( ',', $weekdays );
} else {
- $weekday_arr = array();
+ $weekday_arr = [];
}
// this comes from global WordPress preferences
@@ -173,10 +173,10 @@ function eme_get_calendar( $args = '' ) {
try {
$client_timeinfo = eme_sanitize_request( json_decode( $_COOKIE['eme_client_time'], true ) );
if ( ! is_array( $client_timeinfo ) ) {
- $client_timeinfo = array();
+ $client_timeinfo = [];
}
} catch ( Exception $error ) {
- $client_timeinfo = array();
+ $client_timeinfo = [];
}
// avoid php warnings
if ( ! isset( $client_timeinfo['eme_client_unixtime'] ) ) {
@@ -203,11 +203,11 @@ function eme_get_calendar( $args = '' ) {
$iNowYear = 0;
}
if ( empty( $iNowDay ) || empty( $iNowMonth ) || empty( $iNowYear ) ) {
- list($iNowYear, $iNowMonth, $iNowDay) = explode( '-', $eme_date_obj->getDate() );
+ [$iNowYear, $iNowMonth, $iNowDay] = explode( '-', $eme_date_obj->getDate() );
}
} else {
// Get current year, month and day
- list($iNowYear, $iNowMonth, $iNowDay) = explode( '-', $eme_date_obj->getDate() );
+ [$iNowYear, $iNowMonth, $iNowDay] = explode( '-', $eme_date_obj->getDate() );
}
$iSelectedYear = $year;
@@ -317,7 +317,7 @@ function eme_get_calendar( $args = '' ) {
$calend = "$iNextYear-$iNextMonth-07";
$events = eme_get_events( 0, "$calbegin--$calend", 'ASC', 0, $location_id, $category, $author, $contact_person, 1, $notcategory );
- $eventful_days = array();
+ $eventful_days = [];
if ( $events ) {
// go through the events and slot them into the right d-m index
foreach ( $events as $event ) {
@@ -346,7 +346,7 @@ function eme_get_calendar( $args = '' ) {
if ( isset( $eventful_days[ $event_eventful_date ] ) && is_array( $eventful_days[ $event_eventful_date ] ) ) {
$eventful_days[ $event_eventful_date ][] = $event;
} else {
- $eventful_days[ $event_eventful_date ] = array( $event );
+ $eventful_days[ $event_eventful_date ] = [ $event ];
}
$eme_date_obj_tmp->addOneDay();
}
@@ -356,7 +356,7 @@ function eme_get_calendar( $args = '' ) {
if ( isset( $eventful_days[ $event_start_date ] ) && is_array( $eventful_days[ $event_start_date ] ) ) {
$eventful_days[ $event_start_date ][] = $event;
} else {
- $eventful_days[ $event_start_date ] = array( $event );
+ $eventful_days[ $event_start_date ] = [ $event ];
}
}
}
@@ -371,9 +371,9 @@ function eme_get_calendar( $args = '' ) {
$event_title_format = get_option( 'eme_small_calendar_event_title_format' );
$event_title_separator_format = get_option( 'eme_small_calendar_event_title_separator' );
- $cells = array();
- $holidays = array();
- $holiday_titles = array();
+ $cells = [];
+ $holidays = [];
+ $holiday_titles = [];
if ( $holiday_id ) {
$holidays = eme_get_holiday_listinfo( $holiday_id );
if ( $holidays ) {
@@ -416,7 +416,7 @@ function eme_get_calendar( $args = '' ) {
foreach ( $eventful_days as $day_key => $events ) {
// Set the date into the key
- $events_titles = array();
+ $events_titles = [];
if ( isset( $holiday_titles[ $day_key ] ) ) {
$events_titles[] = $holiday_titles[ $day_key ];
}
@@ -431,23 +431,23 @@ function eme_get_calendar( $args = '' ) {
// Let's add the possible options
// template_id is not being used per event
if ( ! empty( $location_id ) ) {
- $cal_day_link = add_query_arg( array( 'location_id' => $location_id ), $cal_day_link );
+ $cal_day_link = add_query_arg( [ 'location_id' => $location_id ], $cal_day_link );
}
if ( ! empty( $category ) ) {
- $cal_day_link = add_query_arg( array( 'category' => $category ), $cal_day_link );
+ $cal_day_link = add_query_arg( [ 'category' => $category ], $cal_day_link );
}
if ( ! empty( $notcategory ) ) {
- $cal_day_link = add_query_arg( array( 'notcategory' => $notcategory ), $cal_day_link );
+ $cal_day_link = add_query_arg( [ 'notcategory' => $notcategory ], $cal_day_link );
}
// the hash char and everything following it in a GET is not getting through a browser request, so we replace "#_MYSELF" with just "_MYSELF" here
$author = str_replace( '#_MYSELF', '_MYSELF', $author );
$contact_person = str_replace( '#_MYSELF', '_MYSELF', $contact_person );
if ( ! empty( $author ) ) {
- $cal_day_link = add_query_arg( array( 'author' => $author ), $cal_day_link );
+ $cal_day_link = add_query_arg( [ 'author' => $author ], $cal_day_link );
}
if ( ! empty( $contact_person ) ) {
- $cal_day_link = add_query_arg( array( 'contact_person' => $contact_person ), $cal_day_link );
+ $cal_day_link = add_query_arg( [ 'contact_person' => $contact_person ], $cal_day_link );
}
$event_date = explode( '-', $day_key );
@@ -570,8 +570,8 @@ function eme_get_calendar( $args = '' ) {
$sCalDivRows .= "\n";
}
- $weekday_names = array( __( 'Sunday' ), __( 'Monday' ), __( 'Tuesday' ), __( 'Wednesday' ), __( 'Thursday' ), __( 'Friday' ), __( 'Saturday' ) );
- $weekday_header_class = array( 'Sun_header', 'Mon_header', 'Tue_header', 'Wed_header', 'Thu_header', 'Fri_header', 'Sat_header' );
+ $weekday_names = [ __( 'Sunday' ), __( 'Monday' ), __( 'Tuesday' ), __( 'Wednesday' ), __( 'Thursday' ), __( 'Friday' ), __( 'Saturday' ) ];
+ $weekday_header_class = [ 'Sun_header', 'Mon_header', 'Tue_header', 'Wed_header', 'Thu_header', 'Fri_header', 'Sat_header' ];
$sCalTblDayNames = '';
$sCalDivDayNames = '';
// respect the beginning of the week offset
diff --git a/eme-categories.php b/eme-categories.php
index 05ca33ba..d2a6e797 100644
--- a/eme-categories.php
+++ b/eme-categories.php
@@ -5,12 +5,12 @@
}
function eme_new_category() {
- $category = array(
+ $category = [
'category_name' => '',
'category_slug' => '',
'category_prefix' => '',
'description' => '',
- );
+ ];
return $category;
}
@@ -44,7 +44,7 @@ function eme_categories_page() {
check_admin_referer( 'eme_admin', 'eme_admin_nonce' );
if ( $_POST['eme_admin_action'] == 'do_editcategory' ) {
// category update required
- $category = array();
+ $category = [];
$category['category_name'] = eme_sanitize_request( $_POST['category_name'] );
$category['description'] = eme_kses( $_POST['description'] );
if ( ! empty( $_POST['category_prefix'] ) ) {
@@ -56,7 +56,7 @@ function eme_categories_page() {
$category['category_slug'] = eme_permalink_convert_noslash( $category['category_name'] );
}
if ( isset( $_POST['category_id'] ) && intval( $_POST['category_id'] ) > 0 ) {
- $validation_result = $wpdb->update( $categories_table, $category, array( 'category_id' => intval( $_POST['category_id'] ) ) );
+ $validation_result = $wpdb->update( $categories_table, $category, [ 'category_id' => intval( $_POST['category_id'] ) ] );
if ( $validation_result !== false ) {
$message = __( 'Successfully edited the category', 'events-made-easy' );
} else {
@@ -247,7 +247,7 @@ function eme_categories_edit_layout( $message = '' ) {
}
if ( preg_match( '/,/', $categories_prefixes ) ) {
$categories_prefixes = explode( ',', $categories_prefixes );
- $categories_prefixes_arr = array();
+ $categories_prefixes_arr = [];
foreach ( $categories_prefixes as $categories_prefix ) {
$categories_prefixes_arr[ $categories_prefix ] = eme_permalink_convert( $categories_prefix );
}
@@ -286,7 +286,7 @@ function eme_get_cached_categories() {
function eme_get_categories( $eventful = false, $scope = 'future', $extra_conditions = '' ) {
global $wpdb,$eme_db_prefix;
$categories_table = $eme_db_prefix . CATEGORIES_TBNAME;
- $categories = array();
+ $categories = [];
$order_by = ' ORDER BY category_name ASC';
if ( $eventful ) {
$events = eme_get_events( 0, $scope, 'ASC' );
@@ -325,7 +325,7 @@ function eme_get_categories( $eventful = false, $scope = 'future', $extra_condit
function eme_get_categories_filtered( $category_ids, $categories ) {
$cat_id_arr = explode( ',', $category_ids );
- $new_arr = array();
+ $new_arr = [];
foreach ( $categories as $cat ) {
if ( in_array( $cat['category_id'], $cat_id_arr ) ) {
$new_arr[] = $cat;
@@ -395,7 +395,7 @@ function eme_get_category_eventids( $category_id, $future_only = 1 ) {
$extra_condition = "AND event_start > '$today'";
}
$cat_ids = explode( ',', $category_id );
- $event_ids = array();
+ $event_ids = [];
foreach ( $cat_ids as $cat_id ) {
$sql = $wpdb->prepare( "SELECT event_id FROM $events_table WHERE FIND_IN_SET(%d,event_category_ids) $extra_condition ORDER BY event_start ASC, event_name ASC", $cat_id );
if ( empty( $event_ids ) ) {
@@ -452,7 +452,7 @@ function eme_get_location_category_descriptions( $location_id, $extra_conditions
function eme_get_category_ids( $cat_slug ) {
global $wpdb,$eme_db_prefix;
$categories_table = $eme_db_prefix . CATEGORIES_TBNAME;
- $cat_ids = array();
+ $cat_ids = [];
if ( ! empty( $cat_slug ) ) {
$sql = $wpdb->prepare( "SELECT DISTINCT category_id FROM $categories_table WHERE category_slug = %s", $cat_slug );
$cat_ids = $wpdb->get_col( $sql );
@@ -463,16 +463,16 @@ function eme_get_category_ids( $cat_slug ) {
function eme_get_categories_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'event_id' => 0,
'eventful' => false,
'scope' => 'all',
'template_id' => 0,
'template_id_header' => 0,
'template_id_footer' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$eventful = filter_var( $eventful, FILTER_VALIDATE_BOOLEAN );
diff --git a/eme-cleanup.php b/eme-cleanup.php
index be63a2e5..43a85827 100644
--- a/eme-cleanup.php
+++ b/eme-cleanup.php
@@ -156,9 +156,9 @@ function eme_cleanup_events( $eme_number, $eme_period ) {
function eme_cleanup_all_event_related_data( $other_data ) {
global $wpdb,$eme_db_prefix;
- $tables = array( EVENTS_TBNAME, EVENTS_CF_TBNAME, BOOKINGS_TBNAME, LOCATIONS_TBNAME, LOCATIONS_CF_TBNAME, RECURRENCE_TBNAME, ANSWERS_TBNAME, PAYMENTS_TBNAME, PEOPLE_TBNAME, MEMBERS_TBNAME, MEMBERSHIPS_CF_TBNAME, MEMBERSHIPS_TBNAME, ATTENDANCES_TBNAME );
+ $tables = [ EVENTS_TBNAME, EVENTS_CF_TBNAME, BOOKINGS_TBNAME, LOCATIONS_TBNAME, LOCATIONS_CF_TBNAME, RECURRENCE_TBNAME, ANSWERS_TBNAME, PAYMENTS_TBNAME, PEOPLE_TBNAME, MEMBERS_TBNAME, MEMBERSHIPS_CF_TBNAME, MEMBERSHIPS_TBNAME, ATTENDANCES_TBNAME ];
if ( $other_data ) {
- $tables2 = array( CATEGORIES_TBNAME, HOLIDAYS_TBNAME, TEMPLATES_TBNAME, FORMFIELDS_TBNAME, COUNTRIES_TBNAME, STATES_TBNAME );
+ $tables2 = [ CATEGORIES_TBNAME, HOLIDAYS_TBNAME, TEMPLATES_TBNAME, FORMFIELDS_TBNAME, COUNTRIES_TBNAME, STATES_TBNAME ];
$tables = array_merge( $tables, $tables2 );
}
foreach ( $tables as $table ) {
@@ -175,7 +175,7 @@ function eme_cleanup_page() {
if ( $_POST['eme_admin_action'] == 'eme_cleanup_events' && isset( $_POST['eme_number'] ) && isset( $_POST['eme_period'] ) ) {
$eme_number = intval( $_POST['eme_number'] );
$eme_period = eme_sanitize_request( $_POST['eme_period'] );
- if ( ! in_array( $eme_period, array( 'day', 'week', 'month' ) ) ) {
+ if ( ! in_array( $eme_period, [ 'day', 'week', 'month' ] ) ) {
$eme_period = 'month';
}
diff --git a/eme-countries.php b/eme-countries.php
index 07b1b947..0be9e1c3 100644
--- a/eme-countries.php
+++ b/eme-countries.php
@@ -5,22 +5,22 @@
}
function eme_new_country() {
- $country = array(
+ $country = [
'alpha_2' => '',
'alpha_3' => '',
'num_3' => '',
'name' => '',
'lang' => '',
- );
+ ];
return $country;
}
function eme_new_state() {
- $state = array(
+ $state = [
'code' => '',
'name' => '',
'country_id' => 0,
- );
+ ];
return $state;
}
@@ -33,7 +33,7 @@ function eme_countries_page() {
}
$message = '';
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
// handle possible ations
if ( isset( $_POST['eme_admin_action'] ) ) {
@@ -729,7 +729,7 @@ function eme_db_update_country( $id, $line ) {
// we only want the columns that interest us
$keys = array_intersect_key( $line, $country );
$new_line = array_merge( $country, $keys );
- $where = array( 'id' => $id );
+ $where = [ 'id' => $id ];
if ( isset( $new_line['id'] ) ) {
unset( $new_line['id'] );
}
@@ -775,7 +775,7 @@ function eme_db_update_state( $id, $line ) {
// we only want the columns that interest us
$keys = array_intersect_key( $line, $state );
$new_line = array_merge( $state, $keys );
- $where = array( 'id' => $id );
+ $where = [ 'id' => $id ];
if ( isset( $new_line['id'] ) ) {
unset( $new_line['id'] );
}
@@ -844,7 +844,7 @@ function eme_get_state_name( $code, $country_code, $lang = '' ) {
function eme_get_countries_lang() {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . COUNTRIES_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
$sql = "SELECT id, CONCAT (name, ' (', lang, ')') AS name FROM $table";
return $wpdb->get_results( $sql, ARRAY_A );
}
@@ -858,12 +858,12 @@ function eme_ajax_countries_list() {
global $wpdb,$eme_db_prefix;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$table = $eme_db_prefix . COUNTRIES_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
// The toolbar search input
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request($_REQUEST['q']) : '';
$opt = isset( $_REQUEST['opt'] ) ? eme_sanitize_request($_REQUEST['opt']) : '';
$where = '';
- $where_array = array();
+ $where_array = [];
if ( $q ) {
for ( $i = 0; $i < count( $opt ); $i++ ) {
$fld = esc_sql( $opt[ $i ] );
@@ -902,7 +902,7 @@ function eme_ajax_states_list() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$table = $eme_db_prefix . STATES_TBNAME;
$countries_table = $eme_db_prefix . COUNTRIES_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
if ( current_user_can( get_option( 'eme_cap_settings' ) ) ) {
$sql = "SELECT COUNT(*) FROM $table";
$recordCount = $wpdb->get_var( $sql );
@@ -981,7 +981,7 @@ function eme_ajax_country_delete() {
function eme_ajax_state_edit() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
- $jTableResult = array();
+ $jTableResult = [];
if ( isset( $_POST['id'] ) ) {
$state = eme_get_state( intval( $_POST['id'] ) );
@@ -1056,13 +1056,13 @@ function eme_select_state_ajax() {
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request( $_REQUEST['q'] ) : '';
$country_code = isset( $_POST['country_code'] ) ? eme_sanitize_request( $_POST['country_code'] ) : '';
// the country code can be empty, in which case eme_get_localized_states will return states if only 1 country exists
- $records = array();
+ $records = [];
$states = eme_get_localized_states( $country_code );
foreach ( $states as $state ) {
if ( ! empty( $q ) && ! stristr( $state['name'], $q ) ) {
continue;
}
- $record = array();
+ $record = [];
$record['id'] = $state['code'];
$record['text'] = $state['name'];
$records[] = $record;
@@ -1079,13 +1079,13 @@ function eme_select_state_ajax() {
function eme_select_country_ajax() {
check_ajax_referer( 'eme_frontend', 'eme_frontend_nonce' );
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request( $_REQUEST['q'] ) : '';
- $records = array();
+ $records = [];
$countries = eme_get_localized_countries();
foreach ( $countries as $country ) {
if ( ! empty( $q ) && ! stristr( $country['name'], $q ) ) {
continue;
}
- $record = array();
+ $record = [];
$record['id'] = $country['alpha_2'];
$record['text'] = $country['name'];
$records[] = $record;
diff --git a/eme-cron.php b/eme-cron.php
index e340c7ed..4954584a 100644
--- a/eme-cron.php
+++ b/eme-cron.php
@@ -6,34 +6,34 @@
function eme_cron_schedules( $schedules ) {
if ( ! isset( $schedules['eme_1min'] ) ) {
- $schedules['eme_1min'] = array(
+ $schedules['eme_1min'] = [
'interval' => 60,
'display' => __( 'Once every minute (EME schedule)', 'events-made-easy' ),
- );
+ ];
}
if ( ! isset( $schedules['eme_5min'] ) ) {
- $schedules['eme_5min'] = array(
+ $schedules['eme_5min'] = [
'interval' => 5 * 60,
'display' => __( 'Once every 5 minutes (EME schedule)', 'events-made-easy' ),
- );
+ ];
}
if ( ! isset( $schedules['eme_15min'] ) ) {
- $schedules['eme_15min'] = array(
+ $schedules['eme_15min'] = [
'interval' => 15 * 60,
'display' => __( 'Once every 15 minutes (EME schedule)', 'events-made-easy' ),
- );
+ ];
}
if ( ! isset( $schedules['eme_30min'] ) ) {
- $schedules['eme_30min'] = array(
+ $schedules['eme_30min'] = [
'interval' => 30 * 60,
'display' => __( 'Once every 30 minutes (EME schedule)', 'events-made-easy' ),
- );
+ ];
}
if ( ! isset( $schedules['eme_4weeks'] ) ) {
- $schedules['eme_4weeks'] = array(
+ $schedules['eme_4weeks'] = [
'interval' => 60 * 60 * 24 * 28,
'display' => __( 'Once every 4 weeks (EME schedule)', 'events-made-easy' ),
- );
+ ];
}
return $schedules;
}
diff --git a/eme-discounts.php b/eme-discounts.php
index de955785..8e85535c 100644
--- a/eme-discounts.php
+++ b/eme-discounts.php
@@ -5,7 +5,7 @@
}
function eme_new_discount() {
- $discount = array(
+ $discount = [
'name' => '',
'description' => '',
'type' => EME_DISCOUNT_TYPE_FIXED,
@@ -14,23 +14,23 @@ function eme_new_discount() {
'dgroup' => '',
'valid_from' => '',
'valid_to' => '',
- 'properties' => array(),
+ 'properties' => [],
'use_per_seat' => 0,
'strcase' => 1,
'count' => 0,
'maxcount' => 0,
- );
+ ];
$discount['properties'] = eme_init_discount_props( $discount['properties'] );
return $discount;
}
function eme_new_discountgroup() {
- $discountgroup = array(
+ $discountgroup = [
'name' => '',
'description' => '',
'maxdiscounts' => 0,
- );
+ ];
return $discountgroup;
}
@@ -43,10 +43,10 @@ function eme_init_discount_props( $props ) {
$props['wp_role'] = '';
}
if ( ! isset( $props['group_ids'] ) ) {
- $props['group_ids'] = array();
+ $props['group_ids'] = [];
}
if ( ! isset( $props['membership_ids'] ) ) {
- $props['membership_ids'] = array();
+ $props['membership_ids'] = [];
}
return $props;
}
@@ -61,7 +61,7 @@ function eme_discounts_page() {
}
$message = '';
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
// handle possible ations
if ( isset( $_POST['eme_admin_action'] ) ) {
@@ -102,7 +102,7 @@ function eme_discounts_page() {
if ( ! in_array( 'name', $headers ) || ! in_array( 'type', $headers ) || ! in_array( 'coupon', $headers ) || ! in_array( 'value', $headers ) ) {
$message = __( 'Not all required fields present.', 'events-made-easy' );
} else {
- $empty_props = array();
+ $empty_props = [];
$empty_props = eme_init_discount_props( $empty_props );
while ( ( $row = fgetcsv( $handle, 0, $delimiter, $enclosure ) ) !== false ) {
$line = array_combine( $headers, $row );
@@ -111,7 +111,7 @@ function eme_discounts_page() {
if ( preg_match( '/^prop_(.*)$/', $key, $matches ) ) {
$prop = $matches[1];
if ( ! isset( $line['properties'] ) ) {
- $line['properties'] = array();
+ $line['properties'] = [];
}
if ( array_key_exists( $prop, $empty_props ) ) {
$line['properties'][ $prop ] = $value;
@@ -124,7 +124,7 @@ function eme_discounts_page() {
$dgroups = $line['group'];
$dgroup_arr = explode( ',', $dgroups );
if ( ! eme_array_integers( $dgroup_arr ) ) {
- $selected_dgroup_arr = array();
+ $selected_dgroup_arr = [];
foreach ( $dgroup_arr as $dgroup_name ) {
$dgroup = eme_get_discountgroup_by_name( $dgroup_name );
// take the case where the group no longer exists into account
@@ -550,7 +550,7 @@ function eme_booking_discount( $event, $booking ) {
if ( ! empty( $booking['discountids'] ) ) {
$applied_discountids = explode( ',', $booking['discountids'] );
} else {
- $applied_discountids = array();
+ $applied_discountids = [];
}
if ( eme_is_admin_request() ) {
@@ -558,9 +558,9 @@ function eme_booking_discount( $event, $booking ) {
$total_discount = sprintf( '%01.2f', $_POST['DISCOUNT'] );
// if there's an amount entered and it is different than what was calculated before, we clear the discount id references
if ( $total_discount != $booking['discount'] ) {
- $applied_discountids = array();
+ $applied_discountids = [];
$discountgroup_id = 0;
- $booking['dcodes_used'] = array();
+ $booking['dcodes_used'] = [];
}
}
} elseif ( ! empty( $event['event_properties']['rsvp_discountgroup'] ) ) {
@@ -578,7 +578,7 @@ function eme_booking_discount( $event, $booking ) {
$group_count = 0;
$max_discounts = $discount_group['maxdiscounts'];
- $booking['dcodes_used'] = array();
+ $booking['dcodes_used'] = [];
foreach ( $discount_ids as $id ) {
// a discount can only be applied once
if ( in_array( $id, $applied_discountids ) ) {
@@ -621,18 +621,18 @@ function eme_booking_discount( $event, $booking ) {
if ( ! empty( $calc_result[1] ) ) {
$booking['dcodes_used'] = $calc_result[1];
} else {
- $booking['dcodes_used'] = array();
+ $booking['dcodes_used'] = [];
}
}
}
$discountids = join( ',', array_unique( $applied_discountids ) );
- return array(
+ return [
'discount' => $total_discount,
'discountids' => $discountids,
'dgroupid' => $discountgroup_id,
'dcodes_used' => $booking['dcodes_used'],
- );
+ ];
}
function eme_member_discount( $membership, $member ) {
@@ -644,7 +644,7 @@ function eme_member_discount( $membership, $member ) {
if ( ! empty( $member['discountids'] ) ) {
$applied_discountids = explode( ',', $member['discountids'] );
} else {
- $applied_discountids = array();
+ $applied_discountids = [];
}
if ( eme_is_admin_request() ) {
@@ -652,9 +652,9 @@ function eme_member_discount( $membership, $member ) {
$total_discount = sprintf( '%01.2f', $_POST['DISCOUNT'] );
// if there's an amount entered and it is different than what was calculated before, we clear the discount id references
if ( $total_discount != $member['discount'] ) {
- $applied_discountids = array();
+ $applied_discountids = [];
$discountgroup_id = 0;
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
}
}
} elseif ( ! empty( $membership['properties']['discountgroup'] ) ) {
@@ -672,7 +672,7 @@ function eme_member_discount( $membership, $member ) {
$group_count = 0;
$max_discounts = $discount_group['maxdiscounts'];
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
foreach ( $discount_ids as $id ) {
// a discount can only be applied once
if ( in_array( $id, $applied_discountids ) ) {
@@ -715,18 +715,18 @@ function eme_member_discount( $membership, $member ) {
if ( ! empty( $calc_result[1] ) ) {
$member['dcodes_used'] = $calc_result[1];
} else {
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
}
}
}
$discountids = join( ',', array_unique( $applied_discountids ) );
- return array(
+ return [
'discount' => $total_discount,
'discountids' => $discountids,
'dgroupid' => $discountgroup_id,
'dcodes_used' => $member['dcodes_used'],
- );
+ ];
}
function eme_update_booking_discount( $booking ) {
@@ -739,8 +739,8 @@ function eme_update_booking_discount( $booking ) {
$calc_discount = eme_booking_discount( $event, $booking );
$bookings_table = $eme_db_prefix . BOOKINGS_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['booking_id'] = $booking['booking_id'];
$fields['discount'] = $calc_discount['discount'];
$fields['discountids'] = $calc_discount['discountids'];
@@ -764,8 +764,8 @@ function eme_update_member_discount( $member ) {
$calc_discount = eme_member_discount( $membership, $member );
$members_table = $eme_db_prefix . MEMBERS_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member['member_id'];
$fields['discount'] = $calc_discount['discount'];
$fields['discountids'] = $calc_discount['discountids'];
@@ -785,7 +785,7 @@ function eme_update_member_discount( $member ) {
function eme_discounts_edit_layout( $discount_id = 0, $message = '' ) {
global $plugin_page;
- $selected_dgroup_arr = array();
+ $selected_dgroup_arr = [];
if ( $discount_id ) {
$discount = eme_get_discount( $discount_id );
$selected_dgroup = $discount['dgroup'];
@@ -796,9 +796,9 @@ function eme_discounts_edit_layout( $discount_id = 0, $message = '' ) {
$dgroup = eme_get_discountgroup_by_name( $selected_dgroup );
// take the case where the group no longer exists into account
if ( ! empty( $dgroup ) ) {
- $selected_dgroup_arr = array( $dgroup['id'] );
+ $selected_dgroup_arr = [ $dgroup['id'] ];
} else {
- $selected_dgroup_arr = array();
+ $selected_dgroup_arr = [];
}
}
}
@@ -1072,7 +1072,7 @@ function eme_db_update_discount( $id, $line ) {
if ( ! eme_is_serialized( $new_line['properties'] ) ) {
$new_line['properties'] = eme_serialize( $new_line['properties'] );
}
- $where = array( 'id' => $id );
+ $where = [ 'id' => $id ];
if ( isset( $new_line['id'] ) ) {
unset( $new_line['id'] );
}
@@ -1106,7 +1106,7 @@ function eme_db_update_dgroup( $id, $line ) {
// we only want the columns that interest us
$keys = array_intersect_key( $line, $discountgroup );
$new_line = array_merge( $discountgroup, $keys );
- $where = array( 'id' => $id );
+ $where = [ 'id' => $id ];
if ( isset( $new_line['id'] ) ) {
unset( $new_line['id'] );
}
@@ -1396,7 +1396,7 @@ function eme_calc_booking_discount( $discount, $booking ) {
}
}
}
- return array( $discount_calculated, $dcodes_used );
+ return [ $discount_calculated, $dcodes_used ];
}
function eme_calc_booking_single_discount( $discount, $booking, $coupon = '' ) {
@@ -1524,7 +1524,7 @@ function eme_calc_member_discount( $discount, $member ) {
}
}
}
- return array( $discount_calculated, $dcodes_used );
+ return [ $discount_calculated, $dcodes_used ];
}
function eme_calc_member_single_discount( $discount, $member, $coupon = '' ) {
@@ -1546,12 +1546,12 @@ function eme_calc_member_single_discount( $discount, $member, $coupon = '' ) {
}
function eme_get_discounttypes() {
- $types = array(
+ $types = [
EME_DISCOUNT_TYPE_FIXED => __( 'Fixed', 'events-made-easy' ),
EME_DISCOUNT_TYPE_PCT => __( 'Percentage', 'events-made-easy' ),
EME_DISCOUNT_TYPE_CODE => __( 'Code', 'events-made-easy' ),
EME_DISCOUNT_TYPE_FIXED_PER_SEAT => __( 'Fixed per seat', 'events-made-easy' ),
- );
+ ];
return $types;
}
@@ -1573,12 +1573,12 @@ function eme_ajax_discounts_list() {
global $wpdb,$eme_db_prefix, $eme_timezone;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$table = $eme_db_prefix . DISCOUNTS_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
// The toolbar search input
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request($_REQUEST['q']) : '';
$opt = isset( $_REQUEST['opt'] ) ? eme_sanitize_request($_REQUEST['opt']) : '';
$where = '';
- $where_array = array();
+ $where_array = [];
if ( $q ) {
for ( $i = 0; $i < count( $opt ); $i++ ) {
$fld = esc_sql( $opt[ $i ] );
@@ -1603,7 +1603,7 @@ function eme_ajax_discounts_list() {
$selected_dgroup = $row['dgroup'];
// let's see if the dgroup is an csv of integers, if so: convert to names
$selected_dgroup_arr = explode( ',', $selected_dgroup );
- $res_arr = array();
+ $res_arr = [];
if ( eme_array_integers( $selected_dgroup_arr ) ) {
foreach ( $selected_dgroup_arr as $dgroup_id ) {
$dgroup = eme_get_discountgroup( $dgroup_id );
@@ -1652,12 +1652,12 @@ function eme_ajax_discountgroups_list() {
global $wpdb,$eme_db_prefix;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$table = $eme_db_prefix . DISCOUNTGROUPS_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
// The toolbar search input
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request($_REQUEST['q']) : '';
$opt = isset( $_REQUEST['opt'] ) ? eme_sanitize_request($_REQUEST['opt']) : '';
$where = '';
- $where_array = array();
+ $where_array = [];
if ( $q ) {
for ( $i = 0; $i < count( $opt ); $i++ ) {
$fld = esc_sql( $opt[ $i ] );
@@ -1699,7 +1699,7 @@ function eme_ajax_discounts_select2() {
wp_die();
}
$table = $eme_db_prefix . DISCOUNTS_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
$q = isset( $_REQUEST['q'] ) ? strtolower( eme_sanitize_request( $_REQUEST['q'] ) ) : '';
if ( ! empty( $q ) ) {
$where = "(name LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%')";
@@ -1713,10 +1713,10 @@ function eme_ajax_discounts_select2() {
$recordCount = $wpdb->get_var( $count_sql );
$search = "$where ORDER BY name LIMIT $start,$pagesize";
- $records = array();
+ $records = [];
$discounts = eme_get_discounts( '', $search );
foreach ( $discounts as $discount ) {
- $record = array();
+ $record = [];
$record['id'] = $discount['id'];
// no eme_esc_html here, select2 does it own escaping upon arrival
$record['text'] = $discount['name'];
@@ -1735,7 +1735,7 @@ function eme_ajax_dgroups_select2() {
wp_die();
}
$table = $eme_db_prefix . DISCOUNTGROUPS_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
$q = isset( $_REQUEST['q'] ) ? strtolower( eme_sanitize_request( $_REQUEST['q'] ) ) : '';
if ( ! empty( $q ) ) {
$where = "(name LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%')";
@@ -1749,10 +1749,10 @@ function eme_ajax_dgroups_select2() {
$recordCount = $wpdb->get_var( $count_sql );
$search = "$where ORDER BY name LIMIT $start,$pagesize";
- $records = array();
+ $records = [];
$dgroups = eme_get_dgroups( '', $search );
foreach ( $dgroups as $dgroup ) {
- $record = array();
+ $record = [];
$record['id'] = $dgroup['id'];
// no eme_esc_html here, select2 does it own escaping upon arrival
$record['text'] = $dgroup['name'];
@@ -1769,7 +1769,7 @@ function eme_ajax_manage_discounts() {
if (! current_user_can( get_option( 'eme_cap_discounts' ) ) ) {
wp_die();
}
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
if ( isset( $_REQUEST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_REQUEST['do_action'] );
@@ -1829,7 +1829,7 @@ function eme_ajax_manage_discountgroups() {
if (! current_user_can( get_option( 'eme_cap_discounts' ) ) ) {
wp_die();
}
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
if ( isset( $_REQUEST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_REQUEST['do_action'] );
diff --git a/eme-events.php b/eme-events.php
index 3c24bb10..e5ac4fb9 100644
--- a/eme-events.php
+++ b/eme-events.php
@@ -9,7 +9,7 @@ function eme_new_event() {
$eme_date_obj = new ExpressiveDate( 'now', $eme_timezone );
$today = $eme_date_obj->getDate();
$this_datetime = $eme_date_obj->getDateTime();
- $event = array(
+ $event = [
'event_name' => '',
'event_status' => get_option( 'eme_event_initial_state' ),
'event_start' => $this_datetime,
@@ -28,7 +28,7 @@ function eme_new_event() {
'event_author' => 0,
'event_contactperson_id' => get_option( 'eme_default_contact_person' ),
'event_category_ids' => '',
- 'event_attributes' => array(),
+ 'event_attributes' => [],
'event_page_title_format' => '',
'event_single_event_format' => '',
'event_contactperson_email_body' => '',
@@ -48,13 +48,13 @@ function eme_new_event() {
'event_external_ref' => '',
'event_url' => '',
'recurrence_id' => 0,
- );
+ ];
// while in EME itself event_image_url can't be set when defining an event, it can be set in the frontend submit or a sync plugin
$event['event_properties'] = eme_init_event_props();
return $event;
}
-function eme_init_event_props( $props = array() ) {
+function eme_init_event_props( $props = [] ) {
if ( ! isset( $props['create_wp_user'] ) ) {
$props['create_wp_user'] = 0;
}
@@ -121,7 +121,7 @@ function eme_init_event_props( $props = array() ) {
$props['rsvp_discountgroup'] = '';
}
if ( ! isset( $props['rsvp_addpersontogroup'] ) ) {
- $props['rsvp_addpersontogroup'] = array();
+ $props['rsvp_addpersontogroup'] = [];
}
if ( ! isset( $props['rsvp_password'] ) ) {
$props['rsvp_password'] = '';
@@ -211,24 +211,24 @@ function eme_init_event_props( $props = array() ) {
$props['rsvp_approved_reminder_days'] = get_option( 'eme_rsvp_approved_reminder_days' );
}
- $template_override = array( 'event_page_title_format_tpl', 'event_single_event_format_tpl', 'event_contactperson_email_body_tpl', 'event_registration_recorded_ok_html_tpl', 'event_respondent_email_body_tpl', 'event_registration_pending_email_body_tpl', 'event_registration_userpending_email_body_tpl', 'event_registration_updated_email_body_tpl', 'event_registration_cancelled_email_body_tpl', 'event_registration_trashed_email_body_tpl', 'event_registration_form_format_tpl', 'event_cancel_form_format_tpl', 'event_registration_paid_email_body_tpl', 'event_contactperson_email_subject_tpl', 'event_respondent_email_subject_tpl', 'event_registration_pending_email_subject_tpl', 'event_registration_userpending_email_subject_tpl', 'event_registration_updated_email_subject_tpl', 'event_registration_cancelled_email_subject_tpl', 'event_registration_trashed_email_subject_tpl', 'event_registration_paid_email_subject_tpl', 'contactperson_registration_pending_email_subject_tpl', 'contactperson_registration_pending_email_body_tpl', 'contactperson_registration_cancelled_email_subject_tpl', 'contactperson_registration_cancelled_email_body_tpl', 'contactperson_registration_ipn_email_subject_tpl', 'contactperson_registration_ipn_email_body_tpl', 'contactperson_registration_paid_email_subject_tpl', 'contactperson_registration_paid_email_body_tpl', 'attendance_unauth_scan_tpl', 'attendance_auth_scan_tpl', 'task_signup_email_subject_tpl', 'task_signup_email_body_tpl', 'cp_task_signup_email_subject_tpl', 'cp_task_signup_email_body_tpl', 'task_signup_pending_email_subject_tpl', 'task_signup_pending_email_body_tpl', 'cp_task_signup_pending_email_subject_tpl', 'cp_task_signup_pending_email_body_tpl', 'task_signup_updated_email_subject_tpl', 'task_signup_updated_email_body_tpl', 'task_signup_cancelled_email_subject_tpl', 'task_signup_cancelled_email_body_tpl', 'cp_task_signup_cancelled_email_subject_tpl', 'cp_task_signup_cancelled_email_body_tpl', 'task_signup_trashed_email_subject_tpl', 'task_signup_trashed_email_body_tpl', 'task_signup_form_format_tpl', 'task_signup_recorded_ok_html_tpl', 'task_signup_reminder_email_subject_tpl', 'task_signup_reminder_email_body_tpl', 'event_registration_reminder_email_subject_tpl', 'event_registration_reminder_email_body_tpl', 'event_registration_pending_reminder_email_subject_tpl', 'event_registration_pending_reminder_email_body_tpl' );
+ $template_override = [ 'event_page_title_format_tpl', 'event_single_event_format_tpl', 'event_contactperson_email_body_tpl', 'event_registration_recorded_ok_html_tpl', 'event_respondent_email_body_tpl', 'event_registration_pending_email_body_tpl', 'event_registration_userpending_email_body_tpl', 'event_registration_updated_email_body_tpl', 'event_registration_cancelled_email_body_tpl', 'event_registration_trashed_email_body_tpl', 'event_registration_form_format_tpl', 'event_cancel_form_format_tpl', 'event_registration_paid_email_body_tpl', 'event_contactperson_email_subject_tpl', 'event_respondent_email_subject_tpl', 'event_registration_pending_email_subject_tpl', 'event_registration_userpending_email_subject_tpl', 'event_registration_updated_email_subject_tpl', 'event_registration_cancelled_email_subject_tpl', 'event_registration_trashed_email_subject_tpl', 'event_registration_paid_email_subject_tpl', 'contactperson_registration_pending_email_subject_tpl', 'contactperson_registration_pending_email_body_tpl', 'contactperson_registration_cancelled_email_subject_tpl', 'contactperson_registration_cancelled_email_body_tpl', 'contactperson_registration_ipn_email_subject_tpl', 'contactperson_registration_ipn_email_body_tpl', 'contactperson_registration_paid_email_subject_tpl', 'contactperson_registration_paid_email_body_tpl', 'attendance_unauth_scan_tpl', 'attendance_auth_scan_tpl', 'task_signup_email_subject_tpl', 'task_signup_email_body_tpl', 'cp_task_signup_email_subject_tpl', 'cp_task_signup_email_body_tpl', 'task_signup_pending_email_subject_tpl', 'task_signup_pending_email_body_tpl', 'cp_task_signup_pending_email_subject_tpl', 'cp_task_signup_pending_email_body_tpl', 'task_signup_updated_email_subject_tpl', 'task_signup_updated_email_body_tpl', 'task_signup_cancelled_email_subject_tpl', 'task_signup_cancelled_email_body_tpl', 'cp_task_signup_cancelled_email_subject_tpl', 'cp_task_signup_cancelled_email_body_tpl', 'task_signup_trashed_email_subject_tpl', 'task_signup_trashed_email_body_tpl', 'task_signup_form_format_tpl', 'task_signup_recorded_ok_html_tpl', 'task_signup_reminder_email_subject_tpl', 'task_signup_reminder_email_body_tpl', 'event_registration_reminder_email_subject_tpl', 'event_registration_reminder_email_body_tpl', 'event_registration_pending_reminder_email_subject_tpl', 'event_registration_pending_reminder_email_body_tpl' ];
foreach ( $template_override as $line ) {
if ( ! isset( $props[ $line ] ) ) {
$props[ $line ] = 0;
}
}
- $text_override = array( 'event_contactperson_email_subject', 'event_respondent_email_subject', 'event_registration_pending_email_subject', 'event_registration_userpending_email_subject', 'event_registration_userpending_email_body', 'event_registration_updated_email_subject', 'event_registration_cancelled_email_subject', 'event_registration_paid_email_subject', 'event_registration_trashed_email_subject', 'contactperson_registration_pending_email_body', 'contactperson_registration_cancelled_email_body', 'contactperson_registration_ipn_email_body', 'contactperson_registration_pending_email_subject', 'contactperson_registration_cancelled_email_subject', 'contactperson_registration_ipn_email_subject', 'contactperson_registration_paid_email_subject', 'contactperson_registration_paid_email_body', 'attendance_unauth_scan_format', 'attendance_auth_scan_format', 'event_registration_reminder_email_subject', 'event_registration_reminder_email_body', 'event_registration_pending_reminder_email_subject', 'event_registration_pending_reminder_email_body' );
+ $text_override = [ 'event_contactperson_email_subject', 'event_respondent_email_subject', 'event_registration_pending_email_subject', 'event_registration_userpending_email_subject', 'event_registration_userpending_email_body', 'event_registration_updated_email_subject', 'event_registration_cancelled_email_subject', 'event_registration_paid_email_subject', 'event_registration_trashed_email_subject', 'contactperson_registration_pending_email_body', 'contactperson_registration_cancelled_email_body', 'contactperson_registration_ipn_email_body', 'contactperson_registration_pending_email_subject', 'contactperson_registration_cancelled_email_subject', 'contactperson_registration_ipn_email_subject', 'contactperson_registration_paid_email_subject', 'contactperson_registration_paid_email_body', 'attendance_unauth_scan_format', 'attendance_auth_scan_format', 'event_registration_reminder_email_subject', 'event_registration_reminder_email_body', 'event_registration_pending_reminder_email_subject', 'event_registration_pending_reminder_email_body' ];
foreach ( $text_override as $line ) {
if ( ! isset( $props[ $line ] ) ) {
$props[ $line ] = '';
}
}
// for renamed properties
- $renamed_props = array(
+ $renamed_props = [
'event_registration_denied_email_body_tpl' => 'event_registration_trashed_email_body_tpl',
'event_registration_denied_email_subject_tpl' => 'event_registration_trashed_email_subject_tpl',
'event_registration_denied_email_subject' => 'event_registration_trashed_email_subject',
- );
+ ];
foreach ( $renamed_props as $old_prop => $new_prop ) {
if ( isset( $props[ $old_prop ] ) ) {
$props[ $new_prop ] = $props[ $old_prop ];
@@ -243,7 +243,7 @@ function eme_events_page() {
global $wpdb,$eme_db_prefix, $eme_timezone, $eme_wp_time_format;
$press_back = __( 'Press the back-button in your browser to return to the previous screen and correct your errors', 'events-made-easy' );
- $extra_conditions = array();
+ $extra_conditions = [];
if ( isset( $_POST['eme_admin_action'] ) ) {
$action = eme_sanitize_request( $_POST['eme_admin_action'] );
$event_ID = isset( $_POST['event_id'] ) ? eme_sanitize_request( $_POST['event_id'] ) : 0;
@@ -350,7 +350,7 @@ function eme_events_page() {
}
}
$orig_event = $event;
- $post_vars = array( 'event_name', 'event_seats', 'price', 'rsvp_number_days', 'rsvp_number_hours', 'currency', 'event_author', 'event_contactperson_id', 'event_url', 'event_image_url', 'event_image_id', 'event_prefix', 'event_slug', 'event_page_title_format', 'event_contactperson_email_body', 'event_registration_recorded_ok_html', 'event_respondent_email_body', 'event_registration_pending_email_body', 'event_registration_updated_email_body', 'event_registration_cancelled_email_body', 'event_registration_trashed_email_body', 'event_registration_form_format', 'event_cancel_form_format', 'event_registration_paid_email_body' );
+ $post_vars = [ 'event_name', 'event_seats', 'price', 'rsvp_number_days', 'rsvp_number_hours', 'currency', 'event_author', 'event_contactperson_id', 'event_url', 'event_image_url', 'event_image_id', 'event_prefix', 'event_slug', 'event_page_title_format', 'event_contactperson_email_body', 'event_registration_recorded_ok_html', 'event_respondent_email_body', 'event_registration_pending_email_body', 'event_registration_updated_email_body', 'event_registration_cancelled_email_body', 'event_registration_trashed_email_body', 'event_registration_form_format', 'event_cancel_form_format', 'event_registration_paid_email_body' ];
foreach ( $post_vars as $post_var ) {
if ( isset( $_POST[ $post_var ] ) ) {
$event[ $post_var ] = eme_kses( $_POST[ $post_var ] );
@@ -358,7 +358,7 @@ function eme_events_page() {
}
// now for the select boxes, we need to set to 0 if not in the _POST
- $select_post_vars = array( 'event_tasks', 'event_rsvp', 'registration_requires_approval', 'registration_wp_users_only' );
+ $select_post_vars = [ 'event_tasks', 'event_rsvp', 'registration_requires_approval', 'registration_wp_users_only' ];
foreach ( $select_post_vars as $post_var ) {
if ( isset( $_POST[ $post_var ] ) ) {
$event[ $post_var ] = intval( $_POST[ $post_var ] );
@@ -449,7 +449,7 @@ function eme_events_page() {
$recurrence['holidays_id'] = isset( $_POST['holidays_id'] ) ? intval( $_POST['holidays_id'] ) : 0;
// set the location info
- $post_vars = array( 'location_name', 'location_address1', 'location_address2', 'location_city', 'location_state', 'location_zip', 'location_country', 'location_latitude', 'location_longitude', 'location_url' );
+ $post_vars = [ 'location_name', 'location_address1', 'location_address2', 'location_city', 'location_state', 'location_zip', 'location_country', 'location_latitude', 'location_longitude', 'location_url' ];
foreach ( $post_vars as $post_var ) {
if ( isset( $_POST[ $post_var ] ) ) {
$location[ $post_var ] = eme_sanitize_request( $_POST[ $post_var ] );
@@ -463,7 +463,7 @@ function eme_events_page() {
}
// set the attributes
- $event_attributes = array();
+ $event_attributes = [];
for ( $i = 1; isset( $_POST[ "eme_attr_{$i}_ref" ] ) && trim( $_POST[ "eme_attr_{$i}_ref" ] ) != ''; $i++ ) {
if ( trim( $_POST[ "eme_attr_{$i}_name" ] ) != '' ) {
$event_attributes[ $_POST[ "eme_attr_{$i}_ref" ] ] = eme_kses( $_POST[ "eme_attr_{$i}_name" ] );
@@ -472,9 +472,9 @@ function eme_events_page() {
$event['event_attributes'] = $event_attributes;
// set the properties for both event and location
- $event_properties = array();
+ $event_properties = [];
$event_properties = eme_init_event_props( $event_properties );
- $location_properties = array();
+ $location_properties = [];
$location_properties = eme_init_location_props( $location_properties );
// now for the select boxes, we need to set to 0 if not in the _POST
$payment_gateways = eme_payment_gateways();
@@ -484,7 +484,7 @@ function eme_events_page() {
$event_properties[ 'use_' . $pg ] = 0;
}
}
- $select_event_post_vars = array( 'use_captcha', 'use_recaptcha', 'use_hcaptcha', 'dyndata_all_fields', 'all_day' );
+ $select_event_post_vars = [ 'use_captcha', 'use_recaptcha', 'use_hcaptcha', 'dyndata_all_fields', 'all_day' ];
foreach ( $select_event_post_vars as $post_var ) {
if ( ! isset( $_POST[ 'eme_prop_' . $post_var ] ) ) {
$event_properties[ $post_var ] = 0;
@@ -493,7 +493,7 @@ function eme_events_page() {
if ( $event_properties['use_captcha'] && ! function_exists( 'imagecreatetruecolor' ) ) {
$event_properties['use_captcha'] = 0;
}
- $select_location_post_vars = array( 'online_only' );
+ $select_location_post_vars = [ 'online_only' ];
foreach ( $select_location_post_vars as $post_var ) {
if ( ! isset( $_POST[ 'eme_loc_prop_' . $post_var ] ) ) {
$location_properties[ $post_var ] = 0;
@@ -504,7 +504,7 @@ function eme_events_page() {
if ( preg_match( '/eme_prop_(.+)/', eme_sanitize_request( $key ), $matches ) ) {
$found_key = $matches[1];
if ( $found_key == 'multiprice_desc' ) {
- $event_properties[ $found_key ] = join( '||', eme_sanitize_request( eme_text_split_newlines( $_POST[ $key ] ) ) );
+ $event_properties[ $found_key ] = join( '||', eme_sanitize_request( eme_text_split_newlines( $value ) ) );
} else {
$event_properties[ $found_key ] = eme_kses( $value );
}
@@ -578,7 +578,7 @@ function eme_events_page() {
$count = eme_recurrence_count( $recurrence_id );
$feedback_message = sprintf( __( 'New recurrence inserted containing %d events', 'events-made-easy' ), $count );
if ( $stay_on_edit_page ) {
- $info = array( 'title' => __( 'Edit Recurrence', 'events-made-easy' ) );
+ $info = [ 'title' => __( 'Edit Recurrence', 'events-made-easy' ) ];
$info['feedback'] = $feedback_message;
$event = eme_get_event( eme_get_recurrence_first_eventid( $recurrence_id ) );
if ( ! empty( $event ) ) {
@@ -601,7 +601,7 @@ function eme_events_page() {
}
$feedback_message = __( 'New event successfully inserted!', 'events-made-easy' );
if ( $stay_on_edit_page ) {
- $info = array( 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) );
+ $info = [ 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) ];
$info['feedback'] = $feedback_message;
$event = eme_get_event( $event_id );
if ( ! empty( $event ) ) {
@@ -622,7 +622,7 @@ function eme_events_page() {
if ( $count ) {
$feedback_message = sprintf( __( 'Recurrence updated, contains %d events', 'events-made-easy' ), $count );
if ( $stay_on_edit_page ) {
- $info = array( 'title' => __( 'Edit Recurrence', 'events-made-easy' ) );
+ $info = [ 'title' => __( 'Edit Recurrence', 'events-made-easy' ) ];
$info['feedback'] = $feedback_message;
$event = eme_get_event( eme_get_recurrence_first_eventid( $recurrence_ID ) );
if ( ! empty( $event ) ) {
@@ -649,7 +649,7 @@ function eme_events_page() {
$count = eme_recurrence_count( $recurrence_id );
$feedback_message = sprintf( __( 'New recurrent event inserted containing %d events', 'events-made-easy' ), $count );
if ( $stay_on_edit_page ) {
- $info = array( 'title' => __( 'Edit Recurrence', 'events-made-easy' ) );
+ $info = [ 'title' => __( 'Edit Recurrence', 'events-made-easy' ) ];
$info['feedback'] = $feedback_message;
$event = eme_get_event( eme_get_recurrence_first_eventid( $recurrence_id ) );
if ( ! empty( $event ) ) {
@@ -670,7 +670,7 @@ function eme_events_page() {
}
$feedback_message = sprintf( __( "Updated '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) );
if ( $stay_on_edit_page ) {
- $info = array( 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) );
+ $info = [ 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) ];
$info['feedback'] = $feedback_message;
$event = eme_get_event( $event_ID );
if ( ! empty( $event ) ) {
@@ -700,7 +700,7 @@ function eme_events_page() {
if ( $action == 'add_new_event' ) {
if ( current_user_can( get_option( 'eme_cap_add_event' ) ) ) {
$event = eme_new_event();
- $info = array( 'title' => __( 'Insert New Event', 'events-made-easy' ) );
+ $info = [ 'title' => __( 'Insert New Event', 'events-made-easy' ) ];
eme_event_form( $event, $info );
} else {
$feedback_message = __( 'You have no right to add events!', 'events-made-easy' );
@@ -712,7 +712,7 @@ function eme_events_page() {
if ( $action == 'add_new_recurrence' ) {
if ( current_user_can( get_option( 'eme_cap_add_event' ) ) ) {
$event = eme_new_event();
- $info = array( 'title' => __( 'Insert New Recurrence', 'events-made-easy' ) );
+ $info = [ 'title' => __( 'Insert New Recurrence', 'events-made-easy' ) ];
eme_event_form( $event, $info, 1 );
} else {
$feedback_message = __( 'You have no right to add events!', 'events-made-easy' );
@@ -729,7 +729,7 @@ function eme_events_page() {
} elseif ( current_user_can( get_option( 'eme_cap_edit_events' ) ) ||
( current_user_can( get_option( 'eme_cap_author_event' ) ) && $event['event_author'] == $current_userid ) ) {
// UPDATE event
- $info = array( 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) );
+ $info = [ 'title' => sprintf( __( "Edit Event '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) ) ];
eme_event_form( $event, $info );
} else {
$feedback_message = sprintf( __( "You have no right to update '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) );
@@ -752,7 +752,7 @@ function eme_events_page() {
if ( current_user_can( get_option( 'eme_cap_edit_events' ) ) ||
( current_user_can( get_option( 'eme_cap_author_event' ) ) && $event['event_author'] == $current_userid ) ) {
- $info = array( 'title' => sprintf( __( "Edit event copy '%s'", 'events-made-easy' ), $event['event_name'] ) );
+ $info = [ 'title' => sprintf( __( "Edit event copy '%s'", 'events-made-easy' ), $event['event_name'] ) ];
eme_event_form( $event, $info );
} else {
$feedback_message = sprintf( __( "You have no right to copy '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) );
@@ -773,7 +773,7 @@ function eme_events_page() {
if ( current_user_can( get_option( 'eme_cap_edit_events' ) ) ||
( current_user_can( get_option( 'eme_cap_author_event' ) ) && $event['event_author'] == $current_userid ) ) {
- $info = array( 'title' => sprintf( __( "Edit recurrence copy '%s'", 'events-made-easy' ), $event['event_name'] ) );
+ $info = [ 'title' => sprintf( __( "Edit recurrence copy '%s'", 'events-made-easy' ), $event['event_name'] ) ];
eme_event_form( $event, $info, 1 );
} else {
$feedback_message = sprintf( __( "You have no right to copy '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) );
@@ -791,7 +791,7 @@ function eme_events_page() {
}
if ( current_user_can( get_option( 'eme_cap_edit_events' ) ) ||
( current_user_can( get_option( 'eme_cap_author_event' ) ) && $event['event_author'] == $current_userid ) ) {
- $info = array( 'title' => __( 'Edit Recurrence', 'events-made-easy' ) . " '" . eme_translate( $event['event_name'] ) . "'" );
+ $info = [ 'title' => __( 'Edit Recurrence', 'events-made-easy' ) . " '" . eme_translate( $event['event_name'] ) . "'" ];
eme_event_form( $event, $info, 1 );
} else {
$feedback_message = sprintf( __( "You have no right to update '%s'", 'events-made-easy' ), eme_translate( $event['event_name'] ) );
@@ -818,7 +818,7 @@ function eme_get_all_pages() {
$pages = $wpdb->get_results( $query, ARRAY_A );
// get_pages() is better, but uses way more memory and it might be filtered by eme_filter_get_pages()
//$pages = get_pages();
- $output = array();
+ $output = [];
$output[] = __( 'Please select a page', 'events-made-easy' );
foreach ( $pages as $page ) {
$output[ $page['id'] ] = $page['post_title'];
@@ -846,7 +846,7 @@ function eme_events_page_content() {
}
} elseif ( ! empty( $_GET['eme_unsub'] ) ) {
// lets act as if the unsub shortcode is on the page
- $atts = array();
+ $atts = [];
return eme_unsubform_shortcode( $atts );
} elseif ( ! empty( $_GET['eme_sub_confirm'] ) && ! empty( $_GET['eme_sub_nonce'] ) ) {
@@ -857,11 +857,11 @@ function eme_events_page_content() {
$eme_email_groups = eme_sanitize_request( $_GET['g'] );
$eme_email_groups_arr = explode( ',', $eme_email_groups );
if ( ! eme_array_integers( $eme_email_groups_arr ) ) {
- $eme_email_groups_arr = array();
+ $eme_email_groups_arr = [];
}
} else {
$eme_email_groups = '';
- $eme_email_groups_arr = array();
+ $eme_email_groups_arr = [];
}
if ( wp_verify_nonce( eme_sanitize_request( $_GET['eme_sub_nonce'] ), "sub $eme_lastname$eme_firstname$eme_email$eme_email_groups" ) ) {
$res = eme_sub_do( $eme_lastname, $eme_firstname, $eme_email, $eme_email_groups_arr );
@@ -879,11 +879,11 @@ function eme_events_page_content() {
$eme_email_groups = eme_sanitize_request( $_GET['g'] );
$eme_email_groups_arr = explode( ',', $eme_email_groups );
if ( ! eme_array_integers( $eme_email_groups_arr ) ) {
- $eme_email_groups_arr = array();
+ $eme_email_groups_arr = [];
}
} else {
$eme_email_groups = '';
- $eme_email_groups_arr = array();
+ $eme_email_groups_arr = [];
}
if ( wp_verify_nonce( eme_sanitize_request( $_GET['eme_unsub_nonce'] ), "unsub $eme_email$eme_email_groups" ) ) {
eme_unsub_do( $eme_email, $eme_email_groups_arr );
@@ -1343,7 +1343,7 @@ function eme_events_page_content() {
function eme_events_count_for( $date ) {
global $wpdb,$eme_db_prefix;
$table_name = $eme_db_prefix . EVENTS_TBNAME;
- $conditions = array();
+ $conditions = [];
if ( ! eme_is_admin_request() ) {
if ( is_user_logged_in() ) {
$conditions[] = 'event_status IN (' . EME_EVENT_STATUS_PUBLIC . ',' . EME_EVENT_STATUS_PRIVATE . ')';
@@ -1636,7 +1636,7 @@ function eme_filter_comments_array_access( $data, $post_id ) {
if ( $access_allowed ) {
return $data;
} else {
- $empty_arr = array();
+ $empty_arr = [];
return $empty_arr;
}
}
@@ -1717,11 +1717,11 @@ function eme_template_redir() {
if ( eme_is_serialized( $eme_memberships ) ) {
$page_membershipids = eme_unserialize( $eme_memberships );
} else {
- $page_membershipids = array();
+ $page_membershipids = [];
}
if ( ! empty( $page_membershipids ) ) {
$page_permalink = get_permalink();
- $redir_url = add_query_arg( array( 'redirect' => $page_permalink ), $redir_url );
+ $redir_url = add_query_arg( [ 'redirect' => $page_permalink ], $redir_url );
eme_nocache_headers();
wp_redirect( esc_url( $redir_url ) );
exit;
@@ -1746,7 +1746,7 @@ function eme_template_redir() {
$redir_url = get_option( 'eme_redir_priv_event_url' );
if ( ! empty( $redir_url ) ) {
$page_permalink = get_permalink();
- $redir_url = add_query_arg( array( 'redirect' => $page_permalink ), $redir_url );
+ $redir_url = add_query_arg( [ 'redirect' => $page_permalink ], $redir_url );
eme_nocache_headers();
wp_redirect( esc_url( $redir_url ) );
exit;
@@ -1846,7 +1846,7 @@ function eme_template_redir() {
// remove yoast SEO from the header, EME generates it's own one
if ( function_exists( 'YoastSEO' ) ) {
$front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
- remove_action( 'wpseo_head', array( $front_end, 'present_head' ), -9999 );
+ remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
}
}
}
@@ -2790,7 +2790,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
} elseif ( $event && preg_match( '/#_EVENTIMAGE$/', $result ) ) {
if ( ! empty( $event['event_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $event['event_image_id'], 'full', 0, array( 'class' => 'eme_event_image' ) );
+ $replacement = wp_get_attachment_image( $event['event_image_id'], 'full', 0, [ 'class' => 'eme_event_image' ] );
} elseif ( ! empty( $event['event_image_url'] ) ) {
$url = $event['event_image_url'];
if ( $target == 'html' ) {
@@ -2818,7 +2818,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
} elseif ( $event && preg_match( '/#_EVENTIMAGETHUMB$/', $result ) ) {
if ( ! empty( $event['event_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $event['event_image_id'], get_option( 'eme_thumbnail_size' ), 0, array( 'class' => 'eme_event_image' ) );
+ $replacement = wp_get_attachment_image( $event['event_image_id'], get_option( 'eme_thumbnail_size' ), 0, [ 'class' => 'eme_event_image' ] );
if ( $target == 'html' ) {
$replacement = apply_filters( 'eme_general', $replacement );
} elseif ( $target == 'rss' ) {
@@ -2836,7 +2836,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
} elseif ( $event && preg_match( '/#_EVENTIMAGETHUMB\{(.+?)\}$/', $result, $matches ) ) {
if ( ! empty( $event['event_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $event['event_image_id'], $matches[1], 0, array( 'class' => 'eme_event_image' ) );
+ $replacement = wp_get_attachment_image( $event['event_image_id'], $matches[1], 0, [ 'class' => 'eme_event_image' ] );
if ( $target == 'html' ) {
$replacement = apply_filters( 'eme_general', $replacement );
} elseif ( $target == 'rss' ) {
@@ -2933,9 +2933,9 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
} elseif ( $event && preg_match( '/#_EVENTPAGEURL\{(.+?)\}$/', $result, $matches ) ) {
$events_page_link = eme_get_events_page();
- $replacement = add_query_arg( array( 'event_id' => intval( $matches[1] ) ), $events_page_link );
+ $replacement = add_query_arg( [ 'event_id' => intval( $matches[1] ) ], $events_page_link );
if ( ! empty( $lang ) ) {
- $replacement = add_query_arg( array( 'lang' => $lang ), $replacement );
+ $replacement = add_query_arg( [ 'lang' => $lang ], $replacement );
}
if ( $target == 'html' ) {
$replacement = esc_url( $replacement );
@@ -2971,7 +2971,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
$eme_date_obj = new ExpressiveDate( $event['event_end'], $eme_timezone );
}
$diff = $eme_date_obj_now->diff( $eme_date_obj )->format( '%r1:%y:%m:%a:%h:%i:%s' );
- list($pos_neg,$years, $months,$days,$hours,$mins,$secs) = explode( ':', $diff );
+ [$pos_neg, $years, $months, $days, $hours, $mins, $secs] = explode( ':', $diff );
if ( $matches[1] == 'TILL' && $pos_neg < 0 ) {
$replacement = 0;
} elseif ( $matches[1] == 'FROM' && $pos_neg > 0 ) {
@@ -3382,7 +3382,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
if ( is_null( $event_categories ) ) {
$event_categories = eme_get_categories_filtered( $event['event_category_ids'], $all_categories );
}
- $cat_links = array();
+ $cat_links = [];
foreach ( $event_categories as $category ) {
$cat_link = eme_category_url( $category );
$cat_name = $category['category_name'];
@@ -3408,7 +3408,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
} elseif ( $event && preg_match( '/^#_(EVENT)?CATEGORIES\{(.*?)\}\{(.*?)\}$/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[2];
$exclude_cats = $matches[3];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $include_cats ) && eme_list_of_int($include_cats) ) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -3419,7 +3419,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
$extra_conditions = join( ' AND ', $extra_conditions_arr );
$t_categories = eme_get_event_category_names( $event['event_id'], $extra_conditions, $order_by );
- $cat_names = array();
+ $cat_names = [];
foreach ( $t_categories as $cat_name ) {
if ( $target == 'html' ) {
array_push( $cat_names, eme_trans_esc_html( $cat_name, $lang ) );
@@ -3442,7 +3442,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
} elseif ( $event && preg_match( '/^#_(EVENT)?CATEGORIES_CSS\{(.*?)\}\{(.*?)\}$/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[2];
$exclude_cats = $matches[3];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $include_cats ) && eme_list_of_int($include_cats) ) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -3466,7 +3466,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
} elseif ( $event && preg_match( '/#_(EVENT)?CATEGORYDESCRIPTIONS\{(.*?)\}\{(.*?)\}$/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[2];
$exclude_cats = $matches[3];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $include_cats ) && eme_list_of_int($include_cats) ) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -3492,7 +3492,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
} elseif ( $event && preg_match( '/#_LINKED(EVENT)?CATEGORIES\{(.*?)\}\{(.*?)\}$/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[2];
$exclude_cats = $matches[3];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $include_cats ) && eme_list_of_int($include_cats) ) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -3503,7 +3503,7 @@ function eme_replace_event_placeholders( $format, $event, $target = 'html', $lan
}
$extra_conditions = join( ' AND ', $extra_conditions_arr );
$t_categories = eme_get_event_categories( $event['event_id'], $extra_conditions, $order_by );
- $cat_links = array();
+ $cat_links = [];
foreach ( $t_categories as $category ) {
$cat_link = eme_category_url( $category );
$cat_name = $category['category_name'];
@@ -3968,7 +3968,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
if ( strpos( $limit, '=' ) ) {
// allows the use of arguments without breaking the legacy code
$eme_event_list_number_events = get_option( 'eme_event_list_number_items' );
- $defaults = array(
+ $defaults = [
'limit' => $eme_event_list_number_events,
'scope' => $scope,
'order' => $order,
@@ -3994,7 +3994,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
'template_id_footer' => $template_id_footer,
'no_events_message' => $no_events_message,
'template_id_no_events' => $template_id_no_events,
- );
+ ];
$r = wp_parse_args( $limit, $defaults );
extract( $r );
// for AND categories: the user enters "+" and this gets translated to " " by wp_parse_args
@@ -4038,7 +4038,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
// for registered users: we'll add a list of event_id's for that user only
$extra_conditions = '';
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
if ( $user_registered_only == 1 && is_user_logged_in() ) {
$current_userid = get_current_user_id();
$list_of_event_ids_arr = eme_get_event_ids_for( $current_userid );
@@ -4173,7 +4173,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
$item = join( ',', $item );
}
if ( ! empty( $item ) ) {
- $this_page_url = add_query_arg( array( $key => $item ), $this_page_url );
+ $this_page_url = add_query_arg( [ $key => $item ], $this_page_url );
}
}
}
@@ -4186,9 +4186,9 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
if ( $backward < 0 ) {
$pagination_top .= "<< $prev_text ";
} else {
- $pagination_top .= " $backward ), $this_page_url ) . "'><< $prev_text ";
+ $pagination_top .= " $backward ], $this_page_url ) . "'><< $prev_text ";
}
- $pagination_top .= " $forward ), $this_page_url ) . "'>$next_text >> ";
+ $pagination_top .= " $forward ], $this_page_url ) . "'>$next_text >> ";
$pagination_top .= "" . sprintf( __( 'Page %d', 'events-made-easy' ), $page_number ) . ' ';
}
if ( $events_count <= $limit && $limit_offset > 0 ) {
@@ -4197,7 +4197,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
if ( $backward < 0 ) {
$pagination_top .= "<< $prev_text ";
} else {
- $pagination_top .= " $backward ), $this_page_url ) . "'><< $prev_text ";
+ $pagination_top .= " $backward ], $this_page_url ) . "'><< $prev_text ";
}
$pagination_top .= "$next_text >> ";
$pagination_top .= "" . sprintf( __( 'Page %d', 'events-made-easy' ), $page_number ) . ' ';
@@ -4226,7 +4226,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
$item = join( ',', $item );
}
if ( ! empty( $item ) ) {
- $this_page_url = add_query_arg( array( $key => $item ), $this_page_url );
+ $this_page_url = add_query_arg( [ $key => $item ], $this_page_url );
}
}
}
@@ -4236,13 +4236,13 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
$older_events = eme_get_events( 1, '--' . $limit_start, $order, 0, $location_id, $category, $author, $contact_person, $show_ongoing, $notcategory, $show_recurrent_events_once, $extra_conditions );
$newer_events = eme_get_events( 1, '++' . $limit_end, $order, 0, $location_id, $category, $author, $contact_person, $show_ongoing, $notcategory, $show_recurrent_events_once, $extra_conditions );
if ( count( $older_events ) > 0 ) {
- $pagination_top .= " $prev_offset ), $this_page_url ) . "'><< $prev_text ";
+ $pagination_top .= " $prev_offset ], $this_page_url ) . "'><< $prev_text ";
} else {
$pagination_top .= "<< $prev_text ";
}
if ( count( $newer_events ) > 0 ) {
- $pagination_top .= " $next_offset ), $this_page_url ) . "'>$next_text >> ";
+ $pagination_top .= " $next_offset ], $this_page_url ) . "'>$next_text >> ";
} else {
$pagination_top .= "$next_text >> ";
}
@@ -4280,7 +4280,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
} elseif ( $events_count > 0 ) {
# we first need to determine on which days events occur
# this code is identical to that in eme_calendar.php for "long events"
- $eventful_days = array();
+ $eventful_days = [];
$event_counter = 1;
foreach ( $events as $event ) {
// we requested $limit+1 events, so we need to break at the $limit, if reached
@@ -4299,7 +4299,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
if ( isset( $eventful_days[ $event_eventful_date ] ) && is_array( $eventful_days[ $event_eventful_date ] ) ) {
$eventful_days[ $event_eventful_date ][] = $event;
} else {
- $eventful_days[ $event_eventful_date ] = array( $event );
+ $eventful_days[ $event_eventful_date ] = [ $event ];
}
$eme_date_obj_tmp->addOneDay();
}
@@ -4309,7 +4309,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
if ( isset( $eventful_days[ $event_start_date ] ) && is_array( $eventful_days[ $event_start_date ] ) ) {
$eventful_days[ $event_start_date ][] = $event;
} else {
- $eventful_days[ $event_start_date ] = array( $event );
+ $eventful_days[ $event_start_date ] = [ $event ];
}
}
++$event_counter;
@@ -4321,7 +4321,7 @@ function eme_get_events_list( $limit, $scope = 'future', $order = 'ASC', $format
$curday = '';
foreach ( $eventful_days as $day_key => $day_events ) {
$eme_date_obj = new ExpressiveDate( $day_key, $eme_timezone );
- list($theyear, $themonth, $theday) = explode( '-', $eme_date_obj->getDate() );
+ [$theyear, $themonth, $theday] = explode( '-', $eme_date_obj->getDate() );
if ( $showperiod == 'yearly' && $theyear != $curyear ) {
$output .= "" . eme_localized_date( $day_key, $eme_timezone, get_option( 'eme_show_period_yearly_dateformat' ) ) . ' ';
} elseif ( $showperiod == 'monthly' && "$theyear$themonth" != "$curyear$curmonth" ) {
@@ -4383,8 +4383,8 @@ function eme_get_events_list_shortcode( $atts ) {
eme_enqueue_frontend();
$eme_event_list_number_events = get_option( 'eme_event_list_number_items' );
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'limit' => $eme_event_list_number_events,
'scope' => 'future',
'order' => 'ASC',
@@ -4409,14 +4409,14 @@ function eme_get_events_list_shortcode( $atts ) {
'ignore_filter' => 0,
'offset' => 0,
'distance' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$event_id = '';
- $event_id_arr = array();
- $location_id_arr = array();
+ $event_id_arr = [];
+ $location_id_arr = [];
// the filter list overrides the settings
if ( ! $ignore_filter && isset( $_REQUEST['eme_eventAction'] ) && eme_sanitize_request( $_REQUEST['eme_eventAction']) == 'filter' ) {
@@ -4564,13 +4564,13 @@ function eme_display_single_event( $event_id, $template_id = 0, $ignore_url = 0
function eme_display_single_event_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => '',
'template_id' => 0,
'ignore_url' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
return eme_display_single_event( $id, $template_id, $ignore_url );
@@ -4580,12 +4580,12 @@ function eme_get_events_page_shortcode( $atts ) {
eme_enqueue_frontend();
// we don't want just the url, but the clickable link by default for the shortcode
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'justurl' => 0,
'text' => get_option( 'eme_events_page_title' ),
- ),
- $atts
+ ],
+ $atts
)
);
$result = eme_get_events_page( $justurl, $text );
@@ -4613,7 +4613,7 @@ function eme_search_events( $name, $scope = 'future', $name_only = 0, $exclude_i
$start_of_week = get_option( 'start_of_week' );
$eme_date_obj->setWeekStartDay( $start_of_week );
$now = $eme_date_obj->getDateTime();
- $where = array();
+ $where = [];
if ( $scope == 'past' ) {
$where[] = "event_start < '$now'";
} elseif ( $scope == 'future' ) {
@@ -4657,7 +4657,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
if ( strpos( $o_limit, '=' ) ) {
// allows the use of arguments
- $defaults = array(
+ $defaults = [
'o_limit' => 0,
'scope' => $scope,
'order' => $order,
@@ -4670,7 +4670,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
'notcategory' => $notcategory,
'show_recurrent_events_once' => $show_recurrent_events_once,
'extra_conditions' => $extra_conditions,
- );
+ ];
$r = wp_parse_args( $o_limit, $defaults );
extract( $r );
@@ -4702,7 +4702,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
if ( $order == 'ASC' || $order == 'DESC' ) {
$orderby = "ORDER BY event_start $order, event_name $order";
} elseif ( ! eme_is_empty_string( $order ) && preg_match( '/^[\w_\-\, ]+$/', $order ) ) {
- $order_arr = array();
+ $order_arr = [];
$order_by = '';
if ( preg_match( '/^[\w_\-\, ]+$/', $order ) ) {
$order_tmp_arr = explode( ',', $order );
@@ -4729,7 +4729,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
$this_time = $eme_date_obj->getTime();
$this_datetime = $eme_date_obj->getDateTime();
- $conditions = array();
+ $conditions = [];
// extra sql conditions we put in front, most of the time this is the most
// effective place
if ( $extra_conditions != '' ) {
@@ -5095,7 +5095,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
$conditions[] = " $events_table.location_id = ''";
} elseif ( preg_match( '/,/', $location_id ) ) {
$location_ids = explode( ',', $location_id );
- $location_conditions = array();
+ $location_conditions = [];
foreach ( $location_ids as $loc ) {
if ( is_numeric( $loc ) && $loc > 0 ) {
$location_conditions[] = "$events_table.location_id = $loc";
@@ -5107,7 +5107,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
} elseif ( preg_match( '/\+| /', $location_id ) ) {
// url decoding of '+' is ' '
$location_ids = preg_split( '/\+| /', $location_id, 0, PREG_SPLIT_NO_EMPTY );
- $location_conditions = array();
+ $location_conditions = [];
foreach ( $location_ids as $loc ) {
if ( is_numeric( $loc ) && $loc > 0 ) {
$location_conditions[] = "$events_table.location_id = $loc";
@@ -5131,7 +5131,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
}
} elseif ( preg_match( '/,/', $author ) ) {
$authors = explode( ',', $author );
- $author_conditions = array();
+ $author_conditions = [];
foreach ( $authors as $authname ) {
if ( is_numeric( $authname ) ) {
$author_conditions[] = 'event_author = ' . $authname;
@@ -5164,7 +5164,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
}
} elseif ( preg_match( '/,/', $contact_person ) ) {
$contact_persons = explode( ',', $contact_person );
- $contact_person_conditions = array();
+ $contact_person_conditions = [];
foreach ( $contact_persons as $authname ) {
if ( is_numeric( $authname ) ) {
$contact_person_conditions[] = "(event_contactperson_id = $authname OR (event_contactperson_id=-1 AND event_author=$authname))";
@@ -5191,7 +5191,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
$conditions[] = "event_category_ids = ''";
} elseif ( preg_match( '/,/', $category ) ) {
$category = explode( ',', $category );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $category as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "FIND_IN_SET($cat,event_category_ids)";
@@ -5202,7 +5202,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
$conditions[] = '(' . implode( ' OR ', $category_conditions ) . ')';
} elseif ( preg_match( '/\+| /', $category ) ) {
$category = preg_split( '/\+| /', $category, 0, PREG_SPLIT_NO_EMPTY );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $category as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "FIND_IN_SET($cat,event_category_ids)";
@@ -5219,7 +5219,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
$conditions[] = "event_category_ids != ''";
} elseif ( preg_match( '/,/', $notcategory ) ) {
$notcategory = explode( ',', $notcategory );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $notcategory as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "(NOT FIND_IN_SET($cat,event_category_ids) OR event_category_ids IS NULL)";
@@ -5231,7 +5231,7 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
} elseif ( preg_match( '/\+| /', $notcategory ) ) {
// url decoding of '+' is ' '
$notcategory = preg_split( '/\+| /', $notcategory, 0, PREG_SPLIT_NO_EMPTY );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $notcategory as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "(NOT FIND_IN_SET($cat,event_category_ids) OR event_category_ids IS NULL)";
@@ -5313,8 +5313,8 @@ function eme_get_events( $o_limit = 0, $scope = 'future', $order = 'ASC', $o_off
return $count;
} else {
$events = $wpdb->get_results( $sql, ARRAY_A );
- $inflated_events = array();
- $seen_recids = array();
+ $inflated_events = [];
+ $seen_recids = [];
if ( ! empty( $events ) ) {
$event_count = 0;
// if in the frontend we might want to hide rsvp ended events
@@ -5360,7 +5360,7 @@ function eme_get_eventids_by_author( $author_id, $scope, $event_id ) {
$events_table = $eme_db_prefix . EVENTS_TBNAME;
$eme_date_obj_now = new ExpressiveDate( 'now', $eme_timezone );
$this_datetime = $eme_date_obj_now->getDateTime();
- $where_arr = array();
+ $where_arr = [];
// if an event id is provided, it takes precedence
if ( ! empty( $event_id ) ) {
@@ -5408,7 +5408,7 @@ function eme_get_event( $event_id ) {
}
$events_table = $eme_db_prefix . EVENTS_TBNAME;
- $conditions = array();
+ $conditions = [];
if ( is_numeric( $event_id ) ) {
$sql = $wpdb->prepare( "SELECT * from $events_table WHERE event_id = %d", $event_id );
@@ -5441,13 +5441,13 @@ function eme_get_event_arr( $event_ids ) {
// optimize if only 1 event id
if ( count( $event_ids ) == 1 ) {
- $events = array();
+ $events = [];
$events[] = eme_get_event( $event_ids[0] );
return $events;
}
$events_table = $eme_db_prefix . EVENTS_TBNAME;
- $conditions = array();
+ $conditions = [];
$event_ids_joined = join( ',', $event_ids );
$conditions[] = "event_id IN ($event_ids_joined)";
@@ -5482,10 +5482,10 @@ function eme_get_extra_event_data( $event ) {
}
$event['event_attributes'] = eme_unserialize( $event['event_attributes'] );
- $event['event_attributes'] = ( ! is_array( $event['event_attributes'] ) ) ? array() : $event['event_attributes'];
+ $event['event_attributes'] = ( ! is_array( $event['event_attributes'] ) ) ? [] : $event['event_attributes'];
$event['event_properties'] = eme_unserialize( $event['event_properties'] );
- $event['event_properties'] = ( ! is_array( $event['event_properties'] ) ) ? array() : $event['event_properties'];
+ $event['event_properties'] = ( ! is_array( $event['event_properties'] ) ) ? [] : $event['event_properties'];
$event['event_properties'] = eme_init_event_props( $event['event_properties'] );
if ( has_filter( 'eme_event_filter' ) ) {
@@ -5499,7 +5499,7 @@ function eme_import_csv_events() {
$answers_table = $eme_db_prefix . ANSWERS_TBNAME;
//validate whether uploaded file is a csv file
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
if ( empty( $_FILES['eme_csv']['name'] ) || ! in_array( $_FILES['eme_csv']['type'], $csvMimes ) ) {
return sprintf( __( 'No CSV file detected: %s', 'events-made-easy' ), $_FILES['eme_csv']['type'] );
}
@@ -5542,7 +5542,7 @@ function eme_import_csv_events() {
if ( ! in_array( 'event_name', $headers ) ) {
$result = __( 'Not all required fields present.', 'events-made-easy' );
} else {
- $empty_props = array();
+ $empty_props = [];
$empty_props = eme_init_event_props( $empty_props );
// now loop over the rest
while ( ( $row = fgetcsv( $handle, 0, $delimiter, $enclosure ) ) !== false ) {
@@ -5613,7 +5613,7 @@ function eme_import_csv_events() {
if ( preg_match( '/^att_(.*)$/', $key, $matches ) ) {
$att = $matches[1];
if ( ! isset( $line['event_attributes'] ) ) {
- $line['event_attributes'] = array();
+ $line['event_attributes'] = [];
}
$line['event_attributes'][ $att ] = $value;
}
@@ -5624,7 +5624,7 @@ function eme_import_csv_events() {
if ( preg_match( '/^prop_(.*)$/', $key, $matches ) ) {
$prop = $matches[1];
if ( ! isset( $line['event_properties'] ) ) {
- $line['event_properties'] = array();
+ $line['event_properties'] = [];
}
if ( array_key_exists( $prop, $empty_props ) ) {
$line['event_properties'][ $prop ] = $value;
@@ -5695,7 +5695,7 @@ function eme_events_table( $message = '' ) {
$hidden_style = '';
}
- $scope_names = array();
+ $scope_names = [];
$scope_names['past'] = __( 'Past events', 'events-made-easy' );
$scope_names['all'] = __( 'All events', 'events-made-easy' );
$scope_names['future'] = __( 'Future events', 'events-made-easy' );
@@ -5855,9 +5855,9 @@ function eme_events_table( $message = '' ) {
%2$s »',
- $view_button_text,
+ '%1$s %2$s »',
+ $view_button_text,
/* translators: Accessibility text. */
__( '(opens in a new tab)' )
);
@@ -6377,7 +6377,7 @@ function eme_event_form( $event, $info, $edit_recurrence = 0 ) {
0 ) {
$user_info = get_userdata( $event_author );
if ($user_info !== false)
@@ -6397,7 +6397,7 @@ function eme_event_form( $event, $info, $edit_recurrence = 0 ) {
0 ) {
$user_info = get_userdata( $event['event_contactperson_id'] );
@@ -6468,10 +6468,10 @@ function eme_validate_event( $event ) {
$event_properties = $event['event_properties'];
- $required_fields = array(
+ $required_fields = [
'event_name' => __( 'The event name', 'events-made-easy' ),
'start_date' => __( 'The start date', 'events-made-easy' ),
- );
+ ];
$troubles = '';
if ( eme_is_empty_datetime( $event['event_start'] ) ) {
$troubles .= '
' . sprintf( __( '%s is missing!', 'events-made-easy' ), $required_fields['start_date'] ) . ' ';
@@ -6805,7 +6805,7 @@ function eme_meta_box_div_event_name( $event, $edit_recurrence = 0 ) {
$events_prefixes = get_option( 'eme_permalink_events_prefix', 'events' );
if ( preg_match( '/,/', $events_prefixes ) ) {
$events_prefixes = explode( ',', $events_prefixes );
- $events_prefixes_arr = array();
+ $events_prefixes_arr = [];
foreach ( $events_prefixes as $events_prefix ) {
$events_prefixes_arr[ $events_prefix ] = eme_permalink_convert( $events_prefix );
}
@@ -6909,13 +6909,13 @@ function eme_meta_box_div_event_datetime( $event, $recurrence, $edit_recurrence
function eme_meta_box_div_recurrence_info( $recurrence, $edit_recurrence = 0 ) {
global $wp_locale;
- $freq_options = array(
+ $freq_options = [
'daily' => __( 'Daily', 'events-made-easy' ),
'weekly' => __( 'Weekly', 'events-made-easy' ),
'monthly' => __( 'Monthly', 'events-made-easy' ),
'specific' => __( 'Specific days', 'events-made-easy' ),
- );
- $days_names = array(
+ ];
+ $days_names = [
1 => $wp_locale->get_weekday_abbrev( __( 'Monday' ) ),
2 => $wp_locale->get_weekday_abbrev( __( 'Tuesday' ) ),
3 => $wp_locale->get_weekday_abbrev( __( 'Wednesday' ) ),
@@ -6923,9 +6923,9 @@ function eme_meta_box_div_recurrence_info( $recurrence, $edit_recurrence = 0 ) {
5 => $wp_locale->get_weekday_abbrev( __( 'Friday' ) ),
6 => $wp_locale->get_weekday_abbrev( __( 'Saturday' ) ),
7 => $wp_locale->get_weekday_abbrev( __( 'Sunday' ) ),
- );
+ ];
$saved_bydays = explode( ',', $recurrence['recurrence_byday'] );
- $weekno_options = array(
+ $weekno_options = [
'1' => __( 'first', 'events-made-easy' ),
'2' => __( 'second', 'events-made-easy' ),
'3' => __( 'third', 'events-made-easy' ),
@@ -6933,7 +6933,7 @@ function eme_meta_box_div_recurrence_info( $recurrence, $edit_recurrence = 0 ) {
'5' => __( 'fifth', 'events-made-easy' ),
'-1' => __( 'last', 'events-made-easy' ),
'0' => __( 'Start day', 'events-made-easy' ),
- );
+ ];
$holidays_array_by_id = eme_get_holidays_array_by_id();
if ( $edit_recurrence && $recurrence['recurrence_freq'] == 'specific' ) {
$recurrence_start_date = $recurrence['recurrence_specific_days'];
@@ -8207,7 +8207,7 @@ function eme_meta_box_div_event_customfields( $event ) {
} elseif ( ! empty( $event['event_id'] ) ) {
$answers = eme_get_event_answers( $event['event_id'] );
} else {
- $answers = array();
+ $answers = [];
}
foreach ( $formfields as $formfield ) {
@@ -8372,7 +8372,7 @@ function eme_meta_box_div_event_rsvp( $event ) {
$eme_prop_rsvp_discount = ( $event['event_properties']['rsvp_discount'] ) ? $event['event_properties']['rsvp_discount'] : '';
$eme_prop_rsvp_discountgroup = ( $event['event_properties']['rsvp_discountgroup'] ) ? $event['event_properties']['rsvp_discountgroup'] : '';
- $eme_prop_rsvp_addpersontogroup = ( $event['event_properties']['rsvp_addpersontogroup'] ) ? $event['event_properties']['rsvp_addpersontogroup'] : array();
+ $eme_prop_rsvp_addpersontogroup = ( $event['event_properties']['rsvp_addpersontogroup'] ) ? $event['event_properties']['rsvp_addpersontogroup'] : [];
$eme_prop_rsvp_password = ( $event['event_properties']['rsvp_password'] ) ? $event['event_properties']['rsvp_password'] : '';
$eme_prop_waitinglist_seats = ( $event['event_properties']['waitinglist_seats'] ) ? $event['event_properties']['waitinglist_seats'] : 0;
$eme_prop_cancel_rsvp_days = $event['event_properties']['cancel_rsvp_days'];
@@ -8380,14 +8380,14 @@ function eme_meta_box_div_event_rsvp( $event ) {
$eme_prop_rsvp_pending_reminder_days = $event['event_properties']['rsvp_pending_reminder_days'];
$eme_prop_rsvp_approved_reminder_days = $event['event_properties']['rsvp_approved_reminder_days'];
- $discount_arr = array();
- $dgroup_arr = array();
- $group_arr = array();
+ $discount_arr = [];
+ $dgroup_arr = [];
+ $group_arr = [];
if ( ! empty( $eme_prop_rsvp_discount ) ) {
- $discount_arr = array( $eme_prop_rsvp_discount => eme_get_discount_name( $eme_prop_rsvp_discount ) );
+ $discount_arr = [ $eme_prop_rsvp_discount => eme_get_discount_name( $eme_prop_rsvp_discount ) ];
}
if ( ! empty( $eme_prop_rsvp_discountgroup ) ) {
- $dgroup_arr = array( $eme_prop_rsvp_discountgroup => eme_get_dgroup_name( $eme_prop_rsvp_discountgroup ) );
+ $dgroup_arr = [ $eme_prop_rsvp_discountgroup => eme_get_dgroup_name( $eme_prop_rsvp_discountgroup ) ];
}
$pdftemplates = eme_get_templates( 'pdf', 1 );
@@ -8536,18 +8536,18 @@ function eme_meta_box_div_event_rsvp( $event ) {
__( 'At booking time', 'events-made-easy' ),
'approval' => __( 'Upon approval', 'events-made-easy' ),
'payment' => __( 'Upon payment', 'events-made-easy' ),
'always' => __(
- 'All of the above',
- 'events-made-easy'
+ 'All of the above',
+ 'events-made-easy'
),
- )
- );
+ ]
+ );
?>
@@ -8561,10 +8561,10 @@ function eme_meta_box_div_event_rsvp( $event ) {
__( 'starts', 'events-made-easy' ),
'end' => __( 'ends', 'events-made-easy' ),
- );
+ ];
echo eme_ui_select( $event['event_properties']['rsvp_start_target'], 'eme_prop_rsvp_start_target', $eme_rsvp_start_target_list );
?>
@@ -8577,10 +8577,10 @@ function eme_meta_box_div_event_rsvp( $event ) {
__( 'starts', 'events-made-easy' ),
'end' => __( 'ends', 'events-made-easy' ),
- );
+ ];
echo eme_ui_select( $event['event_properties']['rsvp_end_target'], 'eme_prop_rsvp_end_target', $eme_rsvp_end_target_list );
?>
@@ -8600,7 +8600,7 @@ function eme_meta_box_div_event_rsvp( $event ) {
function eme_rss_link( $justurl = 0, $echo = 0, $text = 'RSS', $scope = 'future', $order = 'ASC', $show_ongoing = 1, $category = '', $author = '', $contact_person = '', $limit = 5, $location_id = '', $title = '' ) {
if ( strpos( $justurl, '=' ) ) {
// allows the use of arguments without breaking the legacy code
- $defaults = array(
+ $defaults = [
'justurl' => 0,
'show_ongoing' => $show_ongoing,
'echo' => $echo,
@@ -8613,7 +8613,7 @@ function eme_rss_link( $justurl = 0, $echo = 0, $text = 'RSS', $scope = 'future'
'limit' => $limit,
'location_id' => $location_id,
'title' => $title,
- );
+ ];
$r = wp_parse_args( $justurl, $defaults );
extract( $r );
@@ -8640,8 +8640,8 @@ function eme_rss_link( $justurl = 0, $echo = 0, $text = 'RSS', $scope = 'future'
function eme_rss_link_shortcode( $atts ) {
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'justurl' => 0,
'show_ongoing' => 1,
'text' => 'RSS',
@@ -8653,8 +8653,8 @@ function eme_rss_link_shortcode( $atts ) {
'limit' => 5,
'location_id' => '',
'title' => '',
- ),
- $atts
+ ],
+ $atts
)
);
$result = eme_rss_link( "justurl=$justurl&show_ongoing=$show_ongoing&text=$text&limit=$limit&scope=$scope&order=$order&category=$category&author=$author&contact_person=$contact_person&location_id=$location_id&title=" . urlencode( $title ) );
@@ -8872,7 +8872,7 @@ function eme_sanitize_event( $event ) {
$event['event_end'] = $eme_date_end_obj->endOfDay()->getDateTime();
}
} else {
- $event_properties = array();
+ $event_properties = [];
}
// some sanity checks
@@ -8941,7 +8941,7 @@ function eme_sanitize_event( $event ) {
}
// check all variables that need to be urls
- $url_vars = array( 'event_url', 'event_image_url' );
+ $url_vars = [ 'event_url', 'event_image_url' ];
foreach ( $url_vars as $url_var ) {
if ( ! empty( $event[ $url_var ] ) ) {
//make sure url's have a correct prefix
@@ -8962,7 +8962,7 @@ function eme_sanitize_event( $event ) {
}
// some things just need to be integers, let's brute-force them
- $int_vars = array( 'event_contactperson_id', 'event_author', 'event_tasks', 'event_rsvp', 'rsvp_number_days', 'rsvp_number_hours', 'registration_requires_approval', 'registration_wp_users_only', 'event_image_id' );
+ $int_vars = [ 'event_contactperson_id', 'event_author', 'event_tasks', 'event_rsvp', 'rsvp_number_days', 'rsvp_number_hours', 'registration_requires_approval', 'registration_wp_users_only', 'event_image_id' ];
foreach ( $int_vars as $int_var ) {
if ( isset( $event[ $int_var ] ) ) {
$event[ $int_var ] = intval( $event[ $int_var ] );
@@ -8970,7 +8970,7 @@ function eme_sanitize_event( $event ) {
}
// make sure strings with only spaces are also empty strings
- $post_vars = array( 'event_name', 'event_page_title_format', 'event_single_event_format', 'event_contactperson_email_body', 'event_registration_recorded_ok_html', 'event_respondent_email_body', 'event_registration_pending_email_body', 'event_registration_updated_email_body', 'event_registration_cancelled_email_body', 'event_registration_trashed_email_body', 'event_registration_form_format', 'event_cancel_form_format', 'event_registration_paid_email_body' );
+ $post_vars = [ 'event_name', 'event_page_title_format', 'event_single_event_format', 'event_contactperson_email_body', 'event_registration_recorded_ok_html', 'event_respondent_email_body', 'event_registration_pending_email_body', 'event_registration_updated_email_body', 'event_registration_cancelled_email_body', 'event_registration_trashed_email_body', 'event_registration_form_format', 'event_cancel_form_format', 'event_registration_paid_email_body' ];
foreach ( $post_vars as $post_var ) {
if ( eme_is_empty_string( $event[ $post_var ] ) ) {
$event[ $post_var ] = '';
@@ -9096,7 +9096,7 @@ function eme_db_update_event( $line, $event_id, $event_is_part_of_recurrence = 0
$new_line['modif_date'] = current_time( 'mysql', false );
- $where = array( 'event_id' => $event_id );
+ $where = [ 'event_id' => $event_id ];
$wpdb->show_errors( true );
if ( $wpdb->update( $table_name, $new_line, $where ) === false ) {
$wpdb->print_error();
@@ -9199,7 +9199,7 @@ function eme_admin_enqueue_js() {
eme_enqueue_datetimepicker();
// remove some scripts from widgetopts that get loaded everywhere ...
remove_action( 'admin_enqueue_scripts', 'widgetopts_load_admin_scripts', 100 );
- $translation_array = array(
+ $translation_array = [
'translate_plugin_url' => esc_url($eme_plugin_url),
'translate_ajax_url' => admin_url( 'admin-ajax.php' ),
'translate_selectstate' => __( 'State', 'events-made-easy' ),
@@ -9218,10 +9218,10 @@ function eme_admin_enqueue_js() {
'translate_setimg' => __( 'Set image', 'events-made-easy' ),
'translate_chooseimg' => __( 'Choose image', 'events-made-easy' ),
'translate_replaceimg' => __( 'Replace image', 'events-made-easy' ),
- );
+ ];
wp_localize_script( 'eme-basic', 'emebasic', $translation_array );
wp_enqueue_script( 'eme-basic' );
- $translation_array = array(
+ $translation_array = [
'translate_areyousuretodeleteselected' => __( 'Are you sure you want to delete the selected records?', 'events-made-easy' ),
'translate_areyousuretodeletefile' => __( 'Are you sure you want to delete this file?', 'events-made-easy' ),
'translate_selectpersons' => __( 'Select one or more persons', 'events-made-easy' ),
@@ -9240,7 +9240,7 @@ function eme_admin_enqueue_js() {
'translate_minutesStep' => get_option( 'eme_timepicker_minutesstep' ),
'translate_fdateformat' => $eme_wp_date_format,
'translate_ftimeformat' => $eme_wp_time_format,
- );
+ ];
wp_localize_script( 'eme-admin', 'emeadmin', $translation_array );
wp_enqueue_script( 'eme-admin' );
//wp_enqueue_style("wp-jquery-ui-dialog");
@@ -9252,24 +9252,24 @@ function eme_admin_enqueue_js() {
wp_enqueue_script( 'eme-jtable-locale' );
}
}
- if ( $plugin_page == 'eme-new_event' || ( in_array( $plugin_page, array( 'eme-locations', 'eme-manager' ) ) && isset( $_REQUEST['eme_admin_action'] ) ) ) {
+ if ( $plugin_page == 'eme-new_event' || ( in_array( $plugin_page, [ 'eme-locations', 'eme-manager' ] ) && isset( $_REQUEST['eme_admin_action'] ) ) ) {
// we need this to have the "postbox" javascript loaded, so closing/opening works for those divs
// wp_enqueue_script('post');
if ( get_option( 'eme_map_is_active' ) ) {
wp_enqueue_style( 'eme-leaflet-css' );
- $translation_array = array(
+ $translation_array = [
'translate_eme_map_zooming' => get_option( 'eme_map_zooming' ) ? 'true' : 'false',
'translate_default_map_icon' => get_option( 'eme_location_map_icon' ),
'translate_eme_map_is_active' => 'true',
- );
+ ];
wp_localize_script( 'eme-admin-maps', 'emeadminmaps', $translation_array );
wp_enqueue_script( 'eme-admin-maps' );
}
}
- if ( in_array( $plugin_page, array( 'eme-new_event', 'eme-manager' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-new_event', 'eme-manager' ] ) ) {
wp_enqueue_style( 'eme-jquery-ui-autocomplete' );
// Now we can localize the script with our data.
- $translation_array = array(
+ $translation_array = [
'translate_nomatchevent' => __( 'No matching event found', 'events-made-easy' ),
'translate_eme_map_is_active' => get_option( 'eme_map_is_active' ) ? 'true' : 'false',
'translate_events' => __( 'Events', 'events-made-easy' ),
@@ -9304,18 +9304,18 @@ function eme_admin_enqueue_js() {
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
'translate_selectcontact' => __( 'Event author', 'events-made-easy' ),
'translate_firstDayOfWeek' => get_option( 'start_of_week' ),
- );
+ ];
wp_localize_script( 'eme-events', 'eme', $translation_array );
wp_enqueue_script( 'eme-events' );
// some inline js that gets shown at the top
eme_admin_event_script();
}
- if ( in_array( $plugin_page, array( 'eme-options' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-options' ] ) ) {
wp_enqueue_script( 'eme-options' );
}
- if ( in_array( $plugin_page, array( 'eme-attendance-reports' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-attendance-reports' ] ) ) {
wp_enqueue_style( 'eme-jquery-ui-autocomplete' );
- $translation_array = array(
+ $translation_array = [
'translate_id' => __( 'ID', 'events-made-easy' ),
'translate_type' => __( 'Type', 'events-made-easy' ),
'translate_attendancedate' => __( 'Recorded on', 'events-made-easy' ),
@@ -9326,12 +9326,12 @@ function eme_admin_enqueue_js() {
'translate_areyousuretodeletethis' => __( 'Are you sure to delete this record?', 'events-made-easy' ),
'translate_nomatchperson' => __( 'No matching person found', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-attendances', 'emeattendances', $translation_array );
wp_enqueue_script( 'eme-attendances' );
}
- if ( in_array( $plugin_page, array( 'eme-task-signups' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-task-signups' ] ) ) {
+ $translation_array = [
'translate_id' => __( 'ID', 'events-made-easy' ),
'translate_signups' => __( 'Task signups', 'events-made-easy' ),
'translate_taskname' => __( 'Task name', 'events-made-easy' ),
@@ -9348,12 +9348,12 @@ function eme_admin_enqueue_js() {
'translate_deleted' => __( 'Records deleted', 'events-made-easy' ),
'translate_admin_sendmails_url' => admin_url( 'admin.php?page=eme-emails' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-tasksignups', 'emetasks', $translation_array );
wp_enqueue_script( 'eme-tasksignups' );
}
- if ( in_array( $plugin_page, array( 'eme-templates' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-templates' ] ) ) {
+ $translation_array = [
'translate_id' => __( 'ID', 'events-made-easy' ),
'translate_templates' => __( 'Templates', 'events-made-easy' ),
'translate_name' => __( 'Name', 'events-made-easy' ),
@@ -9369,12 +9369,12 @@ function eme_admin_enqueue_js() {
'translate_deleted' => __( 'Records deleted', 'events-made-easy' ),
'translate_copy' => __( 'Copy', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-templates', 'emetemplates', $translation_array );
wp_enqueue_script( 'eme-templates' );
}
- if ( in_array( $plugin_page, array( 'eme-formfields' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-formfields' ] ) ) {
+ $translation_array = [
'translate_id' => __( 'ID', 'events-made-easy' ),
'translate_name' => __( 'Name', 'events-made-easy' ),
'translate_type' => __( 'Type', 'events-made-easy' ),
@@ -9389,12 +9389,12 @@ function eme_admin_enqueue_js() {
'translate_areyousuretodeleteselected' => __( 'Are you sure to delete the selected records?', 'events-made-easy' ),
'translate_pressdeletetoremove' => __( 'Press the delete button to remove', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-formfields', 'emeformfields', $translation_array );
wp_enqueue_script( 'eme-formfields' );
}
- if ( in_array( $plugin_page, array( 'eme-discounts' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-discounts' ] ) ) {
+ $translation_array = [
'translate_discounts' => __( 'Discounts', 'events-made-easy' ),
'translate_name' => __( 'Name', 'events-made-easy' ),
'translate_id' => __( 'ID', 'events-made-easy' ),
@@ -9423,12 +9423,12 @@ function eme_admin_enqueue_js() {
'translate_areyousuretodeleteselected' => __( 'Are you sure to delete the selected records?', 'events-made-easy' ),
'translate_pressdeletetoremove' => __( 'Press the delete button to remove', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-discounts', 'emediscounts', $translation_array );
wp_enqueue_script( 'eme-discounts' );
}
- if ( in_array( $plugin_page, array( 'eme-countries' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-countries' ] ) ) {
+ $translation_array = [
'translate_countries' => __( 'Countries', 'events-made-easy' ),
'translate_id' => __( 'ID', 'events-made-easy' ),
'translate_name' => __( 'Name', 'events-made-easy' ),
@@ -9450,12 +9450,12 @@ function eme_admin_enqueue_js() {
'translate_apply' => __( 'Apply', 'events-made-easy' ),
'translate_areyousuretodeleteselected' => __( 'Are you sure to delete the selected records?', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-countries', 'emecountries', $translation_array );
wp_enqueue_script( 'eme-countries' );
}
- if ( in_array( $plugin_page, array( 'eme-locations' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-locations' ] ) ) {
+ $translation_array = [
'translate_nomatchlocation' => __( 'No matching location found', 'events-made-easy' ),
'translate_locations' => __( 'Locations', 'events-made-easy' ),
'translate_id' => __( 'ID', 'events-made-easy' ),
@@ -9482,13 +9482,13 @@ function eme_admin_enqueue_js() {
'translate_selectfeaturedimage' => __( 'Select the image to be used as featured image', 'events-made-easy' ),
'translate_setfeaturedimage' => __( 'Set featured image', 'events-made-easy' ),
'translate_adminnonce' => wp_create_nonce( 'eme_admin' ),
- );
+ ];
wp_localize_script( 'eme-locations', 'eme', $translation_array );
wp_enqueue_script( 'eme-locations' );
}
- if ( in_array( $plugin_page, array( 'eme-people', 'eme-groups' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-people', 'eme-groups' ] ) ) {
wp_enqueue_media();
- $translation_array = array(
+ $translation_array = [
'translate_nomatchperson' => __( 'No matching person found', 'events-made-easy' ),
'translate_plugin_url' => esc_url($eme_plugin_url),
'translate_personid' => __( 'Person ID', 'events-made-easy' ),
@@ -9537,13 +9537,13 @@ function eme_admin_enqueue_js() {
'translate_firstDayOfWeek' => get_option( 'start_of_week' ),
'translate_flanguage' => $language,
'translate_fdateformat' => $eme_wp_date_format,
- );
+ ];
wp_localize_script( 'eme-people', 'eme', $translation_array );
wp_enqueue_script( 'eme-people' );
}
- if ( in_array( $plugin_page, array( 'eme-members', 'eme-memberships' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-members', 'eme-memberships' ] ) ) {
wp_enqueue_media();
- $translation_array = array(
+ $translation_array = [
'translate_nomatchperson' => __( 'No matching person found', 'events-made-easy' ),
'translate_nomatchmember' => __( 'No matching member found', 'events-made-easy' ),
'translate_plugin_url' => esc_url($eme_plugin_url),
@@ -9597,12 +9597,12 @@ function eme_admin_enqueue_js() {
'translate_dcodes_used' => __( 'Used discount codes', 'events-made-easy' ),
'translate_totalprice' => __( 'Total price', 'events-made-easy' ),
'translate_membershipprice' => __( 'Membership price', 'events-made-easy' ),
- );
+ ];
wp_localize_script( 'eme-members', 'eme', $translation_array );
wp_enqueue_script( 'eme-members' );
}
- if ( in_array( $plugin_page, array( 'eme-registration-approval', 'eme-registration-seats' ) ) ) {
- $translation_array = array(
+ if ( in_array( $plugin_page, [ 'eme-registration-approval', 'eme-registration-seats' ] ) ) {
+ $translation_array = [
'translate_nomatchevent' => __( 'No matching event found', 'events-made-easy' ),
'translate_bookings' => __( 'Bookings', 'events-made-easy' ),
'translate_id' => __( 'ID', 'events-made-easy' ),
@@ -9640,15 +9640,15 @@ function eme_admin_enqueue_js() {
'translate_admin_sendmails_url' => admin_url( 'admin.php?page=eme-emails' ),
'translate_attend_count' => __( 'Attendance count', 'events-made-easy' ),
'translate_selectonerowonlyforpartial' => __( 'Please select only one record in order to do partial payments', 'events-made-easy' ),
- );
+ ];
wp_localize_script( 'eme-rsvp', 'eme', $translation_array );
wp_enqueue_script( 'eme-rsvp' );
}
- if ( in_array( $plugin_page, array( 'eme-emails' ) ) ) {
+ if ( in_array( $plugin_page, [ 'eme-emails' ] ) ) {
wp_enqueue_style( 'eme-jquery-ui-autocomplete' );
// if html mails are disabled, this is needed
wp_enqueue_media();
- $translation_array = array(
+ $translation_array = [
'translate_pleasewait' => __( 'Please wait', 'events-made-easy' ),
'translate_sendmail' => __( 'Send email', 'events-made-easy' ),
'translate_planmail' => __( 'Queue email', 'events-made-easy' ),
@@ -9673,13 +9673,13 @@ function eme_admin_enqueue_js() {
'translate_fdateformat' => $eme_wp_date_format,
'translate_ftimeformat' => $eme_wp_time_format,
'translate_fdatetimeformat' => $eme_wp_date_format . ' ' . $eme_wp_time_format,
- );
+ ];
wp_localize_script( 'eme-sendmails', 'eme', $translation_array );
wp_enqueue_script( 'eme-sendmails' );
}
if ( preg_match( '/^eme-/', $plugin_page ) ) {
- wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', array(), EME_VERSION );
+ wp_enqueue_style( 'eme_textsec', $eme_plugin_url . 'css/text-security/text-security-disc.css', [], EME_VERSION );
wp_enqueue_style( 'eme_stylesheet' );
wp_enqueue_style( 'eme_stylesheet_extra' );
}
@@ -9689,13 +9689,13 @@ function eme_admin_enqueue_js() {
function eme_countdown_shortcode( $atts ) {
global $eme_timezone;
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => '',
'recurrence_id' => 0,
'category_id' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
@@ -9730,7 +9730,7 @@ function eme_countdown_shortcode( $atts ) {
function eme_ajax_events_search() {
global $eme_timezone;
- $return = array();
+ $return = [];
if ( isset( $_REQUEST['q'] ) ) {
$q = isset( $_REQUEST['q'] ) ? strtolower( eme_sanitize_request( $_REQUEST['q'] ) ) : '';
}
@@ -9748,7 +9748,7 @@ function eme_ajax_events_search() {
$only_rsvp = isset( $_REQUEST['only_rsvp'] ) ? intval( $_REQUEST['only_rsvp'] ) : 0;
$events = eme_search_events( $q, $scope, 1, $exclude_id, $only_rsvp );
foreach ( $events as $event ) {
- $record = array();
+ $record = [];
$record['event_id'] = $event['event_id'];
$record['eventinfo'] = eme_esc_html( $event['event_name'] . ' (' . eme_localized_date( $event['event_start'], $eme_timezone, 1 ) . ')' );
$return[] = $record;
@@ -9765,15 +9765,15 @@ function eme_ajax_wpuser_select2() {
if ( ! current_user_can( get_option( 'eme_cap_list_events' ) ) ) {
wp_die();
}
- $jTableResult = array();
+ $jTableResult = [];
$q = isset( $_REQUEST['q'] ) ? strtolower( eme_sanitize_request( $_REQUEST['q'] ) ) : '';
$pagesize = intval( $_REQUEST['pagesize'] );
$start = isset( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) * $pagesize : 0;
- $records = array();
- list($persons,$total) = eme_get_wp_users( $q, $start, $pagesize );
+ $records = [];
+ [$persons, $total] = eme_get_wp_users( $q, $start, $pagesize );
foreach ( $persons as $item ) {
- $record = array();
+ $record = [];
$user_info = get_userdata( $item->ID );
$record['id'] = $item->ID;
// no eme_esc_html here, select2 does it own escaping upon arrival
@@ -9811,7 +9811,7 @@ function eme_ajax_events_list() {
$search_start_date = isset( $_REQUEST['search_start_date'] ) && eme_is_date( $_REQUEST['search_start_date'] ) ? esc_sql(eme_sanitize_request( $_REQUEST['search_start_date']) ) : '';
$search_end_date = isset( $_REQUEST['search_end_date'] ) && eme_is_date( $_REQUEST['search_end_date'] ) ? esc_sql( eme_sanitize_request($_REQUEST['search_end_date']) ) : '';
$where = '';
- $where_arr = array();
+ $where_arr = [];
if ( ! empty( $search_name ) ) {
$where_arr[] = "event_name like '%" . $search_name . "%'";
}
@@ -9845,7 +9845,7 @@ function eme_ajax_events_list() {
if ( ! $wp_id ) {
$ajaxResult['Result'] = 'OK';
$ajaxResult['TotalRecordCount'] = 0;
- $ajaxResult['Records'] = array();
+ $ajaxResult['Records'] = [];
print wp_json_encode( $ajaxResult );
wp_die();
}
@@ -9859,7 +9859,7 @@ function eme_ajax_events_list() {
// we ask only for the event_id column here, more efficient
$count_only = 1;
$formfields_searchable = eme_get_searchable_formfields( 'events' );
- $field_ids_arr = array();
+ $field_ids_arr = [];
foreach ( $formfields_searchable as $formfield ) {
$field_id = $formfield['field_id'];
$field_ids_arr[] = $field_id;
@@ -9887,9 +9887,9 @@ function eme_ajax_events_list() {
// no searchable formfields yet, so we use eme_get_formfields here
$formfields = eme_get_formfields( '', 'events' );
- $rows = array();
+ $rows = [];
foreach ( $events as $event ) {
- $record = array();
+ $record = [];
$record['event_id'] = $event['event_id'];
if ( empty( $event['event_name'] ) ) {
$event['event_name'] = __( 'No name', 'events-made-easy' );
@@ -9901,7 +9901,7 @@ function eme_ajax_events_list() {
if ( ! empty( $event['event_category_ids'] ) ) {
$categories = explode( ',', $event['event_category_ids'] );
$record['event_name'] .= "";
- $cat_names = array();
+ $cat_names = [];
foreach ( $categories as $cat ) {
$category = eme_get_category( $cat );
if ( $category ) {
@@ -10078,7 +10078,7 @@ function eme_ajax_events_list() {
$rows[] = $record;
}
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
$ajaxResult['TotalRecordCount'] = $events_count;
$ajaxResult['Records'] = $rows;
@@ -10088,7 +10088,7 @@ function eme_ajax_events_list() {
function eme_ajax_manage_events() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
- $ajaxResult = array();
+ $ajaxResult = [];
if ( isset( $_REQUEST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_REQUEST['do_action'] );
$ids = $_REQUEST['event_id'];
@@ -10135,7 +10135,7 @@ function eme_ajax_manage_events() {
function eme_ajax_action_events_delete( $ids_arr ) {
eme_delete_events( $ids_arr );
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Events deleted', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
@@ -10143,7 +10143,7 @@ function eme_ajax_action_events_delete( $ids_arr ) {
function eme_ajax_action_events_trash( $ids, $send_trashmails ) {
eme_trash_events( $ids, $send_trashmails );
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Events moved to trash', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
@@ -10151,14 +10151,14 @@ function eme_ajax_action_events_trash( $ids, $send_trashmails ) {
function eme_ajax_action_events_untrash( $ids ) {
eme_untrash_events( $ids );
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Restored selected events to draft status', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
}
function eme_ajax_action_events_status( $ids_arr, $status ) {
- $ajaxResult = array();
+ $ajaxResult = [];
eme_change_event_status( $ids_arr, $status );
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Events status updated', 'events-made-easy' );
@@ -10171,7 +10171,7 @@ function eme_ajax_action_events_addcat( $ids, $category_id ) {
$ids_arr = explode( ',', $ids );
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
$sql = $wpdb->prepare("UPDATE $table_name SET event_category_ids = CONCAT_WS(',',event_category_ids,%d)
- WHERE event_id IN ($commaDelimitedPlaceholders) AND (NOT FIND_IN_SET(%d,event_category_ids) OR event_category_ids IS NULL)",array_merge(array($category_id),$ids_arr,array($category_id)));
+ WHERE event_id IN ($commaDelimitedPlaceholders) AND (NOT FIND_IN_SET(%d,event_category_ids) OR event_category_ids IS NULL)", array_merge([$category_id], $ids_arr, [$category_id]));
$wpdb->query( $sql );
$ajaxResult['Result'] = 'OK';
$ajaxResult['Message'] = __( 'Events added to category', 'events-made-easy' );
@@ -10184,7 +10184,7 @@ function eme_trash_events( $ids, $send_trashmails = 0 ) {
$bookings_table = $eme_db_prefix . BOOKINGS_TBNAME;
$ids_arr = explode( ',', $ids );
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
- $sql = $wpdb->prepare("UPDATE $table_name SET recurrence_id = 0, event_status = %d WHERE event_id IN ($commaDelimitedPlaceholders)",array_merge(array(EME_EVENT_STATUS_TRASH),$ids_arr));
+ $sql = $wpdb->prepare("UPDATE $table_name SET recurrence_id = 0, event_status = %d WHERE event_id IN ($commaDelimitedPlaceholders)", array_merge([EME_EVENT_STATUS_TRASH], $ids_arr));
$wpdb->query( $sql );
if ( $send_trashmails ) {
@@ -10211,7 +10211,7 @@ function eme_untrash_events( $ids ) {
$table_name = $eme_db_prefix . EVENTS_TBNAME;
$ids_arr = explode( ',', $ids );
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
- $sql = $wpdb->prepare("UPDATE $table_name SET event_status = %d WHERE event_id IN ($commaDelimitedPlaceholders)" ,array_merge(array(EME_EVENT_STATUS_DRAFT),$ids_arr));
+ $sql = $wpdb->prepare("UPDATE $table_name SET event_status = %d WHERE event_id IN ($commaDelimitedPlaceholders)", array_merge([EME_EVENT_STATUS_DRAFT], $ids_arr));
$wpdb->query( $sql );
}
@@ -10230,7 +10230,7 @@ function eme_delete_events( $ids_arr ) {
}
function eme_get_event_post_cfs() {
- $answers = array();
+ $answers = [];
foreach ( $_POST as $key => $value ) {
if ( preg_match( '/^FIELD(\d+)$/', $key, $matches ) ) {
$field_id = intval( $matches[1] );
@@ -10243,12 +10243,12 @@ function eme_get_event_post_cfs() {
if ( is_array( $value ) ) {
$value = eme_convert_array2multi( $value );
}
- $answer = array(
+ $answer = [
'field_name' => $formfield['field_name'],
'field_id' => $field_id,
'extra_charge' => $formfield['extra_charge'],
'answer' => $value,
- );
+ ];
$answers[] = $answer;
}
}
@@ -10273,7 +10273,7 @@ function eme_get_event_answers( $event_id ) {
}
function eme_event_store_cf_answers( $event_id ) {
- $answer_ids_seen = array();
+ $answer_ids_seen = [];
$all_answers = eme_get_event_answers( $event_id );
$found_answers = eme_get_event_post_cfs();
@@ -10302,7 +10302,7 @@ function eme_event_store_cf_answers( $event_id ) {
function eme_get_cf_event_ids( $val, $field_id, $is_multi = 0 ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . ANSWERS_TBNAME;
- $conditions = array();
+ $conditions = [];
$val = eme_kses( $val );
if ( is_array( $val ) ) {
@@ -10351,15 +10351,15 @@ function eme_ajax_events_select2() {
$scope = 'future';
}
$events = eme_search_events( $q, $scope, 1 );
- $records = array();
+ $records = [];
$recordCount = 0;
foreach ( $events as $event ) {
if ( current_user_can( get_option( 'eme_cap_send_other_mails' ) ) ||
( current_user_can( get_option( 'eme_cap_send_mails' ) ) && ( $event['event_author'] == $current_userid || $event['event_contactperson_id'] == $current_userid ) ) ) {
- $records[] = array(
+ $records[] = [
'id' => $event['event_id'],
'text' => trim( eme_esc_html( strip_tags( $event['event_name'] ) . ' (' . eme_localized_date( $event['event_start'], $eme_timezone, 1 ) . ')' ) ),
- );
+ ];
++$recordCount;
}
}
diff --git a/eme-filters.php b/eme-filters.php
index 34a1b4dc..d6dc6b04 100644
--- a/eme-filters.php
+++ b/eme-filters.php
@@ -7,8 +7,8 @@
function eme_filter_form_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'multiple' => 0,
'multisize' => 5,
'scope_count' => 12,
@@ -16,8 +16,8 @@ function eme_filter_form_shortcode( $atts ) {
'category' => '',
'notcategory' => '',
'template_id' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$multiple = filter_var( $multiple, FILTER_VALIDATE_BOOLEAN );
@@ -58,7 +58,7 @@ function eme_create_week_scope( $count, $eventful = 0 ) {
$start_of_week = get_option( 'start_of_week' );
$eme_date_obj = new ExpressiveDate( 'now', $eme_timezone );
$eme_date_obj->setWeekStartDay( $start_of_week );
- $scope = array();
+ $scope = [];
for ( $i = 0; $i < $count; $i++ ) {
$limit_start = $eme_date_obj->copy()->startOfWeek()->format( 'Y-m-d' );
$limit_end = $eme_date_obj->copy()->endOfWeek()->format( 'Y-m-d' );
@@ -81,7 +81,7 @@ function eme_create_week_scope( $count, $eventful = 0 ) {
function eme_create_month_scope( $count, $eventful = 0 ) {
global $eme_timezone;
- $scope = array();
+ $scope = [];
$scope[0] = __( 'Select Month', 'events-made-easy' );
$eme_date_obj = new ExpressiveDate( 'now', $eme_timezone );
for ( $i = 0; $i < $count; $i++ ) {
@@ -107,7 +107,7 @@ function eme_create_month_scope( $count, $eventful = 0 ) {
function eme_create_year_scope( $count, $eventful = 0 ) {
global $eme_timezone;
- $scope = array();
+ $scope = [];
$scope[0] = __( 'Select Year', 'events-made-easy' );
$eme_date_obj = new ExpressiveDate( 'now', $eme_timezone );
@@ -153,7 +153,7 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
$selected_author = isset( $_REQUEST[ $author_post_name ] ) ? eme_sanitize_request( $_REQUEST[ $author_post_name ] ) : 0;
$selected_contact = isset( $_REQUEST[ $contact_post_name ] ) ? eme_sanitize_request( $_REQUEST[ $contact_post_name ] ) : 0;
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
if ( $category != '' ) {
$extra_conditions_arr[] = "(category_id IN ($category))";
}
@@ -200,7 +200,7 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
$categories = eme_get_categories( $eventful, 'future', $extra_conditions );
if ( $categories ) {
- $cat_list = array();
+ $cat_list = [];
foreach ( $categories as $this_category ) {
$id = $this_category['category_id'];
$cat_list[ $id ] = eme_translate( $this_category['category_name'] );
@@ -231,7 +231,7 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
$locations = eme_get_locations( $eventful, 'future', '', '', 0, true );
if ( ! empty( $locations ) ) {
- $loc_list = array();
+ $loc_list = [];
foreach ( $locations as $this_location ) {
$id = $this_location['location_id'];
$loc_list[ $id ] = eme_translate( $this_location['location_name'] );
@@ -261,7 +261,7 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
$aria_label = 'aria-label="' . eme_esc_html( $label ) . '"';
$cities = eme_get_locations( $eventful, 'future', '', '', 0, true );
if ( ! empty( $cities ) ) {
- $city_list = array();
+ $city_list = [];
foreach ( $cities as $this_city ) {
$id = eme_translate( $this_city['location_city'] );
$city_list[ $id ] = $id;
@@ -292,7 +292,7 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
$countries = eme_get_locations( $eventful, 'future', '', '', 0, true );
if ( ! empty( $countries ) ) {
- $country_list = array();
+ $country_list = [];
foreach ( $countries as $this_country ) {
$id = eme_translate( $this_country['location_country'] );
$country_list[ $id ] = $id;
@@ -348,12 +348,12 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
} else {
$label = __( 'Event contact', 'events-made-easy' );
}
- $args = array(
+ $args = [
'echo' => 0,
'name' => $contact_post_name,
'show_option_none' => eme_esc_html( $label ),
'selected' => $selected_contact,
- );
+ ];
if ( isset( $matches[2] ) ) {
// remove { and } (first and last char of second match)
$exclude = substr( $matches[2], 1, -1 );
@@ -375,12 +375,12 @@ function eme_replace_filter_form_placeholders( $format, $multiple, $multisize, $
} else {
$label = __( 'Event author', 'events-made-easy' );
}
- $args = array(
+ $args = [
'echo' => 0,
'name' => $author_post_name,
'show_option_none' => eme_esc_html( $label ),
'selected' => $selected_author,
- );
+ ];
if ( isset( $matches[2] ) ) {
// remove { and } (first and last char of second match)
$exclude = substr( $matches[2], 1, -1 );
diff --git a/eme-formfields.php b/eme-formfields.php
index fab08fc3..841ca199 100644
--- a/eme-formfields.php
+++ b/eme-formfields.php
@@ -5,7 +5,7 @@
}
function eme_new_formfield() {
- $formfield = array(
+ $formfield = [
'field_type' => 'text',
'field_name' => '',
'field_values' => '',
@@ -19,7 +19,7 @@ function eme_new_formfield() {
'export' => 0,
'extra_charge' => 0,
'searchable' => 0,
- );
+ ];
return $formfield;
}
@@ -52,7 +52,7 @@ function eme_formfields_page() {
if ( isset( $_POST['eme_admin_action'] ) ) {
check_admin_referer( 'eme_admin', 'eme_admin_nonce' );
if ( $_POST['eme_admin_action'] == 'do_editformfield' ) {
- $formfield = array();
+ $formfield = [];
$field_id = intval( $_POST['field_id'] );
$formfield['field_name'] = trim( eme_sanitize_request( $_POST['field_name'] ) );
$formfield['field_type'] = trim( eme_esc_html( eme_sanitize_request( $_POST['field_type'] ) ) );
@@ -125,7 +125,7 @@ function eme_formfields_page() {
}
}
if ( $field_id > 0 ) {
- $validation_result = $wpdb->update( $formfields_table, $formfield, array( 'field_id' => $field_id ) );
+ $validation_result = $wpdb->update( $formfields_table, $formfield, [ 'field_id' => $field_id ] );
if ( $validation_result !== false ) {
$message = __( 'Successfully edited the field', 'events-made-easy' );
} else {
@@ -210,13 +210,13 @@ function eme_formfields_table_layout( $message = '' ) {
" . __( 'Field purpose', 'events-made-easy' ) . '
';
- if ( ! $used || in_array( $formfield['field_purpose'], array( 'generic', 'rsvp', 'members' ) ) ) {
- if ( in_array( $formfield['field_purpose'], array( 'rsvp', 'members' ) ) ) {
+ if ( ! $used || in_array( $formfield['field_purpose'], [ 'generic', 'rsvp', 'members' ] ) ) {
+ if ( in_array( $formfield['field_purpose'], [ 'rsvp', 'members' ] ) ) {
// for members or rsvp field: allow to change between those and generic
unset( $field_purposes['events'] );
unset( $field_purposes['locations'] );
@@ -414,7 +414,7 @@ function eme_formfields_edit_layout( $field_id = 0, $message = '', $t_formfield
}
function eme_get_dyndata_conditions() {
- $data = array(
+ $data = [
'eq' => __( 'equal to', 'events-made-easy' ),
'ne' => __( 'not equal to', 'events-made-easy' ),
'lt' => __( 'lower than', 'events-made-easy' ),
@@ -424,7 +424,7 @@ function eme_get_dyndata_conditions() {
'notcontains' => __( 'does not contain', 'events-made-easy' ),
'incsv' => __( 'CSV list contains', 'events-made-easy' ),
'notincsv' => __( 'CSV list does not contain', 'events-made-easy' ),
- );
+ ];
return $data;
}
@@ -453,13 +453,13 @@ function eme_get_formfields( $ids = '', $purpose = '' ) {
global $wpdb,$eme_db_prefix;
$formfields_table = $eme_db_prefix . FORMFIELDS_TBNAME;
$where = '';
- $where_arr = array();
+ $where_arr = [];
if ( ! empty( $ids ) && eme_is_list_of_int($ids) ) {
$where_arr[] = "field_id IN ($ids)";
}
if ( ! empty( $purpose ) ) {
$purposes = explode( ',', $purpose );
- $purposes_arr = array();
+ $purposes_arr = [];
foreach ( $purposes as $tmp_p ) {
$purposes_arr[] = "field_purpose='" . esc_sql( $tmp_p ) . "'";
}
@@ -475,7 +475,7 @@ function eme_get_searchable_formfields( $purpose = '', $include_generic = 0 ) {
global $wpdb,$eme_db_prefix;
$formfields_table = $eme_db_prefix . FORMFIELDS_TBNAME;
$where = '';
- $where_arr = array();
+ $where_arr = [];
$where_arr[] = 'searchable=1';
$where_arr[] = "field_type <> 'file' AND field_type <> 'multifile'";
if ( ! empty( $purpose ) ) {
@@ -519,16 +519,16 @@ function eme_delete_formfields( $formfields ) {
if ( ! empty( $formfields ) && eme_array_integers( $formfields ) ) {
$ids_arr = explode( ',', $formfields );
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($ids_arr), '%d'));
- $validation_result = $wpdb->query( $wpdb->prepare("DELETE FROM $formfields_table WHERE field_id IN ($commaDelimitedPlaceholders)",$ids_arr ));
+ $validation_result = $wpdb->query( $wpdb->prepare("DELETE FROM $formfields_table WHERE field_id IN ($commaDelimitedPlaceholders)", $ids_arr ));
if ( $validation_result !== false ) {
$answers_table = $eme_db_prefix . ANSWERS_TBNAME;
- $wpdb->query( $wpdb->prepare("DELETE FROM $answers_table WHERE field_id IN ($commaDelimitedPlaceholders)",$ids_arr ));
+ $wpdb->query( $wpdb->prepare("DELETE FROM $answers_table WHERE field_id IN ($commaDelimitedPlaceholders)", $ids_arr ));
$events_customfields_table = $eme_db_prefix . EVENTS_CF_TBNAME;
- $wpdb->query( $wpdb->prepare("DELETE FROM $events_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)",$ids_arr ));
+ $wpdb->query( $wpdb->prepare("DELETE FROM $events_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)", $ids_arr ));
$locations_customfields_table = $eme_db_prefix . LOCATIONS_CF_TBNAME;
- $wpdb->query( $wpdb->prepare("DELETE FROM $locations_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)",$ids_arr ));
+ $wpdb->query( $wpdb->prepare("DELETE FROM $locations_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)", $ids_arr ));
$memberships_customfields_table = $eme_db_prefix . MEMBERSHIPS_CF_TBNAME;
- $wpdb->query( $wpdb->prepare("DELETE FROM $memberships_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)",$ids_arr ));
+ $wpdb->query( $wpdb->prepare("DELETE FROM $memberships_customfields_table WHERE field_id IN ($commaDelimitedPlaceholders)", $ids_arr ));
return true;
} else {
return false;
@@ -539,7 +539,7 @@ function eme_delete_formfields( $formfields ) {
}
function eme_get_fieldpurpose( $purpose = '' ) {
- $uses = array(
+ $uses = [
'generic' => __( 'Generic', 'events-made-easy' ),
'events' => __( 'Events field', 'events-made-easy' ),
'locations' => __( 'Locations field', 'events-made-easy' ),
@@ -547,7 +547,7 @@ function eme_get_fieldpurpose( $purpose = '' ) {
'people' => __( 'People field', 'events-made-easy' ),
'members' => __( 'Members field', 'events-made-easy' ),
'memberships' => __( 'Memberships field', 'events-made-easy' ),
- );
+ ];
if ( $purpose ) {
if ( isset( $uses[ $purpose ] ) ) {
return $uses[ $purpose ];
@@ -560,7 +560,7 @@ function eme_get_fieldpurpose( $purpose = '' ) {
}
function eme_get_fieldtypes() {
- $types = array(
+ $types = [
'text' => __( 'Text', 'events-made-easy' ),
'textarea' => __( 'Textarea', 'events-made-easy' ),
'dropdown' => __( 'Dropdown', 'events-made-easy' ),
@@ -588,7 +588,7 @@ function eme_get_fieldtypes() {
'range' => __( 'Range (HTML5)', 'events-made-easy' ),
'tel' => __( 'Tel (HTML5)', 'events-made-easy' ),
'url' => __( 'Url (HTML5)', 'events-made-easy' ),
- );
+ ];
return $types;
}
@@ -599,7 +599,7 @@ function eme_get_fieldtype( $type ) {
function eme_is_multifield( $type ) {
global $wpdb,$eme_db_prefix;
- return in_array( $type, array( 'dropdown', 'dropdown_multi', 'radiobox', 'radiobox_vertical', 'checkbox', 'checkbox_vertical' ) );
+ return in_array( $type, [ 'dropdown', 'dropdown_multi', 'radiobox', 'radiobox_vertical', 'checkbox', 'checkbox_vertical' ] );
}
function eme_get_formfield_html( $formfield, $field_name, $entered_val, $required, $class = '', $ro = 0, $force_single = 0 ) {
@@ -723,14 +723,14 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# dropdown
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
// since the values for a dropdown field need not be unique, we give them as an array to be built with eme_ui_select
foreach ( $values as $key => $val ) {
$tag = eme_translate( $tags[ $key ] );
- $new_el = array(
+ $new_el = [
0 => $val,
1 => $tag,
- );
+ ];
$my_arr[] = $new_el;
}
$html = eme_ui_select( $entered_val, $field_name, $my_arr, '', $required, $class, $field_attributes . ' ' . $disabled );
@@ -739,19 +739,19 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# dropdown, multiselect
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
// since the values for a dropdown field need not be unique, we give them as an array to be built with eme_ui_select
foreach ( $values as $key => $val ) {
$tag = eme_translate( $tags[ $key ] );
- $new_el = array(
+ $new_el = [
0 => $val,
1 => $tag,
- );
+ ];
$my_arr[] = $new_el;
}
// force_single can be 1 (only possible case is in the filterform for now)
if ( $force_single == 1 ) {
- $html = eme_ui_select( $entered_val, $field_name, $my_arr, '', $required, $class, $field_attributes . ' ' . $disabled );
+ $html = eme_ui_select( $entered_val, $field_name, $my_arr, '', $required, $class, $field_attributes . ' ' . $disabled );
} else {
$html = eme_ui_multiselect( $entered_val, $field_name, $my_arr, 5, '', $required, $class . ' eme_select2_width50_class', $field_attributes . ' ' . $disabled );
}
@@ -772,7 +772,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# radiobox
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
foreach ( $values as $key => $val ) {
$tag = $tags[ $key ];
$my_arr[ $val ] = eme_translate( $tag );
@@ -783,7 +783,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# radiobox, vertical
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
foreach ( $values as $key => $val ) {
$tag = $tags[ $key ];
$my_arr[ $val ] = eme_translate( $tag );
@@ -794,7 +794,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# checkbox
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
foreach ( $values as $key => $val ) {
$tag = $tags[ $key ];
$my_arr[ $val ] = eme_translate( $tag );
@@ -814,7 +814,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
# checkbox, vertical
$values = eme_convert_multi2array( $field_values );
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
foreach ( $values as $key => $val ) {
$tag = $tags[ $key ];
$my_arr[ $val ] = eme_translate( $tag );
@@ -883,7 +883,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
} else {
$showhide_style = '';
}
- $html .= " ";
+ $html .= " ";
if ( ! empty( $entered_val ) ) {
foreach ( $entered_val as $file ) {
$html .= eme_get_uploaded_file_linkdelete( $file );
@@ -914,7 +914,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
}
$dateformat = $field_attributes;
$html = " ";
- $html .= " ";
+ $html .= " ";
break;
case 'datetime_js':
# for datetime JS field
@@ -936,7 +936,7 @@ function eme_get_formfield_html( $formfield, $field_name, $entered_val, $require
}
$dateformat = $field_attributes;
$html = " ";
- $html .= " ";
+ $html .= " ";
break;
case 'time_js':
# for time JS field
@@ -998,10 +998,10 @@ function eme_replace_eventtaskformfields_placeholders( $format, $task, $event )
if ( preg_match( '/#_TASKSIGNUPCHECKBOX$/', $result ) ) {
if ( $free_spaces > 0 && ! $task_ended ) {
- $select_value = $task['task_id'];
- $select_name = 'eme_task_signups[' . $event['event_id'] . '][]';
- $select_id = 'eme_task_signups_' . $event['event_id'] . '_' . $select_value;
- $replacement = " ";
+ $select_value = $task['task_id'];
+ $select_name = 'eme_task_signups[' . $event['event_id'] . '][]';
+ $select_id = 'eme_task_signups_' . $event['event_id'] . '_' . $select_value;
+ $replacement = " ";
}
} else {
$found = 0;
@@ -1010,7 +1010,7 @@ function eme_replace_eventtaskformfields_placeholders( $format, $task, $event )
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
@@ -1045,7 +1045,7 @@ function eme_replace_task_signupformfields_placeholders( $format ) {
if ( $eme_recaptcha_for_forms ) {
$format = eme_add_captcha_submit( $format, 'recaptcha' );
} elseif ( $eme_hcaptcha_for_forms ) {
- $format = eme_add_captcha_submit( $format, 'hcaptcha' );
+ $format = eme_add_captcha_submit( $format, 'hcaptcha' );
} elseif ( $eme_captcha_for_forms ) {
$format = eme_add_captcha_submit( $format, 'captcha' );
} else {
@@ -1063,9 +1063,9 @@ function eme_replace_task_signupformfields_placeholders( $format ) {
$current_user = wp_get_current_user();
$person = eme_get_person_by_wp_id( $current_user->ID );
if ( ! empty( $person ) ) {
- $bookerLastName = $person['lastname'];
- $bookerFirstName = $person['firstname'];
- $bookerEmail = $person['email'];
+ $bookerLastName = $person['lastname'];
+ $bookerFirstName = $person['firstname'];
+ $bookerEmail = $person['email'];
} else {
$bookerLastName = $current_user->user_lastname;
if ( empty( $bookerLastName ) ) {
@@ -1139,16 +1139,16 @@ function eme_replace_task_signupformfields_placeholders( $format ) {
$required = 1;
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms ) {
- $replacement = eme_load_recaptcha_html();
+ $replacement = eme_load_recaptcha_html();
}
} elseif ( preg_match( '/#_CAPTCHA$/', $result ) ) {
if ( $eme_captcha_for_forms ) {
- $replacement = eme_load_captcha_html();
- $required = 1;
+ $replacement = eme_load_captcha_html();
+ $required = 1;
}
} elseif ( preg_match( '/#_SUBMIT(\{.+?\})?/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
@@ -1165,7 +1165,7 @@ function eme_replace_task_signupformfields_placeholders( $format ) {
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
@@ -1240,9 +1240,9 @@ function eme_replace_cancelformfields_placeholders( $event ) {
$current_user = wp_get_current_user();
$person = eme_get_person_by_wp_id( $current_user->ID );
if ( ! empty( $person ) ) {
- $bookerLastName = eme_esc_html($person['lastname']);
- $bookerFirstName = eme_esc_html($person['firstname']);
- $bookerEmail = eme_esc_html($person['email']);
+ $bookerLastName = eme_esc_html($person['lastname']);
+ $bookerFirstName = eme_esc_html($person['firstname']);
+ $bookerEmail = eme_esc_html($person['email']);
} else {
$bookerLastName = $current_user->user_lastname;
if ( empty( $bookerLastName ) ) {
@@ -1333,16 +1333,16 @@ function eme_replace_cancelformfields_placeholders( $event ) {
$replacement = "";
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms ) {
- $replacement = eme_load_recaptcha_html();
+ $replacement = eme_load_recaptcha_html();
}
} elseif ( preg_match( '/#_CAPTCHA$/', $result ) ) {
if ( $eme_captcha_for_forms ) {
- $replacement = eme_load_captcha_html();
- $required = 1;
+ $replacement = eme_load_captcha_html();
+ $required = 1;
}
} elseif ( preg_match( '/#_SUBMIT(\{.+?\})?/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
@@ -1460,16 +1460,16 @@ function eme_replace_cancel_payment_placeholders( $format, $person, $booking_ids
}
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms ) {
- $replacement = eme_load_recaptcha_html();
+ $replacement = eme_load_recaptcha_html();
}
} elseif ( preg_match( '/#_CAPTCHA$/', $result ) ) {
if ( $eme_captcha_for_forms ) {
- $replacement = eme_load_captcha_html();
- $required = 1;
+ $replacement = eme_load_captcha_html();
+ $required = 1;
}
} elseif ( preg_match( '/#_SUBMIT(\{.+?\})?/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
@@ -1534,23 +1534,23 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$current_user = wp_get_current_user();
$person = eme_get_person_by_wp_id( $current_user->ID );
if ( ! empty( $person ) ) {
- $bookerLastName = eme_esc_html( $person['lastname'] );
- $bookerFirstName = eme_esc_html( $person['firstname'] );
- $bookerBirthdate = eme_is_date( $person['birthdate'] ) ? eme_esc_html( $person['birthdate'] ) : '';
- $bookerBirthplace = eme_esc_html( $person['birthplace'] );
- $bookerAddress1 = eme_esc_html( $person['address1'] );
- $bookerAddress2 = eme_esc_html( $person['address2'] );
- $bookerCity = eme_esc_html( $person['city'] );
- $bookerZip = eme_esc_html( $person['zip'] );
- $bookerState = eme_esc_html( $person['state'] );
- $bookerState_code = eme_esc_html( $person['state_code'] );
- $bookerCountry = eme_esc_html( $person['country'] );
- $bookerCountry_code = eme_esc_html( $person['country_code'] );
- $bookerEmail = eme_esc_html( $person['email'] );
- $bookerPhone = eme_esc_html( $person['phone'] );
- $massmail = intval( $person['massmail'] );
- $bd_email = intval( $person['bd_email'] );
- $gdpr = intval( $person['gdpr'] );
+ $bookerLastName = eme_esc_html( $person['lastname'] );
+ $bookerFirstName = eme_esc_html( $person['firstname'] );
+ $bookerBirthdate = eme_is_date( $person['birthdate'] ) ? eme_esc_html( $person['birthdate'] ) : '';
+ $bookerBirthplace = eme_esc_html( $person['birthplace'] );
+ $bookerAddress1 = eme_esc_html( $person['address1'] );
+ $bookerAddress2 = eme_esc_html( $person['address2'] );
+ $bookerCity = eme_esc_html( $person['city'] );
+ $bookerZip = eme_esc_html( $person['zip'] );
+ $bookerState = eme_esc_html( $person['state'] );
+ $bookerState_code = eme_esc_html( $person['state_code'] );
+ $bookerCountry = eme_esc_html( $person['country'] );
+ $bookerCountry_code = eme_esc_html( $person['country_code'] );
+ $bookerEmail = eme_esc_html( $person['email'] );
+ $bookerPhone = eme_esc_html( $person['phone'] );
+ $massmail = intval( $person['massmail'] );
+ $bd_email = intval( $person['bd_email'] );
+ $gdpr = intval( $person['gdpr'] );
} else {
$bookerLastName = eme_esc_html( $current_user->user_lastname );
if ( empty( $bookerLastName ) ) {
@@ -1612,8 +1612,8 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
if ( preg_match( '/#_(NAME|LASTNAME)(\{.+?\})?$/', $result, $matches ) ) {
$this_readonly = '';
if ( is_user_logged_in() ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
- $this_readonly = "readonly='readonly'";
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ $this_readonly = "readonly='readonly'";
if ( $allow_clear ) {
$this_readonly .= " data-clearable='true'";
}
@@ -1631,8 +1631,8 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
} elseif ( preg_match( '/#_FIRSTNAME(\{.+?\})?$/', $result, $matches ) ) {
$this_readonly = '';
if ( is_user_logged_in() ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
- $this_readonly = "readonly='readonly'";
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ $this_readonly = "readonly='readonly'";
}
if ( isset( $matches[1] ) ) {
// remove { and } (first and last char of second match)
@@ -1644,9 +1644,9 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$replacement = " ";
} elseif ( preg_match( '/#_BIRTHDATE(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Date of birth', 'events-made-easy' );
}
@@ -1690,9 +1690,9 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$replacement = " ";
} elseif ( preg_match( '/#_STATE$/', $result ) ) {
if ( ! empty( $bookerState_code ) ) {
- $state_arr = array( $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) );
+ $state_arr = [ $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) ];
} else {
- $state_arr = array();
+ $state_arr = [];
}
$replacement = eme_ui_select( $bookerState_code, 'state_code', $state_arr, '', $required, 'eme_select2_state_class' );
} elseif ( preg_match( '/#_(ZIP|POSTAL)(\{.+?\})?$/', $result, $matches ) ) {
@@ -1706,21 +1706,21 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$replacement = " ";
} elseif ( preg_match( '/#_COUNTRY\{(.+)\}$/', $result, $matches ) ) {
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
$replacement = eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
} else {
$country_code = $matches[1];
$country_name = eme_get_country_name( $country_code );
if ( ! empty( $country_name ) ) {
- $country_arr = array( $country_code => $country_name );
- $replacement = eme_ui_select( $country_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
+ $country_arr = [ $country_code => $country_name ];
+ $replacement = eme_ui_select( $country_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
}
}
} elseif ( preg_match( '/#_COUNTRY$/', $result ) ) {
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
} else {
- $country_arr = array();
+ $country_arr = [];
}
$replacement = eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
} elseif ( preg_match( '/#_(EMAIL|HTML5_EMAIL)(\{.+?\})?$/', $result, $matches ) ) {
@@ -1744,15 +1744,15 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
} elseif ( preg_match( '/#_OPT_OUT$/', $result ) ) {
$selected_massmail = 1;
if ( get_option( 'eme_massmail_popup' ) ) {
- $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
- $replacement = "";
+ $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
+ $replacement = "";
}
$replacement .= eme_ui_select_binary( $selected_massmail, 'massmail' );
} elseif ( preg_match( '/#_OPT_IN$/', $result ) ) {
$selected_massmail = 0;
if ( get_option( 'eme_massmail_popup' ) ) {
- $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
- $replacement = "";
+ $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
+ $replacement = "";
}
$replacement .= eme_ui_select_binary( $selected_massmail, 'massmail' );
} elseif ( preg_match( '/#_GDPR(\{.+?\})?/', $result, $matches ) ) {
@@ -1830,16 +1830,16 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$replacement = "";
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms ) {
- $replacement = eme_load_recaptcha_html();
+ $replacement = eme_load_recaptcha_html();
}
} elseif ( preg_match( '/#_CAPTCHA$/', $result ) ) {
if ( $eme_captcha_for_forms ) {
- $replacement = eme_load_captcha_html();
- $required = 1;
+ $replacement = eme_load_captcha_html();
+ $required = 1;
}
} elseif ( preg_match( '/#_SUBMIT(\{.+?\})?/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
@@ -1855,7 +1855,7 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $replacement = eme_trans_esc_html( $formfield['field_name'] );
+ $replacement = eme_trans_esc_html( $formfield['field_name'] );
} else {
$found = 0;
}
@@ -1863,9 +1863,9 @@ function eme_replace_extra_multibooking_formfields_placeholders( $format, $event
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $field_id = $formfield['field_id'];
- $postfield_name = 'FIELD' . $field_id;
- $entered_val = '';
+ $field_id = $formfield['field_id'];
+ $postfield_name = 'FIELD' . $field_id;
+ $entered_val = '';
if ( $formfield['field_required'] ) {
$required = 1;
}
@@ -1924,8 +1924,8 @@ function eme_replace_dynamic_rsvp_formfields_placeholders( $event, $booking, $fo
$files = array_merge( $files1, $files2 );
} else {
$editing_booking_from_backend = 0;
- $dyn_answers = array();
- $files = array();
+ $dyn_answers = [];
+ $files = [];
}
$needle_offset = 0;
@@ -1948,7 +1948,7 @@ function eme_replace_dynamic_rsvp_formfields_placeholders( $event, $booking, $fo
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $replacement = eme_trans_esc_html( $formfield['field_name'] );
+ $replacement = eme_trans_esc_html( $formfield['field_name'] );
} else {
$found = 0;
}
@@ -1956,16 +1956,16 @@ function eme_replace_dynamic_rsvp_formfields_placeholders( $event, $booking, $fo
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $field_id = $formfield['field_id'];
- $var_prefix = "dynamic_bookings[$event_id][$grouping][$i][";
- $var_postfix = ']';
- $postfield_name = "${var_prefix}FIELD" . $field_id . $var_postfix;
- $postvar_arr = array( 'dynamic_bookings', $event_id, $grouping, $i, 'FIELD' . $field_id );
-
- // when we edit a booking, there's nothing in $_POST until a field condition changes
- // so the first time entered_val=''
- $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
- // if from backend and entered_val ===false, then get it from the stored answer
+ $field_id = $formfield['field_id'];
+ $var_prefix = "dynamic_bookings[$event_id][$grouping][$i][";
+ $var_postfix = ']';
+ $postfield_name = "{$var_prefix}FIELD" . $field_id . $var_postfix;
+ $postvar_arr = [ 'dynamic_bookings', $event_id, $grouping, $i, 'FIELD' . $field_id ];
+
+ // when we edit a booking, there's nothing in $_POST until a field condition changes
+ // so the first time entered_val=''
+ $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
+ // if from backend and entered_val ===false, then get it from the stored answer
if ( $editing_booking_from_backend && $entered_val === false ) {
foreach ( $dyn_answers as $answer ) {
if ( $answer['field_id'] == $field_id ) {
@@ -1975,7 +1975,7 @@ function eme_replace_dynamic_rsvp_formfields_placeholders( $event, $booking, $fo
}
if ( $editing_booking_from_backend ) {
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id && $file['extra_id'] == "$event_id$grouping$i" ) {
$entered_files[] = $file;
@@ -2007,7 +2007,7 @@ function eme_replace_dynamic_rsvp_formfields_placeholders( $event, $booking, $fo
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
@@ -2036,8 +2036,8 @@ function eme_replace_dynamic_membership_formfields_placeholders( $membership, $m
$files = array_merge( $files1, $files2 );
} else {
$editing_member_from_backend = 0;
- $dyn_answers = array();
- $files = array();
+ $dyn_answers = [];
+ $files = [];
}
$needle_offset = 0;
@@ -2060,7 +2060,7 @@ function eme_replace_dynamic_membership_formfields_placeholders( $membership, $m
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $replacement = eme_trans_esc_html( $formfield['field_name'] );
+ $replacement = eme_trans_esc_html( $formfield['field_name'] );
} else {
$found = 0;
}
@@ -2068,16 +2068,16 @@ function eme_replace_dynamic_membership_formfields_placeholders( $membership, $m
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $field_id = $formfield['field_id'];
- $var_prefix = "dynamic_member[$membership_id][$grouping][$i][";
- $var_postfix = ']';
- $postfield_name = "${var_prefix}FIELD" . $field_id . $var_postfix;
- $postvar_arr = array( 'dynamic_member', $membership_id, $grouping, $i, 'FIELD' . $field_id );
-
- // when we edit a booking, there's nothing in $_POST until a field condition changes
- // so the first time entered_val=''
- $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
- // if from backend and entered_val ===false, then get it from the stored answer
+ $field_id = $formfield['field_id'];
+ $var_prefix = "dynamic_member[$membership_id][$grouping][$i][";
+ $var_postfix = ']';
+ $postfield_name = "{$var_prefix}FIELD" . $field_id . $var_postfix;
+ $postvar_arr = [ 'dynamic_member', $membership_id, $grouping, $i, 'FIELD' . $field_id ];
+
+ // when we edit a booking, there's nothing in $_POST until a field condition changes
+ // so the first time entered_val=''
+ $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
+ // if from backend and entered_val ===false, then get it from the stored answer
if ( $editing_member_from_backend && $entered_val === false ) {
foreach ( $dyn_answers as $answer ) {
if ( $answer['field_id'] == $field_id ) {
@@ -2088,7 +2088,7 @@ function eme_replace_dynamic_membership_formfields_placeholders( $membership, $m
if ( $editing_member_from_backend ) {
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id && $file['extra_id'] == "$membership_id$grouping$i" ) {
$entered_files[] = $file;
@@ -2120,7 +2120,7 @@ function eme_replace_dynamic_membership_formfields_placeholders( $membership, $m
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
@@ -2189,7 +2189,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$bookerComment = '';
$bookerPhone = '';
$bookedSeats = 0;
- $booking_seats_mp = array();
+ $booking_seats_mp = [];
$massmail = null;
$bd_email = 0;
$gdpr = 0;
@@ -2200,8 +2200,8 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! empty( $person ) ) {
$bookerLastName = eme_esc_html( $person['lastname'] );
$bookerFirstName = eme_esc_html( $person['firstname'] );
- $bookerBirthdate = eme_is_date( $person['birthdate'] ) ? eme_esc_html( $person['birthdate'] ) : '';
- $bookerBirthplace = eme_esc_html( $person['birthplace'] );
+ $bookerBirthdate = eme_is_date( $person['birthdate'] ) ? eme_esc_html( $person['birthdate'] ) : '';
+ $bookerBirthplace = eme_esc_html( $person['birthplace'] );
$bookerAddress1 = eme_esc_html( $person['address1'] );
$bookerAddress2 = eme_esc_html( $person['address2'] );
$bookerCity = eme_esc_html( $person['city'] );
@@ -2294,7 +2294,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
// check which fields are used in the event definition for dynamic data
- $eme_dyndatafields = array();
+ $eme_dyndatafields = [];
if ( isset( $event['event_properties']['rsvp_dyndata'] ) ) {
foreach ( $event['event_properties']['rsvp_dyndata'] as $dynfield ) {
$eme_dyndatafields[] = $dynfield['field'];
@@ -2345,7 +2345,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
}
- $booked_seats_options = array();
+ $booked_seats_options = [];
if ( eme_is_multi( $max_allowed ) ) {
$multi_max_allowed = eme_convert_multi2array( $max_allowed );
$max_allowed_is_multi = 1;
@@ -2369,7 +2369,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
foreach ( $multi_avail as $key => $avail_seats ) {
- $booked_seats_options[ $key ] = array();
+ $booked_seats_options[ $key ] = [];
if ( $max_allowed_is_multi ) {
$real_max_allowed = intval( $multi_max_allowed[ $key ] );
} else {
@@ -2383,7 +2383,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
// 0 means no limit, but we need a sensible max to show ...
if ( $event_multiseats[ $key ] == 0 && $real_max_allowed == 0 ) {
- $real_max_allowed = 10;
+ $real_max_allowed = 10;
}
if ( $editing_booking_from_backend && isset( $booking_seats_mp[ $key ] ) ) {
@@ -2410,7 +2410,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
} elseif ( eme_is_multi( $event['price'] ) ) {
// we just need to loop through the same amount of seats as there are prices
foreach ( eme_convert_multi2array( $event['price'] ) as $key => $value ) {
- $booked_seats_options[ $key ] = array();
+ $booked_seats_options[ $key ] = [];
if ( $max_allowed_is_multi ) {
$real_max_allowed = (int) $multi_max_allowed[ $key ];
} else {
@@ -2424,7 +2424,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
// 0 means no limit, but we need a sensible max to show ...
if ( $event_seats == 0 && $real_max_allowed == 0 ) {
- $real_max_allowed = 10;
+ $real_max_allowed = 10;
}
if ( $editing_booking_from_backend && isset( $booking_seats_mp[ $key ] ) ) {
@@ -2469,9 +2469,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( $editing_booking_from_backend && $real_max_allowed < $bookedSeats ) {
$real_max_allowed += $bookedSeats;
if ( $max_allowed_is_multi && $real_max_allowed > $multi_max_allowed[0] ) {
- $real_max_allowed = $multi_max_allowed[0];
+ $real_max_allowed = $multi_max_allowed[0];
} elseif ( $real_max_allowed > $max_allowed ) {
- $real_max_allowed = $max_allowed;
+ $real_max_allowed = $max_allowed;
}
}
@@ -2610,15 +2610,15 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'lastname';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
- $this_readonly = "readonly='readonly'";
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ $this_readonly = "readonly='readonly'";
if ( $allow_clear ) {
$this_readonly .= " data-clearable='true'";
}
} elseif ( ! empty( $invite_readonly ) && ! empty( $bookerLastName ) ) {
$this_readonly = $invite_readonly;
} else {
- $this_readonly = $readonly;
+ $this_readonly = $readonly;
}
if ( isset( $matches[2] ) ) {
// remove { and } (first and last char of second match)
@@ -2640,12 +2640,12 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'firstname';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
- $this_readonly = "readonly='readonly'";
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ $this_readonly = "readonly='readonly'";
} elseif ( ! empty( $invite_readonly ) && ! empty( $bookerFirstName ) ) {
$this_readonly = $invite_readonly;
} else {
- $this_readonly = $readonly;
+ $this_readonly = $readonly;
}
if ( isset( $matches[1] ) ) {
// remove { and } (first and last char of second match)
@@ -2659,23 +2659,23 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
} elseif ( preg_match( '/#_BIRTHDATE(\{.+?\})?$/', $result, $matches ) ) {
if ( ! $is_multibooking ) {
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Date of birth', 'events-made-easy' );
}
$fieldname = 'birthdate';
$replacement = " ";
- $replacement .= " ";
+ $replacement .= " ";
}
} elseif ( preg_match( '/#_BIRTHPLACE(\{.+?\})?$/', $result, $matches ) ) {
if ( ! $is_multibooking ) {
$fieldname = 'birthplace';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Place of birth', 'events-made-easy' );
}
@@ -2685,9 +2685,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'address1';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = eme_trans_esc_html( get_option( 'eme_address1_string' ) );
}
@@ -2697,9 +2697,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'address2';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = eme_trans_esc_html( get_option( 'eme_address2_string' ) );
}
@@ -2709,9 +2709,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'city';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'City', 'events-made-easy' );
}
@@ -2721,9 +2721,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'zip';
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Postal code', 'events-made-easy' );
}
@@ -2733,9 +2733,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'state_code';
if ( ! empty( $bookerState_code ) ) {
- $state_arr = array( $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) );
+ $state_arr = [ $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) ];
} else {
- $state_arr = array();
+ $state_arr = [];
}
$replacement = eme_ui_select( $bookerState_code, 'state_code', $state_arr, '', $required, "eme_select2_state_class $dynamic_field_class_basic", $disabled );
}
@@ -2743,9 +2743,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'country_code';
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
} else {
- $country_arr = array();
+ $country_arr = [];
}
$replacement = eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, "eme_select2_country_class $dynamic_field_class_basic", $disabled );
}
@@ -2753,12 +2753,12 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'email';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
- $this_readonly = "readonly='readonly'";
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ $this_readonly = "readonly='readonly'";
} elseif ( ! empty( $invite_readonly ) && ! empty( $bookerEmail ) ) {
$this_readonly = $invite_readonly;
} else {
- $this_readonly = $readonly;
+ $this_readonly = $readonly;
}
// there still exist people without email, so in the backend we allow it ...
if ( isset( $matches[2] ) ) {
@@ -2781,9 +2781,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'phone';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Phone number', 'events-made-easy' );
}
@@ -2793,9 +2793,9 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $is_multibooking ) {
$fieldname = 'phone';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Phone number', 'events-made-easy' );
}
@@ -2808,8 +2808,8 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$selected_massmail = ( isset( $massmail ) ) ? $massmail : 1;
$fieldname = 'massmail';
if ( ! $eme_is_admin_request && get_option( 'eme_massmail_popup' ) ) {
- $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
- $replacement = "";
+ $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
+ $replacement = "";
}
$replacement .= eme_ui_select_binary( $selected_massmail, $fieldname, 0, $dynamic_field_class_basic, $disabled );
}
@@ -2818,16 +2818,16 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$selected_massmail = ( isset( $massmail ) ) ? $massmail : 0;
$fieldname = 'massmail';
if ( ! $eme_is_admin_request && get_option( 'eme_massmail_popup' ) ) {
- $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
- $replacement = "";
+ $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
+ $replacement = "";
}
$replacement .= eme_ui_select_binary( $selected_massmail, $fieldname, 0, $dynamic_field_class_basic, $disabled );
}
} elseif ( preg_match( '/#_GDPR(\{.+?\})?/', $result, $matches ) ) {
if ( ! $is_multibooking ) {
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $label = substr( $matches[1], 1, -1 );
+ // remove { and } (first and last char of second match)
+ $label = substr( $matches[1], 1, -1 );
} else {
$label = '';
}
@@ -2839,7 +2839,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
} elseif ( preg_match( '/#_SUBSCRIBE_TO_GROUP\{(.+?)\}(\{.+?\})?/', $result, $matches ) ) {
if ( ! $is_multibooking ) {
if ( is_numeric( $matches[1] ) ) {
- $group = eme_get_group( $matches[1] );
+ $group = eme_get_group( $matches[1] );
} else {
$group = eme_get_group_by_name( eme_sanitize_request( $matches[1] ) );
}
@@ -2852,11 +2852,11 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
// remove { and } (first and last char of second match)
$label = substr( $matches[2], 1, -1 );
} else {
- $label = $group['name'];
+ $label = $group['name'];
}
$replacement = " ";
if ( ! empty( $label ) ) {
- $replacement .= "" . eme_esc_html( $label ) . ' ';
+ $replacement .= "" . eme_esc_html( $label ) . ' ';
}
}
} else {
@@ -2865,7 +2865,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
} elseif ( preg_match( '/#_PASSWORD(\{.+?\})?$/', $result, $matches ) ) {
if ( ! empty( $event['event_properties']['rsvp_password'] ) && ! $eme_is_admin_request && ! $is_multibooking ) {
- $fieldname = 'rsvp_password';
+ $fieldname = 'rsvp_password';
if ( isset( $matches[1] ) ) {
// remove { and } (first and last char of second match)
$placeholder_text = substr( $matches[1], 1, -1 );
@@ -2889,7 +2889,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
} elseif ( preg_match( '/#_SEATS$|#_SPACES$/', $result ) ) {
$var_prefix = "bookings[$event_id][";
$var_postfix = ']';
- $fieldname = "${var_prefix}bookedSeats${var_postfix}";
+ $fieldname = "{$var_prefix}bookedSeats{$var_postfix}";
if ( $editing_booking_from_backend && isset( $bookedSeats ) ) {
$entered_val = $bookedSeats;
} else {
@@ -2916,12 +2916,12 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
++$seats_found;
}
} elseif ( preg_match( '/#_(SEATS|SPACES)\{(\d+)\}/', $result, $matches ) ) {
- $field_id = intval( $matches[2] );
- $var_prefix = "bookings[$event_id][";
- $var_postfix = ']';
- $fieldname = "${var_prefix}bookedSeats" . $field_id . $var_postfix;
+ $field_id = intval( $matches[2] );
+ $var_prefix = "bookings[$event_id][";
+ $var_postfix = ']';
+ $fieldname = "{$var_prefix}bookedSeats" . $field_id . $var_postfix;
- // for multiseats, the index starts at 1 (#_SEATS1, #_SEATS2, etc ...) but in booking_seats_mp the index starts at 0, so we do -1
+ // for multiseats, the index starts at 1 (#_SEATS1, #_SEATS2, etc ...) but in booking_seats_mp the index starts at 0, so we do -1
if ( $editing_booking_from_backend && $field_id > 0 && isset( $booking_seats_mp[ $field_id - 1 ] ) ) {
$entered_val = intval( $booking_seats_mp[ $field_id - 1 ] );
} else {
@@ -2929,8 +2929,8 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
if ( ! eme_is_multi( $event['price'] ) ) {
- // this will show if people mix #_SEATS and #_SEATS{xx}
- $error_msg = __( 'By using #_SEATS{xx}, you are using multiple seat categories in your RSVP template, but you have not defined a price for each category in your event RSVP settings. Please correct the event RSVP settings.', 'events-made-easy' );
+ // this will show if people mix #_SEATS and #_SEATS{xx}
+ $error_msg = __( 'By using #_SEATS{xx}, you are using multiple seat categories in your RSVP template, but you have not defined a price for each category in your event RSVP settings. Please correct the event RSVP settings.', 'events-made-easy' );
} elseif ( $event['event_properties']['take_attendance'] ) {
// if we require 1 seat at the minimum, we set it to that and hide it for take_attendance
if ( $min_allowed_is_multi && $multi_min_allowed[ $field_id - 1 ] > 0 ) {
@@ -2938,22 +2938,22 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
} else {
$replacement = eme_ui_select_binary( $entered_val, $fieldname, 0, $dynamic_price_class_basic . ' ' . $dynamic_field_class_basic );
}
- ++$seats_found;
+ ++$seats_found;
} else {
if ( $min_allowed_is_multi && $multi_min_allowed[ $field_id - 1 ] > 0 && $multi_min_allowed[ $field_id - 1 ] == $multi_max_allowed[ $field_id - 1 ] ) {
- $replacement = " ";
+ $replacement = " ";
} else {
- $replacement = eme_ui_select( $entered_val, $fieldname, $booked_seats_options[ $field_id - 1 ], '', 0, $dynamic_price_class_basic . ' ' . $dynamic_field_class_basic );
+ $replacement = eme_ui_select( $entered_val, $fieldname, $booked_seats_options[ $field_id - 1 ], '', 0, $dynamic_price_class_basic . ' ' . $dynamic_field_class_basic );
}
- ++$seats_found;
+ ++$seats_found;
}
} elseif ( preg_match( '/#_COMMENT(\{.+?\})?$/', $result, $matches ) ) {
if ( ! $is_multibooking ) {
$fieldname = 'eme_rsvpcomment';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Comment', 'events-made-easy' );
}
@@ -2961,7 +2961,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms && ! $is_multibooking ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms && ! $is_multibooking ) {
@@ -2976,7 +2976,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $replacement = eme_trans_esc_html( $formfield['field_name'] );
+ $replacement = eme_trans_esc_html( $formfield['field_name'] );
} else {
$found = 0;
}
@@ -2989,7 +2989,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$replacement = '';
} else {
$field_id = $formfield['field_id'];
- $fieldname = "${var_prefix}FIELD" . $field_id . $var_postfix;
+ $fieldname = "{$var_prefix}FIELD" . $field_id . $var_postfix;
$entered_val = '';
$field_readonly = 0;
if ( $editing_booking_from_backend ) {
@@ -3010,7 +3010,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
$files2 = eme_get_uploaded_files( $booking['booking_id'], 'bookings' );
$files = array_merge( $files1, $files2 );
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id ) {
$entered_files[] = $file;
@@ -3028,7 +3028,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
}
}
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id ) {
$entered_files[] = $file;
@@ -3056,14 +3056,14 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( ! $eme_is_admin_request ) {
$var_prefix = "bookings[$event_id][";
$var_postfix = ']';
- $postfield_name = "${var_prefix}DISCOUNT${discount_fields_count}${var_postfix}";
+ $postfield_name = "{$var_prefix}DISCOUNT{$discount_fields_count}{$var_postfix}";
$entered_val = '';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
- $placeholder_text = esc_html__( 'Discount code', 'events-made-easy' );
+ $placeholder_text = esc_html__( 'Discount code', 'events-made-easy' );
}
$replacement = " ";
} elseif ( $eme_is_admin_request && $discount_fields_count == 1 ) {
@@ -3114,7 +3114,7 @@ function eme_replace_rsvp_formfields_placeholders( $event, $booking, $format = '
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
@@ -3181,10 +3181,10 @@ function eme_replace_membership_familyformfields_placeholders( $format, $counter
}
if ( preg_match( '/#_(NAME|LASTNAME)(\{.+?\})?$/', $result, $matches ) ) {
- $postvar_arr = array( 'familymember', $counter, 'lastname' );
+ $postvar_arr = [ 'familymember', $counter, 'lastname' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[2] ) ) {
// remove { and } (first and last char of second match)
@@ -3197,15 +3197,15 @@ function eme_replace_membership_familyformfields_placeholders( $format, $counter
++$lastname_found;
$required = 1;
} elseif ( preg_match( '/#_FIRSTNAME(\{.+?\})?$/', $result, $matches ) ) {
- $postvar_arr = array( 'familymember', $counter, 'firstname' );
+ $postvar_arr = [ 'familymember', $counter, 'firstname' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'First name', 'events-made-easy' );
}
@@ -3213,71 +3213,71 @@ function eme_replace_membership_familyformfields_placeholders( $format, $counter
++$firstname_found;
$required = 1;
} elseif ( preg_match( '/#_(PHONE$|HTML5_PHONE)(\{.+?\})?$/', $result, $matches ) ) {
- $postvar_arr = array( 'familymember', $counter, 'phone' );
+ $postvar_arr = [ 'familymember', $counter, 'phone' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Phone number', 'events-made-easy' );
}
$replacement = " ";
$required = 1;
} elseif ( preg_match( '/#_(EMAIL|HTML5_EMAIL)(\{.+?\})?$/', $result, $matches ) ) {
- $postvar_arr = array( 'familymember', $counter, 'email' );
+ $postvar_arr = [ 'familymember', $counter, 'email' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Email', 'events-made-easy' );
}
$replacement = " ";
$required = 1;
} elseif ( preg_match( '/#_BIRTHDAY_EMAIL$/', $result ) ) {
- $postvar_arr = array( 'familymember', $counter, 'bd_email' );
+ $postvar_arr = [ 'familymember', $counter, 'bd_email' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $selected_bd_email = 1;
+ $selected_bd_email = 1;
} else {
$selected_bd_email = $entered_val;
}
$replacement .= eme_ui_select_binary( $selected_bd_email, "familymember[$counter][bd_email]", 0, $dynamic_field_class_basic );
} elseif ( preg_match( '/#_OPT_OUT/', $result ) ) {
- $postvar_arr = array( 'familymember', $counter, 'massmail' );
+ $postvar_arr = [ 'familymember', $counter, 'massmail' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $selected_massmail = 1;
+ $selected_massmail = 1;
} else {
$selected_massmail = $entered_val;
}
$replacement .= eme_ui_select_binary( $selected_massmail, "familymember[$counter][massmail]", 0, $dynamic_field_class_basic );
} elseif ( preg_match( '/#_OPT_IN$/', $result ) ) {
if ( $entered_val === false ) {
- $selected_massmail = 0;
+ $selected_massmail = 0;
} else {
$selected_massmail = $entered_val;
}
$replacement .= eme_ui_select_binary( $selected_massmail, "familymember[$counter][massmail]", 0, $dynamic_field_class_basic );
$required = 1;
} elseif ( preg_match( '/#_BIRTHPLACE(\{.+?\})?/', $result, $matches ) ) {
- $postvar_arr = array( 'familymember', $counter, 'birthplace' );
+ $postvar_arr = [ 'familymember', $counter, 'birthplace' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Place of birth', 'events-made-easy' );
}
@@ -3285,26 +3285,26 @@ function eme_replace_membership_familyformfields_placeholders( $format, $counter
$required = 1;
} elseif ( preg_match( '/#_BIRTHDATE(\{.+?\})?/', $result, $matches ) ) {
$fieldname = "familymember[$counter][birthdate]";
- $postvar_arr = array( 'familymember', $counter, 'birthdate' );
+ $postvar_arr = [ 'familymember', $counter, 'birthdate' ];
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $entered_val === false ) {
- $entered_val = '';
+ $entered_val = '';
}
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Date of birth', 'events-made-easy' );
}
$replacement = " ";
- $replacement .= " ";
+ $replacement .= " ";
$required = 1;
} elseif ( preg_match( '/#_FIELDNAME\{(.+)\}/', $result, $matches ) ) {
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $replacement = eme_trans_esc_html( $formfield['field_name'] );
+ $replacement = eme_trans_esc_html( $formfield['field_name'] );
} else {
$found = 0;
}
@@ -3312,13 +3312,13 @@ function eme_replace_membership_familyformfields_placeholders( $format, $counter
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) && $formfield['field_purpose'] == 'people' ) {
- $field_id = $formfield['field_id'];
- // all the people fields are dynamic fields in the backend, and the function eme_store_people_answers searches for that, so we need that name again
- $var_prefix = "familymember[$counter][";
- $var_postfix = ']';
- $postfield_name = "${var_prefix}FIELD" . $field_id . $var_postfix;
- $postvar_arr = array( 'familymember', $counter, 'FIELD' . $field_id );
- $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
+ $field_id = $formfield['field_id'];
+ // all the people fields are dynamic fields in the backend, and the function eme_store_people_answers searches for that, so we need that name again
+ $var_prefix = "familymember[$counter][";
+ $var_postfix = ']';
+ $postfield_name = "{$var_prefix}FIELD" . $field_id . $var_postfix;
+ $postvar_arr = [ 'familymember', $counter, 'FIELD' . $field_id ];
+ $entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
if ( $formfield['field_required'] ) {
$required = 1;
}
@@ -3409,23 +3409,23 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
$person = eme_get_person_by_wp_id( $current_user->ID );
if ( ! empty( $person ) ) {
- $bookerLastName = eme_esc_html( $person['lastname'] );
- $bookerFirstName = eme_esc_html( $person['firstname'] );
+ $bookerLastName = eme_esc_html( $person['lastname'] );
+ $bookerFirstName = eme_esc_html( $person['firstname'] );
$bookerBirthdate = eme_is_date( $person['birthdate'] ) ? eme_esc_html( $person['birthdate'] ) : '';
$bookerBirthplace = eme_esc_html( $person['birthplace'] );
- $bookerAddress1 = eme_esc_html( $person['address1'] );
- $bookerAddress2 = eme_esc_html( $person['address2'] );
- $bookerCity = eme_esc_html( $person['city'] );
- $bookerZip = eme_esc_html( $person['zip'] );
- $bookerState = eme_esc_html( $person['state'] );
- $bookerState_code = eme_esc_html( $person['state_code'] );
- $bookerCountry = eme_esc_html( $person['country'] );
- $bookerCountry_code = eme_esc_html( $person['country_code'] );
- $bookerEmail = eme_esc_html( $person['email'] );
- $bookerPhone = eme_esc_html( $person['phone'] );
- $massmail = intval( $person['massmail'] );
- $bd_email = intval( $person['bd_email'] );
- $gdpr = intval( $person['gdpr'] );
+ $bookerAddress1 = eme_esc_html( $person['address1'] );
+ $bookerAddress2 = eme_esc_html( $person['address2'] );
+ $bookerCity = eme_esc_html( $person['city'] );
+ $bookerZip = eme_esc_html( $person['zip'] );
+ $bookerState = eme_esc_html( $person['state'] );
+ $bookerState_code = eme_esc_html( $person['state_code'] );
+ $bookerCountry = eme_esc_html( $person['country'] );
+ $bookerCountry_code = eme_esc_html( $person['country_code'] );
+ $bookerEmail = eme_esc_html( $person['email'] );
+ $bookerPhone = eme_esc_html( $person['phone'] );
+ $massmail = intval( $person['massmail'] );
+ $bd_email = intval( $person['bd_email'] );
+ $gdpr = intval( $person['gdpr'] );
} else {
$bookerLastName = eme_esc_html( $current_user->user_lastname );
if ( empty( $bookerLastName ) ) {
@@ -3469,7 +3469,7 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
}
// check which fields are used in the event definition for dynamic data
- $eme_dyndatafields = array();
+ $eme_dyndatafields = [];
if ( isset( $membership['properties']['dyndata'] ) ) {
foreach ( $membership['properties']['dyndata'] as $dynfield ) {
$eme_dyndatafields[] = $dynfield['field'];
@@ -3575,7 +3575,7 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
if ( preg_match( '/#_(NAME|LASTNAME)(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'lastname';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
$this_readonly = "readonly='readonly'";
if ( $allow_clear ) {
$this_readonly .= " data-clearable='true'";
@@ -3603,7 +3603,7 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
} elseif ( preg_match( '/#_FIRSTNAME(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'firstname';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
$this_readonly = "readonly='readonly'";
} else {
$this_readonly = $readonly;
@@ -3613,31 +3613,31 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
$required = 1;
}
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
- $placeholder_text = esc_html__( 'First name', 'events-made-easy' );
+ $placeholder_text = esc_html__( 'First name', 'events-made-easy' );
}
$replacement = " ";
++$firstname_found;
} elseif ( preg_match( '/#_BIRTHDATE(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'birthdate';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Date of birth', 'events-made-easy' );
}
$replacement = " ";
- $replacement .= " ";
+ $replacement .= " ";
} elseif ( preg_match( '/#_BIRTHPLACE(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'birthplace';
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Place of birth', 'events-made-easy' );
}
@@ -3685,23 +3685,23 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
} elseif ( preg_match( '/#_STATE$/', $result ) ) {
$fieldname = 'state_code';
if ( ! empty( $bookerState_code ) ) {
- $state_arr = array( $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) );
+ $state_arr = [ $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) ];
} else {
- $state_arr = array();
+ $state_arr = [];
}
$replacement = "" . eme_ui_select( $bookerState_code, 'state_code', $state_arr, '', $required, "eme_select2_state_class $dynamic_field_class_basic", $disabled ) . '
';
} elseif ( preg_match( '/#_COUNTRY$/', $result ) ) {
$fieldname = 'country_code';
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
} else {
- $country_arr = array();
+ $country_arr = [];
}
$replacement = "" . eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, "eme_select2_country_class $dynamic_field_class_basic", $disabled ) . '
';
} elseif ( preg_match( '/#_(EMAIL|HTML5_EMAIL)(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'email';
if ( is_user_logged_in() && ! $eme_is_admin_request ) {
- // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
+ // in the frontend and logged in, so this info comes from the wp profile, so make it readonly
$this_readonly = "readonly='readonly'";
} else {
$this_readonly = $readonly;
@@ -3713,20 +3713,20 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
$required = 1;
}
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
- $placeholder_text = esc_html__( 'Email', 'events-made-easy' );
+ $placeholder_text = esc_html__( 'Email', 'events-made-easy' );
}
$replacement = " ";
++$email_found;
} elseif ( preg_match( '/#_(PHONE$|HTML5_PHONE)(\{.+?\})?$/', $result, $matches ) ) {
$fieldname = 'phone';
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Phone number', 'events-made-easy' );
}
@@ -3745,8 +3745,8 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
$selected_massmail = ( isset( $massmail ) ) ? $massmail : 0;
$fieldname = 'massmail';
if ( ! $eme_is_admin_request && get_option( 'eme_massmail_popup' ) ) {
- $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
- $replacement = "";
+ $popup = eme_esc_html( get_option( 'eme_massmail_popup_text' ) );
+ $replacement = "";
}
$replacement .= eme_ui_select_binary( $selected_massmail, $fieldname, 0, "$dynamic_field_class_basic $personal_info_class", $disabled );
} elseif ( preg_match( '/#_GDPR(\{.+?\})?/', $result, $matches ) ) {
@@ -3762,7 +3762,7 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
}
} elseif ( preg_match( '/#_SUBSCRIBE_TO_GROUP\{(.+?)\}(\{.+?\})?/', $result, $matches ) ) {
if ( is_numeric( $matches[1] ) ) {
- $group = eme_get_group( $matches[1] );
+ $group = eme_get_group( $matches[1] );
} else {
$group = eme_get_group_by_name( eme_sanitize_request( $matches[1] ) );
}
@@ -3787,12 +3787,12 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
}
} elseif ( preg_match( '/#_DISCOUNT(\{.+?\})?$/', $result, $matches ) ) {
if ( $membership['properties']['discount'] || $membership['properties']['discountgroup'] ) {
- // we need an ID to have a unique name per DISCOUNT input field
- ++$discount_fields_count;
+ // we need an ID to have a unique name per DISCOUNT input field
+ ++$discount_fields_count;
if ( ! $eme_is_admin_request ) {
$var_prefix = "members[$membership_id][";
$var_postfix = ']';
- $postfield_name = "${var_prefix}DISCOUNT${discount_fields_count}${var_postfix}";
+ $postfield_name = "{$var_prefix}DISCOUNT{$discount_fields_count}{$var_postfix}";
$entered_val = '';
if ( isset( $matches[1] ) ) {
// remove { and } (first and last char of second match)
@@ -3855,7 +3855,7 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
} elseif ( preg_match( '/#_FAMILYCOUNT/', $result, $matches ) ) {
$fieldname = 'familycount';
if ( ! $eme_is_admin_request ) {
- $range_arr = array();
+ $range_arr = [];
for ( $i = 0;$i <= 10;$i++ ) {
$range_arr[ $i ] = $i;
}
@@ -3880,10 +3880,10 @@ function eme_replace_membership_formfields_placeholders( $membership, $member, $
$field_key = $matches[1];
$formfield = eme_get_formfield( $field_key );
if ( ! empty( $formfield ) ) {
- $field_id = $formfield['field_id'];
- $fieldname = 'FIELD' . $field_id;
- $entered_val = '';
- $field_readonly = 0;
+ $field_id = $formfield['field_id'];
+ $fieldname = 'FIELD' . $field_id;
+ $entered_val = '';
+ $field_readonly = 0;
if ( $editing_from_backend ) {
if ( $formfield['field_purpose'] == 'people' ) {
$answers = eme_get_person_answers( $member['person_id'] );
@@ -3981,15 +3981,15 @@ function eme_replace_subscribeform_placeholders( $format, $unsubscribe = 0 ) {
$tmp_groups = eme_get_public_groups();
if ( ! empty( $tmp_groups ) ) {
- $public_groups = array( '' => esc_html__( 'All', 'events-made-easy' ) );
+ $public_groups = [ '' => esc_html__( 'All', 'events-made-easy' ) ];
} else {
- $public_groups = array();
+ $public_groups = [];
}
if ( wp_next_scheduled( 'eme_cron_send_new_events' ) ) {
- $public_groups['-1'] = esc_html__( 'Newsletter concerning new events', 'events-made-easy' );
+ $public_groups['-1'] = esc_html__( 'Newsletter concerning new events', 'events-made-easy' );
}
foreach ( $tmp_groups as $group ) {
- $public_groups[ $group['group_id'] ] = eme_esc_html( $group['name'] );
+ $public_groups[ $group['group_id'] ] = eme_esc_html( $group['name'] );
}
$bookerLastName = '';
@@ -4001,9 +4001,9 @@ function eme_replace_subscribeform_placeholders( $format, $unsubscribe = 0 ) {
$current_user = wp_get_current_user();
$person = eme_get_person_by_wp_id( $current_user->ID );
if ( ! empty( $person ) ) {
- $bookerLastName = $person['lastname'];
- $bookerFirstName = $person['firstname'];
- $bookerEmail = $person['email'];
+ $bookerLastName = $person['lastname'];
+ $bookerFirstName = $person['firstname'];
+ $bookerEmail = $person['email'];
} else {
$bookerLastName = $current_user->user_lastname;
if ( empty( $bookerLastName ) ) {
@@ -4110,15 +4110,15 @@ function eme_replace_subscribeform_placeholders( $format, $unsubscribe = 0 ) {
$replacement = eme_ui_checkbox_binary( 0, 'gdpr', $label, 1, 'eme-gdpr-field' );
} elseif ( preg_match( '/#_HCAPTCHA$/', $result ) ) {
if ( $eme_hcaptcha_for_forms ) {
- $replacement = eme_load_hcaptcha_html();
+ $replacement = eme_load_hcaptcha_html();
}
} elseif ( preg_match( '/#_RECAPTCHA$/', $result ) ) {
if ( $eme_recaptcha_for_forms ) {
- $replacement = eme_load_recaptcha_html();
+ $replacement = eme_load_recaptcha_html();
}
} elseif ( preg_match( '/#_CAPTCHA/', $result ) ) {
if ( $eme_captcha_for_forms ) {
- $replacement = eme_load_captcha_html();
+ $replacement = eme_load_captcha_html();
}
} elseif ( preg_match( '/#_SUBMIT(\{.+?\})?/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
@@ -4215,9 +4215,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
if ( preg_match( '/#_(NAME|LASTNAME)(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Last name', 'events-made-easy' );
}
@@ -4230,9 +4230,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$required = 1;
} elseif ( preg_match( '/#_FIRSTNAME(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'First name', 'events-made-easy' );
}
@@ -4244,9 +4244,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$required = 1;
} elseif ( preg_match( '/#_BIRTHDATE(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Date of birth', 'events-made-easy' );
}
@@ -4255,9 +4255,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
} elseif ( preg_match( '/#_BIRTHPLACE(\{.+?\})?$/', $result, $matches ) ) {
$replacement = " ";
if ( isset( $matches[1] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[1], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[1], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Place of birth', 'events-made-easy' );
}
@@ -4290,9 +4290,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$replacement = " ";
} elseif ( preg_match( '/#_STATE$/', $result ) ) {
if ( ! empty( $bookerState_code ) ) {
- $state_arr = array( $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) );
+ $state_arr = [ $bookerState_code => eme_get_state_name( $bookerState_code, $bookerCountry_code ) ];
} else {
- $state_arr = array();
+ $state_arr = [];
}
$replacement = eme_ui_select( $bookerState_code, 'state_code', $state_arr, '', $required, 'eme_select2_state_class' );
} elseif ( preg_match( '/#_(ZIP|POSTAL)(\{.+?\})?$/', $result, $matches ) ) {
@@ -4306,29 +4306,29 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$replacement = " ";
} elseif ( preg_match( '/#_COUNTRY\{(.+)\}$/', $result, $matches ) ) {
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
$replacement = eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
} else {
$country_code = $matches[1];
$country_name = eme_get_country_name( $country_code );
if ( ! empty( $country_name ) ) {
- $country_arr = array( $country_code => $country_name );
+ $country_arr = [ $country_code => $country_name ];
$replacement = eme_ui_select( $country_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
}
}
} elseif ( preg_match( '/#_COUNTRY$/', $result ) ) {
if ( ! empty( $bookerCountry_code ) ) {
- $country_arr = array( $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) );
+ $country_arr = [ $bookerCountry_code => eme_get_country_name( $bookerCountry_code ) ];
} else {
- $country_arr = array();
+ $country_arr = [];
}
$replacement = eme_ui_select( $bookerCountry_code, 'country_code', $country_arr, '', $required, 'eme_select2_country_class' );
} elseif ( preg_match( '/#_(EMAIL|HTML5_EMAIL)(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Email', 'events-made-easy' );
}
@@ -4340,9 +4340,9 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$required = 1;
} elseif ( preg_match( '/#_(PHONE$|HTML5_PHONE)(\{.+?\})?$/', $result, $matches ) ) {
if ( isset( $matches[2] ) ) {
- // remove { and } (first and last char of second match)
- $placeholder_text = substr( $matches[2], 1, -1 );
- $placeholder_text = eme_trans_esc_html( $placeholder_text );
+ // remove { and } (first and last char of second match)
+ $placeholder_text = substr( $matches[2], 1, -1 );
+ $placeholder_text = eme_trans_esc_html( $placeholder_text );
} else {
$placeholder_text = esc_html__( 'Phone number', 'events-made-easy' );
}
@@ -4401,8 +4401,8 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
$person_id = $person['person_id'];
$var_prefix = "dynamic_personfields[$person_id][";
$var_postfix = ']';
- $postfield_name = "${var_prefix}FIELD" . $field_id . $var_postfix;
- $postvar_arr = array( 'dynamic_personfields', $person_id, 'FIELD' . $field_id );
+ $postfield_name = "{$var_prefix}FIELD" . $field_id . $var_postfix;
+ $postvar_arr = [ 'dynamic_personfields', $person_id, 'FIELD' . $field_id ];
// the first time there's no $_POST yet
if ( ! empty( $_POST ) ) {
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
@@ -4421,7 +4421,7 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
}
$files = eme_get_uploaded_files( $person['person_id'], 'people' );
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id ) {
$entered_files[] = $file;
@@ -4452,7 +4452,7 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
if ( $required ) {
$eme_form_required_field_string = eme_translate( get_option( 'eme_form_required_field_string' ) );
if ( ! empty( $eme_form_required_field_string ) ) {
- $replacement .= "$eme_form_required_field_string
";
+ $replacement .= "$eme_form_required_field_string
";
}
}
if ( $found ) {
@@ -4476,7 +4476,7 @@ function eme_replace_cpiform_placeholders( $format, $person ) {
function eme_find_required_formfields( $format ) {
preg_match_all( '/#REQ_?[A-Za-z0-9_]+(\{.*?\})?/', $format, $placeholders );
usort( $placeholders[0], 'eme_sort_stringlenth' );
- $result = array();
+ $result = [];
foreach ( $placeholders[0] as $placeholder ) {
// #_NAME and #REQ_NAME should be using _LASTNAME
$res = preg_replace( '/_NAME/', '_LASTNAME', $placeholder );
@@ -4530,7 +4530,7 @@ function eme_answer2readable( $answer, $formfield, $convert_val = 1, $sep = '||'
return eme_convert_array2multi( $answers, $sep );
}
$tags = eme_convert_multi2array( $field_tags );
- $my_arr = array();
+ $my_arr = [];
foreach ( $answers as $ans ) {
foreach ( $values as $key => $val ) {
if ( $val === $ans ) {
@@ -4585,12 +4585,12 @@ function eme_answer2readable( $answer, $formfield, $convert_val = 1, $sep = '||'
function eme_convert_answer_price( $answer ) {
if ( $answer['type'] == 'booking' ) { // for fields with answers that are an extra charge
- $event = eme_get_event_by_booking_id( $answer['related_id'] );
- return eme_localized_price( $answer, $event['currency'] );
+ $event = eme_get_event_by_booking_id( $answer['related_id'] );
+ return eme_localized_price( $answer, $event['currency'] );
} elseif ( $answer['type'] == 'member' ) { // for fields with answers that are an extra charge
- $member = eme_get_member( $answer['related_id'] );
- $membership = eme_get_membership( $member['membership_id'] );
- return eme_localized_price( $answer, $membership['properties']['currency'] );
+ $member = eme_get_member( $answer['related_id'] );
+ $membership = eme_get_membership( $member['membership_id'] );
+ return eme_localized_price( $answer, $membership['properties']['currency'] );
} else {
return $answer;
}
@@ -4601,7 +4601,7 @@ function eme_get_answer_fieldids( $booking_ids_arr ) {
$answers_table = $eme_db_prefix . ANSWERS_TBNAME;
# use ORDER BY to get a predictable list of field ids (otherwise result could be different for each event/booking)
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($booking_ids_arr), '%d'));
- $sql = $wpdb->prepare("SELECT DISTINCT field_id FROM $answers_table WHERE type='booking' AND eme_grouping=0 AND related_id IN ($commaDelimitedPlaceholders) ORDER BY field_id",$booking_ids_arr);
+ $sql = $wpdb->prepare("SELECT DISTINCT field_id FROM $answers_table WHERE type='booking' AND eme_grouping=0 AND related_id IN ($commaDelimitedPlaceholders) ORDER BY field_id", $booking_ids_arr);
return $wpdb->get_col( $sql );
}
@@ -4636,7 +4636,7 @@ function eme_dyndata_adminform( $eme_data, $templates_array, $used_groupingids )
'',
'condition' => '',
'condval' => '',
@@ -4645,8 +4645,8 @@ function eme_dyndata_adminform( $eme_data, $templates_array, $used_groupingids )
'template_id_footer' => 0,
'repeat' => 0,
'grouping' => 1,
- );
- $eme_data = array( $info );
+ ];
+ $eme_data = [ $info ];
$required = '';
} else {
$required = "required='required'";
@@ -4711,10 +4711,10 @@ function eme_dyndata_adminform( $eme_data, $templates_array, $used_groupingids )
}
function eme_handle_dyndata_post_adminform() {
- $eme_dyndata = array();
- $biggest_grouping_seen = 0;
- $groupings_seen = array();
- $eme_dyndata_arr = array();
+ $eme_dyndata = [];
+ $biggest_grouping_seen = 0;
+ $groupings_seen = [];
+ $eme_dyndata_arr = [];
if ( empty( $_POST['eme_dyndata'] ) ) {
return $eme_dyndata_arr;
}
@@ -4728,21 +4728,21 @@ function eme_handle_dyndata_post_adminform() {
}
foreach ( $_POST['eme_dyndata'] as $eme_dyndata ) {
if ( $eme_dyndata['template_id'] > 0 ) {
- $eme_dyndata['template_id'] = intval( $eme_dyndata['template_id'] );
+ $eme_dyndata['template_id'] = intval( $eme_dyndata['template_id'] );
if ( isset( $eme_dyndata['repeat'] ) && $eme_dyndata['repeat'] == 1 ) {
- $eme_dyndata['repeat'] = intval( $eme_dyndata['repeat'] );
- $eme_dyndata['condval'] = intval( $eme_dyndata['condval'] );
+ $eme_dyndata['repeat'] = intval( $eme_dyndata['repeat'] );
+ $eme_dyndata['condval'] = intval( $eme_dyndata['condval'] );
} else {
- $eme_dyndata['repeat'] = 0;
- $eme_dyndata['condval'] = $eme_dyndata['condval'];
+ $eme_dyndata['repeat'] = 0;
+ $eme_dyndata['condval'] = $eme_dyndata['condval'];
}
if ( isset( $eme_dyndata['template_id_header'] ) ) {
- $eme_dyndata['template_id_header'] = intval( $eme_dyndata['template_id_header'] );
+ $eme_dyndata['template_id_header'] = intval( $eme_dyndata['template_id_header'] );
} else {
$eme_dyndata['template_id_header'] = 0;
}
if ( isset( $eme_dyndata['template_id_footer'] ) ) {
- $eme_dyndata['template_id_footer'] = intval( $eme_dyndata['template_id_footer'] );
+ $eme_dyndata['template_id_footer'] = intval( $eme_dyndata['template_id_footer'] );
} else {
$eme_dyndata['template_id_footer'] = 0;
}
@@ -4765,7 +4765,7 @@ function eme_handle_dyndata_post_adminform() {
$eme_dyndata_arr[] = $eme_dyndata;
}
}
- return $eme_dyndata_arr;
+ return $eme_dyndata_arr;
}
add_action( 'wp_ajax_eme_formfields_list', 'eme_ajax_formfields_list' );
@@ -4776,21 +4776,21 @@ function eme_ajax_formfields_list() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
if ( ! current_user_can( get_option( 'eme_cap_list_events' ) ) ) {
- $ajaxResult = array();
- $ajaxResult['Result'] = 'Error';
- $ajaxResult['Message'] = __( 'Access denied!', 'events-made-easy' );
- print wp_json_encode( $ajaxResult );
- wp_die();
+ $ajaxResult = [];
+ $ajaxResult['Result'] = 'Error';
+ $ajaxResult['Message'] = __( 'Access denied!', 'events-made-easy' );
+ print wp_json_encode( $ajaxResult );
+ wp_die();
}
$table = $eme_db_prefix . FORMFIELDS_TBNAME;
$used_formfield_ids = eme_get_used_formfield_ids();
- $jTableResult = array();
+ $jTableResult = [];
$search_type = isset( $_REQUEST['search_type'] ) ? esc_sql( eme_sanitize_request( $_REQUEST['search_type'] ) ) : '';
$search_purpose = isset( $_REQUEST['search_purpose'] ) ? esc_sql( eme_sanitize_request( $_REQUEST['search_purpose'] ) ) : '';
$search_name = isset( $_REQUEST['search_name'] ) ? esc_sql( $wpdb->esc_like( eme_sanitize_request( $_REQUEST['search_name'] ) ) ) : '';
$where = '';
- $where_arr = array();
+ $where_arr = [];
if ( ! empty( $search_name ) ) {
$where_arr[] = "field_name like '%" . $search_name . "%'";
}
@@ -4812,7 +4812,7 @@ function eme_ajax_formfields_list() {
$sorting = ( ! empty( $_REQUEST['jtSorting'] ) && ! empty( eme_sanitize_sql_orderby( $_REQUEST['jtSorting'] ) ) ) ? 'ORDER BY ' . esc_sql(eme_sanitize_sql_orderby($_REQUEST['jtSorting'])) : '';
$sql = "SELECT * FROM $table $where $sorting LIMIT $start,$pagesize";
$rows = $wpdb->get_results( $sql, ARRAY_A );
- $res = array();
+ $res = [];
foreach ( $rows as $key => $row ) {
if ( empty( $row['field_name'] ) ) {
$row['field_name'] = __( 'No name', 'events-made-easy' );
@@ -4838,7 +4838,7 @@ function eme_ajax_formfields_list() {
function eme_ajax_manage_formfields() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
- $jTableResult=array();
+ $jTableResult=[];
if (! current_user_can( get_option( 'eme_cap_forms' ) ) || !isset( $_POST['field_id'] ) ) {
$jTableResult['Result'] = 'Error';
$jTableResult['Message'] = __( 'Access denied!', 'events-made-easy' );
@@ -4849,7 +4849,7 @@ function eme_ajax_manage_formfields() {
switch ( $do_action ) {
case 'deleteFormfield':
// validation happens in the eme_delete_formfields function
- eme_delete_formfields( array( intval($_POST['field_id']) ) );
+ eme_delete_formfields( [ intval($_POST['field_id']) ] );
$jTableResult['Result'] = 'OK';
$jTableResult['htmlmessage'] = __( 'Records deleted!', 'events-made-easy' );
print wp_json_encode( $jTableResult );
diff --git a/eme-functions.php b/eme-functions.php
index d4d64aa4..e9cd6f5d 100644
--- a/eme-functions.php
+++ b/eme-functions.php
@@ -48,11 +48,11 @@ function eme_client_clock_ajax() {
try {
$client_timeinfo = eme_sanitize_request( json_decode( $_COOKIE['eme_client_time'], true ) );
if ( ! is_array( $client_timeinfo ) ) {
- $client_timeinfo = array();
+ $client_timeinfo = [];
}
$ret = '0';
} catch ( Exception $error ) {
- $client_timeinfo = array();
+ $client_timeinfo = [];
$valid = false;
}
if ( ! isset( $client_timeinfo['eme_client_unixtime'] ) ) {
@@ -164,7 +164,7 @@ function eme_captcha_generate( $file ) {
$red = imagecolorallocate( $im, 255, 0, 0 );
$blue = imagecolorallocate( $im, 0, 0, 255 );
$green = imagecolorallocate( $im, 0, 255, 0 );
- $background_colors = array( $red, $blue, $green, $black );
+ $background_colors = [ $red, $blue, $green, $black ];
// draw rectangle in random color
$background_color = $background_colors[ rand( 0, 3 ) ];
@@ -279,10 +279,10 @@ function eme_check_hcaptcha() {
$eme_hcaptcha = get_option( 'eme_hcaptcha_for_forms' );
$eme_hcaptcha_key = get_option( 'eme_hcaptcha_secret_key' );
if ( isset( $_POST['h-captcha-response'] ) && ! empty( $eme_hcaptcha_key ) && $eme_hcaptcha && function_exists( 'curl_init' ) ) {
- $data = array(
+ $data = [
'secret' => $eme_hcaptcha_key,
'response' => eme_sanitize_request( $_POST['h-captcha-response'] ),
- );
+ ];
$url = 'https://hcaptcha.com/siteverify';
$response = wp_remote_post( $url, $data );
if ( is_wp_error( $response ) ) {
@@ -384,8 +384,8 @@ function eme_captcha_remove( $captcha ) {
function eme_if_shortcode( $atts, $content ) {
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'tag' => '',
'value' => '',
'eq' => '',
@@ -400,8 +400,8 @@ function eme_if_shortcode( $atts, $content ) {
'is_empty' => 0,
'incsv' => '',
'notincsv' => '',
- ),
- $atts
+ ],
+ $atts
)
);
// replace placeholders if eme_if is used outside EME shortcodes
@@ -520,14 +520,14 @@ function eme_if_shortcode( $atts, $content ) {
function eme_for_shortcode( $atts, $content ) {
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'min' => 1,
'max' => 0,
'list' => '',
'sep' => ',',
- ),
- $atts
+ ],
+ $atts
)
);
$min = intval( $min );
@@ -535,20 +535,20 @@ function eme_for_shortcode( $atts, $content ) {
$result = '';
$loopcounter = 1;
if ( ! empty( $list ) ) {
- $search = array( '#_LOOPVALUE', '#URL_LOOPVALUE', '#_LOOPCOUNTER' );
+ $search = [ '#_LOOPVALUE', '#URL_LOOPVALUE', '#_LOOPCOUNTER' ];
$array_values = explode( $sep, $list );
foreach ( $array_values as $val ) {
$url_val = rawurlencode( $val );
$esc_val = eme_sanitize_request( eme_esc_html( preg_replace( '/\n|\r/', '', $val ) ) );
- $replace = array( $val, $url_val, $loopcounter );
+ $replace = [ $val, $url_val, $loopcounter ];
$tmp_content = str_replace( $search, $replace, $content );
$result .= do_shortcode( $tmp_content );
++$loopcounter;
}
} else {
- $search = array( '#_LOOPVALUE', '#_LOOPCOUNTER' );
+ $search = [ '#_LOOPVALUE', '#_LOOPCOUNTER' ];
while ( $min <= $max ) {
- $replace = array( $min, $loopcounter );
+ $replace = [ $min, $loopcounter ];
$tmp_content = str_replace( $search, $replace, $content );
$result .= do_shortcode( $tmp_content );
++$min;
@@ -752,11 +752,11 @@ function eme_event_url( $event, $language = '' ) {
$the_link = eme_uri_add_lang( $name, $language );
} else {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'event_id' => $event['event_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'event_id' => $event['event_id'] ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
}
@@ -796,11 +796,11 @@ function eme_location_url( $location, $language = '' ) {
$the_link = eme_uri_add_lang( $name, $language );
} else {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'location_id' => $location['location_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'location_id' => $location['location_id'] ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
}
@@ -824,11 +824,11 @@ function eme_calendar_day_url( $day ) {
$the_link = eme_uri_add_lang( $name, $language );
} else {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'calendar_day' => $day ), $the_link );
+ $the_link = add_query_arg( [ 'calendar_day' => $day ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
return $the_link;
@@ -847,16 +847,16 @@ function eme_booking_confirm_url( $payment ) {
} else {
$the_link = eme_get_events_page();
$the_link = add_query_arg(
- array(
+ [
'eme_pmt_rndid' => $payment['random_id'],
'eme_rsvp_confirm' => 1,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
return $the_link;
@@ -878,16 +878,16 @@ function eme_payment_url( $payment, $resultcode = 0 ) {
$the_link = eme_uri_add_lang( $name, $language );
} else {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_pmt_rndid' => $payment['random_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'eme_pmt_rndid' => $payment['random_id'] ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
if ( $resultcode > 0 ) {
// we return the payment url but we want to indicate a payment failure too
- $the_link = add_query_arg( array( 'res_fail' => $resultcode ), $the_link );
+ $the_link = add_query_arg( [ 'res_fail' => $resultcode ], $the_link );
}
return $the_link;
}
@@ -919,11 +919,11 @@ function eme_category_url( $category ) {
} else {
$the_link = eme_get_events_page();
$slug = $category['category_slug'] ? $category['category_slug'] : $category['category_name'];
- $the_link = add_query_arg( array( 'eme_event_cat' => $slug ), $the_link );
+ $the_link = add_query_arg( [ 'eme_event_cat' => $slug ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
}
return $the_link;
@@ -959,17 +959,17 @@ function eme_invite_url( $event, $email, $lastname, $firstname, $lang ) {
$hashstring = $email . $lastname . $firstname;
$invite_hash = wp_hash( $hashstring . '|' . $event['event_id'], 'nonce' );
$the_link = add_query_arg(
- array(
+ [
'eme_email' => $email,
'eme_invite' => $invite_hash,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $lastname ) ) {
- $the_link = add_query_arg( array( 'eme_ln' => $lastname ), $the_link );
+ $the_link = add_query_arg( [ 'eme_ln' => $lastname ], $the_link );
}
if ( ! empty( $firstname ) ) {
- $the_link = add_query_arg( array( 'eme_fn' => $firstname ), $the_link );
+ $the_link = add_query_arg( [ 'eme_fn' => $firstname ], $the_link );
}
return $the_link;
}
@@ -977,11 +977,11 @@ function eme_invite_url( $event, $email, $lastname, $firstname, $lang ) {
function eme_check_rsvp_url( $payment, $booking_id ) {
$the_link = eme_get_events_page();
$the_link = add_query_arg(
- array(
+ [
'eme_check_rsvp' => 1,
'eme_pmt_rndid' => $payment['random_id'],
- ),
- $the_link
+ ],
+ $the_link
);
return $the_link;
}
@@ -992,17 +992,17 @@ function eme_cpi_url( $person_id, $orig_email ) {
$the_link = eme_get_events_page();
$nonce = wp_create_nonce( "change_pi $person_id $orig_email" );
$the_link = add_query_arg(
- array(
+ [
'eme_cpi' => $person_id,
'email' => $orig_email,
'eme_cpi_nonce' => $nonce,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1028,10 +1028,10 @@ function eme_check_member_url() {
function eme_member_url( $member ) {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_check_member' => 1 ), $the_link );
- $the_link = add_query_arg( array( 'member_id' => $member['member_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'eme_check_member' => 1 ], $the_link );
+ $the_link = add_query_arg( [ 'member_id' => $member['member_id'] ], $the_link );
$hash = wp_hash( $member['member_id'], 'nonce' );
- $the_link = add_query_arg( array( 'eme_nonce' => $hash ), $the_link );
+ $the_link = add_query_arg( [ 'eme_nonce' => $hash ], $the_link );
return $the_link;
}
@@ -1048,8 +1048,8 @@ function eme_payment_return_url( $payment, $resultcode ) {
// payment result using the notification link and then redirects to the return url
$res = $resultcode;
}
- $the_link = add_query_arg( array( 'eme_pmt_result' => $res ), $the_link );
- $the_link = add_query_arg( array( 'eme_pmt_rndid' => $payment['random_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'eme_pmt_result' => $res ], $the_link );
+ $the_link = add_query_arg( [ 'eme_pmt_rndid' => $payment['random_id'] ], $the_link );
return $the_link;
}
@@ -1057,11 +1057,11 @@ function eme_tasksignup_cancel_url( $signup ) {
$language = eme_detect_lang();
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_cancel_signup' => $signup['random_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'eme_cancel_signup' => $signup['random_id'] ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1070,11 +1070,11 @@ function eme_cancel_url( $payment ) {
$language = eme_detect_lang();
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_cancel_payment' => $payment['random_id'] ), $the_link );
+ $the_link = add_query_arg( [ 'eme_cancel_payment' => $payment['random_id'] ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1083,11 +1083,11 @@ function eme_unsub_url() {
$language = eme_detect_lang();
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_unsub' => 1 ), $the_link );
+ $the_link = add_query_arg( [ 'eme_unsub' => 1 ], $the_link );
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1098,19 +1098,19 @@ function eme_unsub_confirm_url( $email, $groups ) {
$the_link = eme_get_events_page();
$nonce = wp_create_nonce( "unsub $email$groups" );
$the_link = add_query_arg(
- array(
+ [
'eme_unsub_confirm' => $email,
'eme_unsub_nonce' => $nonce,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $groups ) ) {
- $the_link = add_query_arg( array( 'g' => $groups ), $the_link );
+ $the_link = add_query_arg( [ 'g' => $groups ], $the_link );
}
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1121,21 +1121,21 @@ function eme_sub_confirm_url( $lastname, $firstname, $email, $groups ) {
$the_link = eme_get_events_page();
$nonce = wp_create_nonce( "sub $lastname$firstname$email$groups" );
$the_link = add_query_arg(
- array(
+ [
'eme_sub_confirm' => $email,
'lastname' => $lastname,
'firstname' => $firstname,
'eme_sub_nonce' => $nonce,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $groups ) ) {
- $the_link = add_query_arg( array( 'g' => $groups ), $the_link );
+ $the_link = add_query_arg( [ 'g' => $groups ], $the_link );
}
if ( ! empty( $language ) ) {
// some plugins add the lang info to the home_url, remove it so we don't get into trouble or add it twice
$the_link = remove_query_arg( 'lang', $the_link );
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1145,7 +1145,7 @@ function eme_single_event_ical_url( $id ) {
$the_link = site_url( '/?eme_ical=public_single&event_id=' . $id );
if ( ! empty( $language ) ) {
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -1159,25 +1159,25 @@ function eme_captcha_url( $file ) {
}
// ts added to try and prevent initial caching
$the_link = add_query_arg(
- array(
+ [
'eme_captcha' => 'generate',
'f' => $file,
'ts' => time(),
- ),
- $the_link
+ ],
+ $the_link
);
return $the_link;
}
function eme_tracker_url( $random_id ) {
$the_link = eme_get_events_page();
- $the_link = add_query_arg( array( 'eme_tracker_id' => $random_id ), $the_link );
+ $the_link = add_query_arg( [ 'eme_tracker_id' => $random_id ], $the_link );
return $the_link;
}
-function eme_current_page_url( $extra_arg = array() ) {
+function eme_current_page_url( $extra_arg = [] ) {
global $wp;
- $the_link = home_url( add_query_arg( array(), $wp->request ) );
+ $the_link = home_url( add_query_arg( [], $wp->request ) );
if ( ! empty( $extra_arg ) ) {
$extra_arg = array_map( 'esc_attr', $extra_arg );
$the_link = add_query_arg( $extra_arg, $the_link );
@@ -1238,8 +1238,8 @@ function eme_capNamesCB( $cap ) {
}
function eme_get_all_caps() {
global $wp_roles;
- $caps = array();
- $capabilities = array();
+ $caps = [];
+ $capabilities = [];
foreach ( $wp_roles->roles as $role ) {
if ( $role['capabilities'] ) {
@@ -1261,7 +1261,7 @@ function eme_get_all_caps() {
}
function eme_status_array() {
- $status_array = array();
+ $status_array = [];
$status_array[ EME_EVENT_STATUS_PUBLIC ] = __( 'Public', 'events-made-easy' );
$status_array[ EME_EVENT_STATUS_PRIVATE ] = __( 'Private', 'events-made-easy' );
$status_array[ EME_EVENT_STATUS_UNLISTED ] = __( 'Unlisted', 'events-made-easy' );
@@ -1270,7 +1270,7 @@ function eme_status_array() {
}
function eme_member_status_array() {
- $status_array = array();
+ $status_array = [];
$status_array[ EME_MEMBER_STATUS_PENDING ] = __( 'Pending', 'events-made-easy' );
$status_array[ EME_MEMBER_STATUS_ACTIVE ] = __( 'Active', 'events-made-easy' );
$status_array[ EME_MEMBER_STATUS_GRACE ] = __( 'Grace period', 'events-made-easy' );
@@ -1298,7 +1298,7 @@ function eme_js_datetime( $mydate, $timezone = '' ) {
return '';
} elseif ( strstr( $mydate, ',' ) ) {
$dates = explode( ',', $mydate );
- $res_arr = array();
+ $res_arr = [];
foreach ( $dates as $date ) {
$eme_date_obj = new ExpressiveDate( $date, $timezone );
//if ($safari)
@@ -1486,7 +1486,7 @@ function eme_localized_price( $price, $cur, $target = 'html' ) {
if ( eme_is_multi( $price ) ) {
$price_arr = eme_convert_multi2array( $price );
} else {
- $price_arr = array( $price );
+ $price_arr = [ $price ];
}
$locale = determine_locale();
@@ -1507,7 +1507,7 @@ function eme_localized_price( $price, $cur, $target = 'html' ) {
$decimals = intval( get_option( 'eme_decimals' ) );
}
- $res = array();
+ $res = [];
foreach ( $price_arr as $t_price ) {
if ( $eme_localize_price ) {
$result = $formatter->formatCurrency( $t_price, $cur );
@@ -1549,7 +1549,7 @@ function eme_int_price( $price ) {
}
function eme_currency_array() {
- $currency_array = array();
+ $currency_array = [];
$currency_array ['ARS'] = __( 'Argentine Peso', 'events-made-easy' );
$currency_array ['AUD'] = __( 'Australian Dollar', 'events-made-easy' );
$currency_array ['BIF'] = __( 'Burundian Franc', 'events-made-easy' );
@@ -1600,7 +1600,7 @@ function eme_currency_array() {
}
function eme_currency_codes() {
- $currency_array = array();
+ $currency_array = [];
$currency_array ['ARS'] = '032';
$currency_array ['AUD'] = '036';
$currency_array ['BIF'] = '108';
@@ -1650,7 +1650,7 @@ function eme_currency_codes() {
function eme_zero_decimal_currencies() {
# returns an array of currencies that don't have decimals
- $currency_array = array(
+ $currency_array = [
'BIF',
'CLP',
'DJF',
@@ -1666,7 +1666,7 @@ function eme_zero_decimal_currencies() {
'XAF',
'XOF',
'XPF',
- );
+ ];
# the next filter allows people to add extra currencies:
if ( has_filter( 'eme_add_zero_decimal_currencies' ) ) {
$currency_array = apply_filters( 'eme_add_zero_decimal_currencies', $currency_array );
@@ -1675,7 +1675,7 @@ function eme_zero_decimal_currencies() {
}
function eme_thumbnail_sizes() {
- $sizes = array();
+ $sizes = [];
foreach ( get_intermediate_image_sizes() as $s ) {
$sizes[ $s ] = $s;
}
@@ -1718,7 +1718,7 @@ function recurse( $array, $array1 ) {
foreach ( $array1 as $key => $value ) {
// create new key in $array, if it is empty or not an array
if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) {
- $array[ $key ] = array();
+ $array[ $key ] = [];
}
// overwrite the value in the base array
@@ -1988,8 +1988,8 @@ function eme_fake_booking( $event ) {
function eme_booking_from_form( $event ) {
$booking = eme_new_booking();
$bookedSeats = 0;
- $bookedSeats_mp = array();
- $dcodes_entered = array();
+ $bookedSeats_mp = [];
+ $dcodes_entered = [];
$event_id = $event['event_id'];
if ( ! eme_is_multi( $event['price'] ) ) {
if ( isset( $_POST['bookings'][ $event_id ]['bookedSeats'] ) ) {
@@ -2008,7 +2008,7 @@ function eme_booking_from_form( $event ) {
}
if ( isset( $_POST['bookings'][ $event_id ] ) ) {
foreach ( $_POST['bookings'][ $event_id ] as $key => $value ) {
- if ( preg_match( '/bookedSeats(\d+)/', $key, $matches ) ) {
+ if ( preg_match( '/bookedSeats(\d+)/', eme_sanitize_request( $key ), $matches ) ) {
$field_id = intval( $matches[1] ) - 1;
$bookedSeats += intval( $value );
$bookedSeats_mp[ $field_id ] = intval( $value );
@@ -2018,7 +2018,7 @@ function eme_booking_from_form( $event ) {
}
if ( isset( $_POST['bookings'][ $event_id ] ) ) {
foreach ( $_POST['bookings'][ $event_id ] as $key => $value ) {
- if ( preg_match( '/^DISCOUNT/', $key, $matches ) ) {
+ if ( preg_match( '/^DISCOUNT/', eme_sanitize_request( $key ), $matches ) ) {
$discount_value = eme_sanitize_request( $value );
if ( ! empty( $value ) ) {
$dcodes_entered[] = $discount_value;
@@ -2066,7 +2066,7 @@ function eme_booking_from_form( $event ) {
function eme_calc_bookingprice_ajax() {
header( 'Content-type: application/json; charset=utf-8' );
// first detect multibooking
- $event_ids = array();
+ $event_ids = [];
if ( isset( $_POST['bookings'] ) ) {
foreach ( $_POST['bookings'] as $key => $val ) {
$event_ids[] = intval( $key );
@@ -2090,7 +2090,7 @@ function eme_calc_bookingprice_ajax() {
}
$result = eme_localized_price( $total, $cur );
- echo wp_json_encode( array( 'total' => $result ) );
+ echo wp_json_encode( [ 'total' => $result ] );
}
// the people dyndata only gets called from the backend, so we use wp ajax and check the admin nonce
@@ -2109,14 +2109,14 @@ function eme_dyndata_people_ajax() {
$answers = eme_get_person_answers( $person_id );
$files = eme_get_uploaded_files( $person_id, 'people' );
} else {
- $answers = array();
- $files = array();
+ $answers = [];
+ $files = [];
}
if ( isset( $_POST['groups'] ) && eme_array_integers( $_POST['groups'] ) ) {
$groups = eme_sanitize_request( $_POST['groups'] );
} else {
- $groups = array();
+ $groups = [];
}
// We need the groupid 0 as the first element, to show fields not belonging to a specific group (the array keys are not important here, only the values)
array_unshift( $groups, '0' );
@@ -2137,8 +2137,8 @@ function eme_dyndata_people_ajax() {
$form_html .= "$name ";
$var_prefix = "dynamic_personfields[$person_id][";
$var_postfix = ']';
- $postfield_name = "${var_prefix}FIELD" . $field_id . $var_postfix;
- $postvar_arr = array( 'dynamic_personfields', $person_id, 'FIELD' . $field_id );
+ $postfield_name = "{$var_prefix}FIELD" . $field_id . $var_postfix;
+ $postvar_arr = [ 'dynamic_personfields', $person_id, 'FIELD' . $field_id ];
// the first time there's no $_POST yet
if ( ! empty( $_POST ) ) {
$entered_val = eme_getValueFromPath( $_POST, $postvar_arr );
@@ -2155,7 +2155,7 @@ function eme_dyndata_people_ajax() {
}
// the next code prevents uploading a file for a file field if already done
if ( $formfield['field_type'] == 'file' || $formfield['field_type'] == 'multifile' ) {
- $entered_files = array();
+ $entered_files = [];
foreach ( $files as $file ) {
if ( $file['field_id'] == $field_id ) {
$entered_files[] = $file;
@@ -2177,19 +2177,19 @@ function eme_dyndata_people_ajax() {
$form_html .= '';
}
}
- echo wp_json_encode( array( 'Result' => $form_html ) );
+ echo wp_json_encode( [ 'Result' => $form_html ] );
wp_die();
}
function eme_dyndata_rsvp_ajax() {
header( 'Content-type: application/json; charset=utf-8' );
// first detect multibooking
- $event_ids = array();
+ $event_ids = [];
if ( ! empty( $_POST['eme_event_ids'] ) ) {
$event_ids = array_map( 'intval', $_POST['eme_event_ids'] );
} elseif ( eme_is_admin_request() && ! empty( $_POST['event_id'] ) ) {
// the case when adding a booking in the backend
- $event_ids = array( 0 => intval( $_POST['event_id'] ) );
+ $event_ids = [ 0 => intval( $_POST['event_id'] ) ];
}
if ( ! empty( $_POST['booking_id'] ) ) {
@@ -2197,9 +2197,9 @@ function eme_dyndata_rsvp_ajax() {
$booking_id = intval( $_POST['booking_id'] );
check_admin_referer( "eme_admin", 'eme_admin_nonce' );
$booking = eme_get_booking( $booking_id );
- $event_ids = array( 0 => $booking['event_id'] );
+ $event_ids = [ 0 => $booking['event_id'] ];
} else {
- $booking = array();
+ $booking = [];
}
$form_html = '';
@@ -2321,7 +2321,7 @@ function eme_dyndata_rsvp_ajax() {
}
}
}
- echo wp_json_encode( array( 'Result' => do_shortcode( $form_html ) ) );
+ echo wp_json_encode( [ 'Result' => do_shortcode( $form_html ) ] );
}
function eme_safe_css_attributes( $array ) {
@@ -2361,7 +2361,7 @@ function _eme_kses_single( $value, $allow_unfiltered ) {
// the first element is the tag, the rest the attributes
$tag = array_shift( $info );
if ( ! array_key_exists( $tag, $allowed_html ) ) {
- $allowed_html[ $tag ] = array();
+ $allowed_html[ $tag ] = [];
}
foreach ( $info as $attr ) {
$allowed_html[ $tag ][ $attr ] = true;
@@ -2416,10 +2416,10 @@ function eme_strip_weird( $value ) {
# '?', $value);
//reject overly long 3 byte sequences and UTF-16 surrogates and replace with ?
$value = preg_replace(
- '/\xE0[\x80-\x9F][\x80-\xBF]' .
+ '/\xE0[\x80-\x9F][\x80-\xBF]' .
'|\xED[\xA0-\xBF][\x80-\xBF]/S',
- '?',
- $value
+ '?',
+ $value
);
return $value;
}
@@ -2430,12 +2430,12 @@ function eme_get_editor_settings( $tinymce = true, $quicktags = true, $media_but
add_action( 'admin_print_footer_scripts', 'eme_add_my_quicktags' );
}
- return array(
+ return [
'textarea_rows' => $rows,
'tinymce' => $tinymce,
'quicktags' => $quicktags,
'media_buttons' => $media_buttons,
- );
+ ];
}
function eme_nl2br_save_html( $string ) {
@@ -2452,7 +2452,7 @@ function eme_nl2br_save_html( $string ) {
}
// replace other lineendings
- $string = str_replace( array( "\r\n", "\r" ), "\n", $string );
+ $string = str_replace( [ "\r\n", "\r" ], "\n", $string );
// if br is found, replace it by BREAK
$string = preg_replace( "/\n? \n?/", 'BREAK', $string );
@@ -2492,7 +2492,7 @@ function eme_nl2br_save_html( $string ) {
function eme_wp_date_format_php_to_datepicker_js( $php_format ) {
return $php_format;
- $SYMBOLS_MATCHING = array(
+ $SYMBOLS_MATCHING = [
// Day
'd' => 'dd',
'D' => 'D',
@@ -2515,7 +2515,7 @@ function eme_wp_date_format_php_to_datepicker_js( $php_format ) {
'o' => '',
'Y' => 'yyyy',
'y' => 'yy',
- );
+ ];
$fdatepicker_format = '';
for ( $i = 0; $i < strlen( $php_format ); $i++ ) {
$char = $php_format[ $i ];
@@ -2533,7 +2533,7 @@ function eme_wp_date_format_php_to_datepicker_js( $php_format ) {
function eme_wp_time_format_php_to_datepicker_js( $php_format ) {
return $php_format;
- $SYMBOLS_MATCHING = array(
+ $SYMBOLS_MATCHING = [
'a' => 'aa', // am/pm
'A' => 'AA', // AM/PM
'g' => 'h', // 12-hour format of an hour without leading zeros
@@ -2548,7 +2548,7 @@ function eme_wp_time_format_php_to_datepicker_js( $php_format ) {
'P' => '', // Difference to Greenwich time (GMT) with colon between hours and minutes
'T' => '', // Timezone abbreviation
'Z' => '', // Timezone offset in seconds
- );
+ ];
$fdatepicker_format = '';
for ( $i = 0; $i < strlen( $php_format ); $i++ ) {
$char = $php_format[ $i ];
@@ -2582,14 +2582,14 @@ function eme_getValueFromPath( $arr, $path ) {
function eme_get_wp_image( $image_id ) {
$image = get_post( $image_id );
- return array(
+ return [
'alt' => get_post_meta( $image->ID, '_wp_attachment_image_alt', true ),
'caption' => $image->post_excerpt,
'description' => $image->post_content,
'href' => get_permalink( $image->ID ),
'src' => $image->guid,
'title' => $image->post_title,
- );
+ ];
}
function eme_column_exists( $table_name, $column_name ) {
@@ -2775,7 +2775,7 @@ function eme_upload_file_err( $code ) {
function eme_upload_files( $id, $type = 'bookings' ) {
//$supported_mime_types = wp_get_mime_types();
- $errors = array();
+ $errors = [];
$max_upload_wp = wp_max_upload_size();
$eme_is_admin_request = eme_is_admin_request();
foreach ( $_FILES as $key => $value ) {
@@ -2964,7 +2964,7 @@ function eme_upload_files( $id, $type = 'bookings' ) {
}
function eme_get_uploaded_files( $id, $type = 'bookings' ) {
- $res = array();
+ $res = [];
$dir = EME_UPLOAD_DIR . '/' . $type . '/' . $id;
if ( is_dir( $dir ) ) {
if ( $handle = opendir( $dir ) ) {
@@ -2976,7 +2976,7 @@ function eme_get_uploaded_files( $id, $type = 'bookings' ) {
if ( count( $info ) != 4 ) {
continue;
}
- $line = array();
+ $line = [];
$line['id'] = $id;
$line['type'] = $type;
$line['random_id'] = $info[0];
@@ -3027,7 +3027,7 @@ function eme_get_uploaded_file_html( $file ) {
}
function eme_delTree( $dir ) {
- $files = array_diff( scandir( $dir ), array( '.', '..' ) );
+ $files = array_diff( scandir( $dir ), [ '.', '..' ] );
foreach ( $files as $file ) {
( is_dir( "$dir/$file" ) ) ? delTree( "$dir/$file" ) : wp_delete_file( "$dir/$file" );
}
@@ -3093,15 +3093,15 @@ function eme_fputcsv( $fh, $fields, $delimiter = ';', $enclosure = '"', $mysql_n
return;
}
- $output = array();
+ $output = [];
foreach ( $fields as $field ) {
if ( $field === null && $mysql_null ) {
$output[] = 'NULL';
continue;
}
- $output[] = preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s|\r|\t|\n)/", $field ) ? (
- $enclosure . str_replace( $enclosure, $enclosure . $enclosure, $field ) . $enclosure
+ $output[] = preg_match( "/(?:{$delimiter_esc}|{$enclosure_esc}|\s|\r|\t|\n)/", $field ) ? (
+ $enclosure . str_replace( $enclosure, $enclosure . $enclosure, $field ) . $enclosure
) : $enclosure . $field . $enclosure;
}
@@ -3117,7 +3117,7 @@ function eme_nocache_headers() {
function eme_text_split_newlines( $text ) {
// returns an array of trimmed lines, based on text input
- $text = str_replace( array( "\r\n", "\r" ), "\n", $text );
+ $text = str_replace( [ "\r\n", "\r" ], "\n", $text );
$lines = explode( "\n", $text );
return $lines;
}
@@ -3125,12 +3125,12 @@ function eme_text_split_newlines( $text ) {
function eme_ajax_record_list( $tablename, $cap ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . $tablename;
- $jTableResult = array();
+ $jTableResult = [];
// The toolbar search input
$q = isset( $_REQUEST['q'] ) ? eme_sanitize_request($_REQUEST['q']) : '';
$opt = isset( $_REQUEST['opt'] ) ? eme_sanitize_request($_REQUEST['opt']) : '';
$where = '';
- $where_array = array();
+ $where_array = [];
if ( $q ) {
for ( $i = 0; $i < count( $opt ); $i++ ) {
$fld = esc_sql( $opt[ $i ] );
@@ -3168,7 +3168,7 @@ function eme_ajax_record_list( $tablename, $cap ) {
function eme_ajax_record_delete( $tablename, $cap, $postvar ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . $tablename;
- $jTableResult = array();
+ $jTableResult = [];
if ( current_user_can( get_option( $cap ) ) && isset( $_POST[ $postvar ] ) ) {
// check the POST var
@@ -3190,7 +3190,7 @@ function eme_ajax_record_delete( $tablename, $cap, $postvar ) {
function eme_ajax_record_edit( $tablename, $cap, $id_column, $record, $record_function = '', $update = 0 ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . $tablename;
- $jTableResult = array();
+ $jTableResult = [];
if ( ! $record ) {
$jTableResult['Result'] = 'Error';
$jTableResult['Message'] = __( 'No such record', 'events-made-easy' );
@@ -3200,7 +3200,7 @@ function eme_ajax_record_edit( $tablename, $cap, $id_column, $record, $record_fu
$wpdb->show_errors( false );
if ( current_user_can( get_option( $cap ) ) ) {
if ( $update ) {
- $wpdb->update( $table, $record, array( $id_column => $record[ $id_column ] ) );
+ $wpdb->update( $table, $record, [ $id_column => $record[ $id_column ] ] );
} else {
$wpdb->insert( $table, $record );
}
@@ -3235,7 +3235,7 @@ function eme_ajax_record_edit( $tablename, $cap, $id_column, $record, $record_fu
function eme_str_split_unicode( $str, $l = 0 ) {
if ( $l > 0 ) {
- $ret = array();
+ $ret = [];
$len = mb_strlen( $str, 'UTF-8' );
for ( $i = 0; $i < $len; $i += $l ) {
$ret[] = mb_substr( $str, $i, $l, 'UTF-8' );
@@ -3308,7 +3308,7 @@ function eme_create_wp_user( $person ) {
if ( has_filter( 'eme_wp_userdata_filter' ) ) {
$userdata = apply_filters( 'eme_wp_userdata_filter', $person );
} else {
- $userdata = array();
+ $userdata = [];
}
// let's do everything in one go
@@ -3343,10 +3343,10 @@ function eme_format_full_name( $firstname, $lastname ) {
if ( ! strstr( $format, '#_FIRSTNAME' ) ) {
$format .= ' #_FIRSTNAME';
}
- $patterns = array();
+ $patterns = [];
$patterns[0] = '/#_LASTNAME/';
$patterns[1] = '/#_FIRSTNAME/';
- $replacements = array();
+ $replacements = [];
$replacements[0] = $lastname;
$replacements[1] = $firstname;
$res = preg_replace( $patterns, $replacements, $format );
@@ -3382,7 +3382,7 @@ function eme_extra_event_headers( $event ) {
$header .= "\n";
$header .= '';
- $content = array();
+ $content = [];
$content['@context'] = 'http://www.schema.org';
$content['@type'] = 'Event';
$content['name'] = '#_EVENTNAME';
@@ -3405,7 +3405,7 @@ function eme_extra_event_headers( $event ) {
}
// location is a required property, so add it, even if empty
- $loc = array();
+ $loc = [];
$location = eme_get_location( $event['location_id'] );
if ( ! empty( $location ) && ! empty( $location['location_url'] ) ) {
if ( $location['location_properties']['online_only'] ) {
@@ -3414,13 +3414,13 @@ function eme_extra_event_headers( $event ) {
$loc['url'] = '#_LOCATION_EXTERNAL_URL';
} else {
$content['eventAttendanceMode'] = 'https://schema.org/MixedEventAttendanceMode';
- $location1 = array();
+ $location1 = [];
$location1['@type'] = 'VirtualLocation';
$location1['url'] = '#_LOCATION_EXTERNAL_URL';
- $location2 = array();
+ $location2 = [];
$location2['@type'] = 'Place';
$location2['name'] = '#_LOCATION';
- $address = array();
+ $address = [];
$address['@type'] = 'PostalAddress';
$address['streetAddress'] = '#_ADDRESS';
$address['addressLocality'] = '#_CITY';
@@ -3434,7 +3434,7 @@ function eme_extra_event_headers( $event ) {
$content['eventAttendanceMode'] = 'https://schema.org/OfflineEventAttendanceMode';
$loc['@type'] = 'Place';
$loc['name'] = '#_LOCATION';
- $address = array();
+ $address = [];
$address['@type'] = 'PostalAddress';
$address['streetAddress'] = '#_ADDRESS';
$address['addressLocality'] = '#_CITY';
@@ -3445,7 +3445,7 @@ function eme_extra_event_headers( $event ) {
$content['location'] = $loc;
if ( $event['event_rsvp'] ) {
- $offers = array();
+ $offers = [];
$offers['@type'] = 'Offer';
$offers['url'] = '#_EVENTPAGEURL';
if ( ! eme_is_multi( $event['price'] ) ) {
@@ -3494,7 +3494,7 @@ function eme_extra_event_headers( $event ) {
if ( $answer['field_id'] == $field_id ) {
$val = eme_answer2readable( $answer['answer'], $formfield );
if ( ! empty( $val ) ) {
- $performer = array();
+ $performer = [];
$performer['@type'] = 'Person';
$performer['name'] = $val;
$content['performer'] = $performer;
@@ -3506,12 +3506,12 @@ function eme_extra_event_headers( $event ) {
// add something, in case no performer custom field exists
if ( ! isset( $content['performer'] ) ) {
- $performer = array();
+ $performer = [];
$performer['@type'] = 'Person';
$performer['name'] = '#_EVENTNAME';
$content['performer'] = $performer;
}
- $organizer = array();
+ $organizer = [];
$organizer['@type'] = 'Organization';
$organizer['name'] = '#_CONTACTNAME';
$organizer['url'] = '#_EVENTPAGEURL';
@@ -3540,7 +3540,7 @@ function eme_serialize( $data ) {
if ( !eme_is_serialized( $data )) {
return json_encode( $data );
} elseif (is_serialized( $data )) {
- $data = unserialize( $data, ['allowed_classes' => false] );
+ $data = unserialize( $data, ['allowed_classes' => false] );
return json_encode( $data );
} else {
return $data;
@@ -3552,7 +3552,7 @@ function eme_unserialize( $data ) {
return unserialize( $data, ['allowed_classes' => false] );
} elseif (eme_isjson($data)) {
// add TRUE to make sure the return is an array
- return json_decode ($data,TRUE);
+ return json_decode ($data, TRUE);
} else {
return $data;
}
@@ -3636,7 +3636,7 @@ function eme_generate_qrcode( $url_to_encode, $targetBasePath, $targetBaseUrl, $
$target_file = $targetBasePath . '/' . basename( $existing_file );
$target_url = $targetBaseUrl . '/' . basename( $existing_file );
}
- return array( $target_file, $target_url );
+ return [ $target_file, $target_url ];
}
function eme_check_access( $post_id ) {
@@ -3653,12 +3653,12 @@ function eme_check_access( $post_id ) {
if ( eme_is_serialized( $eme_membershipids ) ) {
$page_membershipids = eme_unserialize( $eme_membershipids );
} else {
- $page_membershipids = array();
+ $page_membershipids = [];
}
if ( eme_is_serialized( $eme_groupids ) ) {
$page_groupids = eme_unserialize( $eme_groupids );
} else {
- $page_groupids = array();
+ $page_groupids = [];
}
if ( ! empty( $page_membershipids ) ) {
// check if the memberships still exist
@@ -3722,7 +3722,7 @@ function eme_migrate_event_payment_options() {
global $wpdb,$eme_db_prefix;
$table_name = $eme_db_prefix . EVENTS_TBNAME;
- $payment_options = array( 'use_paypal', 'use_2co', 'use_webmoney', 'use_fdgg', 'use_mollie' );
+ $payment_options = [ 'use_paypal', 'use_2co', 'use_webmoney', 'use_fdgg', 'use_mollie' ];
foreach ( $payment_options as $payment_option ) {
$sql = "SELECT event_id from $table_name WHERE $payment_option=1";
$ids = $wpdb->get_col( $sql );
@@ -3839,12 +3839,12 @@ function eme_is_datamaster() {
function eme_get_initials( $myname ) {
$words = preg_split( '/\s/', $myname, -1, PREG_SPLIT_NO_EMPTY );
$res = implode(
- '.',
- array_map(
- function ( $a ) {
+ '.',
+ array_map(
+ function ( $a ) {
return mb_substr( $a[0], 0, 1, 'UTF-8' );
},
- $words
+ $words
)
);
// add trailing '.'
diff --git a/eme-gdpr.php b/eme-gdpr.php
index b14e1e50..1f62362d 100644
--- a/eme-gdpr.php
+++ b/eme-gdpr.php
@@ -12,14 +12,14 @@ function eme_gdpr_approve_url( $email ) {
$the_link = remove_query_arg( 'lang', $the_link );
$nonce = wp_create_nonce( "gdpr $email" );
$the_link = add_query_arg(
- array(
+ [
'eme_gdpr_approve' => $email,
'eme_gdpr_nonce' => $nonce,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $language ) ) {
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -32,14 +32,14 @@ function eme_gdpr_url( $email ) {
$the_link = remove_query_arg( 'lang', $the_link );
$nonce = wp_create_nonce( "gdpr $email" );
$the_link = add_query_arg(
- array(
+ [
'eme_gdpr' => $email,
'eme_gdpr_nonce' => $nonce,
- ),
- $the_link
+ ],
+ $the_link
);
if ( ! empty( $language ) ) {
- $the_link = add_query_arg( array( 'lang' => $language ), $the_link );
+ $the_link = add_query_arg( [ 'lang' => $language ], $the_link );
}
return $the_link;
}
@@ -52,10 +52,10 @@ function eme_gdpr_ajax() {
if ( ! isset( $_POST['honeypot_check'] ) || ! empty( $_POST['honeypot_check'] ) ) {
$form_html = __( "Bot detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -63,10 +63,10 @@ function eme_gdpr_ajax() {
if ( ! isset( $_POST['eme_frontend_nonce'] ) || ! wp_verify_nonce( eme_sanitize_request($_POST['eme_frontend_nonce']), 'eme_frontend' ) ) {
$form_html = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -92,10 +92,10 @@ function eme_gdpr_ajax() {
}
$form_html = __( 'Thank you for your request, an email will be sent with further info', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -109,7 +109,7 @@ function eme_rpi_shortcode( $atts ) {
$email = '';
}
- $atts = shortcode_atts( array( 'show_info_if_logged_in' => 0 ), $atts );
+ $atts = shortcode_atts( [ 'show_info_if_logged_in' => 0 ], $atts );
$show_info_if_logged_in = filter_var( $atts['show_info_if_logged_in'], FILTER_VALIDATE_BOOLEAN );
// for logged in users that are linked to an EME user, immediately show the info
@@ -143,10 +143,10 @@ function eme_gdpr_approve_ajax() {
if ( ! isset( $_POST['honeypot_check'] ) || ! empty( $_POST['honeypot_check'] ) ) {
$form_html = __( "Bot detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -154,10 +154,10 @@ function eme_gdpr_approve_ajax() {
if ( ! isset( $_POST['eme_frontend_nonce'] ) || ! wp_verify_nonce( eme_sanitize_request($_POST['eme_frontend_nonce']), 'eme_frontend' ) ) {
$form_html = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -183,10 +183,10 @@ function eme_gdpr_approve_ajax() {
}
$form_html = __( 'Thank you for your request, an email will be sent with further info', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -221,10 +221,10 @@ function eme_cpi_request_ajax() {
if ( ! isset( $_POST['honeypot_check'] ) || ! empty( $_POST['honeypot_check'] ) ) {
$message = __( "Bot detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -232,10 +232,10 @@ function eme_cpi_request_ajax() {
if ( ! isset( $_POST['eme_frontend_nonce'] ) || ! wp_verify_nonce( eme_sanitize_request($_POST['eme_frontend_nonce']), 'eme_frontend' ) ) {
$message = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -294,10 +294,10 @@ function eme_cpi_request_ajax() {
}
$message = __( 'Thank you for your request, an email will be sent with further info.', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -311,7 +311,7 @@ function eme_cpi_shortcode( $atts ) {
$email = '';
}
- $atts = shortcode_atts( array( 'show_form_if_logged_in' => 0 ), $atts );
+ $atts = shortcode_atts( [ 'show_form_if_logged_in' => 0 ], $atts );
$show_form_if_logged_in = filter_var( $atts['show_form_if_logged_in'], FILTER_VALIDATE_BOOLEAN );
// for logged in users that are linked to an EME user, immediately show the form
@@ -345,10 +345,10 @@ function eme_cpi_ajax() {
if ( ! isset( $_POST['honeypot_check'] ) || ! empty( $_POST['honeypot_check'] ) ) {
$message = __( "Bot detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -356,10 +356,10 @@ function eme_cpi_ajax() {
if ( empty( $_POST['person_id'] ) ) {
$message = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -367,10 +367,10 @@ function eme_cpi_ajax() {
if ( ! isset( $_POST['eme_cpi_nonce'] ) || ! wp_verify_nonce( eme_sanitize_request($_POST['eme_cpi_nonce']), "eme_cpi $person_id" ) ) {
$message = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -378,10 +378,10 @@ function eme_cpi_ajax() {
if ( ! eme_check_recaptcha() ) {
$message = __( 'Please check the Google reCAPTCHA box', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -389,10 +389,10 @@ function eme_cpi_ajax() {
if ( ! eme_check_hcaptcha() ) {
$message = __( 'Please check the hCaptcha box', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -400,15 +400,15 @@ function eme_cpi_ajax() {
if ( ! eme_check_captcha( 1 ) ) {
$message = __( 'You entered an incorrect code', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
}
- list($person_id,$add_update_message) = eme_add_update_person_from_form( $person_id );
+ [$person_id, $add_update_message] = eme_add_update_person_from_form( $person_id );
if ( $person_id ) {
$message = __( 'Person updated', 'events-made-easy' );
} else {
@@ -416,10 +416,10 @@ function eme_cpi_ajax() {
$message .= ' ' . $add_update_message;
}
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $message,
- )
+ ]
);
wp_die();
}
@@ -483,7 +483,7 @@ function eme_show_personal_info( $email ) {
$output .= ' ' . __( 'MassMail', 'events-made-easy' ) . ' ' . $massmail . ' ';
$output .= '
' . __( 'GDPR approval', 'events-made-easy' ) . ' ' . $gdpr . ' ';
if ( ! empty( $person['properties']['image_id'] ) ) {
- $img = wp_get_attachment_image( $person['properties']['image_id'], 'full', 0, array( 'class' => 'eme_person_image' ) );
+ $img = wp_get_attachment_image( $person['properties']['image_id'], 'full', 0, [ 'class' => 'eme_person_image' ] );
$output .= '
' . __( 'Image', 'events-made-easy' ) . ' ' . $img . ' ';
}
$output .= '
' . __( 'Member of group(s)', 'events-made-easy' ) . ' ' . eme_esc_html( $groups ) . ' ';
@@ -569,14 +569,14 @@ function eme_gdpr_add_suggested_privacy_content() {
}
function eme_gdpr_register_exporters( $exporters ) {
- $exporters[] = array(
+ $exporters[] = [
'exporter_friendly_name' => __( 'Events Made Easy' ),
'callback' => 'eme_gdpr_user_data_exporter',
- );
+ ];
return $exporters;
}
function eme_gdpr_user_data_exporter( $email, $page = 1 ) {
- $export_items = array();
+ $export_items = [];
if ( eme_count_persons_by_email( $email ) > 0 ) {
$person_ids = eme_get_personids_by_email( $email );
$eme_address1_string = get_option( 'eme_address1_string' );
@@ -588,133 +588,133 @@ function eme_gdpr_user_data_exporter( $email, $page = 1 ) {
$groups = join( ',', eme_get_persongroup_names( $person['person_id'] ) );
$massmail = $person['massmail'] ? __( 'Yes', 'events-made-easy' ) : __( 'No', 'events-made-easy' );
$gdpr = $person['gdpr'] ? __( 'Yes', 'events-made-easy' ) : __( 'No', 'events-made-easy' );
- $data = array();
- $data[] = array(
+ $data = [];
+ $data[] = [
'name' => __( 'Person ID', 'events-made-easy' ),
'value' => $person['person_id'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Last name', 'events-made-easy' ),
'value' => $person['lastname'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'First name', 'events-made-easy' ),
'value' => $person['firstname'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Email', 'events-made-easy' ),
'value' => $person['email'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => $eme_address1_string,
'value' => $person['address1'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => $eme_address1_string,
'value' => $person['address2'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'City', 'events-made-easy' ),
'value' => $person['city'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Postal code', 'events-made-easy' ),
'value' => $person['zip'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'State', 'events-made-easy' ),
'value' => eme_get_state_name( $person['state_code'], $person['country_code'], $person['lang'] ),
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Country', 'events-made-easy' ),
'value' => eme_get_country_name( $person['country_code'], $person['lang'] ),
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Phone number', 'events-made-easy' ),
'value' => $person['phone'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'MassMail', 'events-made-easy' ),
'value' => $massmail,
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'GDPR approval', 'events-made-easy' ),
'value' => $gdpr,
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Member of group(s)', 'events-made-easy' ),
'value' => $groups,
- );
+ ];
foreach ( $answers as $answer ) {
$formfield = eme_get_formfield( $answer['field_id'] );
if ( ! empty( $formfield ) ) {
- $data[] = array(
+ $data[] = [
'name' => eme_translate( $formfield['field_name'] ),
'value' => eme_answer2readable( $answer['answer'], $formfield, 1, ',', 'text' ),
- );
+ ];
}
}
// Add this group of items to the exporters data array.
$group_id = 'eme-personal-data';
$group_label = __( 'Events Made Easy Personal Data', 'event-made-easy' );
- $export_items[] = array(
+ $export_items[] = [
'group_id' => $group_id,
'group_label' => $group_label,
'item_id' => $person_id,
'data' => $data,
- );
+ ];
// Now the media
$files = eme_get_uploaded_files( $person_id, 'people' );
if ( ! empty( $files ) ) {
$group_id = 'eme-personal-data-media';
$group_label = __( 'Events Made Easy Uploaded files linked to the person', 'event-made-easy' );
- $data = array();
+ $data = [];
foreach ( $files as $file ) {
- $data[] = array(
+ $data[] = [
'name' => eme_translate( $file['field_name'] ),
'value' => "
" . $file['name'] . ' ',
- );
+ ];
}
- $export_items[] = array(
+ $export_items[] = [
'group_id' => $group_id,
'group_label' => $group_label,
'item_id' => $person_id,
'data' => $data,
- );
+ ];
}
if ( count( $members ) > 0 ) {
foreach ( $members as $member ) {
$start_date = eme_localized_date( $member['start_date'] );
$end_date = eme_localized_date( $member['end_date'] );
- $data = array();
- $data[] = array(
+ $data = [];
+ $data[] = [
'name' => __( 'Member ID', 'events-made-easy' ),
'value' => $member['member_id'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Membership', 'events-made-easy' ),
'value' => $member['membership_name'],
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'Start', 'events-made-easy' ),
'value' => $start_date,
- );
- $data[] = array(
+ ];
+ $data[] = [
'name' => __( 'End', 'events-made-easy' ),
'value' => $end_date,
- );
+ ];
$related_member_ids = eme_get_family_member_ids( $member['member_id'] );
if ( ! empty( $related_member_ids ) ) {
$related_member = eme_get_member( $related_member_id );
if ( $related_member ) {
$related_person = eme_get_person( $related_member['person_id'] );
if ( $related_person ) {
- $data[] = array(
+ $data[] = [
'name' => __( 'Main family account for', 'events-made-easy' ),
'value' => eme_format_full_name( $related_person['firstname'], $related_person['lastname'] ) . ' (' . $related_person['email'] . ')',
- );
+ ];
}
}
}
@@ -722,38 +722,38 @@ function eme_gdpr_user_data_exporter( $email, $page = 1 ) {
foreach ( $answers as $answer ) {
$formfield = eme_get_formfield( $answer['field_id'] );
if ( ! empty( $formfield ) ) {
- $data[] = array(
+ $data[] = [
'name' => eme_translate( $formfield['field_name'] ),
'value' => eme_answer2readable( $answer['answer'], $formfield, 1, ',', 'text' ),
- );
+ ];
}
}
$group_id = 'eme-member-data';
$group_label = __( 'Events Made Easy Member Data', 'event-made-easy' );
- $export_items[] = array(
+ $export_items[] = [
'group_id' => $group_id,
'group_label' => $group_label,
'item_id' => $member['member_id'],
'data' => $data,
- );
+ ];
// Now the media
$files = eme_get_uploaded_files( $member['member_id'], 'members' );
if ( ! empty( $files ) ) {
$group_id = 'eme-member-data-media';
$group_label = __( 'Events Made Easy Uploaded files linked to the member', 'event-made-easy' );
- $data = array();
+ $data = [];
foreach ( $files as $file ) {
- $data[] = array(
+ $data[] = [
'name' => eme_translate( $file['field_name'] ),
'value' => "
" . $file['name'] . ' ',
- );
+ ];
}
- $export_items[] = array(
+ $export_items[] = [
'group_id' => $group_id,
'group_label' => $group_label,
'item_id' => $person_id,
'data' => $data,
- );
+ ];
}
}
}
@@ -761,27 +761,27 @@ function eme_gdpr_user_data_exporter( $email, $page = 1 ) {
}
// Returns an array of exported items for this pass, but also a boolean whether this exporter is finished.
//If not it will be called again with $page increased by 1.
- return array(
+ return [
'data' => $export_items,
'done' => true,
- );
+ ];
}
-function eme_gdpr_register_erasers( $erasers = array() ) {
- $erasers[] = array(
+function eme_gdpr_register_erasers( $erasers = [] ) {
+ $erasers[] = [
'eraser_friendly_name' => __( 'Events Made Easy' ),
'callback' => 'eme_gdpr_user_data_eraser',
- );
+ ];
return $erasers;
}
function eme_gdpr_user_data_eraser( $email, $page = 1 ) {
if ( empty( $email ) ) {
- return array(
+ return [
'items_removed' => false,
'items_retained' => false,
- 'messages' => array(),
+ 'messages' => [],
'done' => true,
- );
+ ];
}
$person_ids = eme_get_personids_by_email( $email );
if ( ! empty( $person_ids ) ) {
@@ -790,14 +790,14 @@ function eme_gdpr_user_data_eraser( $email, $page = 1 ) {
}
$items_removed = true;
$items_retained = false;
- $messages = array();
+ $messages = [];
$messages[] = __( "All data from the plugin Events Made Easy related to this email has been removed, but don't forget this also cancelled the corresponding memberships!", 'events-made-easy' );
- return array(
+ return [
'items_removed' => $items_removed,
'items_retained' => $items_retained,
'messages' => $messages,
'done' => true,
- );
+ ];
}
diff --git a/eme-holidays.php b/eme-holidays.php
index ac4f2a6c..68b608a1 100644
--- a/eme-holidays.php
+++ b/eme-holidays.php
@@ -5,10 +5,10 @@
}
function eme_new_holidays() {
- $hol = array(
+ $hol = [
'name' => '',
'list' => '',
- );
+ ];
return $hol;
}
@@ -41,11 +41,11 @@ function eme_holidays_page() {
check_admin_referer( 'eme_admin', 'eme_admin_nonce' );
if ( $_POST['eme_admin_action'] == 'do_editholidays' ) {
// holidays update required
- $holidays = array();
+ $holidays = [];
$holidays['name'] = eme_sanitize_request( $_POST['name'] );
$holidays['list'] = eme_sanitize_textarea( $_POST['list'] );
if ( ! empty( $_POST['id'] ) ) {
- $validation_result = $wpdb->update( $holidays_table, $holidays, array( 'id' => intval( $_POST['id'] ) ) );
+ $validation_result = $wpdb->update( $holidays_table, $holidays, [ 'id' => intval( $_POST['id'] ) ] );
if ( $validation_result !== false ) {
$message = __( 'Successfully edited the list of holidays', 'events-made-easy' );
} else {
@@ -241,11 +241,11 @@ function eme_get_holiday_list( $id ) {
function eme_get_holiday_listinfo( $id ) {
$holiday_list = eme_get_holiday_list( $id );
- $res_days = array();
+ $res_days = [];
$days = explode( "\n", str_replace( "\r", "\n", $holiday_list['list'] ) );
foreach ( $days as $day_info ) {
//$info=explode(',',$day_info);
- list($date_info,$name,$class,$link) = array_pad( explode( ',', $day_info ), 4, '' );
+ [$date_info, $name, $class, $link] = array_pad( explode( ',', $day_info ), 4, '' );
if ( preg_match( '/^([0-9]{4}-[0-9]{2}-[0-9]{2})--([0-9]{4}-[0-9]{2}-[0-9]{2})$/', $date_info, $matches ) ) {
$start = $matches[1];
$end = $matches[2];
@@ -269,7 +269,7 @@ function eme_get_holiday_listinfo( $id ) {
function eme_get_holidays_array_by_id() {
$holidays = eme_get_holiday_lists();
- $holidays_by_id = array();
+ $holidays_by_id = [];
if ( ! empty( $holidays ) ) {
$holidays_by_id[] = '';
foreach ( $holidays as $holiday_list ) {
@@ -284,12 +284,12 @@ function eme_holidays_shortcode( $atts ) {
global $eme_timezone;
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => '',
'scope' => 'all',
- ),
- $atts
+ ],
+ $atts
)
);
@@ -304,7 +304,7 @@ function eme_holidays_shortcode( $atts ) {
$eme_date_obj_now = new ExpressiveDate( 'now', $eme_timezone );
print '
';
foreach ( $days as $day_info ) {
- list($day,$name,$class) = array_pad( explode( ',', $day_info ), 3, '' );
+ [$day, $name, $class] = array_pad( explode( ',', $day_info ), 3, '' );
if ( empty( $day ) ) {
continue;
}
diff --git a/eme-ical.php b/eme-ical.php
index 8e557fc1..0ae4e20a 100644
--- a/eme-ical.php
+++ b/eme-ical.php
@@ -120,7 +120,7 @@ function eme_ical_link( $justurl = 0, $echo = 0, $text = 'ICAL', $category = '',
if ( strpos( $justurl, '=' ) ) {
// allows the use of arguments without breaking the legacy code
- $defaults = array(
+ $defaults = [
'justurl' => 0,
'echo' => $echo,
'text' => $text,
@@ -130,7 +130,7 @@ function eme_ical_link( $justurl = 0, $echo = 0, $text = 'ICAL', $category = '',
'contact_person' => $contact_person,
'location_id' => $location_id,
'notcategory' => $notcategory,
- );
+ ];
$r = wp_parse_args( $justurl, $defaults );
extract( $r );
@@ -143,25 +143,25 @@ function eme_ical_link( $justurl = 0, $echo = 0, $text = 'ICAL', $category = '',
}
$url = site_url( '/?eme_ical=public' );
if ( ! empty( $location_id ) ) {
- $url = add_query_arg( array( 'location_id' => $location_id ), $url );
+ $url = add_query_arg( [ 'location_id' => $location_id ], $url );
}
if ( ! empty( $category ) ) {
- $url = add_query_arg( array( 'category' => $category ), $url );
+ $url = add_query_arg( [ 'category' => $category ], $url );
}
if ( ! empty( $notcategory ) ) {
- $url = add_query_arg( array( 'notcategory' => $notcategory ), $url );
+ $url = add_query_arg( [ 'notcategory' => $notcategory ], $url );
}
if ( ! empty( $scope ) ) {
- $url = add_query_arg( array( 'scope' => $scope ), $url );
+ $url = add_query_arg( [ 'scope' => $scope ], $url );
}
if ( ! empty( $author ) ) {
- $url = add_query_arg( array( 'author' => $author ), $url );
+ $url = add_query_arg( [ 'author' => $author ], $url );
}
if ( ! empty( $contact_person ) ) {
- $url = add_query_arg( array( 'contact_person' => $contact_person ), $url );
+ $url = add_query_arg( [ 'contact_person' => $contact_person ], $url );
}
if ( ! empty( $language ) ) {
- $url = add_query_arg( array( 'lang' => $language ), $url );
+ $url = add_query_arg( [ 'lang' => $language ], $url );
}
$link = "
$text ";
@@ -180,8 +180,8 @@ function eme_ical_link( $justurl = 0, $echo = 0, $text = 'ICAL', $category = '',
function eme_ical_link_shortcode( $atts ) {
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'justurl' => 0,
'text' => 'ICAL',
'category' => '',
@@ -190,8 +190,8 @@ function eme_ical_link_shortcode( $atts ) {
'author' => '',
'contact_person' => '',
'notcategory' => '',
- ),
- $atts
+ ],
+ $atts
)
);
diff --git a/eme-locations.php b/eme-locations.php
index c650f3f1..1d58cb2a 100644
--- a/eme-locations.php
+++ b/eme-locations.php
@@ -5,7 +5,7 @@
}
function eme_new_location() {
- $location = array(
+ $location = [
'location_name' => '',
'location_address1' => '',
'location_address2' => '',
@@ -24,14 +24,14 @@ function eme_new_location() {
'location_external_ref' => '',
'location_image_id' => 0,
'location_author' => 0,
- 'location_attributes' => array(),
- );
+ 'location_attributes' => [],
+ ];
$location['location_properties'] = eme_init_location_props();
return $location;
}
-function eme_init_location_props( $props = array() ) {
+function eme_init_location_props( $props = [] ) {
if ( ! isset( $props['map_icon'] ) ) {
$props['map_icon'] = '';
}
@@ -112,7 +112,7 @@ function eme_locations_page() {
$message = __( 'You have no right to edit this location!', 'events-made-easy' );
eme_locations_table( $message );
} else {
- $post_vars = array( 'location_name', 'location_address1', 'location_address2', 'location_city', 'location_state', 'location_zip', 'location_country', 'location_url', 'location_image_url', 'location_image_id', 'location_prefix', 'location_slug', 'location_latitude', 'location_longitude', 'location_author' );
+ $post_vars = [ 'location_name', 'location_address1', 'location_address2', 'location_city', 'location_state', 'location_zip', 'location_country', 'location_url', 'location_image_url', 'location_image_id', 'location_prefix', 'location_slug', 'location_latitude', 'location_longitude', 'location_author' ];
foreach ( $post_vars as $post_var ) {
if ( isset( $_POST[ $post_var ] ) ) {
$location[ $post_var ] = eme_sanitize_request( $_POST[ $post_var ] );
@@ -127,7 +127,7 @@ function eme_locations_page() {
$location ['location_category_ids'] = '';
}
- $location_attributes = array();
+ $location_attributes = [];
for ( $i = 1; isset( $_POST[ "eme_attr_{$i}_ref" ] ) && trim( $_POST[ "eme_attr_{$i}_ref" ] ) != ''; $i++ ) {
if ( trim( $_POST[ "eme_attr_{$i}_name" ] ) != '' ) {
$location_attributes[ $_POST[ "eme_attr_{$i}_ref" ] ] = eme_kses( $_POST[ "eme_attr_{$i}_name" ] );
@@ -135,10 +135,10 @@ function eme_locations_page() {
}
$location['location_attributes'] = $location_attributes;
- $location_properties = array();
+ $location_properties = [];
$location_properties = eme_init_location_props( $location_properties );
// now for the select boxes, we need to set to 0 if not in the _POST
- $select_location_post_vars = array( 'online_only' );
+ $select_location_post_vars = [ 'online_only' ];
foreach ( $select_location_post_vars as $post_var ) {
if ( ! isset( $_POST[ 'eme_loc_prop_' . $post_var ] ) ) {
$location_properties[ $post_var ] = 0;
@@ -201,7 +201,7 @@ function eme_import_csv_locations() {
$answers_table = $eme_db_prefix . ANSWERS_TBNAME;
//validate whether uploaded file is a csv file
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
if ( empty( $_FILES['eme_csv']['name'] ) || ! in_array( $_FILES['eme_csv']['type'], $csvMimes ) ) {
return sprintf( __( 'No CSV file detected: %s', 'events-made-easy' ), $_FILES['eme_csv']['type'] );
}
@@ -244,7 +244,7 @@ function eme_import_csv_locations() {
if ( ! in_array( 'location_name', $headers ) || ! in_array( 'location_address1', $headers ) ) {
$result = __( 'Not all required fields present.', 'events-made-easy' );
} else {
- $empty_props = array();
+ $empty_props = [];
$empty_props = eme_init_location_props( $empty_props );
// now loop over the rest
while ( ( $row = fgetcsv( $handle, 0, $delimiter, $enclosure ) ) !== false ) {
@@ -258,7 +258,7 @@ function eme_import_csv_locations() {
if ( preg_match( '/^att_(.*)$/', $key, $matches ) ) {
$att = $matches[1];
if ( ! isset( $line['location_attributes'] ) ) {
- $line['location_attributes'] = array();
+ $line['location_attributes'] = [];
}
$line['location_attributes'][ $att ] = $value;
}
@@ -269,7 +269,7 @@ function eme_import_csv_locations() {
if ( preg_match( '/^prop_(.*)$/', $key, $matches ) ) {
$prop = $matches[1];
if ( ! isset( $line['location_properties'] ) ) {
- $line['location_properties'] = array();
+ $line['location_properties'] = [];
}
if ( array_key_exists( $prop, $empty_props ) ) {
$line['location_properties'][ $prop ] = $value;
@@ -435,11 +435,11 @@ function eme_locations_edit_layout( $location, $message = '' ) {
'location_author',
'selected' => $location_author,
- )
- );
+ ]
+ );
?>
@@ -505,7 +505,7 @@ function eme_meta_box_div_location_name( $location ) {
$locations_prefixes = get_option( 'eme_permalink_locations_prefix', 'locations' );
if ( preg_match( '/,/', $locations_prefixes ) ) {
$locations_prefixes = explode( ',', $locations_prefixes );
- $locations_prefixes_arr = array();
+ $locations_prefixes_arr = [];
foreach ( $locations_prefixes as $locations_prefix ) {
$locations_prefixes_arr[ $locations_prefix ] = eme_permalink_convert( $locations_prefix );
}
@@ -765,7 +765,7 @@ function eme_meta_box_div_location_customfields( $location ) {
} elseif ( ! empty( $location['location_id'] ) ) {
$answers = eme_get_location_answers( $location['location_id'] );
} else {
- $answers = array();
+ $answers = [];
}
foreach ( $formfields as $formfield ) {
@@ -889,9 +889,9 @@ function eme_locations_table( $message = '' ) {
0 ) {
@@ -1070,7 +1070,7 @@ function eme_get_locations( $eventful = false, $scope = 'all', $category = '', $
$conditions [] = "location_category_ids=''";
} elseif ( preg_match( '/,/', $category ) ) {
$category = explode( ',', $category );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $category as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = " FIND_IN_SET($cat,location_category_ids)";
@@ -1081,7 +1081,7 @@ function eme_get_locations( $eventful = false, $scope = 'all', $category = '', $
$conditions [] = '(' . implode( ' OR', $category_conditions ) . ')';
} elseif ( preg_match( '/\+/', $category ) ) {
$category = explode( '+', $category );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $category as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = " FIND_IN_SET($cat,location_category_ids)";
@@ -1098,7 +1098,7 @@ function eme_get_locations( $eventful = false, $scope = 'all', $category = '', $
$conditions[] = "location_category_ids != ''";
} elseif ( preg_match( '/,/', $notcategory ) ) {
$notcategory = explode( ',', $notcategory );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $notcategory as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "(NOT FIND_IN_SET($cat,location_category_ids) OR location_category_ids IS NULL)";
@@ -1110,7 +1110,7 @@ function eme_get_locations( $eventful = false, $scope = 'all', $category = '', $
} elseif ( preg_match( '/\+| /', $notcategory ) ) {
// url decoding of '+' is ' '
$notcategory = preg_split( '/\+| /', $notcategory, 0, PREG_SPLIT_NO_EMPTY );
- $category_conditions = array();
+ $category_conditions = [];
foreach ( $notcategory as $cat ) {
if ( is_numeric( $cat ) && $cat > 0 ) {
$category_conditions[] = "(NOT FIND_IN_SET($cat,location_category_ids) OR location_category_ids IS NULL)";
@@ -1216,10 +1216,10 @@ function eme_get_extra_location_data( $location ) {
}
}
$location['location_attributes'] = eme_unserialize( $location['location_attributes'] );
- $location['location_attributes'] = ( ! is_array( $location['location_attributes'] ) ) ? array() : $location['location_attributes'];
+ $location['location_attributes'] = ( ! is_array( $location['location_attributes'] ) ) ? [] : $location['location_attributes'];
$location['location_properties'] = eme_unserialize( $location['location_properties'] );
- $location['location_properties'] = ( ! is_array( $location['location_properties'] ) ) ? array() : $location['location_properties'];
+ $location['location_properties'] = ( ! is_array( $location['location_properties'] ) ) ? [] : $location['location_properties'];
$location['location_properties'] = eme_init_location_props( $location['location_properties'] );
if ( has_filter( 'eme_location_filter' ) ) {
@@ -1232,10 +1232,10 @@ function eme_get_extra_location_data( $location ) {
function eme_get_city_location_ids( $cities ) {
global $wpdb,$eme_db_prefix;
$locations_table = $eme_db_prefix . LOCATIONS_TBNAME;
- $location_ids = array();
+ $location_ids = [];
$conditions = '';
if ( is_array( $cities ) ) {
- $city_conditions = array();
+ $city_conditions = [];
foreach ( $cities as $city ) {
$city_conditions[] = " location_city = '" . esc_sql( $city ) . "'";
}
@@ -1253,10 +1253,10 @@ function eme_get_city_location_ids( $cities ) {
function eme_get_country_location_ids( $countries ) {
global $wpdb,$eme_db_prefix;
$locations_table = $eme_db_prefix . LOCATIONS_TBNAME;
- $location_ids = array();
+ $location_ids = [];
$conditions = '';
if ( is_array( $countries ) ) {
- $country_conditions = array();
+ $country_conditions = [];
foreach ( $countries as $country ) {
$country_conditions[] = " location_country = '" . esc_sql( $country ) . "'";
}
@@ -1285,7 +1285,7 @@ function eme_sanitize_location( $location ) {
}
// check all variables that need to be urls
- $url_vars = array( 'location_url', 'location_image_url' );
+ $url_vars = [ 'location_url', 'location_image_url' ];
foreach ( $url_vars as $url_var ) {
if ( ! empty( $location[ $url_var ] ) ) {
//make sure url's have a correct prefix
@@ -1313,7 +1313,7 @@ function eme_sanitize_location( $location ) {
}
// some things just need to be integers, let's brute-force them
- $int_vars = array( 'location_image_id', 'location_author' );
+ $int_vars = [ 'location_image_id', 'location_author' ];
foreach ( $int_vars as $int_var ) {
if ( isset( $location[ $int_var ] ) ) {
$location[ $int_var ] = intval( $location[ $int_var ] );
@@ -1324,11 +1324,11 @@ function eme_sanitize_location( $location ) {
}
function eme_validate_location( $location ) {
- $location_required_fields = array(
+ $location_required_fields = [
'location_name' => __( 'The location name', 'events-made-easy' ),
'location_address1' => __( 'The location address', 'events-made-easy' ),
'location_city' => __( 'The location city', 'events-made-easy' ),
- );
+ ];
$troubles = '';
if ( empty( $location['location_name'] ) ) {
$troubles .= '
' . sprintf( __( '%s is missing!', 'events-made-easy' ), $location_required_fields['location_name'] ) . ' ';
@@ -1371,7 +1371,7 @@ function eme_update_location( $line, $location_id ) {
$new_line['location_properties'] = eme_serialize( $new_line['location_properties'] );
$wpdb->show_errors( true );
- $where = array( 'location_id' => $location_id );
+ $where = [ 'location_id' => $location_id ];
if ( $wpdb->update( $table_name, $new_line, $where ) === false ) {
$wpdb->print_error();
$wpdb->show_errors( false );
@@ -1514,8 +1514,8 @@ function eme_global_map_shortcode( $atts ) {
// the locations shortcode has been deteced, so we indicate
// that we want the javascript in the footer as well
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'show_locations' => true,
'letter_icons' => true,
'show_events' => false,
@@ -1531,8 +1531,8 @@ function eme_global_map_shortcode( $atts ) {
'width' => 450,
'height' => 300,
'list_location' => 'after',
- ),
- $atts
+ ],
+ $atts
)
);
$eventful = filter_var( $eventful, FILTER_VALIDATE_BOOLEAN );
@@ -1659,10 +1659,10 @@ function eme_global_map_shortcode( $atts ) {
// remove the offset info
$this_page_url = remove_query_arg( 'eme_offset', $this_page_url );
if ( $prev_text != '' ) {
- $pagination_top .= "
$prev_offset ), $this_page_url ) . "'><< $prev_text ";
+ $pagination_top .= "
$prev_offset ], $this_page_url ) . "'><< $prev_text ";
}
if ( $next_text != '' ) {
- $pagination_top .= "
$next_offset ), $this_page_url ) . "'>$next_text >> ";
+ $pagination_top .= "
$next_offset ], $this_page_url ) . "'>$next_text >> ";
}
$pagination_top .= "
$scope_text ";
$pagination_top .= '
';
@@ -1722,14 +1722,14 @@ function eme_global_map_shortcode( $atts ) {
function eme_single_location_map_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => '',
'width' => 0,
'height' => 0,
'zoom' => get_option( 'eme_indiv_zoom_factor' ),
- ),
- $atts
+ ],
+ $atts
)
);
$location = eme_get_location( $id );
@@ -1764,13 +1764,13 @@ function eme_display_single_location( $location_id, $template_id = 0, $ignore_ur
function eme_get_location_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => '',
'template_id' => 0,
'ignore_url' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$ignore_url = filter_var( $ignore_url, FILTER_VALIDATE_BOOLEAN );
@@ -1780,8 +1780,8 @@ function eme_get_location_shortcode( $atts ) {
function eme_get_locations_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'eventful' => false,
'ignore_filter' => false,
'random_order' => false,
@@ -1794,8 +1794,8 @@ function eme_get_locations_shortcode( $atts ) {
'template_id' => 0,
'template_id_header' => 0,
'template_id_footer' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$eventful = filter_var( $eventful, FILTER_VALIDATE_BOOLEAN );
@@ -2105,7 +2105,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
}
} elseif ( preg_match( '/#_LOCATIONIMAGE$/', $result ) ) {
if ( ! empty( $location['location_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $location['location_image_id'], 'full', 0, array( 'class' => 'eme_location_image' ) );
+ $replacement = wp_get_attachment_image( $location['location_image_id'], 'full', 0, [ 'class' => 'eme_location_image' ] );
} elseif ( ! empty( $location['location_image_url'] ) ) {
$url = $location['location_image_url'];
if ( $target == 'html' ) {
@@ -2133,7 +2133,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
}
} elseif ( preg_match( '/#_LOCATIONIMAGETHUMB$/', $result ) ) {
if ( ! empty( $location['location_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $location['location_image_id'], get_option( 'eme_thumbnail_size' ), 0, array( 'class' => 'eme_location_image' ) );
+ $replacement = wp_get_attachment_image( $location['location_image_id'], get_option( 'eme_thumbnail_size' ), 0, [ 'class' => 'eme_location_image' ] );
if ( $target == 'html' ) {
$replacement = apply_filters( 'eme_general', $replacement );
} elseif ( $target == 'rss' ) {
@@ -2144,7 +2144,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
}
} elseif ( preg_match( '/#_LOCATIONIMAGETHUMB\{(.+?)\}/', $result, $matches ) ) {
if ( ! empty( $location['location_image_id'] ) ) {
- $replacement = wp_get_attachment_image( $location['location_image_id'], $matches[1], 0, array( 'class' => 'eme_location_image' ) );
+ $replacement = wp_get_attachment_image( $location['location_image_id'], $matches[1], 0, [ 'class' => 'eme_location_image' ] );
if ( $target == 'html' ) {
$replacement = apply_filters( 'eme_general', $replacement );
} elseif ( $target == 'rss' ) {
@@ -2280,7 +2280,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
} elseif ( preg_match( '/^#_LOCATIONCATEGORIES\{(.*?)\}\{(.*?)\}/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[1];
$exclude_cats = $matches[2];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $include_cats ) && eme_is_list_of_int($include_cats) ) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -2291,7 +2291,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
}
$extra_conditions = join( ' AND ', $extra_conditions_arr );
$categories = eme_get_location_category_names( $location['location_id'], $extra_conditions, $order_by );
- $cat_names = array();
+ $cat_names = [];
foreach ( $categories as $cat_name ) {
if ( $target == 'html' ) {
array_push( $cat_names, eme_trans_esc_html( $cat_name, $lang ) );
@@ -2314,7 +2314,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
} elseif ( preg_match( '/^#_LOCATIONCATEGORIES_CSS\{(.*?)\}\{(.*?)\}/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[1];
$exclude_cats = $matches[2];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $exclude_cats ) && eme_is_list_of_int($include_cats)) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -2338,7 +2338,7 @@ function eme_replace_locations_placeholders( $format, $location = '', $target =
} elseif ( preg_match( '/#_LOCATIONCATEGORYDESCRIPTIONS\{(.*?)\}\{(.*?)\}/', $result, $matches ) && get_option( 'eme_categories_enabled' ) ) {
$include_cats = $matches[1];
$exclude_cats = $matches[2];
- $extra_conditions_arr = array();
+ $extra_conditions_arr = [];
$order_by = '';
if ( ! empty( $exclude_cats ) && eme_is_list_of_int($include_cats)) {
array_push( $extra_conditions_arr, "category_id IN ($include_cats)" );
@@ -2630,9 +2630,9 @@ function eme_add_directions_form( $location ) {
}
function eme_global_map_json( $locations, $marker_clustering, $letter_icons ) {
- $json_locations = array();
+ $json_locations = [];
foreach ( $locations as $location ) {
- $json_location = array();
+ $json_location = [];
// we need lat and long, otherwise it fails
if ( empty( $location['location_latitude'] ) || empty( $location['location_longitude'] ) ) {
@@ -2662,14 +2662,14 @@ function eme_global_map_json( $locations, $marker_clustering, $letter_icons ) {
$marker_clustering_val = ( $marker_clustering ) ? 'true' : 'false';
- $json = array(
+ $json = [
'locations' => $json_locations,
'enable_zooming' => get_option( 'eme_map_zooming' ) ? 'true' : 'false',
'default_map_icon' => get_option( 'eme_location_map_icon' ),
'letter_icons' => $letter_icons ? 'true' : 'false',
'marker_clustering' => $marker_clustering_val,
'gestures' => get_option( 'eme_map_gesture_handling' ) ? 'true' : 'false',
- );
+ ];
return wp_json_encode( $json );
}
@@ -2757,7 +2757,7 @@ function eme_locations_search_ajax() {
header( 'Content-type: application/json; charset=utf-8' );
if ( isset( $_GET['id'] ) && $_GET['id'] != '' ) {
$item = eme_get_location( intval( $_GET['id'] ) );
- $record = array();
+ $record = [];
if ( empty( $item ) ) {
echo wp_json_encode( $record );
return;
@@ -2782,7 +2782,7 @@ function eme_locations_search_ajax() {
}
function eme_locations_autocomplete_ajax( $no_wp_die = 0 ) {
- $res = array();
+ $res = [];
if ( ! isset( $_REQUEST['q'] ) ) {
echo wp_json_encode( $res );
return;
@@ -2796,14 +2796,14 @@ function eme_locations_autocomplete_ajax( $no_wp_die = 0 ) {
$locations = eme_search_locations( eme_sanitize_request($_REQUEST['q']) );
// change null to empty
$locations = array_map(
- function( $v ) {
+ function( $v ) {
return ( is_null( $v ) ) ? '' : $v;
},
- $locations
+ $locations
);
foreach ( $locations as $item ) {
- $record = array();
+ $record = [];
$record['location_id'] = $item['location_id'];
$record['name'] = eme_trans_esc_html( $item['location_name'] );
$record['address1'] = eme_trans_esc_html( $item['location_address1'] );
@@ -2840,7 +2840,7 @@ function eme_ajax_locations_list() {
$answers_table = $eme_db_prefix . ANSWERS_TBNAME;
$search_name = isset( $_REQUEST['search_name'] ) ? esc_sql( $wpdb->esc_like( eme_sanitize_request( $_REQUEST['search_name'] ) ) ) : '';
$where = '';
- $where_arr = array();
+ $where_arr = [];
if ( ! empty( $search_name ) ) {
$where_arr[] = "(locations.location_name like '%" . $search_name . "%')";
}
@@ -2851,7 +2851,7 @@ function eme_ajax_locations_list() {
if ( ! $wp_id ) {
$ajaxResult['Result'] = 'OK';
$ajaxResult['TotalRecordCount'] = 0;
- $ajaxResult['Records'] = array();
+ $ajaxResult['Records'] = [];
print wp_json_encode( $ajaxResult );
wp_die();
}
@@ -2865,7 +2865,7 @@ function eme_ajax_locations_list() {
$formfields_searchable = eme_get_searchable_formfields( 'locations' );
$formfields = eme_get_formfields( '', 'locations' );
- $jTableResult = array();
+ $jTableResult = [];
$start = intval( $_REQUEST['jtStartIndex'] );
$pagesize = intval( $_REQUEST['jtPageSize'] );
$sorting = ( ! empty( $_REQUEST['jtSorting'] ) && ! empty( eme_sanitize_sql_orderby( $_REQUEST['jtSorting'] ) ) ) ? 'ORDER BY ' . esc_sql( eme_sanitize_sql_orderby($_REQUEST['jtSorting'] )) : '';
@@ -2874,7 +2874,7 @@ function eme_ajax_locations_list() {
$count_sql = "SELECT COUNT(*) FROM $table AS locations $where";
$sql = "SELECT locations.* FROM $table AS locations $where $sorting LIMIT $start,$pagesize";
} else {
- $field_ids_arr = array();
+ $field_ids_arr = [];
foreach ( $formfields_searchable as $formfield ) {
$field_ids_arr[] = $formfield['field_id'];
}
@@ -2904,13 +2904,13 @@ function eme_ajax_locations_list() {
$recordCount = $wpdb->get_var( $count_sql );
$rows = $wpdb->get_results( $sql, ARRAY_A );
- $records = array();
+ $records = [];
foreach ( $rows as $item ) {
$item = eme_get_extra_location_data( $item );
if ( empty( $item['location_name'] ) ) {
$item['location_name'] = __( 'No name', 'events-made-easy' );
}
- $record = array();
+ $record = [];
$record['location_id'] = $item['location_id'];
$record['location_name'] = "
" . eme_trans_esc_html( $item['location_name'] ) . ' ';
if ( ! $item['location_latitude'] && ! $item['location_longitude'] && get_option( 'eme_map_is_active' ) && ! $item['location_properties']['online_only'] ) {
@@ -2958,7 +2958,7 @@ function eme_ajax_manage_locations() {
$current_userid = get_current_user_id();
$table = $eme_db_prefix . LOCATIONS_TBNAME;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
- $jTableResult = array();
+ $jTableResult = [];
if ( isset( $_POST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_POST['do_action'] );
switch ( $do_action ) {
@@ -2981,9 +2981,9 @@ function eme_ajax_manage_locations() {
}
function eme_get_location_post_cfs() {
- $answers = array();
+ $answers = [];
foreach ( $_POST as $key => $value ) {
- if ( preg_match( '/^FIELD(\d+)$/', $key, $matches ) ) {
+ if ( preg_match( '/^FIELD(\d+)$/', eme_sanitize_request( $key ), $matches ) ) {
$field_id = intval( $matches[1] );
$formfield = eme_get_formfield( $field_id );
if ( ! empty( $formfield ) && $formfield['field_purpose'] == 'locations' ) {
@@ -2994,12 +2994,12 @@ function eme_get_location_post_cfs() {
if ( is_array( $value ) ) {
$value = eme_convert_array2multi( $value );
}
- $answer = array(
+ $answer = [
'field_name' => $formfield['field_name'],
'field_id' => $field_id,
'extra_charge' => $formfield['extra_charge'],
'answer' => $value,
- );
+ ];
$answers[] = $answer;
}
}
@@ -3024,7 +3024,7 @@ function eme_get_location_answers( $location_id ) {
}
function eme_location_store_cf_answers( $location_id ) {
- $answer_ids_seen = array();
+ $answer_ids_seen = [];
$all_answers = eme_get_location_answers( $location_id );
$found_answers = eme_get_location_post_cfs();
@@ -3053,7 +3053,7 @@ function eme_location_store_cf_answers( $location_id ) {
function eme_get_cf_location_ids( $val, $field_id, $is_multi = 0 ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . ANSWERS_TBNAME;
- $conditions = array();
+ $conditions = [];
$val = eme_kses( $val );
if ( is_array( $val ) ) {
diff --git a/eme-mailer.php b/eme-mailer.php
index 3acb9f5b..f7aea15d 100644
--- a/eme-mailer.php
+++ b/eme-mailer.php
@@ -9,14 +9,14 @@ function eme_set_wpmail_html_content_type() {
}
// for backwards compat, the fromname and email are after the replyto and can be empty
-function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $replytoemail = '', $replytoname = '', $fromemail = '', $fromname = '', $atts = array(), $custom_headers = array() ) {
+function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $replytoemail = '', $replytoname = '', $fromemail = '', $fromname = '', $atts = [], $custom_headers = [] ) {
$subject = preg_replace( '/(^\s+|\s+$)/m', '', $subject );
$res = true;
$message = '';
// nothing to send? Then act as if all is ok
if ( empty( $body ) || empty( $subject ) || empty( $receiveremail ) ) {
- return array( $res, $message );
+ return [ $res, $message ];
}
// the next 8 lines are no longer needed, but best to keep for mails already queued before this release (2.3.8)
@@ -31,7 +31,7 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
// get all mail options, put them in an array and apply filter
// if you change this array, don't forget to update the doc
- $mailoptions = array(
+ $mailoptions = [
'fromMail' => $fromemail,
'fromName' => $fromname,
'toMail' => $receiveremail,
@@ -49,7 +49,7 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
'smtp_username' => get_option( 'eme_smtp_username', '' ),
'smtp_password' => get_option( 'eme_smtp_password', '' ),
'smtp_debug' => get_option( 'eme_smtp_debug' ), // true or false
- );
+ ];
$mailoptions = apply_filters( 'eme_filter_mail_options', $mailoptions );
if ( empty( $mailoptions['smtp_host'] ) ) {
@@ -62,7 +62,7 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
$bcc_addresses = preg_split( '/,|;/', $mailoptions['bcc_addresses'] );
// allow either an array of file paths or of attachment ids
- $attachment_paths_arr = array();
+ $attachment_paths_arr = [];
foreach ( $atts as $attachment ) {
if ( ! empty( $attachment ) ) {
if ( is_numeric( $attachment ) ) {
@@ -79,7 +79,7 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
}
}
- if ( ! in_array( $mailoptions['mail_send_method'], array( 'smtp', 'mail', 'sendmail', 'qmail', 'wp_mail' ) ) ) {
+ if ( ! in_array( $mailoptions['mail_send_method'], [ 'smtp', 'mail', 'sendmail', 'qmail', 'wp_mail' ] ) ) {
$mailoptions['mail_send_method'] = 'wp_mail';
}
@@ -209,13 +209,13 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
// so now we disable cert verification as requested and allow self signed
// but only for ip's in the reserved range
if ( $in_reserved_range ) {
- $mail->SMTPOptions = array(
- 'ssl' => array(
+ $mail->SMTPOptions = [
+ 'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
- ),
- );
+ ],
+ ];
}
}
@@ -277,14 +277,14 @@ function eme_send_mail( $subject, $body, $receiveremail, $receivername = '', $re
}
// remove the phpmailer url added for some errors
$message = str_replace( 'https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting', '', $message );
- return array( $res, $message );
+ return [ $res, $message ];
}
-function eme_db_insert_ongoing_mailing( $mailing_name, $subject, $body, $fromemail, $fromname, $replytoemail, $replytoname, $mail_text_html, $conditions = array() ) {
+function eme_db_insert_ongoing_mailing( $mailing_name, $subject, $body, $fromemail, $fromname, $replytoemail, $replytoname, $mail_text_html, $conditions = [] ) {
global $wpdb,$eme_db_prefix;
$mailing_table = $eme_db_prefix . MAILINGS_TBNAME;
$now = current_time( 'mysql', false );
- $mailing = array(
+ $mailing = [
'name' => mb_substr( $mailing_name, 0, 255 ),
'planned_on' => $now,
'status' => 'ongoing',
@@ -297,7 +297,7 @@ function eme_db_insert_ongoing_mailing( $mailing_name, $subject, $body, $fromema
'mail_text_html' => $mail_text_html,
'creation_date' => $now,
'conditions' => eme_serialize( $conditions ),
- );
+ ];
if ( $wpdb->insert( $mailing_table, $mailing ) === false ) {
return false;
} else {
@@ -309,7 +309,7 @@ function eme_db_insert_mailing( $mailing_name, $planned_on, $subject, $body, $fr
global $wpdb,$eme_db_prefix;
$mailing_table = $eme_db_prefix . MAILINGS_TBNAME;
$now = current_time( 'mysql', false );
- $mailing = array(
+ $mailing = [
'name' => mb_substr( $mailing_name, 0, 255 ),
'planned_on' => $planned_on,
'status' => 'initial',
@@ -322,7 +322,7 @@ function eme_db_insert_mailing( $mailing_name, $planned_on, $subject, $body, $fr
'mail_text_html' => $mail_text_html,
'creation_date' => $now,
'conditions' => eme_serialize( $conditions ),
- );
+ ];
if ( $wpdb->insert( $mailing_table, $mailing ) === false ) {
return false;
} else {
@@ -330,11 +330,11 @@ function eme_db_insert_mailing( $mailing_name, $planned_on, $subject, $body, $fr
}
}
-function eme_queue_fastmail( $subject, $body, $fromemail, $fromname, $receiveremail, $receivername, $replytoemail, $replytoname, $mailing_id = 0, $person_id = 0, $member_id = 0, $atts = array() ) {
+function eme_queue_fastmail( $subject, $body, $fromemail, $fromname, $receiveremail, $receivername, $replytoemail, $replytoname, $mailing_id = 0, $person_id = 0, $member_id = 0, $atts = [] ) {
return eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail, $receivername, $replytoemail, $replytoname, $mailing_id, $person_id, $member_id, $atts, 1 );
}
-function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail, $receivername, $replytoemail, $replytoname, $mailing_id = 0, $person_id = 0, $member_id = 0, $atts = array(), $send_immediately = 0 ) {
+function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail, $receivername, $replytoemail, $replytoname, $mailing_id = 0, $person_id = 0, $member_id = 0, $atts = [], $send_immediately = 0 ) {
global $wpdb,$eme_db_prefix;
$mqueue_table = $eme_db_prefix . MQUEUE_TBNAME;
@@ -348,7 +348,7 @@ function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail,
}
$random_id = eme_random_id();
- $custom_headers = array( 'X-EME-mailid:' . $random_id );
+ $custom_headers = [ 'X-EME-mailid:' . $random_id ];
if ( ! get_option( 'eme_queue_mails' ) ) {
$send_immediately = 1;
}
@@ -363,7 +363,7 @@ function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail,
}
$now = current_time( 'mysql', false );
- $mail = array(
+ $mail = [
'subject' => mb_substr( $subject, 0, 255 ),
'body' => $body,
'fromemail' => $fromemail,
@@ -378,7 +378,7 @@ function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail,
'attachments' => eme_serialize( $atts ),
'creation_date' => $now,
'random_id' => $random_id,
- );
+ ];
if ( $send_immediately ) {
// we add the mail to the queue as sent and send it immediately
$mail['status'] = 1;
@@ -395,8 +395,8 @@ function eme_queue_mail( $subject, $body, $fromemail, $fromname, $receiveremail,
function eme_mark_mail_ignored( $id ) {
global $wpdb,$eme_db_prefix;
$mqueue_table = $eme_db_prefix . MQUEUE_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['id'] = intval( $id );
$fields['status'] = 4;
$fields['sent_datetime'] = current_time( 'mysql', false );
@@ -410,8 +410,8 @@ function eme_mark_mail_ignored( $id ) {
function eme_mark_mail_sent( $id ) {
global $wpdb,$eme_db_prefix;
$mqueue_table = $eme_db_prefix . MQUEUE_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['id'] = intval( $id );
$fields['status'] = 1;
$fields['sent_datetime'] = current_time( 'mysql', false );
@@ -425,8 +425,8 @@ function eme_mark_mail_sent( $id ) {
function eme_mark_mail_fail( $id, $error_msg = '' ) {
global $wpdb,$eme_db_prefix;
$mqueue_table = $eme_db_prefix . MQUEUE_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['id'] = intval( $id );
$fields['status'] = 2;
$fields['error_msg'] = esc_sql( $error_msg );
@@ -530,7 +530,7 @@ function eme_send_queued() {
$body .= $track_html;
}
}
- $custom_headers = array( 'X-EME-mailid:' . $mail['random_id'] );
+ $custom_headers = [ 'X-EME-mailid:' . $mail['random_id'] ];
$mail_res_arr = eme_send_mail( $mail['subject'], $body, $mail['receiveremail'], $mail['receivername'], $mail['replytoemail'], $mail['replytoname'], $mail['fromemail'], $mail['fromname'], $atts, $custom_headers );
if ( $mail_res_arr[0] ) {
eme_mark_mail_sent( $mail['id'] );
@@ -704,23 +704,23 @@ function eme_get_mailings( $archive = 0 ) {
}
function eme_mail_states() {
- $states = array(
+ $states = [
0 => 'planned',
1 => 'sent',
2 => 'failed',
3 => 'cancelled',
4 => 'ignored',
- );
+ ];
return $states;
}
function eme_mail_localizedstates() {
- $states = array(
+ $states = [
0 => __( 'Planned', 'events-made-easy' ),
1 => __( 'Sent', 'events-made-easy' ),
2 => __( 'Failed', 'events-made-easy' ),
3 => __( 'Cancelled', 'events-made-easy' ),
4 => __( 'Ignored', 'events-made-easy' ),
- );
+ ];
return $states;
}
@@ -736,14 +736,14 @@ function eme_get_mailing_stats( $mailing_id = 0 ) {
$table = $eme_db_prefix . MQUEUE_TBNAME;
$sql = "SELECT COUNT(*) AS count,status FROM $table WHERE mailing_id=$mailing_id GROUP BY mailing_id,status";
$lines = $wpdb->get_results( $sql, ARRAY_A );
- $res = array(
+ $res = [
'planned' => 0,
'sent' => 0,
'failed' => 0,
'cancelled' => 0,
'ignored' => 0,
'total_read_count' => 0,
- );
+ ];
$states = eme_mail_states();
foreach ( $lines as $line ) {
$status = $states[ $line['status'] ];
@@ -837,28 +837,28 @@ function eme_update_mailing_receivers( $mail_subject, $mail_message, $from_email
$res['not_sent'] = '';
$mail_subject = eme_replace_generic_placeholders( $mail_subject );
$mail_message = eme_replace_generic_placeholders( $mail_message );
- $not_sent = array();
- $emails_handled = array();
+ $not_sent = [];
+ $emails_handled = [];
if ( isset( $conditions['ignore_massmail_setting'] ) && $conditions['ignore_massmail_setting'] == 1 ) {
$ignore_massmail_setting = 1;
} else {
$ignore_massmail_setting = 0;
}
- $atts = array();
+ $atts = [];
$attachment_ids = '';
if ( $conditions['action'] == 'genericmail' ) {
- $person_ids = array();
- $member_ids = array();
- $cond_person_ids_arr = array();
- $cond_member_ids_arr = array();
+ $person_ids = [];
+ $member_ids = [];
+ $cond_person_ids_arr = [];
+ $cond_member_ids_arr = [];
if ( isset( $conditions['eme_generic_attach_ids'] ) ) {
$attachment_ids = $conditions['eme_generic_attach_ids'];
}
if ( ! empty( $attachment_ids ) ) {
$attachment_id_arr = explode( ',', $attachment_ids );
} else {
- $attachment_id_arr = array();
+ $attachment_id_arr = [];
}
if ( isset( $conditions['eme_send_all_people'] ) ) {
@@ -961,7 +961,7 @@ function eme_update_mailing_receivers( $mail_subject, $mail_message, $from_email
if ( ! empty( $attachment_ids ) ) {
$attachment_id_arr = explode( ',', $attachment_ids );
} else {
- $attachment_id_arr = array();
+ $attachment_id_arr = [];
}
if ( empty( $event ) ) {
@@ -998,8 +998,8 @@ function eme_update_mailing_receivers( $mail_subject, $mail_message, $from_email
}
}
} elseif ( $conditions['eme_mail_type'] == 'all_people' || $conditions['eme_mail_type'] == 'people_and_groups' || $conditions['eme_mail_type'] == 'all_people_not_registered' ) {
- $person_ids = array();
- $member_ids = array();
+ $person_ids = [];
+ $member_ids = [];
if ( $conditions['eme_mail_type'] == 'all_people' || $conditions['eme_mail_type'] == 'all_people_not_registered' ) {
// although we check later on the massmail preference per person too, we optimize the sql load a bit
if ( $ignore_massmail_setting ) {
@@ -1028,7 +1028,7 @@ function eme_update_mailing_receivers( $mail_subject, $mail_message, $from_email
if ( ! empty( $conditions['exclude_registered'] ) || $conditions['eme_mail_type'] == 'all_people_not_registered' ) {
$registered_ids = eme_get_attendee_ids( $conditions['event_id'] );
} else {
- $registered_ids = array();
+ $registered_ids = [];
}
foreach ( $member_ids as $member_id ) {
$member = eme_get_member( $member_id );
@@ -1089,7 +1089,7 @@ function eme_update_mailing_receivers( $mail_subject, $mail_message, $from_email
if ( $conditions['eme_mail_type'] == 'all_wp_not_registered' || $conditions['exclude_registered'] ) {
$attendee_wp_ids = eme_get_wp_ids_for( $conditions['event_id'] );
} else {
- $attendee_wp_ids = array();
+ $attendee_wp_ids = [];
}
$lang = eme_detect_lang();
foreach ( $wp_users as $wp_user ) {
@@ -1122,7 +1122,7 @@ function eme_mailingreport_list() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
if ( ! current_user_can( get_option( 'eme_cap_send_mails' ) ) ) {
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'Error';
$ajaxResult['Message'] = __( 'Access denied!', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
@@ -1136,7 +1136,7 @@ function eme_mailingreport_list() {
$mailing_id = intval( $_REQUEST['mailing_id'] );
$search_name = isset( $_REQUEST['search_name'] ) ? esc_sql( $wpdb->esc_like( eme_sanitize_request( $_REQUEST['search_name'] ) ) ) : '';
$where = '';
- $where_arr = array();
+ $where_arr = [];
$where_arr[] = '(mailing_id=' . intval( $_REQUEST['mailing_id'] ) . ')';
if ( ! empty( $search_name ) ) {
$where_arr[] = "(receivername like '%$search_name%' OR receiveremail like '%$search_name%')";
@@ -1146,7 +1146,7 @@ function eme_mailingreport_list() {
$where = ' WHERE ' . implode( ' AND ', $where_arr );
}
- $jTableResult = array();
+ $jTableResult = [];
$sql = "SELECT COUNT(*) FROM $table $where";
$recordCount = $wpdb->get_var( $sql );
$start = ( isset( $_REQUEST['jtStartIndex'] ) ) ? intval( $_REQUEST['jtStartIndex'] ) : 0;
@@ -1154,10 +1154,10 @@ function eme_mailingreport_list() {
$sorting = ( ! empty( $_REQUEST['jtSorting'] ) && ! empty( eme_sanitize_sql_orderby( $_REQUEST['jtSorting'] ) ) ) ? 'ORDER BY ' . esc_sql( $_REQUEST['jtSorting'] ) : '';
$sql = "SELECT * FROM $table $where $sorting LIMIT $start,$pagesize";
$rows = $wpdb->get_results( $sql, ARRAY_A );
- $records = array();
+ $records = [];
$states = eme_mail_localizedstates();
foreach ( $rows as $item ) {
- $record = array();
+ $record = [];
$id = $item['id'];
$record['receiveremail'] = $item['receiveremail'];
$record['receivername'] = $item['receivername'];
@@ -1231,8 +1231,8 @@ function eme_send_mails_ajax_actions( $action ) {
wp_die();
}
$event_ids = isset( $_POST['event_ids'] ) ? wp_parse_id_list($_POST['event_ids']) : 0;
- $ajaxResult = array();
- $conditions = array();
+ $ajaxResult = [];
+ $conditions = [];
$eme_date_obj_now = new ExpressiveDate( 'now', $eme_timezone );
if ( $action == 'searchmail' ) {
@@ -1430,7 +1430,7 @@ function eme_send_mails_ajax_actions( $action ) {
if ( ! empty( $attachment_ids ) ) {
$attachment_ids_arr = explode( ',', $attachment_ids );
} else {
- $attachment_ids_arr = array();
+ $attachment_ids_arr = [];
}
$preview_mail_to = intval( $_POST['send_previewmailto_id'] );
if ( $preview_mail_to == 0 ) {
@@ -1592,7 +1592,7 @@ function eme_send_mails_ajax_actions( $action ) {
if ( ! empty( $attachment_ids ) ) {
$attachment_ids_arr = explode( ',', $attachment_ids );
} else {
- $attachment_ids_arr = array();
+ $attachment_ids_arr = [];
}
$preview_mail_to = intval( $_POST['send_previeweventmailto_id'] );
if ( $preview_mail_to == 0 ) {
@@ -1663,7 +1663,7 @@ function eme_send_mails_ajax_actions( $action ) {
$current_userid = get_current_user_id();
$mail_problems = 0;
$mail_access_problems = 0;
- $not_sent = array();
+ $not_sent = [];
$count_event_ids = count( $event_ids );
foreach ( $event_ids as $event_id ) {
$conditions['event_id'] = $event_id;
@@ -1743,13 +1743,13 @@ function eme_emails_page() {
$eme_queue_mails_configured = 1;
}
- $mygroups = array();
- $mymembergroups = array();
- $person_ids = array();
- $membership_ids = array();
- $persongroup_ids = array();
- $membergroup_ids = array();
- $member_ids = array();
+ $mygroups = [];
+ $mymembergroups = [];
+ $person_ids = [];
+ $membership_ids = [];
+ $persongroup_ids = [];
+ $membergroup_ids = [];
+ $member_ids = [];
// if we get a request for mailings, set the active tab to the 'tab-genericmails' tab (which is index 1)
if ( isset( $_POST['eme_admin_action'] ) && $_POST['eme_admin_action'] == 'new_mailing' ) {
$data_forced_tab = 'data-showtab=1';
diff --git a/eme-members.php b/eme-members.php
index 66fc17be..e347909a 100644
--- a/eme-members.php
+++ b/eme-members.php
@@ -9,21 +9,21 @@ function eme_new_membership() {
$eme_date_obj_now = new ExpressiveDate( 'now', $eme_timezone );
$today = $eme_date_obj_now->getDate();
- $membership = array(
+ $membership = [
'name' => '',
'description' => '',
'type' => '', // fixed/rolling
'start_date' => $today, // only for fixed
'duration_count' => 1,
'duration_period' => 'years',
- );
+ ];
$membership['properties'] = eme_init_membership_props();
return $membership;
}
function eme_new_member() {
- $member = array(
+ $member = [
'membership_id' => 0,
'person_id' => 0,
'related_member_id' => 0,
@@ -38,14 +38,14 @@ function eme_new_member() {
'payment_date' => '0000-00-00 00:00',
'discount' => '',
'discountids' => '',
- 'dcodes_entered' => array(),
- 'dcodes_used' => array(),
+ 'dcodes_entered' => [],
+ 'dcodes_used' => [],
'dgroupid' => 0,
- );
+ ];
return $member;
}
-function eme_init_membership_props( $props = array() ) {
+function eme_init_membership_props( $props = [] ) {
if ( ! isset( $props['reminder_days'] ) ) {
$props['reminder_days'] = '';
} else {
@@ -82,10 +82,10 @@ function eme_init_membership_props( $props = array() ) {
$props['family_membership'] = 0;
}
if ( ! isset( $props['addpersontogroup'] ) ) {
- $props['addpersontogroup'] = array();
+ $props['addpersontogroup'] = [];
}
if ( ! isset( $props['dyndata'] ) ) {
- $props['dyndata'] = array();
+ $props['dyndata'] = [];
}
if ( ! isset( $props['dyndata_all_fields'] ) ) {
$props['dyndata_all_fields'] = 0;
@@ -166,13 +166,13 @@ function eme_init_membership_props( $props = array() ) {
$props['contact_paid_subject_format'] = __( 'Member payment received', 'events-made-easy' );
}
- $templates = array( 'member_form_tpl', 'familymember_form_tpl', 'payment_form_header_tpl', 'payment_form_footer_tpl', 'new_body_format_tpl', 'updated_body_format_tpl', 'extended_body_format_tpl', 'paid_body_format_tpl', 'reminder_body_format_tpl', 'stop_body_format_tpl', 'contact_new_body_format_tpl', 'contact_stop_body_format_tpl', 'contact_ipn_body_format_tpl', 'contact_paid_body_format_tpl', 'offline_payment_tpl', 'member_added_tpl', 'payment_success_tpl' );
+ $templates = [ 'member_form_tpl', 'familymember_form_tpl', 'payment_form_header_tpl', 'payment_form_footer_tpl', 'new_body_format_tpl', 'updated_body_format_tpl', 'extended_body_format_tpl', 'paid_body_format_tpl', 'reminder_body_format_tpl', 'stop_body_format_tpl', 'contact_new_body_format_tpl', 'contact_stop_body_format_tpl', 'contact_ipn_body_format_tpl', 'contact_paid_body_format_tpl', 'offline_payment_tpl', 'member_added_tpl', 'payment_success_tpl' ];
foreach ( $templates as $template ) {
if ( ! isset( $props[ $template ] ) ) {
$props[ $template ] = 0;
}
}
- $template_texts = array( 'member_form_text', 'familymember_form_text', 'payment_form_header_text', 'payment_form_footer_text', 'payment_success_text', 'offline_payment_text', 'new_body_text', 'contact_new_body_text', 'updated_body_text', 'extended_body_text', 'paid_body_text', 'contact_paid_body_text', 'reminder_body_text', 'stop_body_text', 'contact_stop_body_text', 'contact_ipn_body_text', 'member_added_text' );
+ $template_texts = [ 'member_form_text', 'familymember_form_text', 'payment_form_header_text', 'payment_form_footer_text', 'payment_success_text', 'offline_payment_text', 'new_body_text', 'contact_new_body_text', 'updated_body_text', 'extended_body_text', 'paid_body_text', 'contact_paid_body_text', 'reminder_body_text', 'stop_body_text', 'contact_stop_body_text', 'contact_ipn_body_text', 'member_added_text' ];
foreach ( $template_texts as $template_text ) {
if ( ! isset( $props[ $template_text ] ) ) {
$props[ $template_text ] = '';
@@ -251,7 +251,7 @@ function eme_db_insert_member( $line, $membership, $member_id = 0 ) {
function eme_db_update_member( $member_id, $line, $membership, $update_answers = 1 ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . MEMBERS_TBNAME;
- $where = array();
+ $where = [];
$where['member_id'] = intval( $member_id );
$tmp_member = eme_get_member( $member_id );
@@ -299,7 +299,7 @@ function eme_db_update_member( $member_id, $line, $membership, $update_answers =
function eme_db_update_membership( $membership_id, $line ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . MEMBERSHIPS_TBNAME;
- $where = array();
+ $where = [];
$where['membership_id'] = intval( $membership_id );
$membership = eme_get_membership( $membership_id );
@@ -324,10 +324,10 @@ function eme_db_update_membership( $membership_id, $line ) {
function eme_update_member_lastseen( $member_id ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . MEMBERS_TBNAME;
- $where = array();
+ $where = [];
$where['member_id'] = intval( $member_id );
- $fields = array();
+ $fields = [];
$fields['last_seen'] = current_time( 'mysql', false );
$wpdb->update( $table, $fields, $where );
}
@@ -337,14 +337,14 @@ function eme_get_members( $member_ids, $extra_search = '' ) {
$people_table = $eme_db_prefix . PEOPLE_TBNAME;
$members_table = $eme_db_prefix . MEMBERS_TBNAME;
$memberships_table = $eme_db_prefix . MEMBERSHIPS_TBNAME;
- $lines = array();
+ $lines = [];
if ( ! empty( $member_ids ) && eme_array_integers( $member_ids ) ) {
$commaDelimitedPlaceholders = implode(',', array_fill(0, count($member_ids), '%d'));
$sql = $wpdb->prepare("SELECT members.*, people.lastname, people.firstname, people.email, memberships.name AS membership_name
FROM $members_table AS members
LEFT JOIN $memberships_table AS memberships ON members.membership_id=memberships.membership_id
LEFT JOIN $people_table AS people ON members.person_id=people.person_id
- WHERE members.member_id IN ($commaDelimitedPlaceholders)",$member_ids);
+ WHERE members.member_id IN ($commaDelimitedPlaceholders)", $member_ids);
if ( ! empty( $extra_search ) ) {
$sql .= " AND $extra_search";
}
@@ -406,22 +406,22 @@ function eme_get_membership( $id ) {
}
function eme_membership_types() {
- $type_array = array(
+ $type_array = [
'fixed' => __( 'Fixed startdate', 'events-made-easy' ),
'rolling' => __( 'Rolling period', 'events-made-easy' ),
- );
+ ];
return $type_array;
}
function eme_membership_durations() {
- $duration_array = array(
+ $duration_array = [
'' => '',
'days' => __( 'Days', 'events-made-easy' ),
'weeks' => __( 'Weeks', 'events-made-easy' ),
'months' => __( 'Months', 'events-made-easy' ),
'years' => __( 'Years', 'events-made-easy' ),
'forever' => __( 'Forever', 'events-made-easy' ),
- );
+ ];
return $duration_array;
}
@@ -434,12 +434,12 @@ function eme_get_member( $id ) {
if ( eme_is_serialized( $member['dcodes_used'] ) ) {
$member['dcodes_used'] = eme_unserialize( $member['dcodes_used'] );
} else {
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
}
if ( eme_is_serialized( $member['dcodes_entered'] ) ) {
$member['dcodes_entered'] = eme_unserialize( $member['dcodes_entered'] );
} else {
- $member['dcodes_entered'] = array();
+ $member['dcodes_entered'] = [];
}
}
return $member;
@@ -456,12 +456,12 @@ function eme_get_active_member_by_personid_membershipid( $person_id, $membership
if ( eme_is_serialized( $member['dcodes_used'] ) ) {
$member['dcodes_used'] = eme_unserialize( $member['dcodes_used'] );
} else {
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
}
if ( eme_is_serialized( $member['dcodes_entered'] ) ) {
$member['dcodes_entered'] = eme_unserialize( $member['dcodes_entered'] );
} else {
- $member['dcodes_entered'] = array();
+ $member['dcodes_entered'] = [];
}
}
return $member;
@@ -486,12 +486,12 @@ function eme_get_member_by_wpid_membershipid( $wp_id, $membership_id, $status =
if ( eme_is_serialized( $member['dcodes_used'] ) ) {
$member['dcodes_used'] = eme_unserialize( $member['dcodes_used'] );
} else {
- $member['dcodes_used'] = array();
+ $member['dcodes_used'] = [];
}
if ( eme_is_serialized( $member['dcodes_entered'] ) ) {
$member['dcodes_entered'] = eme_unserialize( $member['dcodes_entered'] );
} else {
- $member['dcodes_entered'] = array();
+ $member['dcodes_entered'] = [];
}
}
@@ -686,7 +686,7 @@ function eme_memberships_page() {
$message = __( 'You have no right to manage memberships!', 'events-made-easy' );
} elseif ( isset( $_POST['eme_admin_action'] ) && $_POST['eme_admin_action'] == 'do_addmembership' ) {
check_admin_referer( 'eme_admin', 'eme_admin_nonce' );
- list($membership_id,$res_text) = eme_add_update_membership();
+ [$membership_id, $res_text] = eme_add_update_membership();
if ( $membership_id ) {
$message = __( 'Membership added', 'events-made-easy' );
if ( get_option( 'eme_stay_on_edit_page' ) || ! empty( $res_text ) ) {
@@ -703,7 +703,7 @@ function eme_memberships_page() {
} elseif ( isset( $_POST['eme_admin_action'] ) && $_POST['eme_admin_action'] == 'do_editmembership' ) {
check_admin_referer( 'eme_admin', 'eme_admin_nonce' );
$membership_id = intval( $_POST['membership_id'] );
- list($res,$res_text) = eme_add_update_membership( $membership_id );
+ [$res, $res_text] = eme_add_update_membership( $membership_id );
if ( $res ) {
$message = __( 'Membership updated', 'events-made-easy' );
if ( get_option( 'eme_stay_on_edit_page' ) || ! empty( $res_text ) ) {
@@ -737,7 +737,7 @@ function eme_memberships_page() {
}
function eme_add_update_member( $member_id = 0 ) {
- $member = array();
+ $member = [];
$payment_id = 0;
$membership_id = 0;
$transfer = 0;
@@ -751,6 +751,7 @@ function eme_add_update_member( $member_id = 0 ) {
$membership_id = intval( $_POST['transferto_membershipid'] );
// move all data from the original membership in $_POST to the new membership id too, so other membership code (like eme_store_member_answers) can work as expected with the new membership id
foreach ( $_POST as $key => $val ) {
+ $key = eme_sanitize_request( $key );
if ( is_array( $_POST[ $key ] ) && isset( $_POST[ $key ][ $orig_membership_id ] ) ) {
$_POST[ $key ][ $membership_id ] = eme_sanitize_request( $_POST[ $key ][ $orig_membership_id ] );
}
@@ -834,9 +835,9 @@ function eme_add_update_member( $member_id = 0 ) {
// if we're updaing the head of the family, change the family members
$related_member_ids = eme_get_family_member_ids( $member_id );
if ( ! empty( $related_member_ids ) ) {
- $fields_to_copy = array( 'start_date', 'end_date', 'paid', 'payment_date', 'status', 'status_automatic', 'reminder', 'reminder_date', 'pg', 'pg_pid' );
+ $fields_to_copy = [ 'start_date', 'end_date', 'paid', 'payment_date', 'status', 'status_automatic', 'reminder', 'reminder_date', 'pg', 'pg_pid' ];
foreach ( $related_member_ids as $related_member_id ) {
- $related_member = array();
+ $related_member = [];
foreach ( $fields_to_copy as $field_to_copy ) {
$related_member[ $field_to_copy ] = $member[ $field_to_copy ];
}
@@ -889,10 +890,11 @@ function eme_add_update_member( $member_id = 0 ) {
$person_id = $res[0];
$err = $res[1];
// now add the family members
- $familymember_person_ids = array();
+ $familymember_person_ids = [];
if ( $person_id ) {
if ( isset( $_POST['familymember'] ) ) {
foreach ( $_POST['familymember'] as $familymember ) {
+ // sanitizing happens in eme_add_familymember_from_frontend
$familymember_person_ids[] = eme_add_familymember_from_frontend( $person_id, $familymember );
}
}
@@ -964,7 +966,7 @@ function eme_add_update_member( $member_id = 0 ) {
// now for the familymembers, we need to do this before we send out the newMember mail, otherwise the info
// concerning related family members (#_FAMILYCOUNT and #_FAMILYMEMBERS) is not correctly replaced
$familymember_person_ids = eme_get_family_person_ids( $person_id );
- $fields_to_copy = array( 'start_date', 'end_date', 'paid', 'payment_date', 'status', 'status_automatic', 'reminder', 'reminder_date', 'pg', 'pg_pid' );
+ $fields_to_copy = [ 'start_date', 'end_date', 'paid', 'payment_date', 'status', 'status_automatic', 'reminder', 'reminder_date', 'pg', 'pg_pid' ];
foreach ( $familymember_person_ids as $familymember_person_id ) {
$familymember_id = eme_is_member( $familymember_person_id, $membership_id );
if ( $familymember_id ) {
@@ -978,7 +980,7 @@ function eme_add_update_member( $member_id = 0 ) {
$familymember['unique_nbr'] = '';
eme_db_update_member( $familymember_id, $familymember, $membership );
} else {
- $familymember = array();
+ $familymember = [];
$familymember['person_id'] = $familymember_person_id;
$familymember['related_member_id'] = $member_id;
foreach ( $fields_to_copy as $field_to_copy ) {
@@ -1026,10 +1028,10 @@ function eme_add_update_member( $member_id = 0 ) {
} else {
$result = __( 'Problem detected while adding personal info: at least last name, first name and email need to be present', 'events-made-easy' );
}
- $res = array(
+ $res = [
0 => $result,
1 => $payment_id,
- );
+ ];
return $res;
}
@@ -1088,8 +1090,8 @@ function eme_memberships_exists( $ids_arr ) {
}
function eme_add_update_membership( $membership_id = 0 ) {
- $membership = array();
- $properties = array();
+ $membership = [];
+ $properties = [];
$message = '';
$membership['name'] = isset( $_POST['name'] ) ? eme_sanitize_request( $_POST['name'] ) : '';
@@ -1101,7 +1103,7 @@ function eme_add_update_membership( $membership_id = 0 ) {
$membership['properties'] = eme_kses( $_POST['properties'] );
}
// now for the select boxes, we need to set to 0 if not in the _POST
- $select_post_vars = array( 'use_captcha', 'use_recaptcha', 'use_hcaptcha', 'create_wp_user' );
+ $select_post_vars = [ 'use_captcha', 'use_recaptcha', 'use_hcaptcha', 'create_wp_user' ];
foreach ( $select_post_vars as $post_var ) {
if ( ! isset( $_POST['properties'][ $post_var ] ) ) {
$membership['properties'][ $post_var ] = 0;
@@ -1163,7 +1165,7 @@ function eme_add_update_membership( $membership_id = 0 ) {
if ( $membership_id ) {
eme_membership_store_answers( $membership_id );
}
- return array( $membership_id, $message );
+ return [ $membership_id, $message ];
}
function eme_member_edit_layout( $member, $limited = 0 ) {
@@ -1562,13 +1564,13 @@ function eme_meta_box_div_membershipdetails( $membership, $is_new_membership ) {
$create_wp_user = ( $membership['properties']['create_wp_user'] ) ? "checked='checked'" : '';
$membership_discount = ( $membership['properties']['discount'] ) ? $membership['properties']['discount'] : '';
$membership_discountgroup = ( $membership['properties']['discountgroup'] ) ? $membership['properties']['discountgroup'] : '';
- $discount_arr = array();
- $dgroup_arr = array();
+ $discount_arr = [];
+ $dgroup_arr = [];
if ( ! empty( $membership_discount ) ) {
- $discount_arr = array( $membership_discount => eme_get_discount_name( $membership_discount ) );
+ $discount_arr = [ $membership_discount => eme_get_discount_name( $membership_discount ) ];
}
if ( ! empty( $membership_discountgroup ) ) {
- $dgroup_arr = array( $membership_discountgroup => eme_get_dgroup_name( $membership_discountgroup ) );
+ $dgroup_arr = [ $membership_discountgroup => eme_get_dgroup_name( $membership_discountgroup ) ];
}
?>
@@ -1702,11 +1704,11 @@ function eme_meta_box_div_membershipdetails( $membership, $is_new_membership ) {
'properties[contact_id]',
'show_option_none' => __( 'WP Admin', 'events-made-easy' ),
'selected' => $membership['properties']['contact_id'],
- )
+ ]
);
?>
@@ -1916,13 +1918,13 @@ function eme_meta_box_div_membershipdetails( $membership, $is_new_membership ) {
if ( isset( $membership['properties']['dyndata'] ) ) {
$eme_data = $membership['properties']['dyndata'];
} else {
- $eme_data = array();
+ $eme_data = [];
}
// for new memberships there's no membership id
if ( isset( $membership['membership_id'] ) ) {
$used_groupingids = eme_get_membership_cf_answers_groupingids( $membership['membership_id'] );
} else {
- $used_groupingids = array();
+ $used_groupingids = [];
}
eme_dyndata_adminform( $eme_data, $templates_array, $used_groupingids );
$eme_membership_dyndata_all_fields = ( $membership['properties']['dyndata_all_fields'] ) ? "checked='checked'" : '';
@@ -2335,7 +2337,7 @@ function eme_meta_box_div_membershipcustomfields( $membership ) {
if ( ! empty( $membership['membership_id'] ) ) {
$answers = eme_get_membership_answers( $membership['membership_id'] );
} else {
- $answers = array();
+ $answers = [];
}
foreach ( $formfields as $formfield ) {
$field_name = eme_trans_esc_html( $formfield['field_name'] );
@@ -2367,7 +2369,7 @@ function eme_meta_box_div_membershipcustomfields( $membership ) {
$value ) {
if ( preg_match( '/^DISCOUNT/', $key, $matches ) ) {
@@ -2839,18 +2841,18 @@ function eme_calc_memberprice_ajax() {
$membership_id = $member['membership_id'];
}
if ( ! $membership_id ) {
- echo wp_json_encode( array( 'total' => '' ) );
+ echo wp_json_encode( [ 'total' => '' ] );
return;
}
$membership = eme_get_membership( $membership_id );
if ( ! $membership ) {
- echo wp_json_encode( array( 'total' => '' ) );
+ echo wp_json_encode( [ 'total' => '' ] );
return;
}
$total = eme_calc_price_fake_member( $membership );
$cur = $membership['properties']['currency'];
$result = eme_localized_price( $total, $cur );
- echo wp_json_encode( array( 'total' => $result ) );
+ echo wp_json_encode( [ 'total' => $result ] );
}
function eme_dyndata_familymember_ajax() {
@@ -2874,7 +2876,7 @@ function eme_dyndata_familymember_ajax() {
for ( $i = 1;$i <= $count;$i++ ) {
$form_html .= eme_replace_membership_familyformfields_placeholders( $format, $i );
}
- echo wp_json_encode( array( 'Result' => do_shortcode( $form_html ) ) );
+ echo wp_json_encode( [ 'Result' => do_shortcode( $form_html ) ] );
}
function eme_dyndata_member_ajax() {
@@ -2889,7 +2891,7 @@ function eme_dyndata_member_ajax() {
$member = eme_get_member( intval( $_POST['member_id'] ) );
$membership_id = $member['membership_id'];
} else {
- $member = array();
+ $member = [];
}
$total = 0;
@@ -3002,11 +3004,11 @@ function eme_dyndata_member_ajax() {
}
}
}
- echo wp_json_encode( array( 'Result' => do_shortcode( $form_html ) ) );
+ echo wp_json_encode( [ 'Result' => do_shortcode( $form_html ) ] );
}
function eme_get_member_post_answers( $member, $include_dynamicdata = 1 ) {
- $answers = array();
+ $answers = [];
//$fields_seen=array();
$membership_id = $member['membership_id'];
@@ -3036,7 +3038,7 @@ function eme_get_member_post_answers( $member, $include_dynamicdata = 1 ) {
} else {
$value = eme_sanitize_request( $value );
}
- $answer = array(
+ $answer = [
'field_name' => $formfield['field_name'],
'field_id' => $field_id,
'field_purpose' => $formfield['field_purpose'],
@@ -3044,7 +3046,7 @@ function eme_get_member_post_answers( $member, $include_dynamicdata = 1 ) {
'answer' => $value,
'grouping_id' => $group_id,
'occurence_id' => $occurence_id,
- );
+ ];
$answers[] = $answer;
}
}
@@ -3076,7 +3078,7 @@ function eme_get_member_post_answers( $member, $include_dynamicdata = 1 ) {
} else {
$value = eme_sanitize_request( $value );
}
- $answer = array(
+ $answer = [
'field_name' => $formfield['field_name'],
'field_id' => $field_id,
'field_purpose' => $formfield['field_purpose'],
@@ -3084,7 +3086,7 @@ function eme_get_member_post_answers( $member, $include_dynamicdata = 1 ) {
'answer' => $value,
'grouping_id' => 0,
'occurence_id' => 0,
- );
+ ];
$answers[] = $answer;
}
}
@@ -3097,13 +3099,13 @@ function eme_member_answers( $member, $membership, $do_update = 1 ) {
}
function eme_store_member_answers( $member, $do_update = 1 ) {
global $wpdb,$eme_db_prefix;
- $fields_seen = array();
+ $fields_seen = [];
$extra_charge = 0;
$membership_id = $member['membership_id'];
- $member_answers = array();
- $person_answers = array();
- $all_answers = array();
+ $member_answers = [];
+ $person_answers = [];
+ $all_answers = [];
if ( $do_update ) {
$member_id = $member['member_id'];
if ( $member_id > 0 ) {
@@ -3117,7 +3119,7 @@ function eme_store_member_answers( $member, $do_update = 1 ) {
}
$person_id = $member['person_id'];
- $answer_ids_seen = array();
+ $answer_ids_seen = [];
$found_answers = eme_get_member_post_answers( $member );
foreach ( $found_answers as $answer ) {
if ( $answer['extra_charge'] && is_numeric( $answer['answer'] ) ) {
@@ -3466,8 +3468,8 @@ function eme_member_set_paid( $member, $pg = '', $pg_pid = '' ) {
return 0;
}
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member['member_id'];
$fields['paid'] = 1;
$fields['reminder'] = 0;
@@ -3514,8 +3516,8 @@ function eme_member_set_unpaid( $member ) {
return true;
}
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member['member_id'];
$fields['paid'] = 0;
$fields['payment_date'] = '';
@@ -3546,8 +3548,8 @@ function eme_extend_member( $member, $pg = '', $pg_pid = '' ) {
return 0;
}
$membership = eme_get_membership( $member['membership_id'] );
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member['member_id'];
$fields['paid'] = 1;
$fields['pg'] = $pg;
@@ -3579,8 +3581,8 @@ function eme_renew_expired_member( $member, $pg = '', $pg_pid = '' ) {
return 0;
}
$membership = eme_get_membership( $member['membership_id'] );
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member['member_id'];
$fields['paid'] = 1;
$fields['pg'] = $pg;
@@ -3618,8 +3620,8 @@ function eme_member_set_status( $member_id, $status ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . MEMBERS_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member_id;
$fields['status'] = $status;
@@ -3630,8 +3632,8 @@ function eme_stop_member( $member_id, $main_only = 0 ) {
global $wpdb,$eme_db_prefix, $eme_timezone;
$table = $eme_db_prefix . MEMBERS_TBNAME;
- $where = array();
- $fields = array();
+ $where = [];
+ $fields = [];
$where['member_id'] = $member_id;
if ( $main_only ) {
$where['related_member_id'] = 0;
@@ -3692,7 +3694,7 @@ function eme_email_member_action( $member, $action ) {
$member_body = '';
$contact_subject = '';
$contact_body = '';
- $atts = array();
+ $atts = [];
if ( $action == 'expiration_reminder' ) {
$member_subject = $membership['properties']['reminder_subject_format'];
if ( ! eme_is_empty_string( $membership['properties']['reminder_body_text'] ) ) {
@@ -3821,12 +3823,12 @@ function eme_email_member_action( $member, $action ) {
function eme_add_member_form_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'id' => 0,
'name' => '',
- ),
- $atts
+ ],
+ $atts
)
);
if ( ! empty( $name ) ) {
@@ -3842,13 +3844,13 @@ function eme_add_member_form_shortcode( $atts ) {
function eme_mymemberships_list_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'template_id' => 0,
'template_id_header' => 0,
'template_id_footer' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
if ( is_user_logged_in() ) {
@@ -3878,16 +3880,16 @@ function eme_members_report_link_shortcode( $atts ) {
global $post;
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'group_id' => 0,
'membership_id' => 0,
'template_id' => 0,
'template_id_header' => 0,
'link_text' => __( 'Members CSV', 'events-made-easy' ),
'public_access' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
$public_access = filter_var( $public_access, FILTER_VALIDATE_BOOLEAN );
@@ -3916,15 +3918,15 @@ function eme_members_report_link_shortcode( $atts ) {
function eme_members_shortcode( $atts ) {
eme_enqueue_frontend();
extract(
- shortcode_atts(
- array(
+ shortcode_atts(
+ [
'group_id' => 0,
'membership_id' => 0,
'template_id' => 0,
'template_id_header' => 0,
'template_id_footer' => 0,
- ),
- $atts
+ ],
+ $atts
)
);
@@ -3995,7 +3997,7 @@ function eme_members_frontend_csv_report( $group_id, $membership_id, $template_i
foreach ( $member_ids as $member_id ) {
$member = eme_get_member( $member_id );
$membership = eme_get_membership( $member['membership_id'] );
- $line = array();
+ $line = [];
$format_arr = explode( ',', $format );
$line_count = 1;
foreach ( $format_arr as $single_format ) {
@@ -4011,7 +4013,7 @@ function eme_members_frontend_csv_report( $group_id, $membership_id, $template_i
// now we have a line that contains arrays on every position, with $line_count indicating the max size of an arr in the line
// so let's use that to output multiple lines
for ( $i = 0;$i < $line_count;$i++ ) {
- $output = array();
+ $output = [];
foreach ( $line as $el_arr ) {
if ( isset( $el_arr[ $i ] ) ) {
$output[] = $el_arr[ $i ];
@@ -4041,17 +4043,17 @@ function eme_access_meta_box_cb( $post ) {
if ( eme_is_serialized( $selected_membershipids ) ) {
$selected_membershipids_arr = eme_unserialize( $selected_membershipids );
} else {
- $selected_membershipids_arr = array( $selected_membershipids );
+ $selected_membershipids_arr = [ $selected_membershipids ];
}
if ( eme_is_serialized( $selected_groupids ) ) {
$selected_groupids_arr = eme_unserialize( $selected_groupids );
} else {
- $selected_groupids_arr = array( $selected_groupids );
+ $selected_groupids_arr = [ $selected_groupids ];
}
$all_memberships = eme_get_memberships();
$all_groups = eme_get_static_groups();
echo "
" . esc_html__( 'Limit access to EME members of', 'events-made-easy' ) . ' ';
- $memberships_arr = array();
+ $memberships_arr = [];
foreach ( $all_memberships as $membership ) {
$memberships_arr[ $membership['membership_id'] ] = $membership['name'];
}
@@ -4060,7 +4062,7 @@ function eme_access_meta_box_cb( $post ) {
echo "
";
echo '
';
echo "
" . esc_html__( 'Limit access to EME people that are members of the following groups', 'events-made-easy' ) . ' ';
- $groups_arr = array();
+ $groups_arr = [];
foreach ( $all_groups as $group ) {
$groups_arr[ $group['group_id'] ] = $group['name'];
}
@@ -4124,10 +4126,10 @@ function eme_add_member_ajax() {
if ( ! isset( $_POST['honeypot_check'] ) || ! empty( $_POST['honeypot_check'] ) ) {
$form_html = __( "Bot detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -4136,10 +4138,10 @@ function eme_add_member_ajax() {
if ( ! isset( $_POST['eme_frontend_nonce'] ) || ! wp_verify_nonce( eme_sanitize_request($_POST['eme_frontend_nonce']), 'eme_frontend' ) ) {
$form_html = __( "Form tampering detected. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
}
@@ -4147,10 +4149,10 @@ function eme_add_member_ajax() {
if ( ! isset( $_POST['membership_id'] ) ) {
$form_html = __( 'No membership selected', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_html,
- )
+ ]
);
wp_die();
} else {
@@ -4163,10 +4165,10 @@ function eme_add_member_ajax() {
if ( ! $captcha_res ) {
$result = __( 'Please check the hCaptcha box', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $result,
- )
+ ]
);
wp_die();
}
@@ -4175,10 +4177,10 @@ function eme_add_member_ajax() {
if ( ! $captcha_res ) {
$result = __( 'Please check the Google reCAPTCHA box', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $result,
- )
+ ]
);
wp_die();
}
@@ -4187,10 +4189,10 @@ function eme_add_member_ajax() {
if ( ! $captcha_res ) {
$result = __( 'You entered an incorrect code', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $result,
- )
+ ]
);
wp_die();
}
@@ -4204,10 +4206,10 @@ function eme_add_member_ajax() {
if ( ! $tmp_member['discount'] || empty( $dcodes_used ) || count( $dcodes_used ) != count( $dcodes_entered ) ) {
$result = __( 'You did not enter a valid discount code', 'events-made-easy' );
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $result,
- )
+ ]
);
wp_die();
}
@@ -4216,10 +4218,10 @@ function eme_add_member_ajax() {
if ( has_filter( 'eme_eval_member_form_post_filter' ) ) {
$eval_filter_return = apply_filters( 'eme_eval_member_form_post_filter', $membership );
} else {
- $eval_filter_return = array(
+ $eval_filter_return = [
0 => 1,
1 => '',
- );
+ ];
}
if ( is_array( $eval_filter_return ) && ! $eval_filter_return[0] ) {
@@ -4246,11 +4248,11 @@ function eme_add_member_ajax() {
if ( $pg_count == 1 && get_option( 'eme_pg_submit_immediately' ) ) {
$payment_form = eme_payment_member_form( $payment_id );
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_result_message,
'paymentform' => $payment_form,
- )
+ ]
);
} elseif ( get_option( 'eme_payment_redirect' ) ) {
$payment = eme_get_payment( $payment_id );
@@ -4262,30 +4264,30 @@ function eme_add_member_ajax() {
$form_result_message .= '
' . $redirect_msg;
}
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_result_message,
'waitperiod' => $waitperiod,
'paymentredirect' => $payment_url,
- )
+ ]
);
} else {
$payment_form = eme_payment_member_form( $payment_id );
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_result_message,
'paymentform' => $payment_form,
- )
+ ]
);
}
} else {
// price=0
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_result_message,
- )
+ ]
);
}
} elseif ( $payment_id ) {
@@ -4293,18 +4295,18 @@ function eme_add_member_ajax() {
eme_captcha_remove( $captcha_res );
}
echo wp_json_encode(
- array(
+ [
'Result' => 'OK',
'htmlmessage' => $form_result_message,
- )
+ ]
);
} else {
// failed
echo wp_json_encode(
- array(
+ [
'Result' => 'NOK',
'htmlmessage' => $form_result_message,
- )
+ ]
);
}
wp_die();
@@ -4323,10 +4325,10 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
if ( $member['person_id'] == -1 ) {
// -1 ? then this is from a fake member
$person = eme_add_update_person_from_form( 0, '', '', '', 0, 0, 1 );
- $person_answers = array();
+ $person_answers = [];
$member_answers = eme_get_member_post_answers( $member, 0 ); // add the 0-option to exclude dynamic answers
- $dyn_answers = array();
- $files = array();
+ $dyn_answers = [];
+ $files = [];
} else {
$person = eme_get_person( $member['person_id'] );
$person_answers = eme_get_person_answers( $member['person_id'] );
@@ -4335,7 +4337,7 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
} else {
$member_answers = eme_get_nodyndata_member_answers( $member['member_id'] );
}
- $dyn_answers = ( isset( $membership['properties']['dyndata'] ) ) ? eme_get_dyndata_member_answers( $member['member_id'] ) : array();
+ $dyn_answers = ( isset( $membership['properties']['dyndata'] ) ) ? eme_get_dyndata_member_answers( $member['member_id'] ) : [];
$files = eme_get_uploaded_files( $member['member_id'], 'members' );
}
$answers = array_merge( $member_answers, $person_answers );
@@ -4381,7 +4383,7 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
} elseif ( preg_match( '/#_APPLIEDDISCOUNTNAMES$/', $result ) ) {
if ( ! empty( $member['discountids'] ) ) {
$discount_ids = explode( ',', $member['discountids'] );
- $discount_names = array();
+ $discount_names = [];
foreach ( $discount_ids as $discount_id ) {
$discount = eme_get_discount( $discount_id );
if ( $discount && isset( $discount['name'] ) ) {
@@ -4683,9 +4685,9 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
$targetBasePath = EME_UPLOAD_DIR . '/members/' . $member['member_id'];
$targetBaseUrl = EME_UPLOAD_URL . '/members/' . $member['member_id'];
$url_to_encode = eme_member_url( $member );
- list($target_file,$target_url) = eme_generate_qrcode( $url_to_encode, $targetBasePath, $targetBaseUrl, $size );
+ [$target_file, $target_url] = eme_generate_qrcode( $url_to_encode, $targetBasePath, $targetBaseUrl, $size );
if ( is_file( $target_file ) ) {
- list($width, $height, $type, $attr) = getimagesize( $target_file );
+ [$width, $height, $type, $attr] = getimagesize( $target_file );
$replacement = "
";
}
} elseif ( preg_match( '/#_DYNAMICFIELD\{(.+?)\}$/', $result, $matches ) ) {
@@ -4749,7 +4751,7 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
}
}
} elseif ( preg_match( '/#_FILES/', $result ) ) {
- $res_files = array();
+ $res_files = [];
foreach ( $files as $file ) {
if ( $target == 'html' ) {
$res_files[] = eme_get_uploaded_file_html( $file );
@@ -4763,7 +4765,7 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
$replacement = join( "\n", $res_files );
}
} elseif ( preg_match( '/#_PERSONAL_FILES/', $result ) ) {
- $res_files = array();
+ $res_files = [];
$person_files = eme_get_uploaded_files( $member['person_id'], 'people' );
foreach ( $person_files as $file ) {
if ( $target == 'html' ) {
@@ -4800,7 +4802,7 @@ function eme_replace_member_placeholders( $format, $membership, $member, $target
$sep = '||';
}
$formfield = eme_get_formfield( $field_key );
- if ( ! empty( $formfield ) && in_array( $formfield['field_purpose'], array( 'generic', 'members' ) ) ) {
+ if ( ! empty( $formfield ) && in_array( $formfield['field_purpose'], [ 'generic', 'members' ] ) ) {
$field_id = $formfield['field_id'];
$field_replace = '';
foreach ( $answers as $answer ) {
@@ -4867,7 +4869,7 @@ function eme_replace_membership_placeholders( $format, $membership, $target = 'h
if ( ! empty( $membership ) && isset( $membership['membership_id'] ) ) {
$answers = eme_get_membership_answers( $membership['membership_id'] );
} else {
- $answers = array();
+ $answers = [];
}
// replace what we can inside curly brackets
@@ -5103,7 +5105,7 @@ function eme_import_csv_members() {
return __( 'Access denied', 'events-made-easy' );
}
//validate whether uploaded file is a csv file
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
if ( empty( $_FILES['eme_csv']['name'] ) || ! in_array( $_FILES['eme_csv']['type'], $csvMimes ) ) {
return sprintf( __( 'No CSV file detected: %s', 'events-made-easy' ), $_FILES['eme_csv']['type'] );
}
@@ -5274,7 +5276,7 @@ function eme_import_csv_member_dynamic_answers() {
}
//validate whether uploaded file is a csv file
- $csvMimes = array( 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' );
+ $csvMimes = [ 'text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain' ];
if ( empty( $_FILES['eme_csv']['name'] ) || ! in_array( $_FILES['eme_csv']['type'], $csvMimes ) ) {
return sprintf( __( 'No CSV file detected: %s', 'events-made-easy' ), $_FILES['eme_csv']['type'] );
}
@@ -5316,7 +5318,7 @@ function eme_import_csv_member_dynamic_answers() {
} else {
// now loop over the rest
// a simple array to be able to increase occurence counter based on memberid and grouping
- $occurences = array();
+ $occurences = [];
while ( ( $row = fgetcsv( $handle, 0, $delimiter, $enclosure ) ) !== false ) {
$line = array_combine( $headers, $row );
// remove columns with empty values
@@ -5344,7 +5346,7 @@ function eme_import_csv_member_dynamic_answers() {
$member_id = eme_is_member( $person_id, $membership['membership_id'] );
if ( $member_id ) {
if ( ! isset( $occurences[ $member_id ] ) ) {
- $occurences[ $member_id ] = array();
+ $occurences[ $member_id ] = [];
}
// make sure grouping contains a sensible value (we call it "index now, but keep "grouping" for backwards compat)
if ( isset( $line['index'] ) ) {
@@ -5414,7 +5416,7 @@ function eme_member_person_autocomplete_ajax( $no_wp_die = 0 ) {
if ( ! current_user_can( get_option( 'eme_cap_list_members' ) ) ) {
wp_die();
}
- $return = array();
+ $return = [];
$q = '';
if ( isset( $_REQUEST['lastname'] ) ) {
$q = strtolower( eme_sanitize_request( $_REQUEST['lastname'] ) );
@@ -5466,7 +5468,7 @@ function eme_member_person_autocomplete_ajax( $no_wp_die = 0 ) {
$persons = $wpdb->get_results( $sql, ARRAY_A );
foreach ( $persons as $item ) {
- $record = array();
+ $record = [];
$record['lastname'] = eme_esc_html( $item['lastname'] );
$record['firstname'] = eme_esc_html( $item['firstname'] );
$record['email'] = eme_esc_html( $item['email'] );
@@ -5485,7 +5487,7 @@ function eme_member_main_account_autocomplete_ajax() {
if ( ! current_user_can( get_option( 'eme_cap_list_members' ) ) ) {
wp_die();
}
- $return = array();
+ $return = [];
$q = '';
$membership_id = 0;
$member_id = 0;
@@ -5508,7 +5510,7 @@ function eme_member_main_account_autocomplete_ajax() {
$search = "(lastname LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%' OR firstname LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%') AND members.member_id <> $member_id AND members.related_member_id=0 AND members.membership_id=$membership_id";
$persons = eme_get_members( '', $search );
foreach ( $persons as $item ) {
- $record = array();
+ $record = [];
$record['lastname'] = eme_esc_html( $item['lastname'] );
$record['firstname'] = eme_esc_html( $item['firstname'] );
$record['email'] = eme_esc_html( $item['email'] );
@@ -5542,7 +5544,7 @@ function eme_ajax_memberships_list() {
$status_grace = EME_MEMBER_STATUS_GRACE;
$table = $eme_db_prefix . MEMBERSHIPS_TBNAME;
$members_table = $eme_db_prefix . MEMBERS_TBNAME;
- $ajaxResult = array();
+ $ajaxResult = [];
$formfields = eme_get_formfields( '', 'memberships' );
@@ -5552,22 +5554,22 @@ function eme_ajax_memberships_list() {
$pagesize = ( isset( $_REQUEST['jtPageSize'] ) ) ? intval( $_REQUEST['jtPageSize'] ) : 10;
$sorting = ( ! empty( $_REQUEST['jtSorting'] ) && ! empty( eme_sanitize_sql_orderby( $_REQUEST['jtSorting'] ) ) ) ? 'ORDER BY ' . esc_sql( eme_sanitize_sql_orderby($_REQUEST['jtSorting']) ) : '';
- $sql = $wpdb->prepare("SELECT membership_id,COUNT(*) AS familymembercount FROM $members_table WHERE status IN (%d,%d) AND related_member_id>0 GROUP BY membership_id",$status_active,$status_grace);
+ $sql = $wpdb->prepare("SELECT membership_id,COUNT(*) AS familymembercount FROM $members_table WHERE status IN (%d,%d) AND related_member_id>0 GROUP BY membership_id", $status_active, $status_grace);
$res = $wpdb->get_results( $sql, ARRAY_A );
- $familymembercount = array();
+ $familymembercount = [];
foreach ( $res as $val ) {
$familymembercount[ $val['membership_id'] ] = $val['familymembercount'];
}
- $sql = $wpdb->prepare("SELECT membership_id,COUNT(*) AS mainmembercount FROM $members_table WHERE status IN (%d,%d) AND related_member_id=0 GROUP BY membership_id",$status_active,$status_grace);
+ $sql = $wpdb->prepare("SELECT membership_id,COUNT(*) AS mainmembercount FROM $members_table WHERE status IN (%d,%d) AND related_member_id=0 GROUP BY membership_id", $status_active, $status_grace);
$res = $wpdb->get_results( $sql, ARRAY_A );
- $mainmembercount = array();
+ $mainmembercount = [];
foreach ( $res as $val ) {
$mainmembercount[ $val['membership_id'] ] = $val['mainmembercount'];
}
$sql = "SELECT * FROM $table $sorting LIMIT $start,$pagesize";
$rows = $wpdb->get_results( $sql, ARRAY_A );
- $records = array();
+ $records = [];
foreach ( $rows as $item ) {
if ( empty( $item['name'] ) ) {
$item['name'] = __( 'No name', 'events-made-easy' );
@@ -5577,7 +5579,7 @@ function eme_ajax_memberships_list() {
$contact_email = $contact->user_email;
$contact_name = $contact->display_name;
- $record = array();
+ $record = [];
$record['membership_id'] = $item['membership_id'];
if ( current_user_can( get_option( 'eme_cap_edit_members' ) ) ) {
$record['name'] = "
" . eme_esc_html( $item['name'] ) . ' ';
@@ -5627,7 +5629,7 @@ function eme_ajax_members_list( $dynamic_groupname = '' ) {
global $wpdb,$eme_db_prefix,$eme_timezone;
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
$eme_member_status_array = eme_member_status_array();
- $ajaxResult = array();
+ $ajaxResult = [];
if ( ! current_user_can( get_option( 'eme_cap_list_members' ) ) ) {
$ajaxResult['Result'] = 'Error';
@@ -5640,9 +5642,9 @@ function eme_ajax_members_list( $dynamic_groupname = '' ) {
$table = $eme_db_prefix . GROUPS_TBNAME;
$group['type'] = 'dynamic_members';
$group['name'] = $dynamic_groupname . ' ' . __( '(Dynamic)', 'events-made-easy' );
- $search_terms = array();
+ $search_terms = [];
// the same as in add_update_group
- $search_fields = array( 'search_membershipids', 'search_memberstatus', 'search_person', 'search_groups', 'search_memberid', 'search_customfields', 'search_customfieldids' );
+ $search_fields = [ 'search_membershipids', 'search_memberstatus', 'search_person', 'search_groups', 'search_memberid', 'search_customfields', 'search_customfieldids' ];
foreach ( $search_fields as $search_field ) {
if ( isset( $_POST[ $search_field ] ) ) {
$search_terms[ $search_field ] = esc_sql( eme_sanitize_request( $_POST[ $search_field ] ) );
@@ -5666,9 +5668,9 @@ function eme_ajax_members_list( $dynamic_groupname = '' ) {
} else {
$formfields = eme_get_formfields( '', 'members,generic' );
}
- $records = array();
+ $records = [];
foreach ( $rows as $item ) {
- $record = array();
+ $record = [];
$membership = eme_get_membership( $item['membership_id'] );
// we can sort on member_id, but in our constructed sql , we have members.member_id and ans.member_id
// some mysql databases don't like it if you then just sort on member_id, so we'll change it to members.member_id
@@ -5781,7 +5783,7 @@ function eme_ajax_members_select2() {
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
if ( ! current_user_can( get_option( 'eme_cap_list_members' ) ) ) {
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['Result'] = 'Error';
$ajaxResult['htmlmessage'] = __( 'Access denied!', 'events-made-easy' );
print wp_json_encode( $ajaxResult );
@@ -5792,7 +5794,7 @@ function eme_ajax_members_select2() {
$people_table = $eme_db_prefix . PEOPLE_TBNAME;
$members_table = $eme_db_prefix . MEMBERS_TBNAME;
$memberships_table = $eme_db_prefix . MEMBERSHIPS_TBNAME;
- $jTableResult = array();
+ $jTableResult = [];
$q = isset( $_REQUEST['q'] ) ? strtolower( eme_sanitize_request( $_REQUEST['q'] ) ) : '';
if ( ! empty( $q ) ) {
$where = "(people.lastname LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%' OR people.firstname LIKE '%" . esc_sql( $wpdb->esc_like( $q ) ) . "%')";
@@ -5813,11 +5815,11 @@ function eme_ajax_members_select2() {
LEFT JOIN $people_table as people ON members.person_id=people.person_id
WHERE $where";
- $records = array();
+ $records = [];
$recordCount = $wpdb->get_var( $count_sql );
$members = $wpdb->get_results( $sql, ARRAY_A );
foreach ( $members as $member ) {
- $record = array();
+ $record = [];
$record['id'] = $member['member_id'];
// no eme_esc_html here, select2 does it own escaping upon arrival
$record['text'] = eme_format_full_name( $member['firstname'], $member['lastname'] ) . ' (' . $member['membership_name'] . ')';
@@ -5888,7 +5890,7 @@ function eme_ajax_manage_members() {
if ( $template_id_subject && $template_id ) {
eme_ajax_action_send_member_mails( $ids_arr, $template_id_subject, $template_id );
} else {
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'Content of subject or body was empty, no mail has been sent.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'ERROR';
print wp_json_encode( $ajaxResult );
@@ -5917,7 +5919,7 @@ function eme_ajax_manage_members() {
}
function eme_ajax_manage_memberships() {
- $ajaxResult = array();
+ $ajaxResult = [];
check_ajax_referer( 'eme_admin', 'eme_admin_nonce' );
if ( isset( $_REQUEST['do_action'] ) ) {
$do_action = eme_sanitize_request( $_REQUEST['do_action'] );
@@ -5949,7 +5951,7 @@ function eme_ajax_action_send_member_mails( $ids_arr, $subject_template_id, $bod
$mail_text_html = get_option( 'eme_rsvp_send_html' ) ? 'html' : 'text';
$subject = eme_get_template_format_plain( $subject_template_id );
$body = eme_get_template_format_plain( $body_template_id );
- $ajaxResult = array();
+ $ajaxResult = [];
if ( eme_is_empty_string( $subject ) || eme_is_empty_string( $body ) ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'Content of subject or body was empty, no mail has been sent.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'ERROR';
@@ -5973,7 +5975,7 @@ function eme_ajax_action_send_member_mails( $ids_arr, $subject_template_id, $bod
}
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( $mail_ok ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The mail has been sent.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
@@ -5997,7 +5999,7 @@ function eme_ajax_action_delete_members( $ids_arr, $trash_person = 0 ) {
print wp_json_encode( $ajaxResult );
}
} else {
- $ajaxResult = array();
+ $ajaxResult = [];
foreach ( $ids_arr as $member_id ) {
eme_delete_member( $member_id );
}
@@ -6026,7 +6028,7 @@ function eme_ajax_action_set_member_unpaid( $ids_arr, $action, $send_mail ) {
$action_ok = 0;
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( $mails_ok && $action_ok ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
@@ -6052,7 +6054,7 @@ function eme_ajax_action_resend_paid_member( $ids_arr, $action ) {
}
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( $mails_ok ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
@@ -6117,7 +6119,7 @@ function eme_ajax_action_payment_membership( $ids_arr, $send_mail ) {
eme_mark_payment_paid( $member['payment_id'], 0 );
}
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
print wp_json_encode( $ajaxResult );
@@ -6147,7 +6149,7 @@ function eme_ajax_action_stop_membership( $ids_arr, $action, $send_mail ) {
$action_ok = 0;
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( $mails_ok && $action_ok ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
@@ -6172,7 +6174,7 @@ function eme_ajax_action_resend_pending_member( $ids_arr, $action ) {
}
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
if ( $mails_ok ) {
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
@@ -6191,7 +6193,7 @@ function eme_ajax_action_resend_member_reminders( $ids_arr ) {
eme_member_send_expiration_reminder( $member_id );
}
}
- $ajaxResult = array();
+ $ajaxResult = [];
$ajaxResult['htmlmessage'] = "
" . esc_html__( 'The action has been executed successfully.', 'events-made-easy' ) . '
';
$ajaxResult['Result'] = 'OK';
print wp_json_encode( $ajaxResult );
@@ -6214,7 +6216,7 @@ function eme_generate_member_pdf( $member, $membership, $template_id ) {
$orientation = $template['properties']['pdf_orientation'];
$pagesize = $template['properties']['pdf_size'];
if ( $pagesize == 'custom' ) {
- $pagesize = array( 0, 0, $template['properties']['pdf_width'], $template['properties']['pdf_height'] );
+ $pagesize = [ 0, 0, $template['properties']['pdf_width'], $template['properties']['pdf_height'] ];
}
$dompdf->setPaper( $pagesize, $orientation );
@@ -6279,7 +6281,7 @@ function eme_ajax_generate_member_pdf( $ids_arr, $template_id, $template_id_head
$orientation = $template['properties']['pdf_orientation'];
$pagesize = $template['properties']['pdf_size'];
if ( $pagesize == 'custom' ) {
- $pagesize = array( 0, 0, $template['properties']['pdf_width'], $template['properties']['pdf_height'] );
+ $pagesize = [ 0, 0, $template['properties']['pdf_width'], $template['properties']['pdf_height'] ];
}
$dompdf->setPaper( $pagesize, $orientation );
@@ -6341,7 +6343,7 @@ function eme_ajax_generate_member_html( $ids_arr, $template_id, $template_id_hea
}
function eme_get_membership_post_answers() {
- $answers = array();
+ $answers = [];
foreach ( $_POST as $key => $value ) {
if ( preg_match( '/^FIELD(\d+)$/', $key, $matches ) ) {
$field_id = intval( $matches[1] );
@@ -6354,12 +6356,12 @@ function eme_get_membership_post_answers() {
if ( is_array( $value ) ) {
$value = eme_convert_array2multi( $value );
}
- $answer = array(
+ $answer = [
'field_name' => $formfield['field_name'],
'field_id' => $field_id,
'extra_charge' => $formfield['extra_charge'],
'answer' => $value,
- );
+ ];
$answers[] = $answer;
}
}
@@ -6380,7 +6382,7 @@ function eme_get_membership_answers( $membership_id ) {
}
function eme_membership_store_answers( $membership_id ) {
- $answer_ids_seen = array();
+ $answer_ids_seen = [];
$all_answers = eme_get_membership_answers( $membership_id );
$found_answers = eme_get_membership_post_answers();
@@ -6409,7 +6411,7 @@ function eme_membership_store_answers( $membership_id ) {
function eme_get_cf_membership_ids( $val, $field_id, $is_multi = 0 ) {
global $wpdb,$eme_db_prefix;
$table = $eme_db_prefix . ANSWERS_TBNAME;
- $conditions = array();
+ $conditions = [];
$val = eme_kses( $val );
if ( is_array( $val ) ) {
diff --git a/eme-options.php b/eme-options.php
index 3a616a50..2da8af78 100644
--- a/eme-options.php
+++ b/eme-options.php
@@ -108,7 +108,7 @@ function eme_add_options( $reset = 0 ) {
$eme_bd_email_subject_localizable = __( 'Happy birthday #_PERSONFIRSTNAME', 'events-made-easy' );
$eme_bd_email_body_localizable = __( 'Hi #_PERSONFIRSTNAME,
Congratulations on your birthday!!!
From EME', 'events-made-easy' );
- $eme_options = array(
+ $eme_options = [
'eme_event_list_item_format' => '
#_STARTDATE - #_STARTTIME #_LINKEDNAME #_TOWN ',
'eme_event_list_item_format_header' => DEFAULT_EVENT_LIST_HEADER_FORMAT,
'eme_cat_event_list_item_format_header' => DEFAULT_CAT_EVENT_LIST_HEADER_FORMAT,
@@ -552,7 +552,7 @@ function eme_add_options( $reset = 0 ) {
'eme_check_free_waiting' => 0,
'eme_unique_email_per_person' => 0,
'eme_multisite_active' => 0,
- );
+ ];
foreach ( $eme_options as $key => $value ) {
eme_add_option( $key, $value, $reset );
@@ -581,17 +581,17 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 119 ) {
// remove some deprecated options
- $options = array( 'eme_image_max_width', 'eme_image_max_height', 'eme_image_max_size', 'eme_legacy', 'eme_deprecated', 'eme_legacy_warning', 'eme_list_events_page', 'eme_deny_mail_event_edit', 'eme_fb_app_id' );
+ $options = [ 'eme_image_max_width', 'eme_image_max_height', 'eme_image_max_size', 'eme_legacy', 'eme_deprecated', 'eme_legacy_warning', 'eme_list_events_page', 'eme_deny_mail_event_edit', 'eme_fb_app_id' ];
foreach ( $options as $opt ) {
delete_option( $opt );
}
// rename some options
- $options2 = array(
+ $options2 = [
'eme_cron_reminder_unpayed_minutes' => 'eme_cron_reminder_unpaid_minutes',
'eme_cron_cleanup_unpayed_minutes' => 'eme_cron_cleanup_unpaid_minutes',
'eme_cron_reminder_unpayed_subject' => 'eme_cron_reminder_unpaid_subject',
'eme_cron_reminder_unpayed_body' => 'eme_cron_reminder_unpaid_body',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -617,9 +617,9 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 197 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_rsvp_required_field_string' => 'eme_form_required_field_string',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -629,10 +629,10 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 206 ) {
delete_option( 'eme_gmap_api_key' );
- $options2 = array(
+ $options2 = [
'eme_gmap_active' => 'eme_map_active',
'eme_gmap_zooming' => 'eme_map_zooming',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -675,10 +675,10 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 247 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_registration_denied_email_subject' => 'eme_registration_trashed_email_subject',
'eme_registration_denied_email_body' => 'eme_registration_trashed_email_body',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -688,10 +688,10 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 250 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_cap_people' => 'eme_cap_edit_people',
'eme_cap_members' => 'eme_cap_edit_members',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -707,9 +707,9 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 298 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_captcha_for_booking' => 'eme_captcha_for_forms',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -732,9 +732,9 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 306 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_mail_recipient_format' => 'eme_full_name_format',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -749,9 +749,9 @@ function eme_update_options( $db_version ) {
}
if ( $db_version < 315 ) {
// rename some options
- $options2 = array(
+ $options2 = [
'eme_gdpr_remove_old_bookings_days' => 'eme_gdpr_anonymize_old_bookings_days',
- );
+ ];
foreach ( $options2 as $old_option => $new_option ) {
if ( get_option( $old_option ) ) {
update_option( $new_option, get_option( $old_option ) );
@@ -838,9 +838,9 @@ function eme_options_delete() {
function eme_metabox_options_delete() {
global $wpdb,$eme_db_prefix;
- $screens = array( 'events_page_eme-new_event', 'toplevel_page_eme-manager' );
+ $screens = [ 'events_page_eme-new_event', 'toplevel_page_eme-manager' ];
foreach ( $screens as $screen ) {
- foreach ( array( 'metaboxhidden', 'closedpostboxes', 'wp_metaboxorder', 'meta-box-order', 'screen_layout' ) as $option ) {
+ foreach ( [ 'metaboxhidden', 'closedpostboxes', 'wp_metaboxorder', 'meta-box-order', 'screen_layout' ] as $option ) {
$keys[] = "'{$option}_{$screen}'";
}
}
@@ -984,56 +984,56 @@ function eme_options_register() {
if ( ! isset( $_POST['option_page'] ) || ( $_POST['option_page'] != 'eme-options' ) ) {
return;
}
- $options = array();
+ $options = [];
$tab = isset( $_POST['tab'] ) ? eme_sanitize_request( $_POST['tab'] ) : 'general';
switch ( $tab ) {
case 'general':
- $options = array( 'eme_use_select_for_locations', 'eme_add_events_locs_link_search', 'eme_rsvp_enabled', 'eme_tasks_enabled', 'eme_categories_enabled', 'eme_attributes_enabled', 'eme_map_is_active', 'eme_load_js_in_header', 'eme_use_client_clock', 'eme_uninstall_drop_data', 'eme_uninstall_drop_settings', 'eme_shortcodes_in_widgets', 'eme_enable_notes_placeholders', 'eme_autocomplete_sources', 'eme_captcha_for_forms', 'eme_recaptcha_for_forms', 'eme_recaptcha_site_key', 'eme_recaptcha_secret_key', 'eme_hcaptcha_for_forms', 'eme_hcaptcha_site_key', 'eme_hcaptcha_secret_key', 'eme_honeypot_for_forms', 'eme_frontend_nocache', 'eme_use_is_page_for_title' );
+ $options = [ 'eme_use_select_for_locations', 'eme_add_events_locs_link_search', 'eme_rsvp_enabled', 'eme_tasks_enabled', 'eme_categories_enabled', 'eme_attributes_enabled', 'eme_map_is_active', 'eme_load_js_in_header', 'eme_use_client_clock', 'eme_uninstall_drop_data', 'eme_uninstall_drop_settings', 'eme_shortcodes_in_widgets', 'eme_enable_notes_placeholders', 'eme_autocomplete_sources', 'eme_captcha_for_forms', 'eme_recaptcha_for_forms', 'eme_recaptcha_site_key', 'eme_recaptcha_secret_key', 'eme_hcaptcha_for_forms', 'eme_hcaptcha_site_key', 'eme_hcaptcha_secret_key', 'eme_honeypot_for_forms', 'eme_frontend_nocache', 'eme_use_is_page_for_title' ];
break;
case 'seo':
- $options = array( 'eme_seo_permalink', 'eme_permalink_events_prefix', 'eme_permalink_locations_prefix', 'eme_permalink_categories_prefix', 'eme_permalink_calendar_prefix', 'eme_permalink_payments_prefix' );
+ $options = [ 'eme_seo_permalink', 'eme_permalink_events_prefix', 'eme_permalink_locations_prefix', 'eme_permalink_categories_prefix', 'eme_permalink_calendar_prefix', 'eme_permalink_payments_prefix' ];
break;
case 'access':
- $options = array( 'eme_cap_add_event', 'eme_cap_author_event', 'eme_cap_publish_event', 'eme_cap_list_events', 'eme_cap_edit_events', 'eme_cap_manage_task_signups', 'eme_cap_list_locations', 'eme_cap_add_locations', 'eme_cap_author_locations', 'eme_cap_edit_locations', 'eme_cap_categories', 'eme_cap_holidays', 'eme_cap_templates', 'eme_cap_access_people', 'eme_cap_list_people', 'eme_cap_edit_people', 'eme_cap_author_person', 'eme_cap_access_members', 'eme_cap_list_members', 'eme_cap_edit_members', 'eme_cap_author_member', 'eme_cap_discounts', 'eme_cap_list_approve', 'eme_cap_author_approve', 'eme_cap_approve', 'eme_cap_list_registrations', 'eme_cap_author_registrations', 'eme_cap_registrations', 'eme_cap_attendancecheck', 'eme_cap_membercheck', 'eme_cap_forms', 'eme_cap_cleanup', 'eme_cap_settings', 'eme_cap_send_mails', 'eme_cap_send_other_mails', 'eme_cap_list_attendances', 'eme_cap_manage_attendances' );
+ $options = [ 'eme_cap_add_event', 'eme_cap_author_event', 'eme_cap_publish_event', 'eme_cap_list_events', 'eme_cap_edit_events', 'eme_cap_manage_task_signups', 'eme_cap_list_locations', 'eme_cap_add_locations', 'eme_cap_author_locations', 'eme_cap_edit_locations', 'eme_cap_categories', 'eme_cap_holidays', 'eme_cap_templates', 'eme_cap_access_people', 'eme_cap_list_people', 'eme_cap_edit_people', 'eme_cap_author_person', 'eme_cap_access_members', 'eme_cap_list_members', 'eme_cap_edit_members', 'eme_cap_author_member', 'eme_cap_discounts', 'eme_cap_list_approve', 'eme_cap_author_approve', 'eme_cap_approve', 'eme_cap_list_registrations', 'eme_cap_author_registrations', 'eme_cap_registrations', 'eme_cap_attendancecheck', 'eme_cap_membercheck', 'eme_cap_forms', 'eme_cap_cleanup', 'eme_cap_settings', 'eme_cap_send_mails', 'eme_cap_send_other_mails', 'eme_cap_list_attendances', 'eme_cap_manage_attendances' ];
break;
case 'events':
- $options = array( 'eme_events_page', 'eme_display_events_in_events_page', 'eme_display_calendar_in_events_page', 'eme_event_list_number_items', 'eme_event_initial_state', 'eme_event_list_item_format_header', 'eme_cat_event_list_item_format_header', 'eme_event_list_item_format', 'eme_event_list_item_format_footer', 'eme_cat_event_list_item_format_footer', 'eme_event_page_title_format', 'eme_event_html_title_format', 'eme_single_event_format', 'eme_show_period_monthly_dateformat', 'eme_show_period_yearly_dateformat', 'eme_events_page_title', 'eme_no_events_message', 'eme_filter_form_format', 'eme_redir_priv_event_url' );
+ $options = [ 'eme_events_page', 'eme_display_events_in_events_page', 'eme_display_calendar_in_events_page', 'eme_event_list_number_items', 'eme_event_initial_state', 'eme_event_list_item_format_header', 'eme_cat_event_list_item_format_header', 'eme_event_list_item_format', 'eme_event_list_item_format_footer', 'eme_cat_event_list_item_format_footer', 'eme_event_page_title_format', 'eme_event_html_title_format', 'eme_single_event_format', 'eme_show_period_monthly_dateformat', 'eme_show_period_yearly_dateformat', 'eme_events_page_title', 'eme_no_events_message', 'eme_filter_form_format', 'eme_redir_priv_event_url' ];
break;
case 'calendar':
- $options = array( 'eme_small_calendar_event_title_format', 'eme_small_calendar_event_title_separator', 'eme_full_calendar_event_format', 'eme_cal_hide_past_events', 'eme_cal_show_single' );
+ $options = [ 'eme_small_calendar_event_title_format', 'eme_small_calendar_event_title_separator', 'eme_full_calendar_event_format', 'eme_cal_hide_past_events', 'eme_cal_show_single' ];
break;
case 'locations':
- $options = array( 'eme_location_list_format_header', 'eme_location_list_format_item', 'eme_location_list_format_footer', 'eme_location_page_title_format', 'eme_location_html_title_format', 'eme_single_location_format', 'eme_location_event_list_item_format', 'eme_location_no_events_message' );
+ $options = [ 'eme_location_list_format_header', 'eme_location_list_format_item', 'eme_location_list_format_footer', 'eme_location_page_title_format', 'eme_location_html_title_format', 'eme_single_location_format', 'eme_location_event_list_item_format', 'eme_location_no_events_message' ];
break;
case 'members':
- $options = array( 'eme_page_access_denied', 'eme_membership_login_required_string', 'eme_redir_protected_pages_url', 'eme_membership_attendance_msg', 'eme_membership_unauth_attendance_msg', 'eme_members_show_people_info' );
+ $options = [ 'eme_page_access_denied', 'eme_membership_login_required_string', 'eme_redir_protected_pages_url', 'eme_membership_attendance_msg', 'eme_membership_unauth_attendance_msg', 'eme_members_show_people_info' ];
break;
case 'rss':
- $options = array( 'eme_rss_main_title', 'eme_rss_main_description', 'eme_rss_title_format', 'eme_rss_description_format', 'eme_rss_show_pubdate', 'eme_rss_pubdate_startdate', 'eme_ical_description_format', 'eme_ical_location_format', 'eme_ical_title_format', 'eme_ical_quote_tzid' );
+ $options = [ 'eme_rss_main_title', 'eme_rss_main_description', 'eme_rss_title_format', 'eme_rss_description_format', 'eme_rss_show_pubdate', 'eme_rss_pubdate_startdate', 'eme_ical_description_format', 'eme_ical_location_format', 'eme_ical_title_format', 'eme_ical_quote_tzid' ];
break;
case 'rsvp':
- $options = array( 'eme_default_contact_person', 'eme_rsvp_registered_users_only', 'eme_rsvp_reg_for_new_events', 'eme_rsvp_require_approval', 'eme_rsvp_require_user_confirmation', 'eme_rsvp_default_number_spaces', 'eme_rsvp_addbooking_min_spaces', 'eme_rsvp_addbooking_max_spaces', 'eme_rsvp_hide_full_events', 'eme_rsvp_hide_rsvp_ended_events', 'eme_rsvp_show_form_after_booking', 'eme_rsvp_addbooking_submit_string', 'eme_rsvp_delbooking_submit_string', 'eme_rsvp_not_yet_allowed_string', 'eme_rsvp_no_longer_allowed_string', 'eme_rsvp_full_string', 'eme_rsvp_on_waiting_list_string', 'eme_rsvp_cancel_no_longer_allowed_string', 'eme_attendees_list_format', 'eme_attendees_list_ignore_pending', 'eme_bookings_list_ignore_pending', 'eme_bookings_list_header_format', 'eme_bookings_list_format', 'eme_bookings_list_footer_format', 'eme_registration_recorded_ok_html', 'eme_registration_form_format', 'eme_cancel_form_format', 'eme_cancel_payment_form_format', 'eme_cancel_payment_line_format', 'eme_cancelled_payment_format', 'eme_rsvp_number_days', 'eme_rsvp_number_hours', 'eme_rsvp_end_target', 'eme_rsvp_check_required_fields', 'eme_cancel_rsvp_days', 'eme_cancel_rsvp_age', 'eme_rsvp_check_without_accents', 'eme_rsvp_admin_allow_overbooking', 'eme_rsvp_login_required_string', 'eme_rsvp_invitation_required_string', 'eme_rsvp_email_already_registered_string', 'eme_rsvp_person_already_registered_string', 'eme_check_free_waiting', 'eme_rsvp_pending_reminder_days', 'eme_rsvp_approved_reminder_days' );
+ $options = [ 'eme_default_contact_person', 'eme_rsvp_registered_users_only', 'eme_rsvp_reg_for_new_events', 'eme_rsvp_require_approval', 'eme_rsvp_require_user_confirmation', 'eme_rsvp_default_number_spaces', 'eme_rsvp_addbooking_min_spaces', 'eme_rsvp_addbooking_max_spaces', 'eme_rsvp_hide_full_events', 'eme_rsvp_hide_rsvp_ended_events', 'eme_rsvp_show_form_after_booking', 'eme_rsvp_addbooking_submit_string', 'eme_rsvp_delbooking_submit_string', 'eme_rsvp_not_yet_allowed_string', 'eme_rsvp_no_longer_allowed_string', 'eme_rsvp_full_string', 'eme_rsvp_on_waiting_list_string', 'eme_rsvp_cancel_no_longer_allowed_string', 'eme_attendees_list_format', 'eme_attendees_list_ignore_pending', 'eme_bookings_list_ignore_pending', 'eme_bookings_list_header_format', 'eme_bookings_list_format', 'eme_bookings_list_footer_format', 'eme_registration_recorded_ok_html', 'eme_registration_form_format', 'eme_cancel_form_format', 'eme_cancel_payment_form_format', 'eme_cancel_payment_line_format', 'eme_cancelled_payment_format', 'eme_rsvp_number_days', 'eme_rsvp_number_hours', 'eme_rsvp_end_target', 'eme_rsvp_check_required_fields', 'eme_cancel_rsvp_days', 'eme_cancel_rsvp_age', 'eme_rsvp_check_without_accents', 'eme_rsvp_admin_allow_overbooking', 'eme_rsvp_login_required_string', 'eme_rsvp_invitation_required_string', 'eme_rsvp_email_already_registered_string', 'eme_rsvp_person_already_registered_string', 'eme_check_free_waiting', 'eme_rsvp_pending_reminder_days', 'eme_rsvp_approved_reminder_days' ];
break;
case 'tasks':
- $options = array( 'eme_task_registered_users_only', 'eme_task_allow_overlap', 'eme_task_form_taskentry_format', 'eme_task_form_format', 'eme_task_signup_format', 'eme_task_signup_recorded_ok_html', 'eme_task_signup_cancelled_ok_html', 'eme_task_reminder_days' );
+ $options = [ 'eme_task_registered_users_only', 'eme_task_allow_overlap', 'eme_task_form_taskentry_format', 'eme_task_form_format', 'eme_task_signup_format', 'eme_task_signup_recorded_ok_html', 'eme_task_signup_cancelled_ok_html', 'eme_task_reminder_days' ];
break;
case 'mail':
- $options = array( 'eme_rsvp_mail_notify_is_active', 'eme_rsvp_mail_notify_pending', 'eme_rsvp_mail_notify_paid', 'eme_rsvp_mail_notify_approved', 'eme_mail_sender_name', 'eme_mail_sender_address', 'eme_mail_force_from', 'eme_rsvp_mail_send_method', 'eme_smtp_host', 'eme_smtp_port', 'eme_smtp_encryption', 'eme_rsvp_mail_SMTPAuth', 'eme_smtp_username', 'eme_smtp_password', 'eme_smtp_debug', 'eme_rsvp_send_html', 'eme_mail_bcc_address', 'eme_smtp_verify_cert', 'eme_queue_mails', 'eme_cron_send_queued', 'eme_cron_queue_count', 'eme_people_newsletter', 'eme_people_massmail', 'eme_massmail_popup_text', 'eme_massmail_popup', 'eme_mail_tracking', 'eme_mail_sleep', 'eme_mail_blacklist' );
+ $options = [ 'eme_rsvp_mail_notify_is_active', 'eme_rsvp_mail_notify_pending', 'eme_rsvp_mail_notify_paid', 'eme_rsvp_mail_notify_approved', 'eme_mail_sender_name', 'eme_mail_sender_address', 'eme_mail_force_from', 'eme_rsvp_mail_send_method', 'eme_smtp_host', 'eme_smtp_port', 'eme_smtp_encryption', 'eme_rsvp_mail_SMTPAuth', 'eme_smtp_username', 'eme_smtp_password', 'eme_smtp_debug', 'eme_rsvp_send_html', 'eme_mail_bcc_address', 'eme_smtp_verify_cert', 'eme_queue_mails', 'eme_cron_send_queued', 'eme_cron_queue_count', 'eme_people_newsletter', 'eme_people_massmail', 'eme_massmail_popup_text', 'eme_massmail_popup', 'eme_mail_tracking', 'eme_mail_sleep', 'eme_mail_blacklist' ];
break;
case 'mailtemplates':
- $options = array( 'eme_contactperson_email_subject', 'eme_contactperson_cancelled_email_subject', 'eme_contactperson_pending_email_subject', 'eme_contactperson_email_body', 'eme_contactperson_cancelled_email_body', 'eme_contactperson_pending_email_body', 'eme_contactperson_ipn_email_subject', 'eme_contactperson_ipn_email_body', 'eme_contactperson_paid_email_subject', 'eme_contactperson_paid_email_body', 'eme_respondent_email_subject', 'eme_respondent_email_body', 'eme_registration_pending_email_subject', 'eme_registration_pending_email_body', 'eme_registration_userpending_email_subject', 'eme_registration_userpending_email_body', 'eme_registration_cancelled_email_subject', 'eme_registration_cancelled_email_body', 'eme_registration_trashed_email_subject', 'eme_registration_trashed_email_body', 'eme_registration_updated_email_subject', 'eme_registration_updated_email_body', 'eme_registration_paid_email_subject', 'eme_registration_paid_email_body', 'eme_registration_pending_reminder_email_subject', 'eme_registration_pending_reminder_email_body', 'eme_registration_reminder_email_subject', 'eme_registration_reminder_email_body', 'eme_sub_subject', 'eme_sub_body', 'eme_unsub_subject', 'eme_unsub_body', 'eme_booking_attach_ids', 'eme_pending_attach_ids', 'eme_paid_attach_ids', 'eme_subscribe_attach_ids', 'eme_full_name_format', 'eme_cp_task_signup_email_subject', 'eme_cp_task_signup_email_body', 'eme_cp_task_signup_cancelled_email_subject', 'eme_cp_task_signup_cancelled_email_body', 'eme_task_signup_email_subject', 'eme_task_signup_email_body', 'eme_task_signup_cancelled_email_subject', 'eme_task_signup_cancelled_email_body', 'eme_task_signup_trashed_email_subject', 'eme_task_signup_trashed_email_body', 'eme_task_signup_reminder_email_subject', 'eme_task_signup_reminder_email_body', 'eme_bd_email_subject', 'eme_bd_email_body' );
+ $options = [ 'eme_contactperson_email_subject', 'eme_contactperson_cancelled_email_subject', 'eme_contactperson_pending_email_subject', 'eme_contactperson_email_body', 'eme_contactperson_cancelled_email_body', 'eme_contactperson_pending_email_body', 'eme_contactperson_ipn_email_subject', 'eme_contactperson_ipn_email_body', 'eme_contactperson_paid_email_subject', 'eme_contactperson_paid_email_body', 'eme_respondent_email_subject', 'eme_respondent_email_body', 'eme_registration_pending_email_subject', 'eme_registration_pending_email_body', 'eme_registration_userpending_email_subject', 'eme_registration_userpending_email_body', 'eme_registration_cancelled_email_subject', 'eme_registration_cancelled_email_body', 'eme_registration_trashed_email_subject', 'eme_registration_trashed_email_body', 'eme_registration_updated_email_subject', 'eme_registration_updated_email_body', 'eme_registration_paid_email_subject', 'eme_registration_paid_email_body', 'eme_registration_pending_reminder_email_subject', 'eme_registration_pending_reminder_email_body', 'eme_registration_reminder_email_subject', 'eme_registration_reminder_email_body', 'eme_sub_subject', 'eme_sub_body', 'eme_unsub_subject', 'eme_unsub_body', 'eme_booking_attach_ids', 'eme_pending_attach_ids', 'eme_paid_attach_ids', 'eme_subscribe_attach_ids', 'eme_full_name_format', 'eme_cp_task_signup_email_subject', 'eme_cp_task_signup_email_body', 'eme_cp_task_signup_cancelled_email_subject', 'eme_cp_task_signup_cancelled_email_body', 'eme_task_signup_email_subject', 'eme_task_signup_email_body', 'eme_task_signup_cancelled_email_subject', 'eme_task_signup_cancelled_email_body', 'eme_task_signup_trashed_email_subject', 'eme_task_signup_trashed_email_body', 'eme_task_signup_reminder_email_subject', 'eme_task_signup_reminder_email_body', 'eme_bd_email_subject', 'eme_bd_email_body' ];
break;
case 'gdpr':
- $options = array( 'eme_cpi_subject', 'eme_cpi_body', 'eme_cpi_form', 'eme_gdpr_subject', 'eme_gdpr_body', 'eme_gdpr_approve_subject', 'eme_gdpr_approve_body', 'eme_gdpr_page_title', 'eme_gdpr_page_header', 'eme_gdpr_page_footer', 'eme_gdpr_approve_page_title', 'eme_gdpr_approve_page_content', 'eme_gdpr_remove_expired_member_days', 'eme_gdpr_anonymize_old_bookings_days', 'eme_gdpr_remove_old_events_days', 'eme_gdpr_archive_old_mailings_days', 'eme_gdpr_remove_old_attendances_days', 'eme_gdpr_remove_old_signups_days' );
+ $options = [ 'eme_cpi_subject', 'eme_cpi_body', 'eme_cpi_form', 'eme_gdpr_subject', 'eme_gdpr_body', 'eme_gdpr_approve_subject', 'eme_gdpr_approve_body', 'eme_gdpr_page_title', 'eme_gdpr_page_header', 'eme_gdpr_page_footer', 'eme_gdpr_approve_page_title', 'eme_gdpr_approve_page_content', 'eme_gdpr_remove_expired_member_days', 'eme_gdpr_anonymize_old_bookings_days', 'eme_gdpr_remove_old_events_days', 'eme_gdpr_archive_old_mailings_days', 'eme_gdpr_remove_old_attendances_days', 'eme_gdpr_remove_old_signups_days' ];
break;
case 'payments':
- $options = array( 'eme_default_vat', 'eme_payment_form_header_format', 'eme_payment_form_footer_format', 'eme_multipayment_form_header_format', 'eme_multipayment_form_footer_format', 'eme_payment_succes_format', 'eme_payment_fail_format', 'eme_payment_member_succes_format', 'eme_payment_member_fail_format', 'eme_payment_booking_already_paid_format', 'eme_payment_booking_on_waitinglist_format', 'eme_default_currency', 'eme_default_price', 'eme_payment_refund_ok', 'eme_pg_submit_immediately', 'eme_payment_redirect', 'eme_payment_redirect_wait', 'eme_payment_redirect_msg', 'eme_paypal_url', 'eme_paypal_clientid', 'eme_paypal_secret', 'eme_2co_demo', 'eme_2co_business', 'eme_2co_secret', 'eme_webmoney_purse', 'eme_webmoney_secret', 'eme_webmoney_demo', 'eme_fdgg_url', 'eme_fdgg_store_name', 'eme_fdgg_shared_secret', 'eme_2co_cost', 'eme_paypal_cost', 'eme_fdgg_cost', 'eme_webmoney_cost', 'eme_2co_cost2', 'eme_paypal_cost2', 'eme_fdgg_cost2', 'eme_webmoney_cost2', 'eme_mollie_api_key', 'eme_mollie_cost', 'eme_mollie_cost2', 'eme_paypal_button_label', 'eme_paypal_button_above', 'eme_paypal_button_below', 'eme_2co_button_label', 'eme_2co_button_above', 'eme_2co_button_below', 'eme_fdgg_button_label', 'eme_fdgg_button_above', 'eme_fdgg_button_below', 'eme_webmoney_button_label', 'eme_webmoney_button_above', 'eme_webmoney_button_below', 'eme_mollie_button_label', 'eme_mollie_button_above', 'eme_mollie_button_below', 'eme_paypal_button_img_url', 'eme_2co_button_img_url', 'eme_fdgg_button_img_url', 'eme_webmoney_button_img_url', 'eme_mollie_button_img_url', 'eme_worldpay_demo', 'eme_worldpay_instid', 'eme_worldpay_md5_secret', 'eme_worldpay_md5_parameters', 'eme_worldpay_test_pwd', 'eme_worldpay_live_pwd', 'eme_worldpay_cost', 'eme_worldpay_cost2', 'eme_worldpay_button_label', 'eme_worldpay_button_img_url', 'eme_worldpay_button_above', 'eme_worldpay_button_below', 'eme_braintree_private_key', 'eme_braintree_public_key', 'eme_braintree_merchant_id', 'eme_braintree_env', 'eme_braintree_cost', 'eme_braintree_cost2', 'eme_braintree_button_label', 'eme_braintree_button_img_url', 'eme_braintree_button_above', 'eme_braintree_button_below', 'eme_stripe_private_key', 'eme_stripe_public_key', 'eme_stripe_cost', 'eme_stripe_cost2', 'eme_stripe_button_label', 'eme_stripe_button_img_url', 'eme_stripe_button_above', 'eme_stripe_button_below', 'eme_stripe_payment_methods', 'eme_offline_payment', 'eme_legacypaypal_url', 'eme_legacypaypal_business', 'eme_legacypaypal_no_tax', 'eme_legacypaypal_cost', 'eme_legacypaypal_cost2', 'eme_legacypaypal_button_label', 'eme_legacypaypal_button_img_url', 'eme_legacypaypal_button_above', 'eme_legacypaypal_button_below', 'eme_instamojo_env', 'eme_instamojo_key', 'eme_instamojo_auth_token', 'eme_instamojo_salt', 'eme_instamojo_cost', 'eme_instamojo_cost2', 'eme_instamojo_button_label', 'eme_instamojo_button_img_url', 'eme_instamojo_button_above', 'eme_instamojo_button_below', 'eme_mercadopago_demo', 'eme_mercadopago_sandbox_token', 'eme_mercadopago_live_token', 'eme_mercadopago_cost', 'eme_mercadopago_cost2', 'eme_mercadopago_button_label', 'eme_mercadopago_button_img_url', 'eme_mercadopago_button_above', 'eme_mercadopago_button_below', 'eme_fondy_merchant_id', 'eme_fondy_secret_key', 'eme_fondy_cost', 'eme_fondy_cost2', 'eme_fondy_button_label', 'eme_fondy_button_img_url', 'eme_fondy_button_above', 'eme_fondy_button_below', 'eme_payconiq_api_key', 'eme_payconiq_env', 'eme_payconiq_merchant_id', 'eme_payconiq_cost', 'eme_payconiq_cost2', 'eme_payconiq_button_label', 'eme_payconiq_button_img_url', 'eme_payconiq_button_above', 'eme_payconiq_button_below', 'eme_sumup_merchant_code', 'eme_sumup_app_id', 'eme_sumup_app_secret', 'eme_sumup_cost', 'eme_sumup_cost2', 'eme_sumup_button_label', 'eme_sumup_button_img_url', 'eme_sumup_button_above', 'eme_sumup_button_below', 'eme_opayo_demo', 'eme_opayo_vendor_name', 'eme_opayo_test_pwd', 'eme_opayo_live_pwd', 'eme_opayo_cost', 'eme_opayo_cost2', 'eme_opayo_button_label', 'eme_opayo_button_img_url', 'eme_opayo_button_above', 'eme_opayo_button_below' );
+ $options = [ 'eme_default_vat', 'eme_payment_form_header_format', 'eme_payment_form_footer_format', 'eme_multipayment_form_header_format', 'eme_multipayment_form_footer_format', 'eme_payment_succes_format', 'eme_payment_fail_format', 'eme_payment_member_succes_format', 'eme_payment_member_fail_format', 'eme_payment_booking_already_paid_format', 'eme_payment_booking_on_waitinglist_format', 'eme_default_currency', 'eme_default_price', 'eme_payment_refund_ok', 'eme_pg_submit_immediately', 'eme_payment_redirect', 'eme_payment_redirect_wait', 'eme_payment_redirect_msg', 'eme_paypal_url', 'eme_paypal_clientid', 'eme_paypal_secret', 'eme_2co_demo', 'eme_2co_business', 'eme_2co_secret', 'eme_webmoney_purse', 'eme_webmoney_secret', 'eme_webmoney_demo', 'eme_fdgg_url', 'eme_fdgg_store_name', 'eme_fdgg_shared_secret', 'eme_2co_cost', 'eme_paypal_cost', 'eme_fdgg_cost', 'eme_webmoney_cost', 'eme_2co_cost2', 'eme_paypal_cost2', 'eme_fdgg_cost2', 'eme_webmoney_cost2', 'eme_mollie_api_key', 'eme_mollie_cost', 'eme_mollie_cost2', 'eme_paypal_button_label', 'eme_paypal_button_above', 'eme_paypal_button_below', 'eme_2co_button_label', 'eme_2co_button_above', 'eme_2co_button_below', 'eme_fdgg_button_label', 'eme_fdgg_button_above', 'eme_fdgg_button_below', 'eme_webmoney_button_label', 'eme_webmoney_button_above', 'eme_webmoney_button_below', 'eme_mollie_button_label', 'eme_mollie_button_above', 'eme_mollie_button_below', 'eme_paypal_button_img_url', 'eme_2co_button_img_url', 'eme_fdgg_button_img_url', 'eme_webmoney_button_img_url', 'eme_mollie_button_img_url', 'eme_worldpay_demo', 'eme_worldpay_instid', 'eme_worldpay_md5_secret', 'eme_worldpay_md5_parameters', 'eme_worldpay_test_pwd', 'eme_worldpay_live_pwd', 'eme_worldpay_cost', 'eme_worldpay_cost2', 'eme_worldpay_button_label', 'eme_worldpay_button_img_url', 'eme_worldpay_button_above', 'eme_worldpay_button_below', 'eme_braintree_private_key', 'eme_braintree_public_key', 'eme_braintree_merchant_id', 'eme_braintree_env', 'eme_braintree_cost', 'eme_braintree_cost2', 'eme_braintree_button_label', 'eme_braintree_button_img_url', 'eme_braintree_button_above', 'eme_braintree_button_below', 'eme_stripe_private_key', 'eme_stripe_public_key', 'eme_stripe_cost', 'eme_stripe_cost2', 'eme_stripe_button_label', 'eme_stripe_button_img_url', 'eme_stripe_button_above', 'eme_stripe_button_below', 'eme_stripe_payment_methods', 'eme_offline_payment', 'eme_legacypaypal_url', 'eme_legacypaypal_business', 'eme_legacypaypal_no_tax', 'eme_legacypaypal_cost', 'eme_legacypaypal_cost2', 'eme_legacypaypal_button_label', 'eme_legacypaypal_button_img_url', 'eme_legacypaypal_button_above', 'eme_legacypaypal_button_below', 'eme_instamojo_env', 'eme_instamojo_key', 'eme_instamojo_auth_token', 'eme_instamojo_salt', 'eme_instamojo_cost', 'eme_instamojo_cost2', 'eme_instamojo_button_label', 'eme_instamojo_button_img_url', 'eme_instamojo_button_above', 'eme_instamojo_button_below', 'eme_mercadopago_demo', 'eme_mercadopago_sandbox_token', 'eme_mercadopago_live_token', 'eme_mercadopago_cost', 'eme_mercadopago_cost2', 'eme_mercadopago_button_label', 'eme_mercadopago_button_img_url', 'eme_mercadopago_button_above', 'eme_mercadopago_button_below', 'eme_fondy_merchant_id', 'eme_fondy_secret_key', 'eme_fondy_cost', 'eme_fondy_cost2', 'eme_fondy_button_label', 'eme_fondy_button_img_url', 'eme_fondy_button_above', 'eme_fondy_button_below', 'eme_payconiq_api_key', 'eme_payconiq_env', 'eme_payconiq_merchant_id', 'eme_payconiq_cost', 'eme_payconiq_cost2', 'eme_payconiq_button_label', 'eme_payconiq_button_img_url', 'eme_payconiq_button_above', 'eme_payconiq_button_below', 'eme_sumup_merchant_code', 'eme_sumup_app_id', 'eme_sumup_app_secret', 'eme_sumup_cost', 'eme_sumup_cost2', 'eme_sumup_button_label', 'eme_sumup_button_img_url', 'eme_sumup_button_above', 'eme_sumup_button_below', 'eme_opayo_demo', 'eme_opayo_vendor_name', 'eme_opayo_test_pwd', 'eme_opayo_live_pwd', 'eme_opayo_cost', 'eme_opayo_cost2', 'eme_opayo_button_label', 'eme_opayo_button_img_url', 'eme_opayo_button_above', 'eme_opayo_button_below' ];
break;
case 'maps':
- $options = array( 'eme_indiv_zoom_factor', 'eme_map_zooming', 'eme_location_baloon_format', 'eme_location_map_icon', 'eme_map_gesture_handling' );
+ $options = [ 'eme_indiv_zoom_factor', 'eme_map_zooming', 'eme_location_baloon_format', 'eme_location_map_icon', 'eme_map_gesture_handling' ];
break;
case 'other':
- $options = array( 'eme_thumbnail_size', 'eme_image_max_width', 'eme_image_max_height', 'eme_image_max_size', 'eme_html_header', 'eme_html_footer', 'eme_event_html_headers_format', 'eme_location_html_headers_format', 'eme_csv_separator', 'eme_use_external_url', 'eme_bd_email', 'eme_bd_email_members_only', 'eme_time_remove_leading_zeros', 'eme_stay_on_edit_page', 'eme_localize_price', 'eme_decimals', 'eme_timepicker_minutesstep', 'eme_form_required_field_string', 'eme_allowed_html', 'eme_allowed_style_attr', 'eme_version', 'eme_pdf_font', 'eme_backend_dateformat', 'eme_backend_timeformat', 'eme_unique_email_per_person', 'eme_address1_string', 'eme_address2_string', 'eme_multisite_active' );
+ $options = [ 'eme_thumbnail_size', 'eme_image_max_width', 'eme_image_max_height', 'eme_image_max_size', 'eme_html_header', 'eme_html_footer', 'eme_event_html_headers_format', 'eme_location_html_headers_format', 'eme_csv_separator', 'eme_use_external_url', 'eme_bd_email', 'eme_bd_email_members_only', 'eme_time_remove_leading_zeros', 'eme_stay_on_edit_page', 'eme_localize_price', 'eme_decimals', 'eme_timepicker_minutesstep', 'eme_form_required_field_string', 'eme_allowed_html', 'eme_allowed_style_attr', 'eme_version', 'eme_pdf_font', 'eme_backend_dateformat', 'eme_backend_timeformat', 'eme_unique_email_per_person', 'eme_address1_string', 'eme_address2_string', 'eme_multisite_active' ];
break;
}
@@ -1054,7 +1054,7 @@ function eme_sanitize_options( $input ) {
// allow js only in very specific header settings
//$allow_js_arr=array('eme_html_header','eme_html_footer','eme_event_html_headers_format','eme_location_html_headers_format','eme_payment_form_header_format','eme_payment_form_footer_format','eme_multipayment_form_header_format','eme_multipayment_form_footer_format','eme_payment_succes_format','eme_payment_fail_format','eme_payment_member_succes_format','eme_payment_member_fail_format','eme_registration_recorded_ok_html');
if ( is_array( $input ) ) {
- $output = array();
+ $output = [];
foreach ($input as $key=>$value) {
//if (in_array($key,$allow_js_arr))
// $output[$key]=$value;
@@ -1068,7 +1068,7 @@ function eme_sanitize_options( $input ) {
}
function eme_admin_tabs( $current = 'homepage' ) {
- $tabs = array(
+ $tabs = [
'general' => __( 'General', 'events-made-easy' ),
'access' => __( 'Access', 'events-made-easy' ),
'seo' => __( 'SEO', 'events-made-easy' ),
@@ -1085,7 +1085,7 @@ function eme_admin_tabs( $current = 'homepage' ) {
'payments' => __( 'Payments', 'events-made-easy' ),
'maps' => __( 'Maps', 'events-made-easy' ),
'other' => __( 'Other', 'events-made-easy' ),
- );
+ ];
if ( ! get_option( 'eme_rsvp_enabled' ) ) {
unset( $tabs['rsvp'] );
}
@@ -1245,18 +1245,18 @@ function eme_options_page() {
eme_options_input_text( __( 'hCaptcha site key', 'events-made-easy' ), 'eme_hcaptcha_site_key', __( 'This field is required', 'events-made-easy' ) );
eme_options_input_text( __( 'hCaptcha secret key', 'events-made-easy' ), 'eme_hcaptcha_secret_key', __( 'This field is required', 'events-made-easy' ) );
eme_options_select(
- __( 'Autocomplete sources', 'events-made-easy' ),
- 'eme_autocomplete_sources',
- array(
+ __( 'Autocomplete sources', 'events-made-easy' ),
+ 'eme_autocomplete_sources',
+ [
'none' => __( 'None', 'events-made-easy' ),
'people' => __( 'EME people', 'events-made-easy' ),
'wp_users' => __( 'Wordpress users', 'events-made-easy' ),
'both' => __(
- 'Both EME people and WP users',
- 'events-made-easy'
+ 'Both EME people and WP users',
+ 'events-made-easy'
),
- ),
- __( 'Decide if autocompletion is used in RSVP or membership forms and select if you want to search EME people, WP users or both. The autocompletion only works on the lastname field and only if you have sufficient rights (event creator or event author).', 'events-made-easy' )
+ ],
+ __( 'Decide if autocompletion is used in RSVP or membership forms and select if you want to search EME people, WP users or both. The autocompletion only works on the lastname field and only if you have sufficient rights (event creator or event author).', 'events-made-easy' )
);
eme_options_radio_binary( __( 'Delete all stored EME data when upgrading or deactivating?', 'events-made-easy' ), 'eme_uninstall_drop_data', __( 'Check this option if you want to delete all EME data concerning events, bookings, ... when upgrading or deactivating the plugin.', 'events-made-easy' ) );
eme_options_radio_binary( __( 'Delete all EME settings when upgrading or deactivating?', 'events-made-easy' ), 'eme_uninstall_drop_settings', __( 'Check this option if you want to delete all EME settings when upgrading or deactivating the plugin.', 'events-made-easy' ) );
@@ -1579,10 +1579,10 @@ function eme_options_page() {
__( 'starts', 'events-made-easy' ),
'end' => __( 'ends', 'events-made-easy' ),
- );
+ ];
esc_html_e( 'before the event ', 'events-made-easy' );
echo eme_ui_select( $eme_rsvp_end_target, 'eme_rsvp_end_target', $eme_rsvp_end_target_list );
?>
@@ -1712,31 +1712,31 @@ function eme_options_page() {
eme_options_radio_binary( __( 'Force sender address everywhere', 'events-made-easy' ), 'eme_mail_force_from', __( 'Force the configured sender address to be used for all outgoing emails. If not activated, the name and email address of the default contact person for RSVP mails will be used for generic mails, while for event or membership related mails the configured contact person will be used (or the blog admin if empty).', 'events-made-easy' ) );
eme_options_input_text( __( 'Default email BCC', 'events-made-easy' ), 'eme_mail_bcc_address', __( 'Insert an email address that will be added in Bcc to all outgoing mails (multiple addresses are to be separated by comma or semicolon). Can be left empty.', 'events-made-easy' ) );
eme_options_select(
- __( 'Email sending method', 'events-made-easy' ),
- 'eme_rsvp_mail_send_method',
- array(
+ __( 'Email sending method', 'events-made-easy' ),
+ 'eme_rsvp_mail_send_method',
+ [
'smtp' => 'SMTP',
'mail' => __( 'PHP email function', 'events-made-easy' ),
'sendmail' => 'Sendmail',
'qmail' => 'Qmail',
'wp_mail' => 'Wordpress Email (default)',
- ),
- __( 'Select how you want to send out emails.', 'events-made-easy' )
+ ],
+ __( 'Select how you want to send out emails.', 'events-made-easy' )
);
eme_options_input_text( __( 'SMTP host', 'events-made-easy' ), 'eme_smtp_host', __( "The SMTP host. Usually it corresponds to 'localhost'.", 'events-made-easy' ) );
eme_options_input_text( __( 'SMTP port', 'events-made-easy' ), 'eme_smtp_port', __( "The port through which you email notifications will be sent. Make sure the firewall doesn't block this port", 'events-made-easy' ) );
eme_options_select(
- __( 'SMTP encryption method', 'events-made-easy' ),
- 'eme_smtp_encryption',
- array(
+ __( 'SMTP encryption method', 'events-made-easy' ),
+ 'eme_smtp_encryption',
+ [
'none' => __( 'None', 'events-made-easy' ),
'tls' => __( 'TLS', 'events-made-easy' ),
'ssl' => __(
- 'SSL',
- 'events-made-easy'
+ 'SSL',
+ 'events-made-easy'
),
- ),
- __( 'Select the SMTP encryption method.', 'events-made-easy' )
+ ],
+ __( 'Select the SMTP encryption method.', 'events-made-easy' )
);
eme_options_radio_binary( __( 'Use SMTP authentication?', 'events-made-easy' ), 'eme_rsvp_mail_SMTPAuth', __( 'SMTP authentication is often needed. If you use Gmail, make sure to set this parameter to Yes', 'events-made-easy' ) );
eme_options_input_text( __( 'SMTP username', 'events-made-easy' ), 'eme_smtp_username', __( 'Insert the username to be used to access your SMTP server.', 'events-made-easy' ) );
@@ -2168,16 +2168,16 @@ function eme_options_page() {
" . __( 'Remark: due to the incomplete PHP implementation by Paypal, it is not recommended to use this method. It works fine, but has some shortcomings: no webhook functionality (meaning: if someone closes the browser immediately after payment, the payment will not get marked as paid in EME) and refunding is not possible.', 'events-made-easy' ) . ' ';
eme_options_select(
- __( 'PayPal live or test', 'events-made-easy' ),
- 'eme_paypal_url',
- array(
+ __( 'PayPal live or test', 'events-made-easy' ),
+ 'eme_paypal_url',
+ [
'sandbox' => __( 'Paypal Sandbox (for testing)', 'events-made-easy' ),
'live' => __(
- 'Paypal Live',
- 'events-made-easy'
+ 'Paypal Live',
+ 'events-made-easy'
),
- ),
- __( 'Choose wether you want to test paypal in a paypal sandbox or go live and really use paypal.', 'events-made-easy' )
+ ],
+ __( 'Choose wether you want to test paypal in a paypal sandbox or go live and really use paypal.', 'events-made-easy' )
);
eme_options_input_text( __( 'PayPal client ID', 'events-made-easy' ), 'eme_paypal_clientid', __( 'Paypal client ID.', 'events-made-easy' ) . '
' . sprintf( __( 'For more info on Paypal apps and credentials, see
this page ', 'events-made-easy' ), 'https://developer.paypal.com/docs/integration/admin/manage-apps/#create-an-app-for-testing' ) );
eme_options_input_text( __( 'PayPal secret', 'events-made-easy' ), 'eme_paypal_secret', __( 'Paypal secret.', 'events-made-easy' ) . '
' . sprintf( __( 'For more info on Paypal apps and credentials, see
this page ', 'events-made-easy' ), 'https://developer.paypal.com/docs/integration/admin/manage-apps/#create-an-app-for-testing' ) );
@@ -2197,18 +2197,18 @@ function eme_options_page() {