@@ -4,29 +4,29 @@ |
||
| 4 | 4 | |
| 5 | 5 | abstract class Abstract_Sync_Hooks { |
| 6 | 6 | |
| 7 | - private $queue = array(); |
|
| 7 | + private $queue = array(); |
|
| 8 | 8 | |
| 9 | - function __construct() { |
|
| 9 | + function __construct() { |
|
| 10 | 10 | |
| 11 | - // To sync at the end of the usual WordPress lifecycle |
|
| 12 | - add_action( 'shutdown', array( $this, 'shutdown' ) ); |
|
| 13 | - // To sync on each iteration of an import (when imported using WP All Import) |
|
| 14 | - add_action( 'pmxi_saved_post', array( $this, 'shutdown' ) ); |
|
| 11 | + // To sync at the end of the usual WordPress lifecycle |
|
| 12 | + add_action( 'shutdown', array( $this, 'shutdown' ) ); |
|
| 13 | + // To sync on each iteration of an import (when imported using WP All Import) |
|
| 14 | + add_action( 'pmxi_saved_post', array( $this, 'shutdown' ) ); |
|
| 15 | 15 | |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - protected function enqueue( $item ) { |
|
| 18 | + protected function enqueue( $item ) { |
|
| 19 | 19 | |
| 20 | - if ( empty( $this->queue ) || $item !== $this->queue[ count( $this->queue ) - 1 ] ) { |
|
| 21 | - $this->queue[] = $item; |
|
| 22 | - } |
|
| 20 | + if ( empty( $this->queue ) || $item !== $this->queue[ count( $this->queue ) - 1 ] ) { |
|
| 21 | + $this->queue[] = $item; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function shutdown() { |
|
| 27 | - foreach ( $this->queue as $callback ) { |
|
| 28 | - call_user_func( array( $this, $callback[0] ), $callback[1] ); |
|
| 29 | - } |
|
| 30 | - } |
|
| 26 | + public function shutdown() { |
|
| 27 | + foreach ( $this->queue as $callback ) { |
|
| 28 | + call_user_func( array( $this, $callback[0] ), $callback[1] ); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | } |
@@ -9,23 +9,23 @@ |
||
| 9 | 9 | function __construct() { |
| 10 | 10 | |
| 11 | 11 | // To sync at the end of the usual WordPress lifecycle |
| 12 | - add_action( 'shutdown', array( $this, 'shutdown' ) ); |
|
| 12 | + add_action('shutdown', array($this, 'shutdown')); |
|
| 13 | 13 | // To sync on each iteration of an import (when imported using WP All Import) |
| 14 | - add_action( 'pmxi_saved_post', array( $this, 'shutdown' ) ); |
|
| 14 | + add_action('pmxi_saved_post', array($this, 'shutdown')); |
|
| 15 | 15 | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - protected function enqueue( $item ) { |
|
| 18 | + protected function enqueue($item) { |
|
| 19 | 19 | |
| 20 | - if ( empty( $this->queue ) || $item !== $this->queue[ count( $this->queue ) - 1 ] ) { |
|
| 20 | + if (empty($this->queue) || $item !== $this->queue[count($this->queue) - 1]) { |
|
| 21 | 21 | $this->queue[] = $item; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function shutdown() { |
| 27 | - foreach ( $this->queue as $callback ) { |
|
| 28 | - call_user_func( array( $this, $callback[0] ), $callback[1] ); |
|
| 27 | + foreach ($this->queue as $callback) { |
|
| 28 | + call_user_func(array($this, $callback[0]), $callback[1]); |
|
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |