Hello
I created a local plugin called local_xxx and this has a moodle editor to add content to the user. I could successfully save images user's add to the text editor using following methods.
$entry = file_prepare_standard_editor($entry, 'description', $definitionoptions, $context, 'local_xxx', 'entry');
#After getting data
$data->id = $DB->insert_record('table_name', $data);
$entry = file_postupdate_standard_editor($data, 'description', $definitionoptions, $context, 'local_xxx', 'entry', $data->id);
$DB->update_record('table_name', $entry);
But when I tried to use file_rewrite_pluginfile_urls to show the content, it doesn't show the image properly.
$description = file_rewrite_pluginfile_urls($data->description, 'pluginfile.php', $context->id, 'local_xxx', 'entry', $postid);
But uploaded image is existing in filedir. How can I make this work?
Thanks you