: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! isset( $_POST['is_BB'] ) ) {
$post_content = et_fb_process_shortcode( stripslashes( $post_content ) );
$result['savedShortcode'] = $post_content;
$response = wp_json_encode( array(
$tmp_dir = function_exists( 'sys_get_temp_dir' ) ? sys_get_temp_dir() : '/tmp';
$tmp_file = tempnam( $tmp_dir, 'et' );
et_()->WPFS()->put_contents( $tmp_file, $response );
// Remove any previous buffered content since we're setting `Content-Length` header
// based on $response value only.
while ( ob_get_level() ) {
header( 'Content-Length: ' . @filesize( $tmp_file ) );
// Charset has to be explicitly mentioned when it is other than UTF-8.
@header( 'Content-Type: application/json; charset=' . esc_attr( get_option( 'blog_charset' ) ) );
die( et_core_intentionally_unescaped( $response, 'html' ) );
* AJAX Callback: Gets layouts data for the builder's library UI.
* @global $_POST['nonce'] Nonce: 'et_builder_library_get_layouts_data'.
* @return string|void $layouts_data JSON Encoded.
public function wp_ajax_et_builder_library_get_layouts_data() {
et_core_security_check( 'edit_posts', 'et_builder_library_get_layouts_data', 'nonce' );
wp_send_json_success( $this->builder_library_layouts_data() );
* AJAX Callback: Updates ET Account in database.
* @global $_POST['nonce'] Nonce: 'et_builder_library_update_account'.
* @global $_POST['username'] Username
* @global $_POST['api_key'] API Key
* @global $_POST['status'] Account Status
public function wp_ajax_et_builder_library_update_account() {
et_core_security_check( 'manage_options', 'et_builder_library_update_account', 'nonce' );
if ( ! self::$_->all( $args ) ) {
$args = array_map( 'sanitize_text_field', $args );
$updates_options = get_site_option( 'et_automatic_updates_options', array() );
'username' => $args['et_username'],
'api_key' => $args['et_api_key'],
update_site_option( 'et_automatic_updates_options', array_merge( $updates_options, $account ) );
update_site_option( 'et_account_status', $args['status'] );
* Enqueues library-related styles and scripts in the admin.
* {@see 'admin_enqueue_scripts'}
public function wp_hook_admin_enqueue_scripts( $page ) {
et_core_load_main_fonts();
wp_enqueue_style( 'et-builder-notification-popup-styles', ET_BUILDER_URI . '/styles/notification_popup_styles.css' );
if ( 'et_pb_layout' === $typenow ) {
$new_layout_modal = et_pb_generate_new_layout_modal();
wp_enqueue_style( 'library-styles', ET_BUILDER_URI . '/styles/library_pages.css', array( 'et-core-admin' ), ET_BUILDER_PRODUCT_VERSION );
wp_enqueue_script( 'library-scripts', ET_BUILDER_URI . '/scripts/library_scripts.js', array(
), ET_BUILDER_PRODUCT_VERSION );
wp_localize_script( 'library-scripts', 'et_pb_new_template_options', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'et_admin_load_nonce' => wp_create_nonce( 'et_admin_load_nonce' ),
'modal_output' => $new_layout_modal,
wp_enqueue_script( 'et-builder-failure-notice', ET_BUILDER_URI . '/scripts/failure_notice.js', array( 'jquery' ), ET_BUILDER_PRODUCT_VERSION );
ET_Builder_Library::instance();