Title: Pym.js Embeds
Author: Automattic
Published: <strong>Òkúdù 17, 2016</strong>
Last modified: Èbìbí  4, 2026

---

Ṣàwárí àwọn plugin

![](https://ps.w.org/pym-shortcode/assets/banner-772x250.jpg?rev=1438598)

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://ps.w.org/pym-shortcode/assets/icon.svg?rev=1944461)

# Pym.js Embeds

 Láti ọwọ́ [Automattic](https://profiles.wordpress.org/automattic/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/pym-shortcode.2.0.0.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/pym-shortcode/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/pym-shortcode/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/pym-shortcode/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/pym-shortcode/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/pym-shortcode/)

## Àpèjúwe

Pym.js Embeds provides shortcode and Gutenberg block wrappers for embedding responsive
iframes using [Pym.js](http://blog.apps.npr.org/pym.js/), developed by the NPR Visuals
Team. Embedded content resizes vertically to match its containerÌtumọ̀ Yorùbá: ’
s width.

AMP compatibility is provided by the [official AMP plugin](https://wordpress.org/plugins/amp/).

### Pym.js Resources from NPR

You may also want to look at NPRÌtumọ̀ Yorùbá: ’s Pym.js resources:

 * [Pym.js homepage](http://blog.apps.npr.org/pym.js/)
 * [Pym.js repo on GutHub/nprapps](https://github.com/nprapps/pym.js/)

## Àwọn ìdí

Plugin yìí pèsè 1 ìdí.

 *   Pym.js Embed

## Ìgbéwọlẹ̀

 1. In the WordPress Dashboard go to **Plugins**, then click the **Add Plugins** button
    and search the WordPress Plugins Directory for Pym.js Embeds. Alternatively, you
    can download the zip file from this Github repo and upload it manually to your 
    WordPress site.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. In **Settings > Pym.js Embed Settings**, decide whether youÌtumọ̀ Yorùbá: ’d like
    to change the pluginÌtumọ̀ Yorùbá: ’s behavior to use a non-default source URL 
    for `Pym.js`, and whether youÌtumọ̀ Yorùbá: ’d like to prevent post authors from
    setting embed-specific URLs for `Pym.js`
 4. Begin embedding content!

## FAQ

For answers to frequently asked questions, [see this pluginÌtumọ̀ Yorùbá: ’s documentation on GitHub](https://github.com/INN/pym-shortcode/tree/master/docs).

For support resources, [see this pluginÌtumọ̀ Yorùbá: ’s documentation on GitHub](https://github.com/INN/pym-shortcode/tree/master/docs).

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“Pym.js Embeds” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa
sí plugin yìí.

Àwọn Olùkópa

 *   [ Automattic ](https://profiles.wordpress.org/automattic/)
 *   [ INN Labs ](https://profiles.wordpress.org/innlabs/)

[Túmọ̀ “Pym.js Embeds” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/pym-shortcode)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/pym-shortcode/), ṣàyẹ̀wò
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/pym-shortcode/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/pym-shortcode/) 
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/pym-shortcode/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 2.0.0

Security fix: the `pymoptions` shortcode/block attribute is now parsed against an
allowlist of known Pym.js Parent options (xdomain, title, name, id, sandbox, parenturlparam,
parenturlvalue, allowfullscreen, optionalparams, trackscroll, scrollwait) and JSON-
encoded at output time. Previously the attribute was inlined verbatim into the `
new pym.Parent(...)` call, which made it a stored XSS sink for any user who could
author content. Documented usage (e.g. `pymoptions=" xdomain: '*\.npr\.org' "`) 
continues to work; arbitrary JavaScript values are dropped.

Backwards-incompatible change: the pluggable function `pym_shortcode_script_footer_enqueue`
now receives `$args['pymoptions']` as an associative array of sanitized options 
rather than a raw JavaScript object body string. Sites that override this pluggable
function must update their override to consume the array (and JSON-encode it safely
on output).

#### 1.3.2.4

 * Now tested up to WordPress 5.4 and Gutenberg 7.8.
 * Fixes a presentational error in the Pym.js Embeds BlockÌtumọ̀ Yorùbá: ’s block
   inspector control within the editor. PR [#74](https://github.com/INN/pym-shortcode/pull/74)
   for issue [#72](https://github.com/INN/pym-shortcode/issues/72).

#### 1.3.2.3

New features:

 * Adds compatibility with [the official WordPress AMP Plugin](https://wordpress.org/plugins/amp/).
   On AMP endpoints, markup for Pym.js-based embeds is converted to `amp-iframe`
   tags. If youÌtumọ̀ Yorùbá: ’re not using the AMP Plugin, your site wonÌtumọ̀ 
   Yorùbá: ’t be affected. And if youÌtumọ̀ Yorùbá: ’re not viewing a page on an
   AMP endpoint, the page wonÌtumọ̀ Yorùbá: ’t be affected. PR [#62](https://github.com/INN/pym-shortcode/pull/62)
   by Claudiu Lodromanean, [originally for AutomatticÌtumọ̀ Yorùbá: ’s Newspack](https://github.com/Automattic/newspack-plugin/pull/276).

Other updates:

 * Adds credit to GitHub user [eidietrich](https://github.com/eidietrich) for [PR #55](https://github.com/INN/pym-shortcode/pull/55)
   in the 1.3.2.2 release notes.
 * Fixes a ‘nwesroom’ typo. [PR #66](https://github.com/INN/pym-shortcode/pull/66)
   for issue [#65](https://github.com/INN/pym-shortcode/issues/65).

#### 1.3.2.2

 * Plugin is now tested against WordPress 5.0 beta 3.
 * Adds support for WordPress 5.0.
 * Fixes bug where the Pym.js Embeds block did not work in WordPress 5.0. [PR #58](https://github.com/INN/pym-shortcode/pulls/58)
   for [issue #57](https://github.com/INN/pym-shortcode/issues/57).
 * Adds advice for where to host graphics files. [PR #55](https://github.com/INN/pym-shortcode/pull/55)
   from Github user [eidietrich](https://github.com/eidietrich).

#### 1.3.2.1

**This is a major update! Please read the release notes.**

Following the practice begun at plugin version 1.1.2 of [having the plugin version number match the version number of the bundled copy of `Pym.js`](https://github.com/INN/pym-shortcode/blob/master/docs/maintainer-notes.md),
the first three numbers in this pluginÌtumọ̀ Yorùbá: ’s version do not change with
this release because the `Pym.js` version has not changed. WeÌtumọ̀ Yorùbá: ’ve 
tacked a `.1` on to the end to denote this release. Please read the release notes
and test your site as appropriate before upgrading in production.

We wish to thank all who helped us test [the release candidate](https://github.com/INN/pym-shortcode/releases/tag/v1.3.2.1-rc1)
for this version, including Mike Janssen at [Current.org](https://current.org/) 
and Alyson Hurt at the NPR Visuals Team.

New features:

 * Plugin renamed from “Pym Shortcode” to “Pym.js Embeds”.
 * Adds a “Pym.js Embed” block for use in Gutenberg. [PR #34](https://github.com/INN/pym-shortcode/pull/34)
   for issue [#28](https://github.com/INN/pym-shortcode/issues/28).
    - If a block is created using this plugin and Gutenberg, and Gutenberg is then
      disabled, the block will show a link to the embedded graphic.
 * Through the settings page, you can now serve Pym.js using your newsroomÌtumọ̀
   Yorùbá: ’s CDN or NPRÌtumọ̀ Yorùbá: ’s CDN! PR #45 for [issue #31](https://github.com/INN/pym-shortcode/issues/31).
 * Adds a settings page, available to [those users with the `manage_options` capability](https://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table),
   with the following options:
    - Change the default pymsrc URL. [PR #45](https://github.com/INN/pym-shortcode/pull/45)
      for [issue #8](https://github.com/INN/pym-shortcode/issues/8).
    - Override block and shortcode pymsrc URLs with the default pymsrc URL. [PR #45](https://github.com/INN/pym-shortcode/pull/45)
      for [issue #8](https://github.com/INN/pym-shortcode/issues/8).
 * Adds an informational page, available to all who can make posts, that lists the
   pluginÌtumọ̀ Yorùbá: ’s default source URL for `Pym.js`. This is to make the 
   process of building new interactives easier.
 * Shortcode now gains an explicit `align=""` parameter, so that WordPressÌtumọ̀
   Yorùbá: ’s generated [alignment CSS classes](https://codex.wordpress.org/CSS#WordPress_Generated_Classes)
   can be used on embeds. By enabling this in the shortcode, the Gutenberg Block
   also gains support for alignment. [PR #34](https://github.com/INN/pym-shortcode/pull/34).
   Prior to this release, the alignment classes could be added via the `class=""`
   parameter.
 * Script tags for embeds are no longer output by `the_content()`, instead being
   output during `wp_footer()` by [closures](https://secure.php.net/manual/en/functions.anonymous.php)
   hooked on the `'wp_footer'` action. [PR #34](https://github.com/INN/pym-shortcode/pull/34)
   for issues [#33](https://github.com/INN/pym-shortcode/issues/33) and [#35](https://github.com/INN/pym-shortcode/issues/35).
 * The script tag used to run `new pym.Parent` is now configurable. By replacing
   the [pluggable function](https://codex.wordpress.org/Pluggable_Functions) `pym_shortcode_script_footer_enqueue()`
   with your own function, you can now use alternate forms of embed code that may
   be required for PJAX sites or custom versions of Pym.js. This resolves issue 
   [#19](https://github.com/INN/pym-shortcode/issues/19).
 * Adds “Requires PHP: 5.3” metadata to the pluginÌtumọ̀ Yorùbá: ’s `readme.txt`,
   since weÌtumọ̀ Yorùbá: ’re now using PHP namespaces for some code.
 * Adds documentation for how to test the plugin:
    - tests to run before enabling the “override pymsrc” option in production
    - tests to run for site compatibility with Gutenberg

Changes:

 * The source URL for `pymjs`, known as the pymsrc URL, is now passed through [wp_http_validate_url](https://developer.wordpress.org/reference/functions/wp_http_validate_url/).
   [PR #45](https://github.com/INN/pym-shortcode/pull/45) for [issue #8](https://github.com/INN/pym-shortcode/issues/8).
 * The source URL for `pym.js` is no longer output by `the_content()`, instead being
   output during `wp_footer` by an action dedicated to the task. If different shortcodes
   and/or blocks on the page specify different source URLs for Pym.js, all are output(
   after removing duplicates), but a message is logged in the browser console. If`
   WP_DEBUG` is set, this message is also logged to the server log, with the post
   ID specified. [PR #34](https://github.com/INN/pym-shortcode/pull/34) for issues
   [#33](https://github.com/INN/pym-shortcode/issues/33) and [#35](https://github.com/INN/pym-shortcode/issues/35).
   See https://github.com/INN/pym-shortcode/tree/master/docs#ive-set-a-different-
   pymsrc-option-but-now-im-seeing-a-message-in-the-console
 * `docs/updating-pym.md` becomes `docs/maintainer-notes.md`
 * Script tags for embeds are no longer output by `the_content()`, instead being
   output during `wp_footer()` by [closures](https://secure.php.net/manual/en/functions.anonymous.php)
   hooked on the `'wp_footer'` action. [PR #34](https://github.com/INN/pym-shortcode/pull/34)
   for issues [#33](https://github.com/INN/pym-shortcode/issues/33) and [#35](https://github.com/INN/pym-shortcode/issues/35).

Removed:

 * Script tags for embeds are no longer output by `the_content()`, instead being
   output during `wp_footer()` by [closures](https://secure.php.net/manual/en/functions.anonymous.php)
   hooked on the `'wp_footer'` action. [PR #34](https://github.com/INN/pym-shortcode/pull/34)
   for issues [#33](https://github.com/INN/pym-shortcode/issues/33) and [#35](https://github.com/INN/pym-shortcode/issues/35).

#### 1.3.2

 * _RECOMMENDED UPDATE_ : Pym.js users, NPR has released an update that closes a
   potential security hole. We recommend everyone update to 1.3.2.
 * Update to Pym.js version 1.3.2: https://github.com/nprapps/pym.js/releases/tag/
   v1.3.2 (Changelog at https://github.com/nprapps/pym.js/blob/v1.3.2/CHANGELOG)

#### 1.3.1

 * Update to Pym.js version 1.3.1: https://github.com/nprapps/pym.js/releases/tag/
   v1.3.1 (Changelog at https://github.com/nprapps/pym.js/blob/v1.3.1/CHANGELOG)
 * (we skipped pym.js version 1.3.0: https://github.com/nprapps/pym.js/releases/
   tag/v1.3.0)

#### 1.2.2

 * Update to Pym.js version 1.2.2: https://github.com/nprapps/pym.js/releases/tag/
   v1.2.2 (Changelog at https://github.com/nprapps/pym.js/blob/master/CHANGELOG )
 * (we skipped Pym.js version 1.2.1: https://github.com/nprapps/pym.js/releases/
   tag/v1.2.1 )
 * Add `id=""` attribute to allow setting custom IDs on embeds. [#21](https://github.com/INN/pym-shortcode/issues/21)
 * Add `class=""` attribute to allow setting custom classes on embeds. [#22](https://github.com/INN/pym-shortcode/issues/22)
   and [#23](https://github.com/INN/pym-shortcode/issues/23).
 * Add a default class name `pym` to all embed-containing div elements output by
   this plugin, and a filter ‘pym_shortcode_default_class’ to allow changing it.

#### 1.2.0.2

 * Fix encoding error on pym.v1.min.js, [thanks to lchheng](https://github.com/INN/pym-shortcode/pull/18)

#### 1.2.0.1

 * Add attribution for lchhengÌtumọ̀ Yorùbá: ’s [pymsrc fix](https://github.com/INN/pym-shortcode/pull/17).

#### 1.2.0

 * Update to Pym.js version 1.2.0: https://github.com/nprapps/pym.js/releases/tag/
   v1.2.0 (Changelog at https://github.com/nprapps/pym.js/blob/v1.2.0/CHANGELOG )
 * Fixes a bug where the `pymsrc` attribute might have been ignored, for real this
   time. [Thanks, lchheng!](https://github.com/INN/pym-shortcode/pull/17)

#### 1.1.2

 * Update to Pym.js version 1.1.2: https://github.com/nprapps/pym.js/releases/tag/
   v1.1.2
 * Switch the new default url of `Pym.js` in this plugin to `js/pym.v1.min.js`, 
   leaving the existing `js/pym.js` where it is.
 * Provide additional notes in [the documentation](https://github.com/INN/pym-shortcode/tree/master/docs)
   for maintainers on updating `Pym.js` in this plugin
 * Fixes a bug where the `pymsrc` attribute might have been ignored
 * Fixes and corrections to documentation.

#### 1.0

 * First release of the plugin

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **2.0.0**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **oṣù 3 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **100+**
 *  Ẹ̀yà WordPress ** 3.0.1 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **5.4.21**
 *  Ẹ̀yà PHP ** 5.3 tàbí ju bẹ́ẹ̀ lọ **
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/pym-shortcode/)
 * Àwọn àmì
 * [Embeds](https://yor.wordpress.org/plugins/tags/embeds/)[iframe](https://yor.wordpress.org/plugins/tags/iframe/)
   [javascript](https://yor.wordpress.org/plugins/tags/javascript/)[responsive](https://yor.wordpress.org/plugins/tags/responsive/)
   [shortcode](https://yor.wordpress.org/plugins/tags/shortcode/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/pym-shortcode/advanced/)

## Àwọn ìbò

Kò sí ìwádìí tí a tíì fi ránṣẹ́.

[Your review](https://wordpress.org/support/plugin/pym-shortcode/reviews/#new-post)

[Wo gbogbo àwọn àgbéyẹ̀wò](https://wordpress.org/support/plugin/pym-shortcode/reviews/)

## Àwọn Olùkópa

 *   [ Automattic ](https://profiles.wordpress.org/automattic/)
 *   [ INN Labs ](https://profiles.wordpress.org/innlabs/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/pym-shortcode/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](https://inn.org/donate)