@@ -11,166 +11,166 @@ |
||
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | return array( |
| 14 | - 'AED' => 'د.إ', |
|
| 15 | - 'AFN' => '؋', |
|
| 16 | - 'ALL' => 'L', |
|
| 17 | - 'AMD' => 'AMD', |
|
| 18 | - 'ANG' => 'ƒ', |
|
| 19 | - 'AOA' => 'Kz', |
|
| 20 | - 'ARS' => '$', |
|
| 21 | - 'AUD' => '$', |
|
| 22 | - 'AWG' => 'ƒ', |
|
| 23 | - 'AZN' => 'AZN', |
|
| 24 | - 'BAM' => 'KM', |
|
| 25 | - 'BBD' => '$', |
|
| 26 | - 'BDT' => '৳', |
|
| 27 | - 'BGN' => 'лв.', |
|
| 28 | - 'BHD' => '.د.ب', |
|
| 29 | - 'BIF' => 'Fr', |
|
| 30 | - 'BMD' => '$', |
|
| 31 | - 'BND' => '$', |
|
| 32 | - 'BOB' => 'Bs.', |
|
| 33 | - 'BRL' => 'R$', |
|
| 34 | - 'BSD' => '$', |
|
| 35 | - 'BTC' => '฿', |
|
| 36 | - 'BTN' => 'Nu.', |
|
| 37 | - 'BWP' => 'P', |
|
| 38 | - 'BYN' => 'Br', |
|
| 39 | - 'BZD' => '$', |
|
| 40 | - 'CAD' => '$', |
|
| 41 | - 'CDF' => 'Fr', |
|
| 42 | - 'CHF' => 'CHF', |
|
| 43 | - 'CLP' => '$', |
|
| 44 | - 'CNY' => '¥', |
|
| 45 | - 'COP' => '$', |
|
| 46 | - 'CRC' => '₡', |
|
| 47 | - 'CUC' => '$', |
|
| 48 | - 'CUP' => '$', |
|
| 49 | - 'CVE' => '$', |
|
| 50 | - 'CZK' => 'Kč', |
|
| 51 | - 'DJF' => 'Fr', |
|
| 52 | - 'DKK' => 'DKK', |
|
| 53 | - 'DOP' => 'RD$', |
|
| 54 | - 'DZD' => 'د.ج', |
|
| 55 | - 'EGP' => 'EGP', |
|
| 56 | - 'ERN' => 'Nfk', |
|
| 57 | - 'ETB' => 'Br', |
|
| 58 | - 'EUR' => '€', |
|
| 59 | - 'FJD' => '$', |
|
| 60 | - 'FKP' => '£', |
|
| 61 | - 'GBP' => '£', |
|
| 62 | - 'GEL' => 'ლ', |
|
| 63 | - 'GGP' => '£', |
|
| 64 | - 'GHS' => '₵', |
|
| 65 | - 'GIP' => '£', |
|
| 66 | - 'GMD' => 'D', |
|
| 67 | - 'GNF' => 'Fr', |
|
| 68 | - 'GTQ' => 'Q', |
|
| 69 | - 'GYD' => '$', |
|
| 70 | - 'HKD' => '$', |
|
| 71 | - 'HNL' => 'L', |
|
| 72 | - 'HRK' => 'Kn', |
|
| 73 | - 'HTG' => 'G', |
|
| 74 | - 'HUF' => 'Ft', |
|
| 75 | - 'IDR' => 'Rp', |
|
| 76 | - 'ILS' => '₪', |
|
| 77 | - 'IMP' => '£', |
|
| 78 | - 'INR' => '₹', |
|
| 79 | - 'IQD' => 'ع.د', |
|
| 80 | - 'IRR' => '﷼', |
|
| 81 | - 'IRT' => 'تومان', |
|
| 82 | - 'ISK' => 'kr.', |
|
| 83 | - 'JEP' => '£', |
|
| 84 | - 'JMD' => '$', |
|
| 85 | - 'JOD' => 'د.ا', |
|
| 86 | - 'JPY' => '¥', |
|
| 87 | - 'KES' => 'KSh', |
|
| 88 | - 'KGS' => 'сом', |
|
| 89 | - 'KHR' => '៛', |
|
| 90 | - 'KMF' => 'Fr', |
|
| 91 | - 'KPW' => '₩', |
|
| 92 | - 'KRW' => '₩', |
|
| 93 | - 'KWD' => 'د.ك', |
|
| 94 | - 'KYD' => '$', |
|
| 95 | - 'KZT' => 'KZT', |
|
| 96 | - 'LAK' => '₭', |
|
| 97 | - 'LBP' => 'ل.ل', |
|
| 98 | - 'LKR' => 'රු', |
|
| 99 | - 'LRD' => '$', |
|
| 100 | - 'LSL' => 'L', |
|
| 101 | - 'LYD' => 'ل.د', |
|
| 102 | - 'MAD' => 'د.م.', |
|
| 103 | - 'MDL' => 'MDL', |
|
| 104 | - 'MGA' => 'Ar', |
|
| 105 | - 'MKD' => 'ден', |
|
| 106 | - 'MMK' => 'Ks', |
|
| 107 | - 'MNT' => '₮', |
|
| 108 | - 'MOP' => 'P', |
|
| 109 | - 'MRO' => 'UM', |
|
| 110 | - 'MUR' => '₨', |
|
| 111 | - 'MVR' => '.ރ', |
|
| 112 | - 'MWK' => 'MK', |
|
| 113 | - 'MXN' => '$', |
|
| 114 | - 'MYR' => 'RM', |
|
| 115 | - 'MZN' => 'MT', |
|
| 116 | - 'NAD' => '$', |
|
| 117 | - 'NGN' => '₦', |
|
| 118 | - 'NIO' => 'C$', |
|
| 119 | - 'NOK' => 'kr', |
|
| 120 | - 'NPR' => '₨', |
|
| 121 | - 'NZD' => '$', |
|
| 122 | - 'OMR' => 'ر.ع.', |
|
| 123 | - 'PAB' => 'B/.', |
|
| 124 | - 'PEN' => 'S/.', |
|
| 125 | - 'PGK' => 'K', |
|
| 126 | - 'PHP' => '₱', |
|
| 127 | - 'PKR' => '₨', |
|
| 128 | - 'PLN' => 'zł', |
|
| 129 | - 'PRB' => 'р.', |
|
| 130 | - 'PYG' => '₲', |
|
| 131 | - 'QAR' => 'ر.ق', |
|
| 132 | - 'RMB' => '¥', |
|
| 133 | - 'RON' => 'lei', |
|
| 134 | - 'RSD' => 'дин.', |
|
| 135 | - 'RUB' => '₽', |
|
| 136 | - 'RWF' => 'Fr', |
|
| 137 | - 'SAR' => 'ر.س', |
|
| 138 | - 'SBD' => '$', |
|
| 139 | - 'SCR' => '₨', |
|
| 140 | - 'SDG' => 'ج.س.', |
|
| 141 | - 'SEK' => 'kr', |
|
| 142 | - 'SGD' => '$', |
|
| 143 | - 'SHP' => '£', |
|
| 144 | - 'SLL' => 'Le', |
|
| 145 | - 'SOS' => 'Sh', |
|
| 146 | - 'SRD' => '$', |
|
| 147 | - 'SSP' => '£', |
|
| 148 | - 'STD' => 'Db', |
|
| 149 | - 'SYP' => 'ل.س', |
|
| 150 | - 'SZL' => 'L', |
|
| 151 | - 'THB' => '฿', |
|
| 152 | - 'TJS' => 'ЅМ', |
|
| 153 | - 'TMT' => 'm', |
|
| 154 | - 'TND' => 'د.ت', |
|
| 155 | - 'TOP' => 'T$', |
|
| 156 | - 'TRY' => '₺', |
|
| 157 | - 'TTD' => '$', |
|
| 158 | - 'TWD' => 'NT$', |
|
| 159 | - 'TZS' => 'Sh', |
|
| 160 | - 'UAH' => '₴', |
|
| 161 | - 'UGX' => 'UGX', |
|
| 162 | - 'USD' => '$', |
|
| 163 | - 'UYU' => '$', |
|
| 164 | - 'UZS' => 'UZS', |
|
| 165 | - 'VEF' => 'Bs.', |
|
| 166 | - 'VND' => '₫', |
|
| 167 | - 'VUV' => 'Vt', |
|
| 168 | - 'WST' => 'T', |
|
| 169 | - 'XAF' => 'Fr', |
|
| 170 | - 'XCD' => '$', |
|
| 171 | - 'XOF' => 'Fr', |
|
| 172 | - 'XPF' => 'Fr', |
|
| 173 | - 'YER' => '﷼', |
|
| 174 | - 'ZAR' => 'R', |
|
| 175 | - 'ZMW' => 'ZK', |
|
| 14 | + 'AED' => 'د.إ', |
|
| 15 | + 'AFN' => '؋', |
|
| 16 | + 'ALL' => 'L', |
|
| 17 | + 'AMD' => 'AMD', |
|
| 18 | + 'ANG' => 'ƒ', |
|
| 19 | + 'AOA' => 'Kz', |
|
| 20 | + 'ARS' => '$', |
|
| 21 | + 'AUD' => '$', |
|
| 22 | + 'AWG' => 'ƒ', |
|
| 23 | + 'AZN' => 'AZN', |
|
| 24 | + 'BAM' => 'KM', |
|
| 25 | + 'BBD' => '$', |
|
| 26 | + 'BDT' => '৳', |
|
| 27 | + 'BGN' => 'лв.', |
|
| 28 | + 'BHD' => '.د.ب', |
|
| 29 | + 'BIF' => 'Fr', |
|
| 30 | + 'BMD' => '$', |
|
| 31 | + 'BND' => '$', |
|
| 32 | + 'BOB' => 'Bs.', |
|
| 33 | + 'BRL' => 'R$', |
|
| 34 | + 'BSD' => '$', |
|
| 35 | + 'BTC' => '฿', |
|
| 36 | + 'BTN' => 'Nu.', |
|
| 37 | + 'BWP' => 'P', |
|
| 38 | + 'BYN' => 'Br', |
|
| 39 | + 'BZD' => '$', |
|
| 40 | + 'CAD' => '$', |
|
| 41 | + 'CDF' => 'Fr', |
|
| 42 | + 'CHF' => 'CHF', |
|
| 43 | + 'CLP' => '$', |
|
| 44 | + 'CNY' => '¥', |
|
| 45 | + 'COP' => '$', |
|
| 46 | + 'CRC' => '₡', |
|
| 47 | + 'CUC' => '$', |
|
| 48 | + 'CUP' => '$', |
|
| 49 | + 'CVE' => '$', |
|
| 50 | + 'CZK' => 'Kč', |
|
| 51 | + 'DJF' => 'Fr', |
|
| 52 | + 'DKK' => 'DKK', |
|
| 53 | + 'DOP' => 'RD$', |
|
| 54 | + 'DZD' => 'د.ج', |
|
| 55 | + 'EGP' => 'EGP', |
|
| 56 | + 'ERN' => 'Nfk', |
|
| 57 | + 'ETB' => 'Br', |
|
| 58 | + 'EUR' => '€', |
|
| 59 | + 'FJD' => '$', |
|
| 60 | + 'FKP' => '£', |
|
| 61 | + 'GBP' => '£', |
|
| 62 | + 'GEL' => 'ლ', |
|
| 63 | + 'GGP' => '£', |
|
| 64 | + 'GHS' => '₵', |
|
| 65 | + 'GIP' => '£', |
|
| 66 | + 'GMD' => 'D', |
|
| 67 | + 'GNF' => 'Fr', |
|
| 68 | + 'GTQ' => 'Q', |
|
| 69 | + 'GYD' => '$', |
|
| 70 | + 'HKD' => '$', |
|
| 71 | + 'HNL' => 'L', |
|
| 72 | + 'HRK' => 'Kn', |
|
| 73 | + 'HTG' => 'G', |
|
| 74 | + 'HUF' => 'Ft', |
|
| 75 | + 'IDR' => 'Rp', |
|
| 76 | + 'ILS' => '₪', |
|
| 77 | + 'IMP' => '£', |
|
| 78 | + 'INR' => '₹', |
|
| 79 | + 'IQD' => 'ع.د', |
|
| 80 | + 'IRR' => '﷼', |
|
| 81 | + 'IRT' => 'تومان', |
|
| 82 | + 'ISK' => 'kr.', |
|
| 83 | + 'JEP' => '£', |
|
| 84 | + 'JMD' => '$', |
|
| 85 | + 'JOD' => 'د.ا', |
|
| 86 | + 'JPY' => '¥', |
|
| 87 | + 'KES' => 'KSh', |
|
| 88 | + 'KGS' => 'сом', |
|
| 89 | + 'KHR' => '៛', |
|
| 90 | + 'KMF' => 'Fr', |
|
| 91 | + 'KPW' => '₩', |
|
| 92 | + 'KRW' => '₩', |
|
| 93 | + 'KWD' => 'د.ك', |
|
| 94 | + 'KYD' => '$', |
|
| 95 | + 'KZT' => 'KZT', |
|
| 96 | + 'LAK' => '₭', |
|
| 97 | + 'LBP' => 'ل.ل', |
|
| 98 | + 'LKR' => 'රු', |
|
| 99 | + 'LRD' => '$', |
|
| 100 | + 'LSL' => 'L', |
|
| 101 | + 'LYD' => 'ل.د', |
|
| 102 | + 'MAD' => 'د.م.', |
|
| 103 | + 'MDL' => 'MDL', |
|
| 104 | + 'MGA' => 'Ar', |
|
| 105 | + 'MKD' => 'ден', |
|
| 106 | + 'MMK' => 'Ks', |
|
| 107 | + 'MNT' => '₮', |
|
| 108 | + 'MOP' => 'P', |
|
| 109 | + 'MRO' => 'UM', |
|
| 110 | + 'MUR' => '₨', |
|
| 111 | + 'MVR' => '.ރ', |
|
| 112 | + 'MWK' => 'MK', |
|
| 113 | + 'MXN' => '$', |
|
| 114 | + 'MYR' => 'RM', |
|
| 115 | + 'MZN' => 'MT', |
|
| 116 | + 'NAD' => '$', |
|
| 117 | + 'NGN' => '₦', |
|
| 118 | + 'NIO' => 'C$', |
|
| 119 | + 'NOK' => 'kr', |
|
| 120 | + 'NPR' => '₨', |
|
| 121 | + 'NZD' => '$', |
|
| 122 | + 'OMR' => 'ر.ع.', |
|
| 123 | + 'PAB' => 'B/.', |
|
| 124 | + 'PEN' => 'S/.', |
|
| 125 | + 'PGK' => 'K', |
|
| 126 | + 'PHP' => '₱', |
|
| 127 | + 'PKR' => '₨', |
|
| 128 | + 'PLN' => 'zł', |
|
| 129 | + 'PRB' => 'р.', |
|
| 130 | + 'PYG' => '₲', |
|
| 131 | + 'QAR' => 'ر.ق', |
|
| 132 | + 'RMB' => '¥', |
|
| 133 | + 'RON' => 'lei', |
|
| 134 | + 'RSD' => 'дин.', |
|
| 135 | + 'RUB' => '₽', |
|
| 136 | + 'RWF' => 'Fr', |
|
| 137 | + 'SAR' => 'ر.س', |
|
| 138 | + 'SBD' => '$', |
|
| 139 | + 'SCR' => '₨', |
|
| 140 | + 'SDG' => 'ج.س.', |
|
| 141 | + 'SEK' => 'kr', |
|
| 142 | + 'SGD' => '$', |
|
| 143 | + 'SHP' => '£', |
|
| 144 | + 'SLL' => 'Le', |
|
| 145 | + 'SOS' => 'Sh', |
|
| 146 | + 'SRD' => '$', |
|
| 147 | + 'SSP' => '£', |
|
| 148 | + 'STD' => 'Db', |
|
| 149 | + 'SYP' => 'ل.س', |
|
| 150 | + 'SZL' => 'L', |
|
| 151 | + 'THB' => '฿', |
|
| 152 | + 'TJS' => 'ЅМ', |
|
| 153 | + 'TMT' => 'm', |
|
| 154 | + 'TND' => 'د.ت', |
|
| 155 | + 'TOP' => 'T$', |
|
| 156 | + 'TRY' => '₺', |
|
| 157 | + 'TTD' => '$', |
|
| 158 | + 'TWD' => 'NT$', |
|
| 159 | + 'TZS' => 'Sh', |
|
| 160 | + 'UAH' => '₴', |
|
| 161 | + 'UGX' => 'UGX', |
|
| 162 | + 'USD' => '$', |
|
| 163 | + 'UYU' => '$', |
|
| 164 | + 'UZS' => 'UZS', |
|
| 165 | + 'VEF' => 'Bs.', |
|
| 166 | + 'VND' => '₫', |
|
| 167 | + 'VUV' => 'Vt', |
|
| 168 | + 'WST' => 'T', |
|
| 169 | + 'XAF' => 'Fr', |
|
| 170 | + 'XCD' => '$', |
|
| 171 | + 'XOF' => 'Fr', |
|
| 172 | + 'XPF' => 'Fr', |
|
| 173 | + 'YER' => '﷼', |
|
| 174 | + 'ZAR' => 'R', |
|
| 175 | + 'ZMW' => 'ZK', |
|
| 176 | 176 | ); |
@@ -11,165 +11,165 @@ |
||
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | return array( |
| 14 | - 'USD' => __( 'US Dollar', 'invoicing' ), |
|
| 15 | - 'EUR' => __( 'Euro', 'invoicing' ), |
|
| 16 | - 'GBP' => __( 'Pound Sterling', 'invoicing' ), |
|
| 17 | - 'AED' => __( 'United Arab Emirates', 'invoicing' ), |
|
| 18 | - 'AFN' => __( 'Afghan Afghani', 'invoicing' ), |
|
| 19 | - 'ALL' => __( 'Albanian Lek', 'invoicing' ), |
|
| 20 | - 'AMD' => __( 'Armenian Dram', 'invoicing' ), |
|
| 21 | - 'ANG' => __( 'Netherlands Antillean Guilder', 'invoicing' ), |
|
| 22 | - 'AOA' => __( 'Angolan Kwanza', 'invoicing' ), |
|
| 23 | - 'ARS' => __( 'Argentine Peso', 'invoicing' ), |
|
| 24 | - 'AUD' => __( 'Australian Dollar', 'invoicing' ), |
|
| 25 | - 'AWG' => __( 'Aruban Florin', 'invoicing' ), |
|
| 26 | - 'AZN' => __( 'Azerbaijani Manat', 'invoicing' ), |
|
| 27 | - 'BAM' => __( 'Bosnia and Herzegovina Convertible Marka', 'invoicing' ), |
|
| 28 | - 'BBD' => __( 'Barbadian Dollar', 'invoicing' ), |
|
| 29 | - 'BDT' => __( 'Bangladeshi Taka', 'invoicing' ), |
|
| 30 | - 'BGN' => __( 'Bulgarian Lev', 'invoicing' ), |
|
| 31 | - 'BHD' => __( 'Bahraini Dinar', 'invoicing' ), |
|
| 32 | - 'BIF' => __( 'Burundian Franc', 'invoicing' ), |
|
| 33 | - 'BMD' => __( 'Bermudian Dollar', 'invoicing' ), |
|
| 34 | - 'BND' => __( 'Brunei Dollar', 'invoicing' ), |
|
| 35 | - 'BOB' => __( 'Bolivian Boliviano', 'invoicing' ), |
|
| 36 | - 'BRL' => __( 'Brazilian Real', 'invoicing' ), |
|
| 37 | - 'BSD' => __( 'Bahamian Dollar', 'invoicing' ), |
|
| 38 | - 'BTC' => __( 'Bitcoin', 'invoicing' ), |
|
| 39 | - 'BTN' => __( 'Bhutanese Ngultrum', 'invoicing' ), |
|
| 40 | - 'BWP' => __( 'Botswana Pula', 'invoicing' ), |
|
| 41 | - 'BYN' => __( 'Belarusian Ruble', 'invoicing' ), |
|
| 42 | - 'BZD' => __( 'Belize Dollar', 'invoicing' ), |
|
| 43 | - 'CAD' => __( 'Canadian Dollar', 'invoicing' ), |
|
| 44 | - 'CDF' => __( 'Congolese Franc', 'invoicing' ), |
|
| 45 | - 'CHF' => __( 'Swiss Franc', 'invoicing' ), |
|
| 46 | - 'CLP' => __( 'Chilean Peso', 'invoicing' ), |
|
| 47 | - 'CNY' => __( 'Chinese Yuan', 'invoicing' ), |
|
| 48 | - 'COP' => __( 'Colombian Peso', 'invoicing' ), |
|
| 49 | - 'CRC' => __( 'Costa Rican Colon', 'invoicing' ), |
|
| 50 | - 'CUC' => __( 'Cuban Convertible Peso', 'invoicing' ), |
|
| 51 | - 'CUP' => __( 'Cuban Peso', 'invoicing' ), |
|
| 52 | - 'CVE' => __( 'Cape Verdean escudo', 'invoicing' ), |
|
| 53 | - 'CZK' => __( 'Czech Koruna', 'invoicing' ), |
|
| 54 | - 'DJF' => __( 'Djiboutian Franc', 'invoicing' ), |
|
| 55 | - 'DKK' => __( 'Danish Krone', 'invoicing' ), |
|
| 56 | - 'DOP' => __( 'Dominican Peso', 'invoicing' ), |
|
| 57 | - 'DZD' => __( 'Algerian Dinar', 'invoicing' ), |
|
| 58 | - 'EGP' => __( 'Egyptian Pound', 'invoicing' ), |
|
| 59 | - 'ERN' => __( 'Eritrean Nakfa', 'invoicing' ), |
|
| 60 | - 'ETB' => __( 'Ethiopian Irr', 'invoicing' ), |
|
| 61 | - 'FJD' => __( 'Fijian Dollar', 'invoicing' ), |
|
| 62 | - 'FKP' => __( 'Falkland Islands Pound', 'invoicing' ), |
|
| 63 | - 'GEL' => __( 'Georgian Lari', 'invoicing' ), |
|
| 64 | - 'GGP' => __( 'Guernsey Pound', 'invoicing' ), |
|
| 65 | - 'GHS' => __( 'Ghana Cedi', 'invoicing' ), |
|
| 66 | - 'GIP' => __( 'Gibraltar Pound', 'invoicing' ), |
|
| 67 | - 'GMD' => __( 'Gambian Dalasi', 'invoicing' ), |
|
| 68 | - 'GNF' => __( 'Guinean Franc', 'invoicing' ), |
|
| 69 | - 'GTQ' => __( 'Guatemalan Quetzal', 'invoicing' ), |
|
| 70 | - 'GYD' => __( 'Guyanese Dollar', 'invoicing' ), |
|
| 71 | - 'HKD' => __( 'Hong Kong Dollar', 'invoicing' ), |
|
| 72 | - 'HNL' => __( 'Honduran Lempira', 'invoicing' ), |
|
| 73 | - 'HRK' => __( 'Croatian Kuna', 'invoicing' ), |
|
| 74 | - 'HTG' => __( 'Haitian Gourde', 'invoicing' ), |
|
| 75 | - 'HUF' => __( 'Hungarian Forint', 'invoicing' ), |
|
| 76 | - 'IDR' => __( 'Indonesian Rupiah', 'invoicing' ), |
|
| 77 | - 'ILS' => __( 'Israeli New Shekel', 'invoicing' ), |
|
| 78 | - 'IMP' => __( 'Manx Pound', 'invoicing' ), |
|
| 79 | - 'INR' => __( 'Indian Rupee', 'invoicing' ), |
|
| 80 | - 'IQD' => __( 'Iraqi Dinar', 'invoicing' ), |
|
| 81 | - 'IRR' => __( 'Iranian Rial', 'invoicing' ), |
|
| 82 | - 'IRT' => __( 'Iranian Toman', 'invoicing' ), |
|
| 83 | - 'ISK' => __( 'Icelandic Krona', 'invoicing' ), |
|
| 84 | - 'JEP' => __( 'Jersey Pound', 'invoicing' ), |
|
| 85 | - 'JMD' => __( 'Jamaican Dollar', 'invoicing' ), |
|
| 86 | - 'JOD' => __( 'Jordanian Dinar', 'invoicing' ), |
|
| 87 | - 'JPY' => __( 'Japanese Yen', 'invoicing' ), |
|
| 88 | - 'KES' => __( 'Kenyan Shilling', 'invoicing' ), |
|
| 89 | - 'KGS' => __( 'Kyrgyzstani Som', 'invoicing' ), |
|
| 90 | - 'KHR' => __( 'Cambodian Riel', 'invoicing' ), |
|
| 91 | - 'KMF' => __( 'Comorian Franc', 'invoicing' ), |
|
| 92 | - 'KPW' => __( 'North Korean Won', 'invoicing' ), |
|
| 93 | - 'KRW' => __( 'South Korean Won', 'invoicing' ), |
|
| 94 | - 'KWD' => __( 'Kuwaiti Dinar', 'invoicing' ), |
|
| 95 | - 'KYD' => __( 'Cayman Islands Dollar', 'invoicing' ), |
|
| 96 | - 'KZT' => __( 'Kazakhstani Tenge', 'invoicing' ), |
|
| 97 | - 'LAK' => __( 'Lao Kip', 'invoicing' ), |
|
| 98 | - 'LBP' => __( 'Lebanese Pound', 'invoicing' ), |
|
| 99 | - 'LKR' => __( 'Sri Lankan Rupee', 'invoicing' ), |
|
| 100 | - 'LRD' => __( 'Liberian Dollar', 'invoicing' ), |
|
| 101 | - 'LSL' => __( 'Lesotho Loti', 'invoicing' ), |
|
| 102 | - 'LYD' => __( 'Libyan Dinar', 'invoicing' ), |
|
| 103 | - 'MAD' => __( 'Moroccan Dirham', 'invoicing' ), |
|
| 104 | - 'MDL' => __( 'Moldovan Leu', 'invoicing' ), |
|
| 105 | - 'MGA' => __( 'Malagasy Ariary', 'invoicing' ), |
|
| 106 | - 'MKD' => __( 'Macedonian Denar', 'invoicing' ), |
|
| 107 | - 'MMK' => __( 'Burmese Kyat', 'invoicing' ), |
|
| 108 | - 'MNT' => __( 'Mongolian Tughrik', 'invoicing' ), |
|
| 109 | - 'MOP' => __( 'Macanese Pataca', 'invoicing' ), |
|
| 110 | - 'MRO' => __( 'Mauritanian Ouguiya', 'invoicing' ), |
|
| 111 | - 'MUR' => __( 'Mauritian Rupee', 'invoicing' ), |
|
| 112 | - 'MVR' => __( 'Maldivian Rufiyaa', 'invoicing' ), |
|
| 113 | - 'MWK' => __( 'Malawian Kwacha', 'invoicing' ), |
|
| 114 | - 'MXN' => __( 'Mexican Peso', 'invoicing' ), |
|
| 115 | - 'MYR' => __( 'Malaysian Ringgit', 'invoicing' ), |
|
| 116 | - 'MZN' => __( 'Mozambican Metical', 'invoicing' ), |
|
| 117 | - 'NAD' => __( 'Namibian Dollar', 'invoicing' ), |
|
| 118 | - 'NGN' => __( 'Nigerian Naira', 'invoicing' ), |
|
| 119 | - 'NIO' => __( 'Nicaraguan Cordoba', 'invoicing' ), |
|
| 120 | - 'NOK' => __( 'Norwegian Krone', 'invoicing' ), |
|
| 121 | - 'NPR' => __( 'Nepalese Rupee', 'invoicing' ), |
|
| 122 | - 'NZD' => __( 'New Zealand Dollar', 'invoicing' ), |
|
| 123 | - 'OMR' => __( 'Omani Rial', 'invoicing' ), |
|
| 124 | - 'PAB' => __( 'Panamanian Balboa', 'invoicing' ), |
|
| 125 | - 'PEN' => __( 'Peruvian Nuevo Sol', 'invoicing' ), |
|
| 126 | - 'PGK' => __( 'Papua New Guinean Kina', 'invoicing' ), |
|
| 127 | - 'PHP' => __( 'Philippine Peso', 'invoicing' ), |
|
| 128 | - 'PKR' => __( 'Pakistani Rupee', 'invoicing' ), |
|
| 129 | - 'PLN' => __( 'Polish Zloty', 'invoicing' ), |
|
| 130 | - 'PRB' => __( 'Transnistrian Ruble', 'invoicing' ), |
|
| 131 | - 'PYG' => __( 'Paraguayan Guarani', 'invoicing' ), |
|
| 132 | - 'QAR' => __( 'Qatari Riyal', 'invoicing' ), |
|
| 133 | - 'RON' => __( 'Romanian Leu', 'invoicing' ), |
|
| 134 | - 'RSD' => __( 'Serbian Dinar', 'invoicing' ), |
|
| 135 | - 'RUB' => __( 'Russian Ruble', 'invoicing' ), |
|
| 136 | - 'RWF' => __( 'Rwandan Franc', 'invoicing' ), |
|
| 137 | - 'SAR' => __( 'Saudi Riyal', 'invoicing' ), |
|
| 138 | - 'SBD' => __( 'Solomon Islands Dollar', 'invoicing' ), |
|
| 139 | - 'SCR' => __( 'Seychellois Rupee', 'invoicing' ), |
|
| 140 | - 'SDG' => __( 'Sudanese Pound', 'invoicing' ), |
|
| 141 | - 'SEK' => __( 'Swedish Krona', 'invoicing' ), |
|
| 142 | - 'SGD' => __( 'Singapore Dollar', 'invoicing' ), |
|
| 143 | - 'SHP' => __( 'Saint Helena Pound', 'invoicing' ), |
|
| 144 | - 'SLL' => __( 'Sierra Leonean Leone', 'invoicing' ), |
|
| 145 | - 'SOS' => __( 'Somali Shilling', 'invoicing' ), |
|
| 146 | - 'SRD' => __( 'Surinamese Dollar', 'invoicing' ), |
|
| 147 | - 'SSP' => __( 'South Sudanese Pound', 'invoicing' ), |
|
| 148 | - 'STD' => __( 'Sao Tomean Dobra', 'invoicing' ), |
|
| 149 | - 'SYP' => __( 'Syrian Pound', 'invoicing' ), |
|
| 150 | - 'SZL' => __( 'Swazi Lilangeni', 'invoicing' ), |
|
| 151 | - 'THB' => __( 'Thai Baht', 'invoicing' ), |
|
| 152 | - 'TJS' => __( 'Tajikistani Somoni', 'invoicing' ), |
|
| 153 | - 'TMT' => __( 'Turkmenistan Manat', 'invoicing' ), |
|
| 154 | - 'TND' => __( 'Tunisian Dinar', 'invoicing' ), |
|
| 155 | - 'TOP' => __( 'Tongan Paʻanga', 'invoicing' ), |
|
| 156 | - 'TRY' => __( 'Turkish Lira', 'invoicing' ), |
|
| 157 | - 'TTD' => __( 'Trinidad and Tobago Dollar', 'invoicing' ), |
|
| 158 | - 'TWD' => __( 'New Taiwan Dollar', 'invoicing' ), |
|
| 159 | - 'TZS' => __( 'Tanzanian Shilling', 'invoicing' ), |
|
| 160 | - 'UAH' => __( 'Ukrainian Hryvnia', 'invoicing' ), |
|
| 161 | - 'UGX' => __( 'Ugandan Shilling', 'invoicing' ), |
|
| 162 | - 'UYU' => __( 'Uruguayan Peso', 'invoicing' ), |
|
| 163 | - 'UZS' => __( 'Uzbekistani Som', 'invoicing' ), |
|
| 164 | - 'VEF' => __( 'Venezuelan Bolívar', 'invoicing' ), |
|
| 165 | - 'VND' => __( 'Vietnamese Dong', 'invoicing' ), |
|
| 166 | - 'VUV' => __( 'Vanuatu Vatu', 'invoicing' ), |
|
| 167 | - 'WST' => __( 'Samoan Tala', 'invoicing' ), |
|
| 168 | - 'XAF' => __( 'Central African CFA Franc', 'invoicing' ), |
|
| 169 | - 'XCD' => __( 'East Caribbean Dollar', 'invoicing' ), |
|
| 170 | - 'XOF' => __( 'West African CFA Franc', 'invoicing' ), |
|
| 171 | - 'XPF' => __( 'CFP Franc', 'invoicing' ), |
|
| 172 | - 'YER' => __( 'Yemeni Rial', 'invoicing' ), |
|
| 173 | - 'ZAR' => __( 'South African Rand', 'invoicing' ), |
|
| 174 | - 'ZMW' => __( 'Zambian Kwacha', 'invoicing' ), |
|
| 14 | + 'USD' => __( 'US Dollar', 'invoicing' ), |
|
| 15 | + 'EUR' => __( 'Euro', 'invoicing' ), |
|
| 16 | + 'GBP' => __( 'Pound Sterling', 'invoicing' ), |
|
| 17 | + 'AED' => __( 'United Arab Emirates', 'invoicing' ), |
|
| 18 | + 'AFN' => __( 'Afghan Afghani', 'invoicing' ), |
|
| 19 | + 'ALL' => __( 'Albanian Lek', 'invoicing' ), |
|
| 20 | + 'AMD' => __( 'Armenian Dram', 'invoicing' ), |
|
| 21 | + 'ANG' => __( 'Netherlands Antillean Guilder', 'invoicing' ), |
|
| 22 | + 'AOA' => __( 'Angolan Kwanza', 'invoicing' ), |
|
| 23 | + 'ARS' => __( 'Argentine Peso', 'invoicing' ), |
|
| 24 | + 'AUD' => __( 'Australian Dollar', 'invoicing' ), |
|
| 25 | + 'AWG' => __( 'Aruban Florin', 'invoicing' ), |
|
| 26 | + 'AZN' => __( 'Azerbaijani Manat', 'invoicing' ), |
|
| 27 | + 'BAM' => __( 'Bosnia and Herzegovina Convertible Marka', 'invoicing' ), |
|
| 28 | + 'BBD' => __( 'Barbadian Dollar', 'invoicing' ), |
|
| 29 | + 'BDT' => __( 'Bangladeshi Taka', 'invoicing' ), |
|
| 30 | + 'BGN' => __( 'Bulgarian Lev', 'invoicing' ), |
|
| 31 | + 'BHD' => __( 'Bahraini Dinar', 'invoicing' ), |
|
| 32 | + 'BIF' => __( 'Burundian Franc', 'invoicing' ), |
|
| 33 | + 'BMD' => __( 'Bermudian Dollar', 'invoicing' ), |
|
| 34 | + 'BND' => __( 'Brunei Dollar', 'invoicing' ), |
|
| 35 | + 'BOB' => __( 'Bolivian Boliviano', 'invoicing' ), |
|
| 36 | + 'BRL' => __( 'Brazilian Real', 'invoicing' ), |
|
| 37 | + 'BSD' => __( 'Bahamian Dollar', 'invoicing' ), |
|
| 38 | + 'BTC' => __( 'Bitcoin', 'invoicing' ), |
|
| 39 | + 'BTN' => __( 'Bhutanese Ngultrum', 'invoicing' ), |
|
| 40 | + 'BWP' => __( 'Botswana Pula', 'invoicing' ), |
|
| 41 | + 'BYN' => __( 'Belarusian Ruble', 'invoicing' ), |
|
| 42 | + 'BZD' => __( 'Belize Dollar', 'invoicing' ), |
|
| 43 | + 'CAD' => __( 'Canadian Dollar', 'invoicing' ), |
|
| 44 | + 'CDF' => __( 'Congolese Franc', 'invoicing' ), |
|
| 45 | + 'CHF' => __( 'Swiss Franc', 'invoicing' ), |
|
| 46 | + 'CLP' => __( 'Chilean Peso', 'invoicing' ), |
|
| 47 | + 'CNY' => __( 'Chinese Yuan', 'invoicing' ), |
|
| 48 | + 'COP' => __( 'Colombian Peso', 'invoicing' ), |
|
| 49 | + 'CRC' => __( 'Costa Rican Colon', 'invoicing' ), |
|
| 50 | + 'CUC' => __( 'Cuban Convertible Peso', 'invoicing' ), |
|
| 51 | + 'CUP' => __( 'Cuban Peso', 'invoicing' ), |
|
| 52 | + 'CVE' => __( 'Cape Verdean escudo', 'invoicing' ), |
|
| 53 | + 'CZK' => __( 'Czech Koruna', 'invoicing' ), |
|
| 54 | + 'DJF' => __( 'Djiboutian Franc', 'invoicing' ), |
|
| 55 | + 'DKK' => __( 'Danish Krone', 'invoicing' ), |
|
| 56 | + 'DOP' => __( 'Dominican Peso', 'invoicing' ), |
|
| 57 | + 'DZD' => __( 'Algerian Dinar', 'invoicing' ), |
|
| 58 | + 'EGP' => __( 'Egyptian Pound', 'invoicing' ), |
|
| 59 | + 'ERN' => __( 'Eritrean Nakfa', 'invoicing' ), |
|
| 60 | + 'ETB' => __( 'Ethiopian Irr', 'invoicing' ), |
|
| 61 | + 'FJD' => __( 'Fijian Dollar', 'invoicing' ), |
|
| 62 | + 'FKP' => __( 'Falkland Islands Pound', 'invoicing' ), |
|
| 63 | + 'GEL' => __( 'Georgian Lari', 'invoicing' ), |
|
| 64 | + 'GGP' => __( 'Guernsey Pound', 'invoicing' ), |
|
| 65 | + 'GHS' => __( 'Ghana Cedi', 'invoicing' ), |
|
| 66 | + 'GIP' => __( 'Gibraltar Pound', 'invoicing' ), |
|
| 67 | + 'GMD' => __( 'Gambian Dalasi', 'invoicing' ), |
|
| 68 | + 'GNF' => __( 'Guinean Franc', 'invoicing' ), |
|
| 69 | + 'GTQ' => __( 'Guatemalan Quetzal', 'invoicing' ), |
|
| 70 | + 'GYD' => __( 'Guyanese Dollar', 'invoicing' ), |
|
| 71 | + 'HKD' => __( 'Hong Kong Dollar', 'invoicing' ), |
|
| 72 | + 'HNL' => __( 'Honduran Lempira', 'invoicing' ), |
|
| 73 | + 'HRK' => __( 'Croatian Kuna', 'invoicing' ), |
|
| 74 | + 'HTG' => __( 'Haitian Gourde', 'invoicing' ), |
|
| 75 | + 'HUF' => __( 'Hungarian Forint', 'invoicing' ), |
|
| 76 | + 'IDR' => __( 'Indonesian Rupiah', 'invoicing' ), |
|
| 77 | + 'ILS' => __( 'Israeli New Shekel', 'invoicing' ), |
|
| 78 | + 'IMP' => __( 'Manx Pound', 'invoicing' ), |
|
| 79 | + 'INR' => __( 'Indian Rupee', 'invoicing' ), |
|
| 80 | + 'IQD' => __( 'Iraqi Dinar', 'invoicing' ), |
|
| 81 | + 'IRR' => __( 'Iranian Rial', 'invoicing' ), |
|
| 82 | + 'IRT' => __( 'Iranian Toman', 'invoicing' ), |
|
| 83 | + 'ISK' => __( 'Icelandic Krona', 'invoicing' ), |
|
| 84 | + 'JEP' => __( 'Jersey Pound', 'invoicing' ), |
|
| 85 | + 'JMD' => __( 'Jamaican Dollar', 'invoicing' ), |
|
| 86 | + 'JOD' => __( 'Jordanian Dinar', 'invoicing' ), |
|
| 87 | + 'JPY' => __( 'Japanese Yen', 'invoicing' ), |
|
| 88 | + 'KES' => __( 'Kenyan Shilling', 'invoicing' ), |
|
| 89 | + 'KGS' => __( 'Kyrgyzstani Som', 'invoicing' ), |
|
| 90 | + 'KHR' => __( 'Cambodian Riel', 'invoicing' ), |
|
| 91 | + 'KMF' => __( 'Comorian Franc', 'invoicing' ), |
|
| 92 | + 'KPW' => __( 'North Korean Won', 'invoicing' ), |
|
| 93 | + 'KRW' => __( 'South Korean Won', 'invoicing' ), |
|
| 94 | + 'KWD' => __( 'Kuwaiti Dinar', 'invoicing' ), |
|
| 95 | + 'KYD' => __( 'Cayman Islands Dollar', 'invoicing' ), |
|
| 96 | + 'KZT' => __( 'Kazakhstani Tenge', 'invoicing' ), |
|
| 97 | + 'LAK' => __( 'Lao Kip', 'invoicing' ), |
|
| 98 | + 'LBP' => __( 'Lebanese Pound', 'invoicing' ), |
|
| 99 | + 'LKR' => __( 'Sri Lankan Rupee', 'invoicing' ), |
|
| 100 | + 'LRD' => __( 'Liberian Dollar', 'invoicing' ), |
|
| 101 | + 'LSL' => __( 'Lesotho Loti', 'invoicing' ), |
|
| 102 | + 'LYD' => __( 'Libyan Dinar', 'invoicing' ), |
|
| 103 | + 'MAD' => __( 'Moroccan Dirham', 'invoicing' ), |
|
| 104 | + 'MDL' => __( 'Moldovan Leu', 'invoicing' ), |
|
| 105 | + 'MGA' => __( 'Malagasy Ariary', 'invoicing' ), |
|
| 106 | + 'MKD' => __( 'Macedonian Denar', 'invoicing' ), |
|
| 107 | + 'MMK' => __( 'Burmese Kyat', 'invoicing' ), |
|
| 108 | + 'MNT' => __( 'Mongolian Tughrik', 'invoicing' ), |
|
| 109 | + 'MOP' => __( 'Macanese Pataca', 'invoicing' ), |
|
| 110 | + 'MRO' => __( 'Mauritanian Ouguiya', 'invoicing' ), |
|
| 111 | + 'MUR' => __( 'Mauritian Rupee', 'invoicing' ), |
|
| 112 | + 'MVR' => __( 'Maldivian Rufiyaa', 'invoicing' ), |
|
| 113 | + 'MWK' => __( 'Malawian Kwacha', 'invoicing' ), |
|
| 114 | + 'MXN' => __( 'Mexican Peso', 'invoicing' ), |
|
| 115 | + 'MYR' => __( 'Malaysian Ringgit', 'invoicing' ), |
|
| 116 | + 'MZN' => __( 'Mozambican Metical', 'invoicing' ), |
|
| 117 | + 'NAD' => __( 'Namibian Dollar', 'invoicing' ), |
|
| 118 | + 'NGN' => __( 'Nigerian Naira', 'invoicing' ), |
|
| 119 | + 'NIO' => __( 'Nicaraguan Cordoba', 'invoicing' ), |
|
| 120 | + 'NOK' => __( 'Norwegian Krone', 'invoicing' ), |
|
| 121 | + 'NPR' => __( 'Nepalese Rupee', 'invoicing' ), |
|
| 122 | + 'NZD' => __( 'New Zealand Dollar', 'invoicing' ), |
|
| 123 | + 'OMR' => __( 'Omani Rial', 'invoicing' ), |
|
| 124 | + 'PAB' => __( 'Panamanian Balboa', 'invoicing' ), |
|
| 125 | + 'PEN' => __( 'Peruvian Nuevo Sol', 'invoicing' ), |
|
| 126 | + 'PGK' => __( 'Papua New Guinean Kina', 'invoicing' ), |
|
| 127 | + 'PHP' => __( 'Philippine Peso', 'invoicing' ), |
|
| 128 | + 'PKR' => __( 'Pakistani Rupee', 'invoicing' ), |
|
| 129 | + 'PLN' => __( 'Polish Zloty', 'invoicing' ), |
|
| 130 | + 'PRB' => __( 'Transnistrian Ruble', 'invoicing' ), |
|
| 131 | + 'PYG' => __( 'Paraguayan Guarani', 'invoicing' ), |
|
| 132 | + 'QAR' => __( 'Qatari Riyal', 'invoicing' ), |
|
| 133 | + 'RON' => __( 'Romanian Leu', 'invoicing' ), |
|
| 134 | + 'RSD' => __( 'Serbian Dinar', 'invoicing' ), |
|
| 135 | + 'RUB' => __( 'Russian Ruble', 'invoicing' ), |
|
| 136 | + 'RWF' => __( 'Rwandan Franc', 'invoicing' ), |
|
| 137 | + 'SAR' => __( 'Saudi Riyal', 'invoicing' ), |
|
| 138 | + 'SBD' => __( 'Solomon Islands Dollar', 'invoicing' ), |
|
| 139 | + 'SCR' => __( 'Seychellois Rupee', 'invoicing' ), |
|
| 140 | + 'SDG' => __( 'Sudanese Pound', 'invoicing' ), |
|
| 141 | + 'SEK' => __( 'Swedish Krona', 'invoicing' ), |
|
| 142 | + 'SGD' => __( 'Singapore Dollar', 'invoicing' ), |
|
| 143 | + 'SHP' => __( 'Saint Helena Pound', 'invoicing' ), |
|
| 144 | + 'SLL' => __( 'Sierra Leonean Leone', 'invoicing' ), |
|
| 145 | + 'SOS' => __( 'Somali Shilling', 'invoicing' ), |
|
| 146 | + 'SRD' => __( 'Surinamese Dollar', 'invoicing' ), |
|
| 147 | + 'SSP' => __( 'South Sudanese Pound', 'invoicing' ), |
|
| 148 | + 'STD' => __( 'Sao Tomean Dobra', 'invoicing' ), |
|
| 149 | + 'SYP' => __( 'Syrian Pound', 'invoicing' ), |
|
| 150 | + 'SZL' => __( 'Swazi Lilangeni', 'invoicing' ), |
|
| 151 | + 'THB' => __( 'Thai Baht', 'invoicing' ), |
|
| 152 | + 'TJS' => __( 'Tajikistani Somoni', 'invoicing' ), |
|
| 153 | + 'TMT' => __( 'Turkmenistan Manat', 'invoicing' ), |
|
| 154 | + 'TND' => __( 'Tunisian Dinar', 'invoicing' ), |
|
| 155 | + 'TOP' => __( 'Tongan Paʻanga', 'invoicing' ), |
|
| 156 | + 'TRY' => __( 'Turkish Lira', 'invoicing' ), |
|
| 157 | + 'TTD' => __( 'Trinidad and Tobago Dollar', 'invoicing' ), |
|
| 158 | + 'TWD' => __( 'New Taiwan Dollar', 'invoicing' ), |
|
| 159 | + 'TZS' => __( 'Tanzanian Shilling', 'invoicing' ), |
|
| 160 | + 'UAH' => __( 'Ukrainian Hryvnia', 'invoicing' ), |
|
| 161 | + 'UGX' => __( 'Ugandan Shilling', 'invoicing' ), |
|
| 162 | + 'UYU' => __( 'Uruguayan Peso', 'invoicing' ), |
|
| 163 | + 'UZS' => __( 'Uzbekistani Som', 'invoicing' ), |
|
| 164 | + 'VEF' => __( 'Venezuelan Bolívar', 'invoicing' ), |
|
| 165 | + 'VND' => __( 'Vietnamese Dong', 'invoicing' ), |
|
| 166 | + 'VUV' => __( 'Vanuatu Vatu', 'invoicing' ), |
|
| 167 | + 'WST' => __( 'Samoan Tala', 'invoicing' ), |
|
| 168 | + 'XAF' => __( 'Central African CFA Franc', 'invoicing' ), |
|
| 169 | + 'XCD' => __( 'East Caribbean Dollar', 'invoicing' ), |
|
| 170 | + 'XOF' => __( 'West African CFA Franc', 'invoicing' ), |
|
| 171 | + 'XPF' => __( 'CFP Franc', 'invoicing' ), |
|
| 172 | + 'YER' => __( 'Yemeni Rial', 'invoicing' ), |
|
| 173 | + 'ZAR' => __( 'South African Rand', 'invoicing' ), |
|
| 174 | + 'ZMW' => __( 'Zambian Kwacha', 'invoicing' ), |
|
| 175 | 175 | ); |
@@ -13,240 +13,240 @@ |
||
| 13 | 13 | |
| 14 | 14 | return array( |
| 15 | 15 | |
| 16 | - 'id' => array( |
|
| 17 | - 'description' => __( 'Unique identifier for the item.', 'invoicing' ), |
|
| 18 | - 'type' => 'integer', |
|
| 19 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 20 | - 'readonly' => true, |
|
| 21 | - ), |
|
| 22 | - |
|
| 23 | - 'parent_id' => array( |
|
| 24 | - 'description' => __( 'Parent item ID.', 'invoicing' ), |
|
| 25 | - 'type' => 'integer', |
|
| 26 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 27 | - 'default' => 0, |
|
| 28 | - ), |
|
| 29 | - |
|
| 30 | - 'status' => array( |
|
| 31 | - 'description' => __( 'A named status for the item.', 'invoicing' ), |
|
| 32 | - 'type' => 'string', |
|
| 33 | - 'enum' => array( 'draft', 'pending', 'publish' ), |
|
| 34 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 35 | - 'default' => 'draft', |
|
| 36 | - ), |
|
| 37 | - |
|
| 38 | - 'version' => array( |
|
| 39 | - 'description' => __( 'Plugin version when the item was created.', 'invoicing' ), |
|
| 40 | - 'type' => 'string', |
|
| 41 | - 'context' => array( 'view', 'edit' ), |
|
| 42 | - 'readonly' => true, |
|
| 43 | - ), |
|
| 44 | - |
|
| 45 | - 'date_created' => array( |
|
| 46 | - 'description' => __( "The date the item was created, in the site's timezone.", 'invoicing' ), |
|
| 47 | - 'type' => 'string', |
|
| 48 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 49 | - ), |
|
| 50 | - |
|
| 51 | - 'date_created_gmt' => array( |
|
| 52 | - 'description' => __( 'The GMT date the item was created.', 'invoicing' ), |
|
| 53 | - 'type' => 'string', |
|
| 54 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 55 | - 'readonly' => true, |
|
| 56 | - ), |
|
| 57 | - |
|
| 58 | - 'date_modified' => array( |
|
| 59 | - 'description' => __( "The date the item was last modified, in the site's timezone.", 'invoicing' ), |
|
| 60 | - 'type' => 'string', |
|
| 61 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 62 | - 'readonly' => true, |
|
| 63 | - ), |
|
| 64 | - |
|
| 65 | - 'date_modified_gmt' => array( |
|
| 66 | - 'description' => __( 'The GMT date the item was last modified.', 'invoicing' ), |
|
| 67 | - 'type' => 'string', |
|
| 68 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 69 | - 'readonly' => true, |
|
| 70 | - ), |
|
| 71 | - |
|
| 72 | - 'name' => array( |
|
| 73 | - 'description' => __( "The item's name.", 'invoicing' ), |
|
| 74 | - 'type' => 'string', |
|
| 75 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 76 | - 'required' => true, |
|
| 77 | - ), |
|
| 78 | - |
|
| 79 | - 'description' => array( |
|
| 80 | - 'description' => __( "The item's description.", 'invoicing' ), |
|
| 81 | - 'type' => 'string', |
|
| 82 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 83 | - ), |
|
| 84 | - |
|
| 85 | - 'owner' => array( |
|
| 86 | - 'description' => __( 'The owner of the item (user id).', 'invoicing' ), |
|
| 87 | - 'type' => 'integer', |
|
| 88 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 89 | - ), |
|
| 90 | - |
|
| 91 | - 'price' => array( |
|
| 92 | - 'description' => __( 'The price of the item.', 'invoicing' ), |
|
| 93 | - 'type' => 'number', |
|
| 94 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 95 | - 'required' => true, |
|
| 96 | - ), |
|
| 97 | - |
|
| 98 | - 'the_price' => array( |
|
| 99 | - 'description' => __( 'The formatted price of the item.', 'invoicing' ), |
|
| 100 | - 'type' => 'string', |
|
| 101 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 102 | - 'readonly' => true, |
|
| 103 | - ), |
|
| 104 | - |
|
| 105 | - 'type' => array( |
|
| 106 | - 'description' => __( 'The item type.', 'invoicing' ), |
|
| 107 | - 'type' => 'string', |
|
| 108 | - 'enum' => wpinv_item_types(), |
|
| 109 | - 'default' => 'custom', |
|
| 110 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 111 | - ), |
|
| 112 | - |
|
| 113 | - 'vat_rule' => array( |
|
| 114 | - 'description' => __( 'VAT rule applied to the item.', 'invoicing' ), |
|
| 115 | - 'type' => 'string', |
|
| 116 | - 'enum' => array_keys( getpaid_tax()->get_rules() ), |
|
| 117 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 118 | - ), |
|
| 119 | - |
|
| 120 | - 'vat_class' => array( |
|
| 121 | - 'description' => __( 'VAT class for the item.', 'invoicing' ), |
|
| 122 | - 'type' => 'string', |
|
| 123 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 124 | - 'enum' => array_keys( getpaid_tax()->get_vat_groups() ), |
|
| 125 | - ), |
|
| 126 | - |
|
| 127 | - 'custom_id' => array( |
|
| 128 | - 'description' => __( 'Custom id for the item.', 'invoicing' ), |
|
| 129 | - 'type' => 'string', |
|
| 130 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 131 | - ), |
|
| 16 | + 'id' => array( |
|
| 17 | + 'description' => __( 'Unique identifier for the item.', 'invoicing' ), |
|
| 18 | + 'type' => 'integer', |
|
| 19 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 20 | + 'readonly' => true, |
|
| 21 | + ), |
|
| 22 | + |
|
| 23 | + 'parent_id' => array( |
|
| 24 | + 'description' => __( 'Parent item ID.', 'invoicing' ), |
|
| 25 | + 'type' => 'integer', |
|
| 26 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 27 | + 'default' => 0, |
|
| 28 | + ), |
|
| 29 | + |
|
| 30 | + 'status' => array( |
|
| 31 | + 'description' => __( 'A named status for the item.', 'invoicing' ), |
|
| 32 | + 'type' => 'string', |
|
| 33 | + 'enum' => array( 'draft', 'pending', 'publish' ), |
|
| 34 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 35 | + 'default' => 'draft', |
|
| 36 | + ), |
|
| 37 | + |
|
| 38 | + 'version' => array( |
|
| 39 | + 'description' => __( 'Plugin version when the item was created.', 'invoicing' ), |
|
| 40 | + 'type' => 'string', |
|
| 41 | + 'context' => array( 'view', 'edit' ), |
|
| 42 | + 'readonly' => true, |
|
| 43 | + ), |
|
| 44 | + |
|
| 45 | + 'date_created' => array( |
|
| 46 | + 'description' => __( "The date the item was created, in the site's timezone.", 'invoicing' ), |
|
| 47 | + 'type' => 'string', |
|
| 48 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 49 | + ), |
|
| 50 | + |
|
| 51 | + 'date_created_gmt' => array( |
|
| 52 | + 'description' => __( 'The GMT date the item was created.', 'invoicing' ), |
|
| 53 | + 'type' => 'string', |
|
| 54 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 55 | + 'readonly' => true, |
|
| 56 | + ), |
|
| 57 | + |
|
| 58 | + 'date_modified' => array( |
|
| 59 | + 'description' => __( "The date the item was last modified, in the site's timezone.", 'invoicing' ), |
|
| 60 | + 'type' => 'string', |
|
| 61 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 62 | + 'readonly' => true, |
|
| 63 | + ), |
|
| 64 | + |
|
| 65 | + 'date_modified_gmt' => array( |
|
| 66 | + 'description' => __( 'The GMT date the item was last modified.', 'invoicing' ), |
|
| 67 | + 'type' => 'string', |
|
| 68 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 69 | + 'readonly' => true, |
|
| 70 | + ), |
|
| 71 | + |
|
| 72 | + 'name' => array( |
|
| 73 | + 'description' => __( "The item's name.", 'invoicing' ), |
|
| 74 | + 'type' => 'string', |
|
| 75 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 76 | + 'required' => true, |
|
| 77 | + ), |
|
| 78 | + |
|
| 79 | + 'description' => array( |
|
| 80 | + 'description' => __( "The item's description.", 'invoicing' ), |
|
| 81 | + 'type' => 'string', |
|
| 82 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 83 | + ), |
|
| 84 | + |
|
| 85 | + 'owner' => array( |
|
| 86 | + 'description' => __( 'The owner of the item (user id).', 'invoicing' ), |
|
| 87 | + 'type' => 'integer', |
|
| 88 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 89 | + ), |
|
| 90 | + |
|
| 91 | + 'price' => array( |
|
| 92 | + 'description' => __( 'The price of the item.', 'invoicing' ), |
|
| 93 | + 'type' => 'number', |
|
| 94 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 95 | + 'required' => true, |
|
| 96 | + ), |
|
| 97 | + |
|
| 98 | + 'the_price' => array( |
|
| 99 | + 'description' => __( 'The formatted price of the item.', 'invoicing' ), |
|
| 100 | + 'type' => 'string', |
|
| 101 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 102 | + 'readonly' => true, |
|
| 103 | + ), |
|
| 104 | + |
|
| 105 | + 'type' => array( |
|
| 106 | + 'description' => __( 'The item type.', 'invoicing' ), |
|
| 107 | + 'type' => 'string', |
|
| 108 | + 'enum' => wpinv_item_types(), |
|
| 109 | + 'default' => 'custom', |
|
| 110 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 111 | + ), |
|
| 112 | + |
|
| 113 | + 'vat_rule' => array( |
|
| 114 | + 'description' => __( 'VAT rule applied to the item.', 'invoicing' ), |
|
| 115 | + 'type' => 'string', |
|
| 116 | + 'enum' => array_keys( getpaid_tax()->get_rules() ), |
|
| 117 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 118 | + ), |
|
| 119 | + |
|
| 120 | + 'vat_class' => array( |
|
| 121 | + 'description' => __( 'VAT class for the item.', 'invoicing' ), |
|
| 122 | + 'type' => 'string', |
|
| 123 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 124 | + 'enum' => array_keys( getpaid_tax()->get_vat_groups() ), |
|
| 125 | + ), |
|
| 126 | + |
|
| 127 | + 'custom_id' => array( |
|
| 128 | + 'description' => __( 'Custom id for the item.', 'invoicing' ), |
|
| 129 | + 'type' => 'string', |
|
| 130 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 131 | + ), |
|
| 132 | 132 | |
| 133 | - 'custom_name' => array( |
|
| 134 | - 'description' => __( 'Custom name for the item.', 'invoicing' ), |
|
| 135 | - 'type' => 'string', |
|
| 136 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 137 | - ), |
|
| 138 | - |
|
| 139 | - 'custom_singular_name' => array( |
|
| 140 | - 'description' => __( 'Custom singular name for the item.', 'invoicing' ), |
|
| 141 | - 'type' => 'string', |
|
| 142 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 143 | - ), |
|
| 144 | - |
|
| 145 | - 'is_editable' => array( |
|
| 146 | - 'description' => __( 'Whether or not the item is editable.', 'invoicing' ), |
|
| 147 | - 'type' => 'integer', |
|
| 148 | - 'enum' => array( 0, 1 ), |
|
| 149 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 150 | - ), |
|
| 151 | - |
|
| 152 | - 'is_dynamic_pricing' => array( |
|
| 153 | - 'description' => __( 'Whether or not customers can enter their own prices when checking out.', 'invoicing' ), |
|
| 154 | - 'type' => 'integer', |
|
| 155 | - 'enum' => array( 0, 1 ), |
|
| 156 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 157 | - ), |
|
| 158 | - |
|
| 159 | - 'minimum_price' => array( |
|
| 160 | - 'description' => __( 'For dynamic prices, this is the minimum price that a user can set.', 'invoicing' ), |
|
| 161 | - 'type' => 'number', |
|
| 162 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 163 | - ), |
|
| 164 | - |
|
| 165 | - 'is_recurring' => array( |
|
| 166 | - 'description' => __( 'Whether or not this is a subscription item.', 'invoicing' ), |
|
| 167 | - 'type' => 'integer', |
|
| 168 | - 'enum' => array( 0, 1 ), |
|
| 169 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 170 | - ), |
|
| 171 | - |
|
| 172 | - 'initial_price' => array( |
|
| 173 | - 'description' => __( 'The initial price of the item.', 'invoicing' ), |
|
| 174 | - 'type' => 'number', |
|
| 175 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 176 | - 'readonly' => true, |
|
| 177 | - ), |
|
| 178 | - |
|
| 179 | - 'the_initial_price' => array( |
|
| 180 | - 'description' => __( 'The formatted initial price of the item.', 'invoicing' ), |
|
| 181 | - 'type' => 'string', |
|
| 182 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 183 | - 'readonly' => true, |
|
| 184 | - ), |
|
| 185 | - |
|
| 186 | - 'recurring_price' => array( |
|
| 187 | - 'description' => __( 'The recurring price of the item.', 'invoicing' ), |
|
| 188 | - 'type' => 'number', |
|
| 189 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 190 | - 'readonly' => true, |
|
| 191 | - ), |
|
| 192 | - |
|
| 193 | - 'the_recurring_price' => array( |
|
| 194 | - 'description' => __( 'The formatted recurring price of the item.', 'invoicing' ), |
|
| 195 | - 'type' => 'string', |
|
| 196 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 197 | - 'readonly' => true, |
|
| 198 | - ), |
|
| 199 | - |
|
| 200 | - 'recurring_period' => array( |
|
| 201 | - 'description' => __( 'The recurring period for a recurring item.', 'invoicing' ), |
|
| 202 | - 'type' => 'string', |
|
| 203 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 204 | - 'enum' => array( 'D', 'W', 'M', 'Y' ), |
|
| 205 | - ), |
|
| 206 | - |
|
| 207 | - 'recurring_interval' => array( |
|
| 208 | - 'description' => __( 'The recurring interval for a subscription item.', 'invoicing' ), |
|
| 209 | - 'type' => 'integer', |
|
| 210 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 211 | - ), |
|
| 212 | - |
|
| 213 | - 'recurring_limit' => array( |
|
| 214 | - 'description' => __( 'The maximum number of renewals for a subscription item.', 'invoicing' ), |
|
| 215 | - 'type' => 'integer', |
|
| 216 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 217 | - ), |
|
| 218 | - |
|
| 219 | - 'is_free_trial' => array( |
|
| 220 | - 'description' => __( 'Whether the item has a free trial period.', 'invoicing' ), |
|
| 221 | - 'type' => 'integer', |
|
| 222 | - 'enum' => array( 0, 1 ), |
|
| 223 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 224 | - ), |
|
| 225 | - |
|
| 226 | - 'trial_period' => array( |
|
| 227 | - 'description' => __( 'The trial period.', 'invoicing' ), |
|
| 228 | - 'type' => 'string', |
|
| 229 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 230 | - 'enum' => array( 'D', 'W', 'M', 'Y' ), |
|
| 231 | - ), |
|
| 232 | - |
|
| 233 | - 'trial_interval' => array( |
|
| 234 | - 'description' => __( 'The trial interval.', 'invoicing' ), |
|
| 235 | - 'type' => 'integer', |
|
| 236 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 237 | - ), |
|
| 238 | - |
|
| 239 | - 'first_renewal_date' => array( |
|
| 240 | - 'description' => __( 'The first renewal date in case the item was to be bought today.', 'invoicing' ), |
|
| 241 | - 'type' => 'string', |
|
| 242 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 243 | - 'readonly' => true, |
|
| 244 | - ), |
|
| 245 | - |
|
| 246 | - 'edit_url' => array( |
|
| 247 | - 'description' => __( 'The URL to edit an item.', 'invoicing' ), |
|
| 248 | - 'type' => 'string', |
|
| 249 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 250 | - 'readonly' => true, |
|
| 251 | - ), |
|
| 133 | + 'custom_name' => array( |
|
| 134 | + 'description' => __( 'Custom name for the item.', 'invoicing' ), |
|
| 135 | + 'type' => 'string', |
|
| 136 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 137 | + ), |
|
| 138 | + |
|
| 139 | + 'custom_singular_name' => array( |
|
| 140 | + 'description' => __( 'Custom singular name for the item.', 'invoicing' ), |
|
| 141 | + 'type' => 'string', |
|
| 142 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 143 | + ), |
|
| 144 | + |
|
| 145 | + 'is_editable' => array( |
|
| 146 | + 'description' => __( 'Whether or not the item is editable.', 'invoicing' ), |
|
| 147 | + 'type' => 'integer', |
|
| 148 | + 'enum' => array( 0, 1 ), |
|
| 149 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 150 | + ), |
|
| 151 | + |
|
| 152 | + 'is_dynamic_pricing' => array( |
|
| 153 | + 'description' => __( 'Whether or not customers can enter their own prices when checking out.', 'invoicing' ), |
|
| 154 | + 'type' => 'integer', |
|
| 155 | + 'enum' => array( 0, 1 ), |
|
| 156 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 157 | + ), |
|
| 158 | + |
|
| 159 | + 'minimum_price' => array( |
|
| 160 | + 'description' => __( 'For dynamic prices, this is the minimum price that a user can set.', 'invoicing' ), |
|
| 161 | + 'type' => 'number', |
|
| 162 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 163 | + ), |
|
| 164 | + |
|
| 165 | + 'is_recurring' => array( |
|
| 166 | + 'description' => __( 'Whether or not this is a subscription item.', 'invoicing' ), |
|
| 167 | + 'type' => 'integer', |
|
| 168 | + 'enum' => array( 0, 1 ), |
|
| 169 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 170 | + ), |
|
| 171 | + |
|
| 172 | + 'initial_price' => array( |
|
| 173 | + 'description' => __( 'The initial price of the item.', 'invoicing' ), |
|
| 174 | + 'type' => 'number', |
|
| 175 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 176 | + 'readonly' => true, |
|
| 177 | + ), |
|
| 178 | + |
|
| 179 | + 'the_initial_price' => array( |
|
| 180 | + 'description' => __( 'The formatted initial price of the item.', 'invoicing' ), |
|
| 181 | + 'type' => 'string', |
|
| 182 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 183 | + 'readonly' => true, |
|
| 184 | + ), |
|
| 185 | + |
|
| 186 | + 'recurring_price' => array( |
|
| 187 | + 'description' => __( 'The recurring price of the item.', 'invoicing' ), |
|
| 188 | + 'type' => 'number', |
|
| 189 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 190 | + 'readonly' => true, |
|
| 191 | + ), |
|
| 192 | + |
|
| 193 | + 'the_recurring_price' => array( |
|
| 194 | + 'description' => __( 'The formatted recurring price of the item.', 'invoicing' ), |
|
| 195 | + 'type' => 'string', |
|
| 196 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 197 | + 'readonly' => true, |
|
| 198 | + ), |
|
| 199 | + |
|
| 200 | + 'recurring_period' => array( |
|
| 201 | + 'description' => __( 'The recurring period for a recurring item.', 'invoicing' ), |
|
| 202 | + 'type' => 'string', |
|
| 203 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 204 | + 'enum' => array( 'D', 'W', 'M', 'Y' ), |
|
| 205 | + ), |
|
| 206 | + |
|
| 207 | + 'recurring_interval' => array( |
|
| 208 | + 'description' => __( 'The recurring interval for a subscription item.', 'invoicing' ), |
|
| 209 | + 'type' => 'integer', |
|
| 210 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 211 | + ), |
|
| 212 | + |
|
| 213 | + 'recurring_limit' => array( |
|
| 214 | + 'description' => __( 'The maximum number of renewals for a subscription item.', 'invoicing' ), |
|
| 215 | + 'type' => 'integer', |
|
| 216 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 217 | + ), |
|
| 218 | + |
|
| 219 | + 'is_free_trial' => array( |
|
| 220 | + 'description' => __( 'Whether the item has a free trial period.', 'invoicing' ), |
|
| 221 | + 'type' => 'integer', |
|
| 222 | + 'enum' => array( 0, 1 ), |
|
| 223 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 224 | + ), |
|
| 225 | + |
|
| 226 | + 'trial_period' => array( |
|
| 227 | + 'description' => __( 'The trial period.', 'invoicing' ), |
|
| 228 | + 'type' => 'string', |
|
| 229 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 230 | + 'enum' => array( 'D', 'W', 'M', 'Y' ), |
|
| 231 | + ), |
|
| 232 | + |
|
| 233 | + 'trial_interval' => array( |
|
| 234 | + 'description' => __( 'The trial interval.', 'invoicing' ), |
|
| 235 | + 'type' => 'integer', |
|
| 236 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 237 | + ), |
|
| 238 | + |
|
| 239 | + 'first_renewal_date' => array( |
|
| 240 | + 'description' => __( 'The first renewal date in case the item was to be bought today.', 'invoicing' ), |
|
| 241 | + 'type' => 'string', |
|
| 242 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 243 | + 'readonly' => true, |
|
| 244 | + ), |
|
| 245 | + |
|
| 246 | + 'edit_url' => array( |
|
| 247 | + 'description' => __( 'The URL to edit an item.', 'invoicing' ), |
|
| 248 | + 'type' => 'string', |
|
| 249 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 250 | + 'readonly' => true, |
|
| 251 | + ), |
|
| 252 | 252 | ); |
@@ -15,172 +15,172 @@ |
||
| 15 | 15 | class WPInv_REST_Items_Controller extends GetPaid_REST_Posts_Controller { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Post type. |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - protected $post_type = 'wpi_item'; |
|
| 18 | + * Post type. |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + protected $post_type = 'wpi_item'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * The base of this controller's route. |
|
| 26 | - * |
|
| 27 | - * @since 1.0.13 |
|
| 28 | - * @var string |
|
| 29 | - */ |
|
| 30 | - protected $rest_base = 'items'; |
|
| 31 | - |
|
| 32 | - /** Contains this controller's class name. |
|
| 33 | - * |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - public $crud_class = 'WPInv_Item'; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Registers the routes for the objects of the controller. |
|
| 40 | - * |
|
| 41 | - * @since 1.0.19 |
|
| 42 | - * |
|
| 43 | - * @see register_rest_route() |
|
| 44 | - */ |
|
| 45 | - public function register_namespace_routes( $namespace ) { |
|
| 46 | - |
|
| 47 | - parent::register_namespace_routes( $namespace ); |
|
| 48 | - |
|
| 49 | - register_rest_route( |
|
| 50 | - $this->namespace, |
|
| 51 | - '/' . $this->rest_base . '/item-types', |
|
| 52 | - array( |
|
| 53 | - array( |
|
| 54 | - 'methods' => WP_REST_Server::READABLE, |
|
| 55 | - 'callback' => array( $this, 'get_item_types' ), |
|
| 56 | - 'permission_callback' => array( $this, 'get_items_permissions_check' ), |
|
| 57 | - ), |
|
| 58 | - ) |
|
| 59 | - ); |
|
| 60 | - |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Handles rest requests for item types. |
|
| 65 | - * |
|
| 66 | - * @since 1.0.13 |
|
| 67 | - * |
|
| 68 | - * |
|
| 69 | - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
|
| 70 | - */ |
|
| 71 | - public function get_item_types() { |
|
| 72 | - return rest_ensure_response( wpinv_get_item_types() ); |
|
| 73 | - } |
|
| 24 | + /** |
|
| 25 | + * The base of this controller's route. |
|
| 26 | + * |
|
| 27 | + * @since 1.0.13 |
|
| 28 | + * @var string |
|
| 29 | + */ |
|
| 30 | + protected $rest_base = 'items'; |
|
| 31 | + |
|
| 32 | + /** Contains this controller's class name. |
|
| 33 | + * |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + public $crud_class = 'WPInv_Item'; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Registers the routes for the objects of the controller. |
|
| 40 | + * |
|
| 41 | + * @since 1.0.19 |
|
| 42 | + * |
|
| 43 | + * @see register_rest_route() |
|
| 44 | + */ |
|
| 45 | + public function register_namespace_routes( $namespace ) { |
|
| 46 | + |
|
| 47 | + parent::register_namespace_routes( $namespace ); |
|
| 48 | + |
|
| 49 | + register_rest_route( |
|
| 50 | + $this->namespace, |
|
| 51 | + '/' . $this->rest_base . '/item-types', |
|
| 52 | + array( |
|
| 53 | + array( |
|
| 54 | + 'methods' => WP_REST_Server::READABLE, |
|
| 55 | + 'callback' => array( $this, 'get_item_types' ), |
|
| 56 | + 'permission_callback' => array( $this, 'get_items_permissions_check' ), |
|
| 57 | + ), |
|
| 58 | + ) |
|
| 59 | + ); |
|
| 60 | + |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Handles rest requests for item types. |
|
| 65 | + * |
|
| 66 | + * @since 1.0.13 |
|
| 67 | + * |
|
| 68 | + * |
|
| 69 | + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
|
| 70 | + */ |
|
| 71 | + public function get_item_types() { |
|
| 72 | + return rest_ensure_response( wpinv_get_item_types() ); |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Retrieves the query params for the items collection. |
|
| 77 | + * |
|
| 78 | + * @since 1.0.13 |
|
| 79 | + * |
|
| 80 | + * @return array Collection parameters. |
|
| 81 | + */ |
|
| 82 | + public function get_collection_params() { |
|
| 83 | + |
|
| 84 | + $params = array_merge( |
|
| 85 | + |
|
| 86 | + parent::get_collection_params(), |
|
| 87 | + |
|
| 88 | + array( |
|
| 89 | + |
|
| 90 | + // Item types |
|
| 91 | + 'type' => array( |
|
| 92 | + 'description' => __( 'Type of items to fetch.', 'invoicing' ), |
|
| 93 | + 'type' => array( 'array', 'string' ), |
|
| 94 | + 'default' => 'any', |
|
| 95 | + 'validate_callback' => 'rest_validate_request_arg', |
|
| 96 | + 'sanitize_callback' => 'wpinv_parse_list', |
|
| 97 | + 'items' => array( |
|
| 98 | + 'enum' => array_merge( array( 'any' ), wpinv_item_types() ), |
|
| 99 | + 'type' => 'string', |
|
| 100 | + ), |
|
| 101 | + ), |
|
| 102 | + |
|
| 103 | + ) |
|
| 104 | + ); |
|
| 105 | + |
|
| 106 | + // Filter collection parameters for the items controller. |
|
| 107 | + return apply_filters( 'getpaid_rest_items_collection_params', $params, $this ); |
|
| 108 | + |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Determine the allowed query_vars for a get_items() response and |
|
| 113 | + * prepare for WP_Query. |
|
| 114 | + * |
|
| 115 | + * @param array $prepared_args Prepared arguments. |
|
| 116 | + * @param WP_REST_Request $request Request object. |
|
| 117 | + * @return array $query_args |
|
| 118 | + */ |
|
| 119 | + protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 120 | + |
|
| 121 | + $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 122 | + |
|
| 123 | + // Retrieve items by type. |
|
| 124 | + if ( ! in_array( 'any', $request['type'] ) ) { |
|
| 125 | + |
|
| 126 | + if ( empty( $query_args['meta_query'] ) ) { |
|
| 127 | + $query_args['meta_query'] = array(); |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + $query_args['meta_query'][] = array( |
|
| 131 | + 'key' => '_wpinv_type', |
|
| 132 | + 'value' => implode( ',', $request['type'] ), |
|
| 133 | + 'compare' => 'IN', |
|
| 134 | + ); |
|
| 135 | + |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + return apply_filters( 'getpaid_rest_items_prepare_items_query', $query_args, $request, $this ); |
|
| 139 | + |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * Retrieves a valid list of post statuses. |
|
| 144 | + * |
|
| 145 | + * @since 1.0.15 |
|
| 146 | + * |
|
| 147 | + * @return array A list of registered item statuses. |
|
| 148 | + */ |
|
| 149 | + public function get_post_statuses() { |
|
| 150 | + return array( 'draft', 'pending', 'publish' ); |
|
| 151 | + } |
|
| 74 | 152 | |
| 75 | 153 | /** |
| 76 | - * Retrieves the query params for the items collection. |
|
| 77 | - * |
|
| 78 | - * @since 1.0.13 |
|
| 79 | - * |
|
| 80 | - * @return array Collection parameters. |
|
| 81 | - */ |
|
| 82 | - public function get_collection_params() { |
|
| 83 | - |
|
| 84 | - $params = array_merge( |
|
| 85 | - |
|
| 86 | - parent::get_collection_params(), |
|
| 87 | - |
|
| 88 | - array( |
|
| 89 | - |
|
| 90 | - // Item types |
|
| 91 | - 'type' => array( |
|
| 92 | - 'description' => __( 'Type of items to fetch.', 'invoicing' ), |
|
| 93 | - 'type' => array( 'array', 'string' ), |
|
| 94 | - 'default' => 'any', |
|
| 95 | - 'validate_callback' => 'rest_validate_request_arg', |
|
| 96 | - 'sanitize_callback' => 'wpinv_parse_list', |
|
| 97 | - 'items' => array( |
|
| 98 | - 'enum' => array_merge( array( 'any' ), wpinv_item_types() ), |
|
| 99 | - 'type' => 'string', |
|
| 100 | - ), |
|
| 101 | - ), |
|
| 102 | - |
|
| 103 | - ) |
|
| 104 | - ); |
|
| 105 | - |
|
| 106 | - // Filter collection parameters for the items controller. |
|
| 107 | - return apply_filters( 'getpaid_rest_items_collection_params', $params, $this ); |
|
| 108 | - |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Determine the allowed query_vars for a get_items() response and |
|
| 113 | - * prepare for WP_Query. |
|
| 114 | - * |
|
| 115 | - * @param array $prepared_args Prepared arguments. |
|
| 116 | - * @param WP_REST_Request $request Request object. |
|
| 117 | - * @return array $query_args |
|
| 118 | - */ |
|
| 119 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 120 | - |
|
| 121 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 122 | - |
|
| 123 | - // Retrieve items by type. |
|
| 124 | - if ( ! in_array( 'any', $request['type'] ) ) { |
|
| 125 | - |
|
| 126 | - if ( empty( $query_args['meta_query'] ) ) { |
|
| 127 | - $query_args['meta_query'] = array(); |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - $query_args['meta_query'][] = array( |
|
| 131 | - 'key' => '_wpinv_type', |
|
| 132 | - 'value' => implode( ',', $request['type'] ), |
|
| 133 | - 'compare' => 'IN', |
|
| 134 | - ); |
|
| 135 | - |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - return apply_filters( 'getpaid_rest_items_prepare_items_query', $query_args, $request, $this ); |
|
| 139 | - |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * Retrieves a valid list of post statuses. |
|
| 144 | - * |
|
| 145 | - * @since 1.0.15 |
|
| 146 | - * |
|
| 147 | - * @return array A list of registered item statuses. |
|
| 148 | - */ |
|
| 149 | - public function get_post_statuses() { |
|
| 150 | - return array( 'draft', 'pending', 'publish' ); |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Checks if a key should be included in a response. |
|
| 155 | - * |
|
| 156 | - * @since 1.0.19 |
|
| 157 | - * @param WPInv_Item $item Item object. |
|
| 158 | - * @param string $field_key The key to check for. |
|
| 159 | - * @return bool |
|
| 160 | - */ |
|
| 161 | - public function object_supports_field( $item, $field_key ) { |
|
| 162 | - |
|
| 163 | - if ( 'minimum_price' == $field_key && ! $item->user_can_set_their_price() ) { |
|
| 164 | - return false; |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - foreach( wpinv_parse_list( 'initial_price the_initial_price recurring_price the_recurring_price recurring_period recurring_interval recurring_limit is_free_trial trial_period trial_interval first_renewal_date' ) as $key ) { |
|
| 168 | - |
|
| 169 | - if ( $key == $field_key && ! $item->is_recurring() ) { |
|
| 170 | - return false; |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - foreach( wpinv_parse_list( 'trial_period trial_interval' ) as $key ) { |
|
| 176 | - |
|
| 177 | - if ( $key == $field_key && ! $item->has_free_trial() ) { |
|
| 178 | - return false; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - } |
|
| 154 | + * Checks if a key should be included in a response. |
|
| 155 | + * |
|
| 156 | + * @since 1.0.19 |
|
| 157 | + * @param WPInv_Item $item Item object. |
|
| 158 | + * @param string $field_key The key to check for. |
|
| 159 | + * @return bool |
|
| 160 | + */ |
|
| 161 | + public function object_supports_field( $item, $field_key ) { |
|
| 162 | + |
|
| 163 | + if ( 'minimum_price' == $field_key && ! $item->user_can_set_their_price() ) { |
|
| 164 | + return false; |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + foreach( wpinv_parse_list( 'initial_price the_initial_price recurring_price the_recurring_price recurring_period recurring_interval recurring_limit is_free_trial trial_period trial_interval first_renewal_date' ) as $key ) { |
|
| 168 | + |
|
| 169 | + if ( $key == $field_key && ! $item->is_recurring() ) { |
|
| 170 | + return false; |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + foreach( wpinv_parse_list( 'trial_period trial_interval' ) as $key ) { |
|
| 176 | + |
|
| 177 | + if ( $key == $field_key && ! $item->has_free_trial() ) { |
|
| 178 | + return false; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | - return parent::object_supports_field( $item, $field_key ); |
|
| 184 | - } |
|
| 183 | + return parent::object_supports_field( $item, $field_key ); |
|
| 184 | + } |
|
| 185 | 185 | |
| 186 | 186 | } |
@@ -15,138 +15,138 @@ |
||
| 15 | 15 | class WPInv_REST_Discounts_Controller extends GetPaid_REST_Posts_Controller { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Post type. |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - protected $post_type = 'wpi_discount'; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * The base of this controller's route. |
|
| 26 | - * |
|
| 27 | - * @since 1.0.13 |
|
| 28 | - * @var string |
|
| 29 | - */ |
|
| 30 | - protected $rest_base = 'discounts'; |
|
| 31 | - |
|
| 32 | - /** Contains this controller's class name. |
|
| 33 | - * |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - public $crud_class = 'WPInv_Discount'; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Registers the routes for the objects of the controller. |
|
| 40 | - * |
|
| 41 | - * @since 1.0.19 |
|
| 42 | - * |
|
| 43 | - * @see register_rest_route() |
|
| 44 | - */ |
|
| 45 | - public function register_namespace_routes( $namespace ) { |
|
| 46 | - |
|
| 47 | - parent::register_namespace_routes( $namespace ); |
|
| 48 | - |
|
| 49 | - register_rest_route( |
|
| 50 | - $this->namespace, |
|
| 51 | - '/' . $this->rest_base . '/discount-types', |
|
| 52 | - array( |
|
| 53 | - array( |
|
| 54 | - 'methods' => WP_REST_Server::READABLE, |
|
| 55 | - 'callback' => array( $this, 'get_discount_types' ), |
|
| 56 | - 'permission_callback' => array( $this, 'get_items_permissions_check' ), |
|
| 57 | - ), |
|
| 58 | - ) |
|
| 59 | - ); |
|
| 60 | - |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Handles rest requests for discount types. |
|
| 65 | - * |
|
| 66 | - * @since 1.0.13 |
|
| 67 | - * |
|
| 68 | - * |
|
| 69 | - * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
|
| 70 | - */ |
|
| 71 | - public function get_discount_types() { |
|
| 72 | - return rest_ensure_response( wpinv_get_discount_types() ); |
|
| 73 | - } |
|
| 18 | + * Post type. |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + protected $post_type = 'wpi_discount'; |
|
| 74 | 23 | |
| 75 | 24 | /** |
| 76 | - * Retrieves the query params for the discount collection. |
|
| 77 | - * |
|
| 78 | - * @since 1.0.13 |
|
| 79 | - * |
|
| 80 | - * @return array Collection parameters. |
|
| 81 | - */ |
|
| 82 | - public function get_collection_params() { |
|
| 83 | - |
|
| 84 | - $params = array_merge( |
|
| 85 | - |
|
| 86 | - parent::get_collection_params(), |
|
| 87 | - |
|
| 88 | - array( |
|
| 89 | - |
|
| 90 | - // Discount types |
|
| 91 | - 'type' => array( |
|
| 92 | - 'description' => __( 'Type of discounts to fetch.', 'invoicing' ), |
|
| 93 | - 'type' => array( 'array', 'string' ), |
|
| 94 | - 'default' => 'any', |
|
| 95 | - 'validate_callback' => 'rest_validate_request_arg', |
|
| 96 | - 'sanitize_callback' => 'wpinv_parse_list', |
|
| 97 | - 'items' => array( |
|
| 98 | - 'enum' => array_merge( array( 'any' ), array_keys( wpinv_get_discount_types() ) ), |
|
| 99 | - 'type' => 'string', |
|
| 100 | - ), |
|
| 101 | - ), |
|
| 102 | - |
|
| 103 | - ) |
|
| 104 | - ); |
|
| 105 | - |
|
| 106 | - // Filter collection parameters for the discounts controller. |
|
| 107 | - return apply_filters( 'getpaid_rest_discounts_collection_params', $params, $this ); |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * Determine the allowed query_vars for a get_items() response and |
|
| 112 | - * prepare for WP_Query. |
|
| 113 | - * |
|
| 114 | - * @param array $prepared_args Prepared arguments. |
|
| 115 | - * @param WP_REST_Request $request Request object. |
|
| 116 | - * @return array $query_args |
|
| 117 | - */ |
|
| 118 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 119 | - |
|
| 120 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 121 | - |
|
| 122 | - // Retrieve items by type. |
|
| 123 | - if ( ! in_array( 'any', $request['type'] ) ) { |
|
| 124 | - |
|
| 125 | - if ( empty( $query_args['meta_query'] ) ) { |
|
| 126 | - $query_args['meta_query'] = array(); |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - $query_args['meta_query'][] = array( |
|
| 130 | - 'key' => '_wpi_discount_type', |
|
| 131 | - 'value' => implode( ',', $request['type'] ), |
|
| 132 | - 'compare' => 'IN', |
|
| 133 | - ); |
|
| 134 | - |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - return apply_filters( 'getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this ); |
|
| 138 | - |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * Retrieves a valid list of post statuses. |
|
| 143 | - * |
|
| 144 | - * @since 1.0.15 |
|
| 145 | - * |
|
| 146 | - * @return array A list of registered item statuses. |
|
| 147 | - */ |
|
| 148 | - public function get_post_statuses() { |
|
| 149 | - return array( 'publish', 'pending', 'draft', 'expired' ); |
|
| 150 | - } |
|
| 25 | + * The base of this controller's route. |
|
| 26 | + * |
|
| 27 | + * @since 1.0.13 |
|
| 28 | + * @var string |
|
| 29 | + */ |
|
| 30 | + protected $rest_base = 'discounts'; |
|
| 31 | + |
|
| 32 | + /** Contains this controller's class name. |
|
| 33 | + * |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + public $crud_class = 'WPInv_Discount'; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Registers the routes for the objects of the controller. |
|
| 40 | + * |
|
| 41 | + * @since 1.0.19 |
|
| 42 | + * |
|
| 43 | + * @see register_rest_route() |
|
| 44 | + */ |
|
| 45 | + public function register_namespace_routes( $namespace ) { |
|
| 46 | + |
|
| 47 | + parent::register_namespace_routes( $namespace ); |
|
| 48 | + |
|
| 49 | + register_rest_route( |
|
| 50 | + $this->namespace, |
|
| 51 | + '/' . $this->rest_base . '/discount-types', |
|
| 52 | + array( |
|
| 53 | + array( |
|
| 54 | + 'methods' => WP_REST_Server::READABLE, |
|
| 55 | + 'callback' => array( $this, 'get_discount_types' ), |
|
| 56 | + 'permission_callback' => array( $this, 'get_items_permissions_check' ), |
|
| 57 | + ), |
|
| 58 | + ) |
|
| 59 | + ); |
|
| 60 | + |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Handles rest requests for discount types. |
|
| 65 | + * |
|
| 66 | + * @since 1.0.13 |
|
| 67 | + * |
|
| 68 | + * |
|
| 69 | + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. |
|
| 70 | + */ |
|
| 71 | + public function get_discount_types() { |
|
| 72 | + return rest_ensure_response( wpinv_get_discount_types() ); |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Retrieves the query params for the discount collection. |
|
| 77 | + * |
|
| 78 | + * @since 1.0.13 |
|
| 79 | + * |
|
| 80 | + * @return array Collection parameters. |
|
| 81 | + */ |
|
| 82 | + public function get_collection_params() { |
|
| 83 | + |
|
| 84 | + $params = array_merge( |
|
| 85 | + |
|
| 86 | + parent::get_collection_params(), |
|
| 87 | + |
|
| 88 | + array( |
|
| 89 | + |
|
| 90 | + // Discount types |
|
| 91 | + 'type' => array( |
|
| 92 | + 'description' => __( 'Type of discounts to fetch.', 'invoicing' ), |
|
| 93 | + 'type' => array( 'array', 'string' ), |
|
| 94 | + 'default' => 'any', |
|
| 95 | + 'validate_callback' => 'rest_validate_request_arg', |
|
| 96 | + 'sanitize_callback' => 'wpinv_parse_list', |
|
| 97 | + 'items' => array( |
|
| 98 | + 'enum' => array_merge( array( 'any' ), array_keys( wpinv_get_discount_types() ) ), |
|
| 99 | + 'type' => 'string', |
|
| 100 | + ), |
|
| 101 | + ), |
|
| 102 | + |
|
| 103 | + ) |
|
| 104 | + ); |
|
| 105 | + |
|
| 106 | + // Filter collection parameters for the discounts controller. |
|
| 107 | + return apply_filters( 'getpaid_rest_discounts_collection_params', $params, $this ); |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * Determine the allowed query_vars for a get_items() response and |
|
| 112 | + * prepare for WP_Query. |
|
| 113 | + * |
|
| 114 | + * @param array $prepared_args Prepared arguments. |
|
| 115 | + * @param WP_REST_Request $request Request object. |
|
| 116 | + * @return array $query_args |
|
| 117 | + */ |
|
| 118 | + protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 119 | + |
|
| 120 | + $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 121 | + |
|
| 122 | + // Retrieve items by type. |
|
| 123 | + if ( ! in_array( 'any', $request['type'] ) ) { |
|
| 124 | + |
|
| 125 | + if ( empty( $query_args['meta_query'] ) ) { |
|
| 126 | + $query_args['meta_query'] = array(); |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + $query_args['meta_query'][] = array( |
|
| 130 | + 'key' => '_wpi_discount_type', |
|
| 131 | + 'value' => implode( ',', $request['type'] ), |
|
| 132 | + 'compare' => 'IN', |
|
| 133 | + ); |
|
| 134 | + |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + return apply_filters( 'getpaid_rest_discounts_prepare_items_query', $query_args, $request, $this ); |
|
| 138 | + |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * Retrieves a valid list of post statuses. |
|
| 143 | + * |
|
| 144 | + * @since 1.0.15 |
|
| 145 | + * |
|
| 146 | + * @return array A list of registered item statuses. |
|
| 147 | + */ |
|
| 148 | + public function get_post_statuses() { |
|
| 149 | + return array( 'publish', 'pending', 'draft', 'expired' ); |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | 152 | } |
@@ -13,168 +13,168 @@ |
||
| 13 | 13 | |
| 14 | 14 | return array( |
| 15 | 15 | |
| 16 | - 'id' => array( |
|
| 17 | - 'description' => __( 'Unique identifier for the discount.', 'invoicing' ), |
|
| 18 | - 'type' => 'integer', |
|
| 19 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 20 | - 'readonly' => true, |
|
| 21 | - ), |
|
| 22 | - |
|
| 23 | - 'status' => array( |
|
| 24 | - 'description' => __( 'A named status for the discount.', 'invoicing' ), |
|
| 25 | - 'type' => 'string', |
|
| 26 | - 'enum' => array( 'publish', 'pending', 'draft', 'expired' ), |
|
| 27 | - 'default' => 'draft', |
|
| 28 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 29 | - ), |
|
| 30 | - |
|
| 31 | - 'version' => array( |
|
| 32 | - 'description' => __( 'Plugin version when the discount was created.', 'invoicing' ), |
|
| 33 | - 'type' => 'string', |
|
| 34 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 35 | - 'readonly' => true, |
|
| 36 | - ), |
|
| 37 | - |
|
| 38 | - 'date_created' => array( |
|
| 39 | - 'description' => __( "The date the discount was created, in the site's timezone.", 'invoicing' ), |
|
| 40 | - 'type' => 'string', |
|
| 41 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 42 | - ), |
|
| 43 | - |
|
| 44 | - 'date_created_gmt' => array( |
|
| 45 | - 'description' => __( 'The GMT date the discount was created.', 'invoicing' ), |
|
| 46 | - 'type' => 'string', |
|
| 47 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 48 | - 'readonly' => true, |
|
| 49 | - ), |
|
| 50 | - |
|
| 51 | - 'date_modified' => array( |
|
| 52 | - 'description' => __( "The date the discount was last modified, in the site's timezone.", 'invoicing' ), |
|
| 53 | - 'type' => 'string', |
|
| 54 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 55 | - 'readonly' => true, |
|
| 56 | - ), |
|
| 57 | - |
|
| 58 | - 'date_modified_gmt' => array( |
|
| 59 | - 'description' => __( 'The GMT date the discount was last modified.', 'invoicing' ), |
|
| 60 | - 'type' => 'string', |
|
| 61 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 62 | - 'readonly' => true, |
|
| 63 | - ), |
|
| 64 | - |
|
| 65 | - 'name' => array( |
|
| 66 | - 'description' => __( 'The discount name.', 'invoicing' ), |
|
| 67 | - 'type' => 'string', |
|
| 68 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 69 | - ), |
|
| 70 | - |
|
| 71 | - 'description' => array( |
|
| 72 | - 'description' => __( 'A description of what the discount is all about.', 'invoicing' ), |
|
| 73 | - 'type' => 'string', |
|
| 74 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 75 | - ), |
|
| 76 | - |
|
| 77 | - 'code' => array( |
|
| 78 | - 'description' => __( 'The discount code.', 'invoicing' ), |
|
| 79 | - 'type' => 'string', |
|
| 80 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 81 | - 'required' => true, |
|
| 82 | - ), |
|
| 83 | - |
|
| 84 | - 'type' => array( |
|
| 85 | - 'description' => __( 'The type of discount.', 'invoicing' ), |
|
| 86 | - 'type' => 'string', |
|
| 87 | - 'enum' => array_keys( wpinv_get_discount_types() ), |
|
| 88 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 89 | - 'default' => 'percent', |
|
| 90 | - ), |
|
| 91 | - |
|
| 92 | - 'amount' => array( |
|
| 93 | - 'description' => __( 'The discount value.', 'invoicing' ), |
|
| 94 | - 'type' => 'number', |
|
| 95 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 96 | - 'required' => true, |
|
| 97 | - ), |
|
| 98 | - |
|
| 99 | - 'formatted_amount' => array( |
|
| 100 | - 'description' => __( 'The formatted discount value.', 'invoicing' ), |
|
| 101 | - 'type' => 'string', |
|
| 102 | - 'context' => array( 'view', 'edit', 'embed' ), |
|
| 103 | - 'readonly' => true, |
|
| 104 | - ), |
|
| 105 | - |
|
| 106 | - 'uses' => array( |
|
| 107 | - 'description' => __( 'The number of times the discount has been used.', 'invoicing' ), |
|
| 108 | - 'type' => 'integer', |
|
| 109 | - 'context' => array( 'view', 'embed' ), |
|
| 110 | - 'readonly' => true, |
|
| 111 | - ), |
|
| 112 | - |
|
| 113 | - 'max_uses' => array( |
|
| 114 | - 'description' => __( 'The maximum number of times the discount can be used.', 'invoicing' ), |
|
| 115 | - 'type' => 'integer', |
|
| 116 | - 'context' => array( 'view', 'edit' ), |
|
| 117 | - ), |
|
| 118 | - |
|
| 119 | - 'usage' => array( |
|
| 120 | - 'description' => __( "The discount's usage, i.e uses / max uses.", 'invoicing' ), |
|
| 121 | - 'type' => 'string', |
|
| 122 | - 'context' => array( 'view', 'embed' ), |
|
| 123 | - 'readonly' => true, |
|
| 124 | - ), |
|
| 125 | - |
|
| 126 | - 'is_single_use' => array( |
|
| 127 | - 'description' => __( 'Whether or not the discount can only be used once per user.', 'invoicing' ), |
|
| 128 | - 'type' => 'boolean', |
|
| 129 | - 'context' => array( 'view', 'edit' ), |
|
| 130 | - ), |
|
| 131 | - |
|
| 132 | - 'is_recurring' => array( |
|
| 133 | - 'description' => __( 'Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing' ), |
|
| 134 | - 'type' => 'boolean', |
|
| 135 | - 'context' => array( 'view', 'edit' ), |
|
| 136 | - ), |
|
| 137 | - |
|
| 138 | - 'start_date' => array( |
|
| 139 | - 'description' => __( 'The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing' ), |
|
| 140 | - 'type' => 'string', |
|
| 141 | - 'context' => array( 'view', 'edit' ), |
|
| 142 | - ), |
|
| 143 | - |
|
| 144 | - 'end_date' => array( |
|
| 145 | - 'description' => __( 'The expiration date for the discount.', 'invoicing' ), |
|
| 146 | - 'type' => 'string', |
|
| 147 | - 'context' => array( 'view', 'edit' ), |
|
| 148 | - ), |
|
| 149 | - |
|
| 150 | - 'allowed_items' => array( |
|
| 151 | - 'description' => __( 'Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing' ), |
|
| 152 | - 'type' => 'array', |
|
| 153 | - 'context' => array( 'view', 'edit' ), |
|
| 154 | - 'items' => array( |
|
| 155 | - 'type' => 'integer' |
|
| 156 | - ) |
|
| 157 | - ), |
|
| 158 | - |
|
| 159 | - 'excluded_items' => array( |
|
| 160 | - 'description' => __( 'Items which are NOT allowed to use this discount.', 'invoicing' ), |
|
| 161 | - 'type' => 'array', |
|
| 162 | - 'context' => array( 'view', 'edit' ), |
|
| 163 | - 'items' => array( |
|
| 164 | - 'type' => 'integer' |
|
| 165 | - ) |
|
| 166 | - ), |
|
| 16 | + 'id' => array( |
|
| 17 | + 'description' => __( 'Unique identifier for the discount.', 'invoicing' ), |
|
| 18 | + 'type' => 'integer', |
|
| 19 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 20 | + 'readonly' => true, |
|
| 21 | + ), |
|
| 22 | + |
|
| 23 | + 'status' => array( |
|
| 24 | + 'description' => __( 'A named status for the discount.', 'invoicing' ), |
|
| 25 | + 'type' => 'string', |
|
| 26 | + 'enum' => array( 'publish', 'pending', 'draft', 'expired' ), |
|
| 27 | + 'default' => 'draft', |
|
| 28 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 29 | + ), |
|
| 30 | + |
|
| 31 | + 'version' => array( |
|
| 32 | + 'description' => __( 'Plugin version when the discount was created.', 'invoicing' ), |
|
| 33 | + 'type' => 'string', |
|
| 34 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 35 | + 'readonly' => true, |
|
| 36 | + ), |
|
| 37 | + |
|
| 38 | + 'date_created' => array( |
|
| 39 | + 'description' => __( "The date the discount was created, in the site's timezone.", 'invoicing' ), |
|
| 40 | + 'type' => 'string', |
|
| 41 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 42 | + ), |
|
| 43 | + |
|
| 44 | + 'date_created_gmt' => array( |
|
| 45 | + 'description' => __( 'The GMT date the discount was created.', 'invoicing' ), |
|
| 46 | + 'type' => 'string', |
|
| 47 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 48 | + 'readonly' => true, |
|
| 49 | + ), |
|
| 50 | + |
|
| 51 | + 'date_modified' => array( |
|
| 52 | + 'description' => __( "The date the discount was last modified, in the site's timezone.", 'invoicing' ), |
|
| 53 | + 'type' => 'string', |
|
| 54 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 55 | + 'readonly' => true, |
|
| 56 | + ), |
|
| 57 | + |
|
| 58 | + 'date_modified_gmt' => array( |
|
| 59 | + 'description' => __( 'The GMT date the discount was last modified.', 'invoicing' ), |
|
| 60 | + 'type' => 'string', |
|
| 61 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 62 | + 'readonly' => true, |
|
| 63 | + ), |
|
| 64 | + |
|
| 65 | + 'name' => array( |
|
| 66 | + 'description' => __( 'The discount name.', 'invoicing' ), |
|
| 67 | + 'type' => 'string', |
|
| 68 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 69 | + ), |
|
| 70 | + |
|
| 71 | + 'description' => array( |
|
| 72 | + 'description' => __( 'A description of what the discount is all about.', 'invoicing' ), |
|
| 73 | + 'type' => 'string', |
|
| 74 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 75 | + ), |
|
| 76 | + |
|
| 77 | + 'code' => array( |
|
| 78 | + 'description' => __( 'The discount code.', 'invoicing' ), |
|
| 79 | + 'type' => 'string', |
|
| 80 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 81 | + 'required' => true, |
|
| 82 | + ), |
|
| 83 | + |
|
| 84 | + 'type' => array( |
|
| 85 | + 'description' => __( 'The type of discount.', 'invoicing' ), |
|
| 86 | + 'type' => 'string', |
|
| 87 | + 'enum' => array_keys( wpinv_get_discount_types() ), |
|
| 88 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 89 | + 'default' => 'percent', |
|
| 90 | + ), |
|
| 91 | + |
|
| 92 | + 'amount' => array( |
|
| 93 | + 'description' => __( 'The discount value.', 'invoicing' ), |
|
| 94 | + 'type' => 'number', |
|
| 95 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 96 | + 'required' => true, |
|
| 97 | + ), |
|
| 98 | + |
|
| 99 | + 'formatted_amount' => array( |
|
| 100 | + 'description' => __( 'The formatted discount value.', 'invoicing' ), |
|
| 101 | + 'type' => 'string', |
|
| 102 | + 'context' => array( 'view', 'edit', 'embed' ), |
|
| 103 | + 'readonly' => true, |
|
| 104 | + ), |
|
| 105 | + |
|
| 106 | + 'uses' => array( |
|
| 107 | + 'description' => __( 'The number of times the discount has been used.', 'invoicing' ), |
|
| 108 | + 'type' => 'integer', |
|
| 109 | + 'context' => array( 'view', 'embed' ), |
|
| 110 | + 'readonly' => true, |
|
| 111 | + ), |
|
| 112 | + |
|
| 113 | + 'max_uses' => array( |
|
| 114 | + 'description' => __( 'The maximum number of times the discount can be used.', 'invoicing' ), |
|
| 115 | + 'type' => 'integer', |
|
| 116 | + 'context' => array( 'view', 'edit' ), |
|
| 117 | + ), |
|
| 118 | + |
|
| 119 | + 'usage' => array( |
|
| 120 | + 'description' => __( "The discount's usage, i.e uses / max uses.", 'invoicing' ), |
|
| 121 | + 'type' => 'string', |
|
| 122 | + 'context' => array( 'view', 'embed' ), |
|
| 123 | + 'readonly' => true, |
|
| 124 | + ), |
|
| 125 | + |
|
| 126 | + 'is_single_use' => array( |
|
| 127 | + 'description' => __( 'Whether or not the discount can only be used once per user.', 'invoicing' ), |
|
| 128 | + 'type' => 'boolean', |
|
| 129 | + 'context' => array( 'view', 'edit' ), |
|
| 130 | + ), |
|
| 131 | + |
|
| 132 | + 'is_recurring' => array( |
|
| 133 | + 'description' => __( 'Whether or not the discount applies to the initial payment only or all recurring payments.', 'invoicing' ), |
|
| 134 | + 'type' => 'boolean', |
|
| 135 | + 'context' => array( 'view', 'edit' ), |
|
| 136 | + ), |
|
| 137 | + |
|
| 138 | + 'start_date' => array( |
|
| 139 | + 'description' => __( 'The start date for the discount in the format of yyyy-mm-dd hh:mm:ss. If provided, the discount can only be used after or on this date.', 'invoicing' ), |
|
| 140 | + 'type' => 'string', |
|
| 141 | + 'context' => array( 'view', 'edit' ), |
|
| 142 | + ), |
|
| 143 | + |
|
| 144 | + 'end_date' => array( |
|
| 145 | + 'description' => __( 'The expiration date for the discount.', 'invoicing' ), |
|
| 146 | + 'type' => 'string', |
|
| 147 | + 'context' => array( 'view', 'edit' ), |
|
| 148 | + ), |
|
| 149 | + |
|
| 150 | + 'allowed_items' => array( |
|
| 151 | + 'description' => __( 'Items which are allowed to use this discount. Leave blank to enable for all items.', 'invoicing' ), |
|
| 152 | + 'type' => 'array', |
|
| 153 | + 'context' => array( 'view', 'edit' ), |
|
| 154 | + 'items' => array( |
|
| 155 | + 'type' => 'integer' |
|
| 156 | + ) |
|
| 157 | + ), |
|
| 158 | + |
|
| 159 | + 'excluded_items' => array( |
|
| 160 | + 'description' => __( 'Items which are NOT allowed to use this discount.', 'invoicing' ), |
|
| 161 | + 'type' => 'array', |
|
| 162 | + 'context' => array( 'view', 'edit' ), |
|
| 163 | + 'items' => array( |
|
| 164 | + 'type' => 'integer' |
|
| 165 | + ) |
|
| 166 | + ), |
|
| 167 | 167 | |
| 168 | - 'minimum_total' => array( |
|
| 169 | - 'description' => __( 'The minimum total needed to use this invoice.', 'invoicing' ), |
|
| 170 | - 'type' => 'number', |
|
| 171 | - 'context' => array( 'view', 'edit' ), |
|
| 172 | - ), |
|
| 173 | - |
|
| 174 | - 'maximum_total' => array( |
|
| 175 | - 'description' => __( 'The maximum total needed to use this invoice.', 'invoicing' ), |
|
| 176 | - 'type' => 'number', |
|
| 177 | - 'context' => array( 'view', 'edit' ), |
|
| 178 | - ), |
|
| 168 | + 'minimum_total' => array( |
|
| 169 | + 'description' => __( 'The minimum total needed to use this invoice.', 'invoicing' ), |
|
| 170 | + 'type' => 'number', |
|
| 171 | + 'context' => array( 'view', 'edit' ), |
|
| 172 | + ), |
|
| 173 | + |
|
| 174 | + 'maximum_total' => array( |
|
| 175 | + 'description' => __( 'The maximum total needed to use this invoice.', 'invoicing' ), |
|
| 176 | + 'type' => 'number', |
|
| 177 | + 'context' => array( 'view', 'edit' ), |
|
| 178 | + ), |
|
| 179 | 179 | |
| 180 | 180 | ); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 4 | - exit; |
|
| 4 | + exit; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | global $wpdb; |
@@ -19,16 +19,16 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // Define constants. |
| 21 | 21 | if ( ! defined( 'WPINV_PLUGIN_FILE' ) ) { |
| 22 | - define( 'WPINV_PLUGIN_FILE', __FILE__ ); |
|
| 22 | + define( 'WPINV_PLUGIN_FILE', __FILE__ ); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | if ( ! defined( 'WPINV_VERSION' ) ) { |
| 26 | - define( 'WPINV_VERSION', '1.0.19' ); |
|
| 26 | + define( 'WPINV_VERSION', '1.0.19' ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // Include the main Invoicing class. |
| 30 | 30 | if ( ! class_exists( 'WPInv_Plugin', false ) ) { |
| 31 | - require_once plugin_dir_path( WPINV_PLUGIN_FILE ) . 'includes/class-wpinv.php'; |
|
| 31 | + require_once plugin_dir_path( WPINV_PLUGIN_FILE ) . 'includes/class-wpinv.php'; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $GLOBALS['invoicing'] = new WPInv_Plugin(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return $GLOBALS['invoicing']; |
|
| 46 | + return $GLOBALS['invoicing']; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -15,322 +15,322 @@ |
||
| 15 | 15 | class GetPaid_Post_Types { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Hook in methods. |
|
| 19 | - */ |
|
| 20 | - public function __construct() { |
|
| 21 | - add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 ); |
|
| 22 | - add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 ); |
|
| 23 | - add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) ); |
|
| 24 | - add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) ); |
|
| 25 | - } |
|
| 18 | + * Hook in methods. |
|
| 19 | + */ |
|
| 20 | + public function __construct() { |
|
| 21 | + add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 ); |
|
| 22 | + add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 ); |
|
| 23 | + add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) ); |
|
| 24 | + add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) ); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Register core post types. |
|
| 29 | - */ |
|
| 30 | - public static function register_post_types() { |
|
| 27 | + /** |
|
| 28 | + * Register core post types. |
|
| 29 | + */ |
|
| 30 | + public static function register_post_types() { |
|
| 31 | 31 | |
| 32 | - if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) { |
|
| 33 | - return; |
|
| 34 | - } |
|
| 32 | + if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) { |
|
| 33 | + return; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - // Fires before registering post types. |
|
| 37 | - do_action( 'getpaid_register_post_types' ); |
|
| 36 | + // Fires before registering post types. |
|
| 37 | + do_action( 'getpaid_register_post_types' ); |
|
| 38 | 38 | |
| 39 | - // Register item post type. |
|
| 40 | - register_post_type( |
|
| 41 | - 'wpi_item', |
|
| 42 | - apply_filters( |
|
| 43 | - 'wpinv_register_post_type_invoice_item', |
|
| 44 | - array( |
|
| 45 | - 'labels' => array( |
|
| 46 | - 'name' => _x( 'Items', 'post type general name', 'invoicing' ), |
|
| 47 | - 'singular_name' => _x( 'Item', 'post type singular name', 'invoicing' ), |
|
| 48 | - 'menu_name' => _x( 'Items', 'admin menu', 'invoicing' ), |
|
| 49 | - 'name_admin_bar' => _x( 'Item', 'add new on admin bar', 'invoicing' ), |
|
| 50 | - 'add_new' => _x( 'Add New', 'Item', 'invoicing' ), |
|
| 51 | - 'add_new_item' => __( 'Add New Item', 'invoicing' ), |
|
| 52 | - 'new_item' => __( 'New Item', 'invoicing' ), |
|
| 53 | - 'edit_item' => __( 'Edit Item', 'invoicing' ), |
|
| 54 | - 'view_item' => __( 'View Item', 'invoicing' ), |
|
| 55 | - 'all_items' => __( 'Items', 'invoicing' ), |
|
| 56 | - 'search_items' => __( 'Search items', 'invoicing' ), |
|
| 57 | - 'parent_item_colon' => __( 'Parent item:', 'invoicing' ), |
|
| 58 | - 'not_found' => __( 'No items found.', 'invoicing' ), |
|
| 59 | - 'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ) |
|
| 60 | - ), |
|
| 61 | - 'description' => __( 'This is where you can add new invoice items.', 'invoicing' ), |
|
| 62 | - 'public' => false, |
|
| 63 | - 'has_archive' => false, |
|
| 64 | - '_builtin' => false, |
|
| 65 | - 'show_ui' => true, |
|
| 66 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 67 | - 'show_in_nav_menus' => false, |
|
| 68 | - 'supports' => array( 'title', 'excerpt' ), |
|
| 69 | - 'rewrite' => false, |
|
| 70 | - 'query_var' => false, |
|
| 71 | - 'capability_type' => 'wpi_item', |
|
| 72 | - 'map_meta_cap' => true, |
|
| 73 | - 'show_in_admin_bar' => true, |
|
| 74 | - 'can_export' => true, |
|
| 75 | - ) |
|
| 76 | - ) |
|
| 77 | - ); |
|
| 39 | + // Register item post type. |
|
| 40 | + register_post_type( |
|
| 41 | + 'wpi_item', |
|
| 42 | + apply_filters( |
|
| 43 | + 'wpinv_register_post_type_invoice_item', |
|
| 44 | + array( |
|
| 45 | + 'labels' => array( |
|
| 46 | + 'name' => _x( 'Items', 'post type general name', 'invoicing' ), |
|
| 47 | + 'singular_name' => _x( 'Item', 'post type singular name', 'invoicing' ), |
|
| 48 | + 'menu_name' => _x( 'Items', 'admin menu', 'invoicing' ), |
|
| 49 | + 'name_admin_bar' => _x( 'Item', 'add new on admin bar', 'invoicing' ), |
|
| 50 | + 'add_new' => _x( 'Add New', 'Item', 'invoicing' ), |
|
| 51 | + 'add_new_item' => __( 'Add New Item', 'invoicing' ), |
|
| 52 | + 'new_item' => __( 'New Item', 'invoicing' ), |
|
| 53 | + 'edit_item' => __( 'Edit Item', 'invoicing' ), |
|
| 54 | + 'view_item' => __( 'View Item', 'invoicing' ), |
|
| 55 | + 'all_items' => __( 'Items', 'invoicing' ), |
|
| 56 | + 'search_items' => __( 'Search items', 'invoicing' ), |
|
| 57 | + 'parent_item_colon' => __( 'Parent item:', 'invoicing' ), |
|
| 58 | + 'not_found' => __( 'No items found.', 'invoicing' ), |
|
| 59 | + 'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ) |
|
| 60 | + ), |
|
| 61 | + 'description' => __( 'This is where you can add new invoice items.', 'invoicing' ), |
|
| 62 | + 'public' => false, |
|
| 63 | + 'has_archive' => false, |
|
| 64 | + '_builtin' => false, |
|
| 65 | + 'show_ui' => true, |
|
| 66 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 67 | + 'show_in_nav_menus' => false, |
|
| 68 | + 'supports' => array( 'title', 'excerpt' ), |
|
| 69 | + 'rewrite' => false, |
|
| 70 | + 'query_var' => false, |
|
| 71 | + 'capability_type' => 'wpi_item', |
|
| 72 | + 'map_meta_cap' => true, |
|
| 73 | + 'show_in_admin_bar' => true, |
|
| 74 | + 'can_export' => true, |
|
| 75 | + ) |
|
| 76 | + ) |
|
| 77 | + ); |
|
| 78 | 78 | |
| 79 | - // Register payment form post type. |
|
| 80 | - register_post_type( |
|
| 81 | - 'wpi_payment_form', |
|
| 82 | - apply_filters( |
|
| 83 | - 'wpinv_register_post_type_payment_form', |
|
| 84 | - array( |
|
| 85 | - 'labels' => array( |
|
| 86 | - 'name' => _x( 'Payment Forms', 'post type general name', 'invoicing' ), |
|
| 87 | - 'singular_name' => _x( 'Payment Form', 'post type singular name', 'invoicing' ), |
|
| 88 | - 'menu_name' => _x( 'Payment Forms', 'admin menu', 'invoicing' ), |
|
| 89 | - 'name_admin_bar' => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ), |
|
| 90 | - 'add_new' => _x( 'Add New', 'Payment Form', 'invoicing' ), |
|
| 91 | - 'add_new_item' => __( 'Add New Payment Form', 'invoicing' ), |
|
| 92 | - 'new_item' => __( 'New Payment Form', 'invoicing' ), |
|
| 93 | - 'edit_item' => __( 'Edit Payment Form', 'invoicing' ), |
|
| 94 | - 'view_item' => __( 'View Payment Form', 'invoicing' ), |
|
| 95 | - 'all_items' => __( 'Payment Forms', 'invoicing' ), |
|
| 96 | - 'search_items' => __( 'Search Payment Forms', 'invoicing' ), |
|
| 97 | - 'parent_item_colon' => __( 'Parent Payment Forms:', 'invoicing' ), |
|
| 98 | - 'not_found' => __( 'No payment forms found.', 'invoicing' ), |
|
| 99 | - 'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ) |
|
| 100 | - ), |
|
| 101 | - 'description' => __( 'Add new payment forms.', 'invoicing' ), |
|
| 102 | - 'public' => false, |
|
| 103 | - 'show_ui' => true, |
|
| 104 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : true, |
|
| 105 | - 'show_in_nav_menus' => false, |
|
| 106 | - 'query_var' => false, |
|
| 107 | - 'rewrite' => true, |
|
| 108 | - 'map_meta_cap' => true, |
|
| 109 | - 'has_archive' => false, |
|
| 110 | - 'hierarchical' => false, |
|
| 111 | - 'menu_position' => null, |
|
| 112 | - 'supports' => array( 'title' ), |
|
| 113 | - 'menu_icon' => 'dashicons-media-form', |
|
| 114 | - ) |
|
| 115 | - ) |
|
| 116 | - ); |
|
| 79 | + // Register payment form post type. |
|
| 80 | + register_post_type( |
|
| 81 | + 'wpi_payment_form', |
|
| 82 | + apply_filters( |
|
| 83 | + 'wpinv_register_post_type_payment_form', |
|
| 84 | + array( |
|
| 85 | + 'labels' => array( |
|
| 86 | + 'name' => _x( 'Payment Forms', 'post type general name', 'invoicing' ), |
|
| 87 | + 'singular_name' => _x( 'Payment Form', 'post type singular name', 'invoicing' ), |
|
| 88 | + 'menu_name' => _x( 'Payment Forms', 'admin menu', 'invoicing' ), |
|
| 89 | + 'name_admin_bar' => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ), |
|
| 90 | + 'add_new' => _x( 'Add New', 'Payment Form', 'invoicing' ), |
|
| 91 | + 'add_new_item' => __( 'Add New Payment Form', 'invoicing' ), |
|
| 92 | + 'new_item' => __( 'New Payment Form', 'invoicing' ), |
|
| 93 | + 'edit_item' => __( 'Edit Payment Form', 'invoicing' ), |
|
| 94 | + 'view_item' => __( 'View Payment Form', 'invoicing' ), |
|
| 95 | + 'all_items' => __( 'Payment Forms', 'invoicing' ), |
|
| 96 | + 'search_items' => __( 'Search Payment Forms', 'invoicing' ), |
|
| 97 | + 'parent_item_colon' => __( 'Parent Payment Forms:', 'invoicing' ), |
|
| 98 | + 'not_found' => __( 'No payment forms found.', 'invoicing' ), |
|
| 99 | + 'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ) |
|
| 100 | + ), |
|
| 101 | + 'description' => __( 'Add new payment forms.', 'invoicing' ), |
|
| 102 | + 'public' => false, |
|
| 103 | + 'show_ui' => true, |
|
| 104 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : true, |
|
| 105 | + 'show_in_nav_menus' => false, |
|
| 106 | + 'query_var' => false, |
|
| 107 | + 'rewrite' => true, |
|
| 108 | + 'map_meta_cap' => true, |
|
| 109 | + 'has_archive' => false, |
|
| 110 | + 'hierarchical' => false, |
|
| 111 | + 'menu_position' => null, |
|
| 112 | + 'supports' => array( 'title' ), |
|
| 113 | + 'menu_icon' => 'dashicons-media-form', |
|
| 114 | + ) |
|
| 115 | + ) |
|
| 116 | + ); |
|
| 117 | 117 | |
| 118 | - // Register invoice post type. |
|
| 119 | - register_post_type( |
|
| 120 | - 'wpi_invoice', |
|
| 121 | - apply_filters( |
|
| 122 | - 'wpinv_register_post_type_invoice', |
|
| 123 | - array( |
|
| 124 | - 'labels' => array( |
|
| 125 | - 'name' => __( 'Invoices', 'invoicing' ), |
|
| 126 | - 'singular_name' => __( 'Invoice', 'invoicing' ), |
|
| 127 | - 'all_items' => __( 'Invoices', 'invoicing' ), |
|
| 128 | - 'menu_name' => _x( 'Invoices', 'Admin menu name', 'invoicing' ), |
|
| 129 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 130 | - 'add_new_item' => __( 'Add new invoice', 'invoicing' ), |
|
| 131 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 132 | - 'edit_item' => __( 'Edit invoice', 'invoicing' ), |
|
| 133 | - 'new_item' => __( 'New invoice', 'invoicing' ), |
|
| 134 | - 'view_item' => __( 'View invoice', 'invoicing' ), |
|
| 135 | - 'view_items' => __( 'View Invoices', 'invoicing' ), |
|
| 136 | - 'search_items' => __( 'Search invoices', 'invoicing' ), |
|
| 137 | - 'not_found' => __( 'No invoices found', 'invoicing' ), |
|
| 138 | - 'not_found_in_trash' => __( 'No invoices found in trash', 'invoicing' ), |
|
| 139 | - 'parent' => __( 'Parent invoice', 'invoicing' ), |
|
| 140 | - 'featured_image' => __( 'Invoice image', 'invoicing' ), |
|
| 141 | - 'set_featured_image' => __( 'Set invoice image', 'invoicing' ), |
|
| 142 | - 'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ), |
|
| 143 | - 'use_featured_image' => __( 'Use as invoice image', 'invoicing' ), |
|
| 144 | - 'insert_into_item' => __( 'Insert into invoice', 'invoicing' ), |
|
| 145 | - 'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ), |
|
| 146 | - 'filter_items_list' => __( 'Filter invoices', 'invoicing' ), |
|
| 147 | - 'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ), |
|
| 148 | - 'items_list' => __( 'Invoices list', 'invoicing' ), |
|
| 149 | - ), |
|
| 150 | - 'description' => __( 'This is where invoices are stored.', 'invoicing' ), |
|
| 151 | - 'public' => true, |
|
| 152 | - 'has_archive' => false, |
|
| 153 | - 'publicly_queryable' => true, |
|
| 154 | - 'exclude_from_search' => true, |
|
| 155 | - 'show_ui' => true, |
|
| 156 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 157 | - 'show_in_nav_menus' => false, |
|
| 158 | - 'supports' => array( 'title', 'author', 'excerpt' ), |
|
| 159 | - 'rewrite' => array( |
|
| 160 | - 'slug' => 'invoice', |
|
| 161 | - 'with_front' => false, |
|
| 162 | - ), |
|
| 163 | - 'query_var' => false, |
|
| 164 | - 'capability_type' => 'wpi_invoice', |
|
| 165 | - 'map_meta_cap' => true, |
|
| 166 | - 'show_in_admin_bar' => true, |
|
| 167 | - 'can_export' => true, |
|
| 168 | - 'hierarchical' => false, |
|
| 169 | - 'menu_position' => null, |
|
| 170 | - 'menu_icon' => 'dashicons-media-spreadsheet', |
|
| 171 | - ) |
|
| 172 | - ) |
|
| 173 | - ); |
|
| 118 | + // Register invoice post type. |
|
| 119 | + register_post_type( |
|
| 120 | + 'wpi_invoice', |
|
| 121 | + apply_filters( |
|
| 122 | + 'wpinv_register_post_type_invoice', |
|
| 123 | + array( |
|
| 124 | + 'labels' => array( |
|
| 125 | + 'name' => __( 'Invoices', 'invoicing' ), |
|
| 126 | + 'singular_name' => __( 'Invoice', 'invoicing' ), |
|
| 127 | + 'all_items' => __( 'Invoices', 'invoicing' ), |
|
| 128 | + 'menu_name' => _x( 'Invoices', 'Admin menu name', 'invoicing' ), |
|
| 129 | + 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 130 | + 'add_new_item' => __( 'Add new invoice', 'invoicing' ), |
|
| 131 | + 'edit' => __( 'Edit', 'invoicing' ), |
|
| 132 | + 'edit_item' => __( 'Edit invoice', 'invoicing' ), |
|
| 133 | + 'new_item' => __( 'New invoice', 'invoicing' ), |
|
| 134 | + 'view_item' => __( 'View invoice', 'invoicing' ), |
|
| 135 | + 'view_items' => __( 'View Invoices', 'invoicing' ), |
|
| 136 | + 'search_items' => __( 'Search invoices', 'invoicing' ), |
|
| 137 | + 'not_found' => __( 'No invoices found', 'invoicing' ), |
|
| 138 | + 'not_found_in_trash' => __( 'No invoices found in trash', 'invoicing' ), |
|
| 139 | + 'parent' => __( 'Parent invoice', 'invoicing' ), |
|
| 140 | + 'featured_image' => __( 'Invoice image', 'invoicing' ), |
|
| 141 | + 'set_featured_image' => __( 'Set invoice image', 'invoicing' ), |
|
| 142 | + 'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ), |
|
| 143 | + 'use_featured_image' => __( 'Use as invoice image', 'invoicing' ), |
|
| 144 | + 'insert_into_item' => __( 'Insert into invoice', 'invoicing' ), |
|
| 145 | + 'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ), |
|
| 146 | + 'filter_items_list' => __( 'Filter invoices', 'invoicing' ), |
|
| 147 | + 'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ), |
|
| 148 | + 'items_list' => __( 'Invoices list', 'invoicing' ), |
|
| 149 | + ), |
|
| 150 | + 'description' => __( 'This is where invoices are stored.', 'invoicing' ), |
|
| 151 | + 'public' => true, |
|
| 152 | + 'has_archive' => false, |
|
| 153 | + 'publicly_queryable' => true, |
|
| 154 | + 'exclude_from_search' => true, |
|
| 155 | + 'show_ui' => true, |
|
| 156 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 157 | + 'show_in_nav_menus' => false, |
|
| 158 | + 'supports' => array( 'title', 'author', 'excerpt' ), |
|
| 159 | + 'rewrite' => array( |
|
| 160 | + 'slug' => 'invoice', |
|
| 161 | + 'with_front' => false, |
|
| 162 | + ), |
|
| 163 | + 'query_var' => false, |
|
| 164 | + 'capability_type' => 'wpi_invoice', |
|
| 165 | + 'map_meta_cap' => true, |
|
| 166 | + 'show_in_admin_bar' => true, |
|
| 167 | + 'can_export' => true, |
|
| 168 | + 'hierarchical' => false, |
|
| 169 | + 'menu_position' => null, |
|
| 170 | + 'menu_icon' => 'dashicons-media-spreadsheet', |
|
| 171 | + ) |
|
| 172 | + ) |
|
| 173 | + ); |
|
| 174 | 174 | |
| 175 | - // Register discount post type. |
|
| 176 | - register_post_type( |
|
| 177 | - 'wpi_discount', |
|
| 178 | - apply_filters( |
|
| 179 | - 'wpinv_register_post_type_discount', |
|
| 180 | - array( |
|
| 181 | - 'labels' => array( |
|
| 182 | - 'name' => __( 'Discounts', 'invoicing' ), |
|
| 183 | - 'singular_name' => __( 'Discount', 'invoicing' ), |
|
| 184 | - 'all_items' => __( 'Discounts', 'invoicing' ), |
|
| 185 | - 'menu_name' => _x( 'Discounts', 'Admin menu name', 'invoicing' ), |
|
| 186 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 187 | - 'add_new_item' => __( 'Add new discount', 'invoicing' ), |
|
| 188 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 189 | - 'edit_item' => __( 'Edit discount', 'invoicing' ), |
|
| 190 | - 'new_item' => __( 'New discount', 'invoicing' ), |
|
| 191 | - 'view_item' => __( 'View discount', 'invoicing' ), |
|
| 192 | - 'view_items' => __( 'View Discounts', 'invoicing' ), |
|
| 193 | - 'search_items' => __( 'Search discounts', 'invoicing' ), |
|
| 194 | - 'not_found' => __( 'No discounts found', 'invoicing' ), |
|
| 195 | - 'not_found_in_trash' => __( 'No discounts found in trash', 'invoicing' ), |
|
| 196 | - 'parent' => __( 'Parent discount', 'invoicing' ), |
|
| 197 | - 'featured_image' => __( 'Discount image', 'invoicing' ), |
|
| 198 | - 'set_featured_image' => __( 'Set discount image', 'invoicing' ), |
|
| 199 | - 'remove_featured_image' => __( 'Remove discount image', 'invoicing' ), |
|
| 200 | - 'use_featured_image' => __( 'Use as discount image', 'invoicing' ), |
|
| 201 | - 'insert_into_item' => __( 'Insert into discount', 'invoicing' ), |
|
| 202 | - 'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ), |
|
| 203 | - 'filter_items_list' => __( 'Filter discounts', 'invoicing' ), |
|
| 204 | - 'items_list_navigation' => __( 'Discount navigation', 'invoicing' ), |
|
| 205 | - 'items_list' => __( 'Discounts list', 'invoicing' ), |
|
| 206 | - ), |
|
| 207 | - 'description' => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ), |
|
| 208 | - 'public' => false, |
|
| 209 | - 'can_export' => true, |
|
| 210 | - '_builtin' => false, |
|
| 211 | - 'publicly_queryable' => false, |
|
| 212 | - 'exclude_from_search'=> true, |
|
| 213 | - 'show_ui' => true, |
|
| 214 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 215 | - 'query_var' => false, |
|
| 216 | - 'rewrite' => false, |
|
| 217 | - 'capability_type' => 'wpi_discount', |
|
| 218 | - 'map_meta_cap' => true, |
|
| 219 | - 'has_archive' => false, |
|
| 220 | - 'hierarchical' => false, |
|
| 221 | - 'supports' => array( 'title', 'excerpt' ), |
|
| 222 | - 'show_in_nav_menus' => false, |
|
| 223 | - 'show_in_admin_bar' => true, |
|
| 224 | - 'menu_position' => null, |
|
| 225 | - ) |
|
| 226 | - ) |
|
| 227 | - ); |
|
| 175 | + // Register discount post type. |
|
| 176 | + register_post_type( |
|
| 177 | + 'wpi_discount', |
|
| 178 | + apply_filters( |
|
| 179 | + 'wpinv_register_post_type_discount', |
|
| 180 | + array( |
|
| 181 | + 'labels' => array( |
|
| 182 | + 'name' => __( 'Discounts', 'invoicing' ), |
|
| 183 | + 'singular_name' => __( 'Discount', 'invoicing' ), |
|
| 184 | + 'all_items' => __( 'Discounts', 'invoicing' ), |
|
| 185 | + 'menu_name' => _x( 'Discounts', 'Admin menu name', 'invoicing' ), |
|
| 186 | + 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 187 | + 'add_new_item' => __( 'Add new discount', 'invoicing' ), |
|
| 188 | + 'edit' => __( 'Edit', 'invoicing' ), |
|
| 189 | + 'edit_item' => __( 'Edit discount', 'invoicing' ), |
|
| 190 | + 'new_item' => __( 'New discount', 'invoicing' ), |
|
| 191 | + 'view_item' => __( 'View discount', 'invoicing' ), |
|
| 192 | + 'view_items' => __( 'View Discounts', 'invoicing' ), |
|
| 193 | + 'search_items' => __( 'Search discounts', 'invoicing' ), |
|
| 194 | + 'not_found' => __( 'No discounts found', 'invoicing' ), |
|
| 195 | + 'not_found_in_trash' => __( 'No discounts found in trash', 'invoicing' ), |
|
| 196 | + 'parent' => __( 'Parent discount', 'invoicing' ), |
|
| 197 | + 'featured_image' => __( 'Discount image', 'invoicing' ), |
|
| 198 | + 'set_featured_image' => __( 'Set discount image', 'invoicing' ), |
|
| 199 | + 'remove_featured_image' => __( 'Remove discount image', 'invoicing' ), |
|
| 200 | + 'use_featured_image' => __( 'Use as discount image', 'invoicing' ), |
|
| 201 | + 'insert_into_item' => __( 'Insert into discount', 'invoicing' ), |
|
| 202 | + 'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ), |
|
| 203 | + 'filter_items_list' => __( 'Filter discounts', 'invoicing' ), |
|
| 204 | + 'items_list_navigation' => __( 'Discount navigation', 'invoicing' ), |
|
| 205 | + 'items_list' => __( 'Discounts list', 'invoicing' ), |
|
| 206 | + ), |
|
| 207 | + 'description' => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ), |
|
| 208 | + 'public' => false, |
|
| 209 | + 'can_export' => true, |
|
| 210 | + '_builtin' => false, |
|
| 211 | + 'publicly_queryable' => false, |
|
| 212 | + 'exclude_from_search'=> true, |
|
| 213 | + 'show_ui' => true, |
|
| 214 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 215 | + 'query_var' => false, |
|
| 216 | + 'rewrite' => false, |
|
| 217 | + 'capability_type' => 'wpi_discount', |
|
| 218 | + 'map_meta_cap' => true, |
|
| 219 | + 'has_archive' => false, |
|
| 220 | + 'hierarchical' => false, |
|
| 221 | + 'supports' => array( 'title', 'excerpt' ), |
|
| 222 | + 'show_in_nav_menus' => false, |
|
| 223 | + 'show_in_admin_bar' => true, |
|
| 224 | + 'menu_position' => null, |
|
| 225 | + ) |
|
| 226 | + ) |
|
| 227 | + ); |
|
| 228 | 228 | |
| 229 | - do_action( 'getpaid_after_register_post_types' ); |
|
| 230 | - } |
|
| 229 | + do_action( 'getpaid_after_register_post_types' ); |
|
| 230 | + } |
|
| 231 | 231 | |
| 232 | - /** |
|
| 233 | - * Register our custom post statuses. |
|
| 234 | - */ |
|
| 235 | - public static function register_post_status() { |
|
| 232 | + /** |
|
| 233 | + * Register our custom post statuses. |
|
| 234 | + */ |
|
| 235 | + public static function register_post_status() { |
|
| 236 | 236 | |
| 237 | - $invoice_statuses = apply_filters( |
|
| 238 | - 'getpaid_register_invoice_post_statuses', |
|
| 239 | - array( |
|
| 237 | + $invoice_statuses = apply_filters( |
|
| 238 | + 'getpaid_register_invoice_post_statuses', |
|
| 239 | + array( |
|
| 240 | 240 | |
| 241 | - 'wpi-pending' => array( |
|
| 242 | - 'label' => _x( 'Pending Payment', 'Invoice status', 'invoicing' ), |
|
| 243 | - 'public' => true, |
|
| 244 | - 'exclude_from_search' => true, |
|
| 245 | - 'show_in_admin_all_list' => true, |
|
| 246 | - 'show_in_admin_status_list' => true, |
|
| 247 | - /* translators: %s: number of invoices */ |
|
| 248 | - 'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ) |
|
| 249 | - ), |
|
| 241 | + 'wpi-pending' => array( |
|
| 242 | + 'label' => _x( 'Pending Payment', 'Invoice status', 'invoicing' ), |
|
| 243 | + 'public' => true, |
|
| 244 | + 'exclude_from_search' => true, |
|
| 245 | + 'show_in_admin_all_list' => true, |
|
| 246 | + 'show_in_admin_status_list' => true, |
|
| 247 | + /* translators: %s: number of invoices */ |
|
| 248 | + 'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ) |
|
| 249 | + ), |
|
| 250 | 250 | |
| 251 | - 'wpi-processing' => array( |
|
| 252 | - 'label' => _x( 'Processing', 'Invoice status', 'invoicing' ), |
|
| 253 | - 'public' => true, |
|
| 254 | - 'exclude_from_search' => true, |
|
| 255 | - 'show_in_admin_all_list' => true, |
|
| 256 | - 'show_in_admin_status_list' => true, |
|
| 257 | - /* translators: %s: number of invoices */ |
|
| 258 | - 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ) |
|
| 259 | - ), |
|
| 251 | + 'wpi-processing' => array( |
|
| 252 | + 'label' => _x( 'Processing', 'Invoice status', 'invoicing' ), |
|
| 253 | + 'public' => true, |
|
| 254 | + 'exclude_from_search' => true, |
|
| 255 | + 'show_in_admin_all_list' => true, |
|
| 256 | + 'show_in_admin_status_list' => true, |
|
| 257 | + /* translators: %s: number of invoices */ |
|
| 258 | + 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ) |
|
| 259 | + ), |
|
| 260 | 260 | |
| 261 | - 'wpi-onhold' => array( |
|
| 262 | - 'label' => _x( 'On Hold', 'Invoice status', 'invoicing' ), |
|
| 263 | - 'public' => true, |
|
| 264 | - 'exclude_from_search' => true, |
|
| 265 | - 'show_in_admin_all_list' => true, |
|
| 266 | - 'show_in_admin_status_list' => true, |
|
| 267 | - /* translators: %s: number of invoices */ |
|
| 268 | - 'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ) |
|
| 269 | - ), |
|
| 261 | + 'wpi-onhold' => array( |
|
| 262 | + 'label' => _x( 'On Hold', 'Invoice status', 'invoicing' ), |
|
| 263 | + 'public' => true, |
|
| 264 | + 'exclude_from_search' => true, |
|
| 265 | + 'show_in_admin_all_list' => true, |
|
| 266 | + 'show_in_admin_status_list' => true, |
|
| 267 | + /* translators: %s: number of invoices */ |
|
| 268 | + 'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ) |
|
| 269 | + ), |
|
| 270 | 270 | |
| 271 | - 'wpi-cancelled' => array( |
|
| 272 | - 'label' => _x( 'Cancelled', 'Invoice status', 'invoicing' ), |
|
| 273 | - 'public' => true, |
|
| 274 | - 'exclude_from_search' => true, |
|
| 275 | - 'show_in_admin_all_list' => true, |
|
| 276 | - 'show_in_admin_status_list' => true, |
|
| 277 | - /* translators: %s: number of invoices */ |
|
| 278 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ) |
|
| 279 | - ), |
|
| 271 | + 'wpi-cancelled' => array( |
|
| 272 | + 'label' => _x( 'Cancelled', 'Invoice status', 'invoicing' ), |
|
| 273 | + 'public' => true, |
|
| 274 | + 'exclude_from_search' => true, |
|
| 275 | + 'show_in_admin_all_list' => true, |
|
| 276 | + 'show_in_admin_status_list' => true, |
|
| 277 | + /* translators: %s: number of invoices */ |
|
| 278 | + 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ) |
|
| 279 | + ), |
|
| 280 | 280 | |
| 281 | - 'wpi-refunded' => array( |
|
| 282 | - 'label' => _x( 'Refunded', 'Invoice status', 'invoicing' ), |
|
| 283 | - 'public' => true, |
|
| 284 | - 'exclude_from_search' => true, |
|
| 285 | - 'show_in_admin_all_list' => true, |
|
| 286 | - 'show_in_admin_status_list' => true, |
|
| 287 | - /* translators: %s: number of invoices */ |
|
| 288 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ) |
|
| 289 | - ), |
|
| 281 | + 'wpi-refunded' => array( |
|
| 282 | + 'label' => _x( 'Refunded', 'Invoice status', 'invoicing' ), |
|
| 283 | + 'public' => true, |
|
| 284 | + 'exclude_from_search' => true, |
|
| 285 | + 'show_in_admin_all_list' => true, |
|
| 286 | + 'show_in_admin_status_list' => true, |
|
| 287 | + /* translators: %s: number of invoices */ |
|
| 288 | + 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ) |
|
| 289 | + ), |
|
| 290 | 290 | |
| 291 | - 'wpi-failed' => array( |
|
| 292 | - 'label' => _x( 'Failed', 'Invoice status', 'invoicing' ), |
|
| 293 | - 'public' => true, |
|
| 294 | - 'exclude_from_search' => true, |
|
| 295 | - 'show_in_admin_all_list' => true, |
|
| 296 | - 'show_in_admin_status_list' => true, |
|
| 297 | - /* translators: %s: number of invoices */ |
|
| 298 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ) |
|
| 299 | - ), |
|
| 291 | + 'wpi-failed' => array( |
|
| 292 | + 'label' => _x( 'Failed', 'Invoice status', 'invoicing' ), |
|
| 293 | + 'public' => true, |
|
| 294 | + 'exclude_from_search' => true, |
|
| 295 | + 'show_in_admin_all_list' => true, |
|
| 296 | + 'show_in_admin_status_list' => true, |
|
| 297 | + /* translators: %s: number of invoices */ |
|
| 298 | + 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ) |
|
| 299 | + ), |
|
| 300 | 300 | |
| 301 | - 'wpi-renewal' => array( |
|
| 302 | - 'label' => _x( 'Renewal', 'Invoice status', 'invoicing' ), |
|
| 303 | - 'public' => true, |
|
| 304 | - 'exclude_from_search' => true, |
|
| 305 | - 'show_in_admin_all_list' => true, |
|
| 306 | - 'show_in_admin_status_list' => true, |
|
| 307 | - /* translators: %s: number of invoices */ |
|
| 308 | - 'label_count' => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ) |
|
| 309 | - ) |
|
| 310 | - ) |
|
| 311 | - ); |
|
| 301 | + 'wpi-renewal' => array( |
|
| 302 | + 'label' => _x( 'Renewal', 'Invoice status', 'invoicing' ), |
|
| 303 | + 'public' => true, |
|
| 304 | + 'exclude_from_search' => true, |
|
| 305 | + 'show_in_admin_all_list' => true, |
|
| 306 | + 'show_in_admin_status_list' => true, |
|
| 307 | + /* translators: %s: number of invoices */ |
|
| 308 | + 'label_count' => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ) |
|
| 309 | + ) |
|
| 310 | + ) |
|
| 311 | + ); |
|
| 312 | 312 | |
| 313 | - foreach ( $invoice_statuses as $invoice_statuse => $args ) { |
|
| 314 | - register_post_status( $invoice_statuse, $args ); |
|
| 315 | - } |
|
| 316 | - } |
|
| 313 | + foreach ( $invoice_statuses as $invoice_statuse => $args ) { |
|
| 314 | + register_post_status( $invoice_statuse, $args ); |
|
| 315 | + } |
|
| 316 | + } |
|
| 317 | 317 | |
| 318 | - /** |
|
| 319 | - * Flush rewrite rules. |
|
| 320 | - */ |
|
| 321 | - public static function flush_rewrite_rules() { |
|
| 322 | - flush_rewrite_rules(); |
|
| 323 | - } |
|
| 318 | + /** |
|
| 319 | + * Flush rewrite rules. |
|
| 320 | + */ |
|
| 321 | + public static function flush_rewrite_rules() { |
|
| 322 | + flush_rewrite_rules(); |
|
| 323 | + } |
|
| 324 | 324 | |
| 325 | - /** |
|
| 326 | - * Flush rules to prevent 404. |
|
| 327 | - * |
|
| 328 | - */ |
|
| 329 | - public static function maybe_flush_rewrite_rules() { |
|
| 330 | - if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) { |
|
| 331 | - update_option( 'getpaid_flushed_rewrite_rules', '1' ); |
|
| 332 | - self::flush_rewrite_rules(); |
|
| 333 | - } |
|
| 334 | - } |
|
| 325 | + /** |
|
| 326 | + * Flush rules to prevent 404. |
|
| 327 | + * |
|
| 328 | + */ |
|
| 329 | + public static function maybe_flush_rewrite_rules() { |
|
| 330 | + if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) { |
|
| 331 | + update_option( 'getpaid_flushed_rewrite_rules', '1' ); |
|
| 332 | + self::flush_rewrite_rules(); |
|
| 333 | + } |
|
| 334 | + } |
|
| 335 | 335 | |
| 336 | 336 | } |