2017 © Pedro PelĂĄez
 

library theme-lib-embed

Optimizes embeds in WordPress themes.

image

mindkomm/theme-lib-embed

Optimizes embeds in WordPress themes.

  • Friday, March 2, 2018
  • by gchtr
  • Repository
  • 3 Watchers
  • 0 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 79 % Grown

The README.md

Theme\Embed

Optimizes embeds in WordPress themes., (*1)

  • Allows you to set default sizes for oEmbed contents.
  • Wraps oEmbed content with div tags to easier style them for responsiveness. You need to add the CSS yourself, though.
  • Optimizes Youtube playlist embeds where the preview image might lack in quality.

Installation

You can install the package via Composer:, (*2)

composer require mindkomm/theme-lib-embed

Usage

functions.php, (*3)

$embeds = new Theme\Embed\Embed();
$embeds->init();

The Embed constructor takes two parameters:, (*4)

  • $width
    (int) The default width for oEmbed content in pixels. Default 1400.
  • $ratio
    (float) The ratio to use to calculate the height. Default 16/9.

Here’s an example if you wanted your oEmbed contents to have a width of 800px and a height of 400px., (*5)

$embeds = new Theme\Embed\Embed( 800, 0.5 );
$embeds->init();

If you already have an embed_oembed_html filter in place that adds divs with classes responsive-embed and keep-aspect-ratio, you could probably remove it, because this library already adds one, too., (*6)

Support

This is a package that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support., (*7)

The Versions

02/03 2018

dev-master

9999999-dev

Optimizes embeds in WordPress themes.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

02/03 2018

1.0.0

1.0.0.0

Optimizes embeds in WordPress themes.

  Sources   Download

MIT

The Requires

  • php >=7.0.0