Making WordPress.org

Opened 18 months ago

Last modified 15 months ago

#6591 new defect (bug)

Add Note or Feedback comment Add/Editor not working

Reported by: mayur8991's profile mayur8991 Owned by:
Milestone: Priority: high
Component: Developer Hub Keywords: has-screenshots
Cc:

Description

Go to Any function of wordpress
For Ex : https://developer.wordpress.org/reference/functions/wp_get_attachment_url/
Try to Add comment which having some php code

for test i'm trying to add

Ex :

<?php
$media = get_attached_media('image', $post->ID);
foreach($media as $post_images) { ?>

<img src="<?php echo esc_url(wp_get_attachment_url( $post_images->ID )); ?>" />

<?php } ?>

After adding above code switch to preview and it display completely wrong code

i have tried with inbuilt [php] & [code] none works

Check the screenshot attached


Attachments (2)

write_a_comment.png (67.7 KB) - added by mayur8991 18 months ago.
before
preview.png (65.4 KB) - added by mayur8991 18 months ago.
Preview-After

Download all attachments as: .zip

Change History (4)

@mayur8991
18 months ago

before

@mayur8991
18 months ago

Preview-After

#1 @krupalpanchal
18 months ago

  • Component changed from WordPress.org Site to Developer Hub

Hi there,

Welcome to the trac.

Looks like some issue. I've tried with the below syntax. Still showing the blank preview.

<?php echo esc_url( $img ); ?>
Last edited 18 months ago by krupalpanchal (previous) (diff)

#2 @mayur8991
15 months ago

Its been long time
still no update
Can somebody please take a look on it ?

Note: See TracTickets for help on using tickets.