Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#59769 closed defect (bug) (wontfix)

Blocked preview of non built in media shortcodes

Reported by: programmin's profile programmin Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3.2
Component: Shortcodes Keywords:
Focuses: Cc:

Description

If I want to add my own display shortcode preview, this no longer works:

wp_ajax_parse_media_shortcode() now has:

<?php

        // Only process previews for media related shortcodes:
        $found_shortcodes = get_shortcode_tags_in_content( $shortcode );
        $media_shortcodes = array(
                'audio',
                'embed',
                'playlist',
                'video',
                'gallery',
        );

        $other_shortcodes = array_diff( $found_shortcodes, $media_shortcodes );

        if ( ! empty( $other_shortcodes ) ) {
                wp_send_json_error();
        }

Change History (3)

#1 @programmin
2 years ago

This error actually started with WordPress 6.2.3 auto upgrade - which doesn't seem to have an option to choose in the version dropdown here in Trac.

#2 @sabernhardt
2 years ago

  • Component changed from General to Shortcodes
  • Version changed from 6.2.2 to 6.3.2

Changeset that restricted the shortcodes: [56838]

For the version number, 6.3.3 probably was intended to be 6.2.3. And [56846] added the code in 6.3.2 as well.

#3 @jorbin
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

It is not intended for the wp_ajax_parse_media_shortcode function to provide previews of shortcodes except those provided by core. Any plugin that would like to provide a preview should do so through custom code that can account for who, when, and what previews are provided.

Note: See TracTickets for help on using tickets.