Содержимое WP_EDITOR не захватываетсяPhp

Кемеровские программисты php общаются здесь
Гость
Содержимое WP_EDITOR не захватывается

Сообщение Гость »


I'm trying to change the default theme editor () to the WP editor, but the edited content is not updating upon form submission.
Here is the code I'm trying to use:

Код: Выделить всё

ob_start();
$editor_id = 'ad_description'; // Unique ID for the editor
$settings = array(
'textarea_name' => 'job_description', // Name of the textarea field
'textarea_rows' => 10, // Number of rows for the textarea
'media_buttons' => true, // Whether to include media upload buttons
'quicktags' => true, // Whether to include quicktags (HTML shortcuts)
);

wp_editor($description, $editor_id, $settings);

$output = ob_get_contents();
echo $output;
The submission works when I use static data instead of

Код: Выделить всё

$description
. Although

Код: Выделить всё

$description
has data in it and I was able to retrieve data from it.

Код: Выделить всё

$post = get_post($job_id);
$description = $post->post_content;
I also tried to use

Код: Выделить всё

ob_get_clean()
with no luck.
I appreciate any help. Thanks!


Источник: https://stackoverflow.com/questions/781 ... t-captured

Вернуться в «Php»