thanks for your help
it really helped. i made the css external and changed my code like this: (complete code is here)
function load_page_content_ajax() {
global $wpdb;
check_ajax_referer('load_page_content_nonce', 'security');
$page_id = isset($_POST['page_id']) ? intval($_POST['page_id']) : 0;
if (!$page_id) {
wp_send_json_error('not valid.');
die();
}
ob_start();
// external css file
$css_url = esc_url_raw("https://www.yourwebsite.com/wp-content/uploads/bricks/css/post-{$page_id}.min.css?ver=" . time());
echo "<link rel='stylesheet' id='bricks-page-custom-css-{$page_id}' href='{$css_url}' type='text/css' media='all' />";
// checks the database for bricks content
$bricks_content = $wpdb->get_var($wpdb->prepare(
"SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE post_id = %d AND meta_key = '_bricks_page_content_2'",
$page_id
));
if ($bricks_content && !empty($bricks_content)) {
// bricks content
$elements = maybe_unserialize($bricks_content);
echo \Bricks\Frontend::render_data($elements, $page_id);
} else {
// normal content(not bricks)
$post = get_post($page_id);
if ($post) {
echo apply_filters('the_content', $post->post_content);
} else {
echo '<p>صفحه مورد نظر یافت نشد.</p>';
}
}
die();
}
but still i have this question that where they are stored while they are inline?
i think it is stored in database but couldn’t fine the table.
it is not in “postmeta”
and I think it is not an external file