-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Background Processing ### Added - Handle `meta_input` field for Term imports - Use `wpautop`for certain fields. Fields are filtered by "yaim_{$type}_autop_keys" filter - Handle p2p connections for post import - Use a5hleyrich/wp-background-processing and process all imports in background ### Changed - More stable log ### Fixed - Multilang values for directly nested attributes. eg `meta_input`. Also works if some directly nested attributes have translations, and others not.
- Loading branch information
1 parent
5e00b5b
commit 40f0a54
Showing
23 changed files
with
1,918 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,3 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"type": "fixed", | ||
"message": "Multilang values for directly nested attributes. eg `meta_input`. Also works if some directly nested attributes have translations, and others not." | ||
}, | ||
{ | ||
"type": "added", | ||
"message": "Handle `meta_input` field for Term imports" | ||
}, | ||
{ | ||
"type": "added", | ||
"message": "Use `wpautop`for certain fields. Fields are filtered by \"yaim_{$type}_autop_keys\" filter" | ||
}, | ||
{ | ||
"type": "added", | ||
"message": "Handle p2p connections for post import" | ||
}, | ||
{ | ||
"type": "changed", | ||
"message": "More stable log" | ||
}, | ||
{ | ||
"type": "added", | ||
"message": "Use a5hleyrich/wp-background-processing and process all imports in background" | ||
} | ||
] | ||
"changes": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace yaim; | ||
|
||
// If this file is called directly, abort. | ||
if ( ! defined( 'WPINC' ) ) { | ||
die; | ||
} | ||
|
||
use croox\wde\utils; | ||
|
||
class Admin_Message_Log { | ||
|
||
protected $msgs = array(); | ||
|
||
protected static $option_key = 'yaim_log'; | ||
|
||
protected $start; | ||
|
||
public function __construct(){ | ||
$this->start = date('d-M-Y H:i:s T'); | ||
update_option( self::$option_key . '_start', $this->start ); | ||
|
||
$this->add_entries( array( $this->start, '' ) ); | ||
|
||
} | ||
|
||
public function add_entries( $msgs = array(), $key = null ){ | ||
foreach( $msgs as $msg ) { | ||
$this->add_entry( $msg ); | ||
} | ||
} | ||
|
||
public function add_entry( $msg = '', $key = null ){ | ||
if ( null === $key ) { | ||
$this->msgs[] = $msg; | ||
} else { | ||
if ( array_key_exists( $key, $this->msgs ) ) { | ||
$this->msgs[$key] .= $msg; | ||
|
||
} else { | ||
$this->msgs[$key] = $msg; | ||
} | ||
} | ||
} | ||
|
||
public function get(){ | ||
return $this->msgs; | ||
} | ||
|
||
public static function get_from_db(){ | ||
$msgs = get_option( self::$option_key ); | ||
$last = get_option( self::$option_key . '_start' ); | ||
return array( | ||
'msgs' => $msgs, | ||
'last_start' => get_option( self::$option_key . '_start' ), | ||
'last_log_saved' => count( $msgs ) > 0 && $msgs[0] === $last, | ||
); | ||
} | ||
|
||
public function save(){ | ||
update_option( self::$option_key, $this->msgs ); | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.