@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | +if (!defined('ABSPATH')) { |
|
| 4 | 4 | exit; // Exit if accessed directly |
| 5 | 5 | } |
| 6 | 6 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @return string The rendered component. |
| 20 | 20 | */ |
| 21 | - public static function get( $args = array() ) { |
|
| 21 | + public static function get($args = array()) { |
|
| 22 | 22 | global $wp_query; |
| 23 | 23 | |
| 24 | 24 | $defaults = array( |
@@ -26,57 +26,57 @@ discard block |
||
| 26 | 26 | 'mid_size' => 2, |
| 27 | 27 | 'prev_text' => '<i class="fas fa-chevron-left"></i>', |
| 28 | 28 | 'next_text' => '<i class="fas fa-chevron-right"></i>', |
| 29 | - 'screen_reader_text' => __( 'Posts navigation','aui' ), |
|
| 29 | + 'screen_reader_text' => __('Posts navigation', 'aui'), |
|
| 30 | 30 | 'before_paging' => '', |
| 31 | 31 | 'after_paging' => '', |
| 32 | 32 | 'type' => 'array', |
| 33 | - 'total' => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1, |
|
| 33 | + 'total' => isset($wp_query->max_num_pages) ? $wp_query->max_num_pages : 1, |
|
| 34 | 34 | 'links' => array() // an array of links if using custom links, this includes the a tag. |
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Parse incoming $args into an array and merge it with $defaults |
| 39 | 39 | */ |
| 40 | - $args = wp_parse_args( $args, $defaults ); |
|
| 40 | + $args = wp_parse_args($args, $defaults); |
|
| 41 | 41 | |
| 42 | 42 | $output = ''; |
| 43 | 43 | |
| 44 | 44 | // Don't print empty markup if there's only one page. |
| 45 | - if ( $args['total'] > 1 ) { |
|
| 45 | + if ($args['total'] > 1) { |
|
| 46 | 46 | |
| 47 | 47 | // Set up paginated links. |
| 48 | - $links = !empty( $args['links'] ) ? $args['links'] : paginate_links( $args ); |
|
| 48 | + $links = !empty($args['links']) ? $args['links'] : paginate_links($args); |
|
| 49 | 49 | |
| 50 | 50 | $class = !empty($args['class']) ? $args['class'] : ''; |
| 51 | 51 | |
| 52 | 52 | // make the output bootstrap ready |
| 53 | 53 | $links_html = "<ul class='pagination m-0 p-0 $class'>"; |
| 54 | - if ( ! empty( $links ) ) { |
|
| 55 | - foreach ( $links as $link ) { |
|
| 56 | - $active = strpos( $link, 'current' ) !== false ? 'active' : ''; |
|
| 54 | + if (!empty($links)) { |
|
| 55 | + foreach ($links as $link) { |
|
| 56 | + $active = strpos($link, 'current') !== false ? 'active' : ''; |
|
| 57 | 57 | $links_html .= "<li class='page-item $active'>"; |
| 58 | - $links_html .= str_replace( "page-numbers", "page-link", $link ); |
|
| 58 | + $links_html .= str_replace("page-numbers", "page-link", $link); |
|
| 59 | 59 | $links_html .= "</li>"; |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | $links_html .= "</ul>"; |
| 63 | 63 | |
| 64 | - if ( $links ) { |
|
| 64 | + if ($links) { |
|
| 65 | 65 | $output .= '<section class="px-0 py-2 w-100">'; |
| 66 | - $output .= _navigation_markup( $links_html, 'aui-pagination', $args['screen_reader_text'] ); |
|
| 66 | + $output .= _navigation_markup($links_html, 'aui-pagination', $args['screen_reader_text']); |
|
| 67 | 67 | $output .= '</section>'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $output = str_replace( "screen-reader-text", "screen-reader-text sr-only", $output ); |
|
| 71 | - $output = str_replace( "nav-links", "aui-nav-links", $output ); |
|
| 70 | + $output = str_replace("screen-reader-text", "screen-reader-text sr-only", $output); |
|
| 71 | + $output = str_replace("nav-links", "aui-nav-links", $output); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( $output ) { |
|
| 75 | - if ( ! empty( $args['before_paging'] ) ) { |
|
| 74 | + if ($output) { |
|
| 75 | + if (!empty($args['before_paging'])) { |
|
| 76 | 76 | $output = $args['before_paging'] . $output; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if ( ! empty( $args['after_paging'] ) ) { |
|
| 79 | + if (!empty($args['after_paging'])) { |
|
| 80 | 80 | $output = $output . $args['after_paging']; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | +if (!defined('ABSPATH')) { |
|
| 4 | 4 | exit; // Exit if accessed directly |
| 5 | 5 | } |
| 6 | 6 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return AUI|null |
| 36 | 36 | */ |
| 37 | 37 | public static function instance() { |
| 38 | - if ( self::$instance == null ) { |
|
| 38 | + if (self::$instance == null) { |
|
| 39 | 39 | self::$instance = new AUI(); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | * @since 1.0.0 |
| 49 | 49 | */ |
| 50 | 50 | private function __construct() { |
| 51 | - if ( function_exists( "__autoload" ) ) { |
|
| 52 | - spl_autoload_register( "__autoload" ); |
|
| 51 | + if (function_exists("__autoload")) { |
|
| 52 | + spl_autoload_register("__autoload"); |
|
| 53 | 53 | } |
| 54 | - spl_autoload_register( array( $this, 'autoload' ) ); |
|
| 54 | + spl_autoload_register(array($this, 'autoload')); |
|
| 55 | 55 | |
| 56 | 56 | // load options |
| 57 | 57 | self::$options = get_option('aui_options'); |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @param $classname |
| 66 | 66 | */ |
| 67 | - private function autoload( $classname ) { |
|
| 68 | - $class = str_replace( '_', '-', strtolower( $classname ) ); |
|
| 69 | - $file_path = trailingslashit( dirname( __FILE__ ) ) . "components/class-" . $class . '.php'; |
|
| 70 | - if ( $file_path && is_readable( $file_path ) ) { |
|
| 71 | - include_once( $file_path ); |
|
| 67 | + private function autoload($classname) { |
|
| 68 | + $class = str_replace('_', '-', strtolower($classname)); |
|
| 69 | + $file_path = trailingslashit(dirname(__FILE__)) . "components/class-" . $class . '.php'; |
|
| 70 | + if ($file_path && is_readable($file_path)) { |
|
| 71 | + include_once($file_path); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -79,27 +79,27 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return string|void |
| 81 | 81 | */ |
| 82 | - public function get_option( $option ){ |
|
| 82 | + public function get_option($option) { |
|
| 83 | 83 | $result = isset(self::$options[$option]) ? esc_attr(self::$options[$option]) : ''; |
| 84 | 84 | |
| 85 | - if ( ! $result && $option) { |
|
| 86 | - if( $option == 'color_primary' ){ |
|
| 85 | + if (!$result && $option) { |
|
| 86 | + if ($option == 'color_primary') { |
|
| 87 | 87 | $result = AUI_PRIMARY_COLOR; |
| 88 | - }elseif( $option == 'color_secondary' ){ |
|
| 88 | + }elseif ($option == 'color_secondary') { |
|
| 89 | 89 | $result = AUI_SECONDARY_COLOR; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | return $result; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function render( $items = array() ) { |
|
| 95 | + public function render($items = array()) { |
|
| 96 | 96 | $output = ''; |
| 97 | 97 | |
| 98 | - if ( ! empty( $items ) ) { |
|
| 99 | - foreach ( $items as $args ) { |
|
| 100 | - $render = isset( $args['render'] ) ? $args['render'] : ''; |
|
| 101 | - if ( $render && method_exists( __CLASS__, $render ) ) { |
|
| 102 | - $output .= $this->$render( $args ); |
|
| 98 | + if (!empty($items)) { |
|
| 99 | + foreach ($items as $args) { |
|
| 100 | + $render = isset($args['render']) ? $args['render'] : ''; |
|
| 101 | + if ($render && method_exists(__CLASS__, $render)) { |
|
| 102 | + $output .= $this->$render($args); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @return string The rendered component. |
| 118 | 118 | */ |
| 119 | - public function alert( $args = array() ) { |
|
| 120 | - return AUI_Component_Alert::get( $args ); |
|
| 119 | + public function alert($args = array()) { |
|
| 120 | + return AUI_Component_Alert::get($args); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @return string The rendered component. |
| 131 | 131 | */ |
| 132 | - public function input( $args = array() ) { |
|
| 133 | - return AUI_Component_Input::input( $args ); |
|
| 132 | + public function input($args = array()) { |
|
| 133 | + return AUI_Component_Input::input($args); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @return string The rendered component. |
| 144 | 144 | */ |
| 145 | - public function textarea( $args = array() ) { |
|
| 146 | - return AUI_Component_Input::textarea( $args ); |
|
| 145 | + public function textarea($args = array()) { |
|
| 146 | + return AUI_Component_Input::textarea($args); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @return string The rendered component. |
| 157 | 157 | */ |
| 158 | - public function button( $args = array() ) { |
|
| 159 | - return AUI_Component_Button::get( $args ); |
|
| 158 | + public function button($args = array()) { |
|
| 159 | + return AUI_Component_Button::get($args); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -168,22 +168,22 @@ discard block |
||
| 168 | 168 | * |
| 169 | 169 | * @return string The rendered component. |
| 170 | 170 | */ |
| 171 | - public function badge( $args = array() ) { |
|
| 171 | + public function badge($args = array()) { |
|
| 172 | 172 | $defaults = array( |
| 173 | 173 | 'class' => 'badge badge-primary align-middle', |
| 174 | 174 | ); |
| 175 | 175 | |
| 176 | 176 | // maybe set type |
| 177 | - if ( empty( $args['href'] ) ) { |
|
| 177 | + if (empty($args['href'])) { |
|
| 178 | 178 | $defaults['type'] = 'badge'; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * Parse incoming $args into an array and merge it with $defaults |
| 183 | 183 | */ |
| 184 | - $args = wp_parse_args( $args, $defaults ); |
|
| 184 | + $args = wp_parse_args($args, $defaults); |
|
| 185 | 185 | |
| 186 | - return AUI_Component_Button::get( $args ); |
|
| 186 | + return AUI_Component_Button::get($args); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @return string The rendered component. |
| 197 | 197 | */ |
| 198 | - public function dropdown( $args = array() ) { |
|
| 199 | - return AUI_Component_Dropdown::get( $args ); |
|
| 198 | + public function dropdown($args = array()) { |
|
| 199 | + return AUI_Component_Dropdown::get($args); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | * |
| 209 | 209 | * @return string The rendered component. |
| 210 | 210 | */ |
| 211 | - public function select( $args = array() ) { |
|
| 212 | - return AUI_Component_Input::select( $args ); |
|
| 211 | + public function select($args = array()) { |
|
| 212 | + return AUI_Component_Input::select($args); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -221,8 +221,8 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @return string The rendered component. |
| 223 | 223 | */ |
| 224 | - public function radio( $args = array() ) { |
|
| 225 | - return AUI_Component_Input::radio( $args ); |
|
| 224 | + public function radio($args = array()) { |
|
| 225 | + return AUI_Component_Input::radio($args); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * @return string The rendered component. |
| 236 | 236 | */ |
| 237 | - public function pagination( $args = array() ) { |
|
| 238 | - return AUI_Component_Pagination::get( $args ); |
|
| 237 | + public function pagination($args = array()) { |
|
| 238 | + return AUI_Component_Pagination::get($args); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | } |
| 242 | 242 | \ No newline at end of file |
@@ -7,14 +7,14 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div v-if='!is_default'> |
| 15 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here. Click to set items.', 'invoicing' ) ?></div> |
|
| 15 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here. Click to set items.', 'invoicing') ?></div> |
|
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <div v-if='is_default'> |
| 19 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here.', 'invoicing' ) ?></div> |
|
| 19 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here.', 'invoicing') ?></div> |
|
| 20 | 20 | </div> |
@@ -7,24 +7,24 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -$bg = wpinv_get_option( 'email_background_color', '#f5f5f5' ); |
|
| 13 | -$body = wpinv_get_option( 'email_body_background_color', '#fdfdfd' ); |
|
| 14 | -$base = wpinv_get_option( 'email_base_color', '#557da2' ); |
|
| 15 | -$base_text = wpinv_light_or_dark( $base, '#202020', '#ffffff' ); |
|
| 16 | -$text = wpinv_get_option( 'email_text_color', '#505050' ); |
|
| 12 | +$bg = wpinv_get_option('email_background_color', '#f5f5f5'); |
|
| 13 | +$body = wpinv_get_option('email_body_background_color', '#fdfdfd'); |
|
| 14 | +$base = wpinv_get_option('email_base_color', '#557da2'); |
|
| 15 | +$base_text = wpinv_light_or_dark($base, '#202020', '#ffffff'); |
|
| 16 | +$text = wpinv_get_option('email_text_color', '#505050'); |
|
| 17 | 17 | |
| 18 | -$bg_darker_10 = wpinv_hex_darker( $bg, 10 ); |
|
| 19 | -$body_darker_10 = wpinv_hex_darker( $body, 10 ); |
|
| 20 | -$base_lighter_20 = wpinv_hex_lighter( $base, 20 ); |
|
| 21 | -$base_lighter_40 = wpinv_hex_lighter( $base, 40 ); |
|
| 22 | -$text_lighter_20 = wpinv_hex_lighter( $text, 20 ); |
|
| 18 | +$bg_darker_10 = wpinv_hex_darker($bg, 10); |
|
| 19 | +$body_darker_10 = wpinv_hex_darker($body, 10); |
|
| 20 | +$base_lighter_20 = wpinv_hex_lighter($base, 20); |
|
| 21 | +$base_lighter_40 = wpinv_hex_lighter($base, 40); |
|
| 22 | +$text_lighter_20 = wpinv_hex_lighter($text, 20); |
|
| 23 | 23 | |
| 24 | 24 | // !important; is a gmail hack to prevent styles being stripped if it doesn't like something. |
| 25 | 25 | ?> |
| 26 | 26 | #wrapper { |
| 27 | - background-color: <?php echo esc_attr( $bg ); ?>; |
|
| 27 | + background-color: <?php echo esc_attr($bg); ?>; |
|
| 28 | 28 | margin: 0; |
| 29 | 29 | -webkit-text-size-adjust: none !important; |
| 30 | 30 | padding: 3%; |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | #template_container { |
| 47 | 47 | box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important; |
| 48 | - background-color: <?php echo esc_attr( $body ); ?>; |
|
| 49 | - border: 1px solid <?php echo esc_attr( $bg_darker_10 ); ?>; |
|
| 48 | + background-color: <?php echo esc_attr($body); ?>; |
|
| 49 | + border: 1px solid <?php echo esc_attr($bg_darker_10); ?>; |
|
| 50 | 50 | border-radius: 3px !important; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | #template_header { |
| 54 | - background-color: <?php echo esc_attr( $base ); ?>; |
|
| 54 | + background-color: <?php echo esc_attr($base); ?>; |
|
| 55 | 55 | border-radius: 3px 3px 0 0 !important; |
| 56 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 56 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 57 | 57 | border-bottom: 0; |
| 58 | 58 | font-weight: bold; |
| 59 | 59 | line-height: 100%; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | #template_header h1 { |
| 69 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 69 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | #template_footer td { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | #template_footer #credit { |
| 79 | 79 | border:0; |
| 80 | - color: <?php echo esc_attr( $base_lighter_40 ); ?>; |
|
| 80 | + color: <?php echo esc_attr($base_lighter_40); ?>; |
|
| 81 | 81 | font-family: Arial; |
| 82 | 82 | font-size:12px; |
| 83 | 83 | line-height:125%; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | #body_content { |
| 89 | - background-color: <?php echo esc_attr( $body ); ?>; |
|
| 89 | + background-color: <?php echo esc_attr($body); ?>; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | #body_content table td { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | #body_content_inner { |
| 109 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 109 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 110 | 110 | font-family: Arial,Helvetica,sans-serif; |
| 111 | 111 | font-size: 14px; |
| 112 | 112 | line-height: 150%; |
@@ -114,17 +114,17 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | .td { |
| 117 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 118 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 117 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 118 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | .text { |
| 122 | - color: <?php echo esc_attr( $text ); ?>; |
|
| 122 | + color: <?php echo esc_attr($text); ?>; |
|
| 123 | 123 | font-family: Arial,Helvetica,sans-serif; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | .link { |
| 127 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 127 | + color: <?php echo esc_attr($base); ?>; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | #header_wrapper { |
@@ -133,19 +133,19 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | h1 { |
| 136 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 136 | + color: <?php echo esc_attr($base); ?>; |
|
| 137 | 137 | font-family: Arial,Helvetica,sans-serif; |
| 138 | 138 | font-size: 30px; |
| 139 | 139 | font-weight: 300; |
| 140 | 140 | line-height: 150%; |
| 141 | 141 | margin: 0; |
| 142 | 142 | text-align: <?php echo is_rtl() ? 'right' : 'left'; ?>; |
| 143 | - text-shadow: 0 1px 0 <?php echo esc_attr( $base_lighter_20 ); ?>; |
|
| 143 | + text-shadow: 0 1px 0 <?php echo esc_attr($base_lighter_20); ?>; |
|
| 144 | 144 | -webkit-font-smoothing: antialiased; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | h2 { |
| 148 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 148 | + color: <?php echo esc_attr($base); ?>; |
|
| 149 | 149 | display: block; |
| 150 | 150 | font-family: Arial,Helvetica,sans-serif; |
| 151 | 151 | font-size: 18px; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | h3 { |
| 159 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 159 | + color: <?php echo esc_attr($base); ?>; |
|
| 160 | 160 | display: block; |
| 161 | 161 | font-family: Arial,Helvetica,sans-serif; |
| 162 | 162 | font-size: 16px; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | a { |
| 170 | - color: <?php echo esc_attr( $base ); ?>; |
|
| 170 | + color: <?php echo esc_attr($base); ?>; |
|
| 171 | 171 | font-weight: normal; |
| 172 | 172 | text-decoration: underline; |
| 173 | 173 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | .table-bordered { |
| 188 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 188 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 189 | 189 | border-collapse: collapse; |
| 190 | 190 | border-spacing: 0; |
| 191 | 191 | width: 100%; |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | .table-bordered th, |
| 195 | 195 | .table-bordered td { |
| 196 | - border: 1px solid <?php echo esc_attr( $body_darker_10 ); ?>; |
|
| 197 | - color: <?php echo esc_attr( $text_lighter_20 ); ?>; |
|
| 196 | + border: 1px solid <?php echo esc_attr($body_darker_10); ?>; |
|
| 197 | + color: <?php echo esc_attr($text_lighter_20); ?>; |
|
| 198 | 198 | font-size: 14px; |
| 199 | 199 | } |
| 200 | 200 | .small { |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | text-decoration: none; |
| 295 | 295 | } |
| 296 | 296 | .btn-default { |
| 297 | - color: <?php echo esc_attr( $base_text ); ?>; |
|
| 298 | - background-color: <?php echo esc_attr( $base ); ?>; |
|
| 299 | - border-color: <?php echo esc_attr( $base ); ?>; |
|
| 297 | + color: <?php echo esc_attr($base_text); ?>; |
|
| 298 | + background-color: <?php echo esc_attr($base); ?>; |
|
| 299 | + border-color: <?php echo esc_attr($base); ?>; |
|
| 300 | 300 | } |
| 301 | 301 | .btn-primary { |
| 302 | 302 | color: #fff; |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 13 | 13 | |
| 14 | -do_action( 'wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note ); |
|
| 14 | +do_action('wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note); |
|
| 15 | 15 | |
| 16 | 16 | // Generate the custom message body. |
| 17 | -echo wptexturize( wp_kses_post( str_replace( '{customer_note}', $customer_note, $message_body ) ) ); |
|
| 17 | +echo wptexturize(wp_kses_post(str_replace('{customer_note}', $customer_note, $message_body))); |
|
| 18 | 18 | |
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 22 | 22 | |
| 23 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 24 | 24 | |
| 25 | -do_action( 'wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note ); |
|
| 25 | +do_action('wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note); |
|
| 26 | 26 | |
| 27 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | 27 | \ No newline at end of file |
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
| 29 | 29 | \ No newline at end of file |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | // MUST have WordPress. |
| 10 | -if ( !defined( 'WPINC' ) ) { |
|
| 10 | +if (!defined('WPINC')) { |
|
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | |
@@ -24,40 +24,40 @@ discard block |
||
| 24 | 24 | * @param Array $assoc_args Key value arguments stored in associated array format. |
| 25 | 25 | * @since 1.0.13 |
| 26 | 26 | */ |
| 27 | - public function insert_invoice( $args, $assoc_args ) { |
|
| 27 | + public function insert_invoice($args, $assoc_args) { |
|
| 28 | 28 | |
| 29 | 29 | // Fetch invoice data from the args |
| 30 | - $invoice_data = wp_unslash( $assoc_args ); |
|
| 30 | + $invoice_data = wp_unslash($assoc_args); |
|
| 31 | 31 | |
| 32 | 32 | // Abort if no invoice data is provided |
| 33 | - if( empty( $invoice_data ) ) { |
|
| 34 | - return WP_CLI::error( __( 'Invoice data not provided', 'invoicing' ) ); |
|
| 33 | + if (empty($invoice_data)) { |
|
| 34 | + return WP_CLI::error(__('Invoice data not provided', 'invoicing')); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | //Cart details |
| 38 | - if( !empty( $invoice_data['cart_details'] ) ) { |
|
| 39 | - $invoice_data['cart_details'] = json_decode( $invoice_data['cart_details'], true ); |
|
| 38 | + if (!empty($invoice_data['cart_details'])) { |
|
| 39 | + $invoice_data['cart_details'] = json_decode($invoice_data['cart_details'], true); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | //User details |
| 43 | - if( !empty( $invoice_data['user_info'] ) ) { |
|
| 44 | - $invoice_data['user_info'] = json_decode( $invoice_data['user_info'], true ); |
|
| 43 | + if (!empty($invoice_data['user_info'])) { |
|
| 44 | + $invoice_data['user_info'] = json_decode($invoice_data['user_info'], true); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | //Payment info |
| 48 | - if( !empty( $invoice_data['payment_details'] ) ) { |
|
| 49 | - $invoice_data['payment_details'] = json_decode( $invoice_data['payment_details'], true ); |
|
| 48 | + if (!empty($invoice_data['payment_details'])) { |
|
| 49 | + $invoice_data['payment_details'] = json_decode($invoice_data['payment_details'], true); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Try creating the invoice |
| 53 | - $invoice = wpinv_insert_invoice( $invoice_data, true ); |
|
| 53 | + $invoice = wpinv_insert_invoice($invoice_data, true); |
|
| 54 | 54 | |
| 55 | - if ( is_wp_error( $invoice ) ) { |
|
| 56 | - return WP_CLI::error( $invoice->get_error_message() ); |
|
| 55 | + if (is_wp_error($invoice)) { |
|
| 56 | + return WP_CLI::error($invoice->get_error_message()); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->get_id() ); |
|
| 60 | - WP_CLI::success( $message ); |
|
| 59 | + $message = sprintf(__('Invoice %s created', 'invoicing'), $invoice->get_id()); |
|
| 60 | + WP_CLI::success($message); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -8,23 +8,23 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div class='form-group'> |
| 16 | - <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e( 'Heading', 'invoicing' ) ?></label> |
|
| 16 | + <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e('Heading', 'invoicing') ?></label> |
|
| 17 | 17 | <input :id="active_form_element.id + '_edit_heading'" v-model='active_form_element.text' class='form-control' type='text' /> |
| 18 | 18 | </div> |
| 19 | 19 | |
| 20 | 20 | <div class='form-group'> |
| 21 | - <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e( 'Select Heading Level', 'invoicing' ) ?></label> |
|
| 21 | + <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e('Select Heading Level', 'invoicing') ?></label> |
|
| 22 | 22 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_level'" v-model='active_form_element.level'> |
| 23 | - <option value='h1'><?php esc_html_e( 'H1', 'invoicing' ); ?></option> |
|
| 24 | - <option value='h2'><?php esc_html_e( 'H2', 'invoicing' ); ?></option> |
|
| 25 | - <option value='h3'><?php esc_html_e( 'H3', 'invoicing' ); ?></option> |
|
| 26 | - <option value='h4'><?php esc_html_e( 'H4', 'invoicing' ); ?></option> |
|
| 27 | - <option value='h5'><?php esc_html_e( 'H5', 'invoicing' ); ?></option> |
|
| 28 | - <option value='h6'><?php esc_html_e( 'H6', 'invoicing' ); ?></option> |
|
| 23 | + <option value='h1'><?php esc_html_e('H1', 'invoicing'); ?></option> |
|
| 24 | + <option value='h2'><?php esc_html_e('H2', 'invoicing'); ?></option> |
|
| 25 | + <option value='h3'><?php esc_html_e('H3', 'invoicing'); ?></option> |
|
| 26 | + <option value='h4'><?php esc_html_e('H4', 'invoicing'); ?></option> |
|
| 27 | + <option value='h5'><?php esc_html_e('H5', 'invoicing'); ?></option> |
|
| 28 | + <option value='h6'><?php esc_html_e('H6', 'invoicing'); ?></option> |
|
| 29 | 29 | </select> |
| 30 | 30 | </div> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * @version 1.0.19 |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * REST API invoices controller class. |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | 'customers' => array( |
| 55 | - 'description' => __( 'Limit result set to invoices for specific user ids.', 'invoicing' ), |
|
| 55 | + 'description' => __('Limit result set to invoices for specific user ids.', 'invoicing'), |
|
| 56 | 56 | 'type' => 'array', |
| 57 | 57 | 'items' => array( |
| 58 | 58 | 'type' => 'integer', |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ), |
| 63 | 63 | |
| 64 | 64 | 'exclude_customers' => array( |
| 65 | - 'description' => __( 'Exclude invoices to specific users.', 'invoicing' ), |
|
| 65 | + 'description' => __('Exclude invoices to specific users.', 'invoicing'), |
|
| 66 | 66 | 'type' => 'array', |
| 67 | 67 | 'items' => array( |
| 68 | 68 | 'type' => 'integer', |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ), |
| 73 | 73 | |
| 74 | 74 | 'parent' => array( |
| 75 | - 'description' => __( 'Limit result set to those of particular parent IDs.', 'invoicing' ), |
|
| 75 | + 'description' => __('Limit result set to those of particular parent IDs.', 'invoicing'), |
|
| 76 | 76 | 'type' => 'array', |
| 77 | 77 | 'items' => array( |
| 78 | 78 | 'type' => 'integer', |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ), |
| 83 | 83 | |
| 84 | 84 | 'parent_exclude' => array( |
| 85 | - 'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'invoicing' ), |
|
| 85 | + 'description' => __('Limit result set to all items except those of a particular parent ID.', 'invoicing'), |
|
| 86 | 86 | 'type' => 'array', |
| 87 | 87 | 'items' => array( |
| 88 | 88 | 'type' => 'integer', |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | 98 | // Filter collection parameters for the invoices controller. |
| 99 | - return apply_filters( 'getpaid_rest_invoices_collection_params', $params, $this ); |
|
| 99 | + return apply_filters('getpaid_rest_invoices_collection_params', $params, $this); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | * @param WP_REST_Request $request Request object. |
| 108 | 108 | * @return array $query_args |
| 109 | 109 | */ |
| 110 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
| 110 | + protected function prepare_items_query($prepared_args = array(), $request = null) { |
|
| 111 | 111 | |
| 112 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
| 112 | + $query_args = parent::prepare_items_query($prepared_args); |
|
| 113 | 113 | |
| 114 | 114 | // Retrieve invoices for specific customers. |
| 115 | - if ( ! empty( $request['customers'] ) ) { |
|
| 115 | + if (!empty($request['customers'])) { |
|
| 116 | 116 | $query_args['author__in'] = $request['customers']; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // Skip invoices for specific customers. |
| 120 | - if ( ! empty( $request['exclude_customers'] ) ) { |
|
| 120 | + if (!empty($request['exclude_customers'])) { |
|
| 121 | 121 | $query_args['author__not_in'] = $request['exclude_customers']; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return apply_filters( 'getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this ); |
|
| 124 | + return apply_filters('getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this); |
|
| 125 | 125 | |
| 126 | 126 | } |
| 127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @return array A list of registered item statuses. |
| 134 | 134 | */ |
| 135 | 135 | public function get_post_statuses() { |
| 136 | - return array_keys( wpinv_get_invoice_statuses( true, false, $this->post_type ) ); |
|
| 136 | + return array_keys(wpinv_get_invoice_statuses(true, false, $this->post_type)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | * @param WPInv_Invoice $invoice Invoice to save. |
| 143 | 143 | * @return WP_Error|WPInv_Invoice |
| 144 | 144 | */ |
| 145 | - protected function save_object( $invoice ) { |
|
| 145 | + protected function save_object($invoice) { |
|
| 146 | 146 | $invoice->recalculate_total(); |
| 147 | - return parent::save_object( $invoice ); |
|
| 147 | + return parent::save_object($invoice); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | } |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class='wpinv-address-wrapper row'> |
| 15 | 15 | |
| 16 | - <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e( 'Billing / Shipping Address', 'invoicing' ); ?></h4> |
|
| 16 | + <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e('Billing / Shipping Address', 'invoicing'); ?></h4> |
|
| 17 | 17 | |
| 18 | 18 | <div class='form-group address-field-preview wpinv-payment-form-field-preview' v-for='(field, index) in visible_fields( form_element.fields )' :class='grid_class( field )' :key='field.name'> |
| 19 | 19 | <label class="d-block w-100"> |