| 1 |
<?php |
| 2 |
/** |
| 3 |
* Divi source |
| 4 |
* |
| 5 |
* @package WPFunnels\Batch\Divi |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WPFunnels\Batch\Divi; |
| 9 |
|
| 10 |
use WPFunnels\Importer\Wpfnl_Importer_Helper; |
| 11 |
|
| 12 |
/** |
| 13 |
* Divi source |
| 14 |
* |
| 15 |
* @package |
| 16 |
*/ |
| 17 |
class Wpfnl_Divi_Source { |
| 18 |
|
| 19 |
|
| 20 |
/** |
| 21 |
* Import single template |
| 22 |
|
| 23 |
* @param string $step_id Funnel Step Id. |
| 24 |
* |
| 25 |
* @return array|int|void|\WP_Error |
| 26 |
* |
| 27 |
* @since 1.0.0 |
| 28 |
*/ |
| 29 |
public function import_single_template( $step_id ) { |
| 30 |
|
| 31 |
add_filter( 'wp_kses_allowed_html', array( $this, 'allowed_tags_and_attributes' ), 10, 2 ); |
| 32 |
$content = get_post_field( 'post_content', $step_id ); |
| 33 |
if ( $content ) { |
| 34 |
$content = Wpfnl_Importer_Helper::get_instance()->get_post_contents( $step_id ); |
| 35 |
wp_update_post( |
| 36 |
array( |
| 37 |
'ID' => $step_id, |
| 38 |
'post_content' => $content, |
| 39 |
) |
| 40 |
); |
| 41 |
|
| 42 |
// Delete temporary meta key. |
| 43 |
delete_post_meta( $step_id, 'divi_content' ); |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
|