You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7cdaae
Browse filesBrowse the repository at this point in the historyBrowse files
Render the GoDAM player from attributes instead of a built shortcode string
The video embed page, the video-shortcode REST route, the GoDAM Gallery
Elementor widget, the preview page and the entry screens of the Fluent Forms,
WPForms, Everest Forms, SureForms and Gravity Forms recorder fields now hand
their values to the player as an attributes array. A new helper,
rtgodam_render_shortcode_from_atts(), calls the registered shortcode callback
directly, so a value is only ever an attribute value and is never parsed as
shortcode syntax.
- The embed page and the route reduce godam_context and block_source to slug
characters with sanitize_key(); the route argument uses sanitize_key too.
- Stored recording and transcoded URLs are passed through esc_url_raw().
- The route gets a rtgodam_shortcode_atts filter for the attributes array.
The rtgodam_shortcode_output filter, which receives the shortcode string, is
deprecated but still applied when a site uses it; every value in that string
is now an ID, a slug, 'show'/'hide' or JSON.
The rendered player HTML for normal values is unchanged.
Adds unit tests for the helper, the embed and preview pages, the route, the
Elementor gallery widget and each form plugin's entry view. The tests register
a harmless shortcode and check that extra shortcode text in a value does not
run it, and that a normal value still reaches the player.
echortgodam_render_shortcode_from_atts( 'godam_video', $atts ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The player template escapes its output.
@@ -2301,10 +2325,10 @@ function rtgodam_get_block_source_from_context( $context ) {
2301
2325
* making it suitable for embedding in iframes or modals.
2302
2326
*
2303
2327
* @param int $video_id The ID of the video attachment to embed.
2304
-
* @param string $godam_context Optional. The player context passed to the godam_video shortcode (e.g. 'video-only').
2328
+
* @param string $godam_context Optional. The player context passed to the godam_video shortcode (e.g. 'video-only'). Reduced to slug characters with sanitize_key().
2305
2329
* @param string $bg_color Optional. Hex background color applied as --godam-video-bg-color CSS variable on the wrapper.
2306
2330
* @param bool $show_engagements Optional. Whether to show engagements in the embed. Default false (no engagements shown).
2307
-
* @param string $block_source Optional. Analytics placement slug forwarded to the player (e.g. 'video-gallery' for gallery iframes).
2331
+
* @param string $block_source Optional. Analytics placement slug forwarded to the player (e.g. 'video-gallery' for gallery iframes). Reduced to slug characters with sanitize_key().
2308
2332
* @param int $host_post_id Optional. Post ID of the page embedding this iframe, so analytics attribute to the host page.
<?phpechortgodam_render_shortcode_from_atts( 'godam_video', $godam_atts );// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The player template escapes its output.?>
0 commit comments