| @@ -32,10 +32,11 @@ | ||
| 32 | 32 | /** |
| 33 | 33 | * Initialise the all admin related stuff |
| 34 | 34 | */ |
| 35 | 35 | public function init() { |
| 36 | + | |
| 36 | 37 | // Load the plugin textdomain |
| 37 | - load_plugin_textdomain( 'boxzilla', null, $this->plugin->dir() . '/languages' ); | |
| 38 | + load_plugin_textdomain( 'boxzilla', null, basename( $this->plugin->dir() ) . '/languages' ); | |
| 38 | 39 | |
| 39 | 40 | // action hooks |
| 40 | 41 | $this->add_hooks(); |
| 41 | 42 | $this->run_migrations(); |
| @@ -488,8 +489,9 @@ | ||
| 488 | 489 | * @param array $rule |
| 489 | 490 | * @return array The sanitized rule array |
| 490 | 491 | */ |
| 491 | 492 | public function sanitize_box_rule( $rule) { |
| 493 | + | |
| 492 | 494 | $rule['value'] = trim( $rule['value'] ); |
| 493 | 495 | |
| 494 | 496 | // convert to array |
| 495 | 497 | $rule['value'] = explode( ',', trim( $rule['value'], ',' ) ); |
| @@ -565,9 +567,10 @@ | ||
| 565 | 567 | $opts = array_replace_recursive( $defaults, $opts ); |
| 566 | 568 | |
| 567 | 569 | $opts['rules'] = array_map( array( $this, 'sanitize_box_rule' ), $opts['rules'] ); |
| 568 | 570 | $opts['css'] = $this->sanitize_box_css( $opts['css'] ); |
| 569 | - $opts['cookie'] = absint( $opts['cookie'] ); | |
| 571 | + $opts['cookie']['triggered'] = absint( $opts['cookie']['triggered'] ); | |
| 572 | + $opts['cookie']['dismissed'] = absint( $opts['cookie']['dismissed'] ); | |
| 570 | 573 | $opts['trigger'] = sanitize_text_field( $opts['trigger'] ); |
| 571 | 574 | $opts['trigger_percentage'] = absint( $opts['trigger_percentage'] ); |
| 572 | 575 | $opts['trigger_element'] = sanitize_text_field( $opts['trigger_element'] ); |
| 573 | 576 | |