Skip to content

Commit

Permalink
add check for register_block_type
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Jan 11, 2019
1 parent 5affebb commit ba38a6d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
@@ -1,5 +1,8 @@
#### [unreleased]

#### 2.0.1 / 2019-01-11
* added `composer.json` and automatically create POT with `composer update`
* added check for `register_block_type()` for WP 4.9.x and below

#### 2.0.0 / 2018-12-20 🎂
* a proper PDF block was added with much help from [Alex Kirk](https://github.com/akirk), many thanks
Expand Down
17 changes: 9 additions & 8 deletions embed-pdf-viewer.php
Expand Up @@ -5,7 +5,7 @@
* Description: Embed a PDF from the Media Library or elsewhere via oEmbed or as a block into an `object` tag or Google Doc Viewer as fallback.
* Author: Andy Fragen
* Author URI: https://github.com/afragen
* Version: 2.0.0.1
* Version: 2.0.1
* License: GPLv2+
* Domain Path: /languages
* Text Domain: embed-pdf-viewer
Expand Down Expand Up @@ -50,13 +50,14 @@ function() {
array( 'wp-blocks', 'wp-element' )
);

register_block_type(
'embed-pdf-viewer/index',
array(
'editor_script' => 'embed-pdf-viewer',
)
);

if ( function_exists( 'register_block_type' ) ) {
register_block_type(
'embed-pdf-viewer/index',
array(
'editor_script' => 'embed-pdf-viewer',
)
);
}
}
);

Expand Down
4 changes: 2 additions & 2 deletions languages/embed-pdf-viewer.pot
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the Embed PDF Viewer plugin.
msgid ""
msgstr ""
"Project-Id-Version: Embed PDF Viewer 2.0.0.1\n"
"Project-Id-Version: Embed PDF Viewer 2.0.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/embed-pdf-viewer\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-01-02T19:26:00+00:00\n"
"POT-Creation-Date: 2019-01-11T16:02:16+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.1.0\n"
"X-Domain: embed-pdf-viewer\n"
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Expand Up @@ -5,7 +5,7 @@ Tags: pdf, embed, oembed, viewer, block
Requires at least: 5.0
Tested up to: 5.0
Requires PHP: 5.6
Stable tag: 2.0.0
Stable tag: 2.0.1
License: GPL v2+
License URI: <https://www.gnu.org/licenses/gpl-2.0.html>

Expand All @@ -22,6 +22,10 @@ Development on [GitHub](https://github.com/afragen/embed-pdf-viewer). Pull reque

## Changelog

#### 2.0.1 / 2019-01-11
* added `composer.json` and automatically create POT with `composer update`
* added check for `register_block_type()` for WP 4.9.x and below

#### 2.0.0 / 2018-12-20 🎂
* a proper PDF block was added with much help from [Alex Kirk](https://github.com/akirk), many thanks

Expand Down

0 comments on commit ba38a6d

Please sign in to comment.