Skip to content
Snippets Groups Projects
Commit 26a0fab0 authored by Erick Hitter's avatar Erick Hitter
Browse files

PHPCS

parent 609b7730
No related branches found
No related tags found
1 merge request!14Add native block-editor support
Pipeline #4805 failed with stages
in 2 minutes and 11 seconds
......@@ -4,7 +4,7 @@
**Tags:** link, redirect, external link, permalink
**Requires at least:** 3.0
**Tested up to:** 6.0
**Stable tag:** 1.2
**Stable tag:** 1.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
......@@ -37,6 +37,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
## Changelog ##
### 1.3 ###
* Introduce block-editor (Gutenberg) sidebar component for supported post types..
### 1.2 ###
* Introduce `get_redirect_data()` method to look up a post ID's redirect.
* Introduce PHPUnit tests
......@@ -67,6 +70,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
## Upgrade Notice ##
### 1.3 ###
Introduces block-editor (Gutenberg) sidebar component for supported post types.
### 1.2 ###
Introduces `get_redirect_data()` method along with unit tests and PHPCS cleanup.
......
......@@ -3,7 +3,7 @@
* Plugin Name: External Permalinks Redux
* Plugin URI: http://www.thinkoomph.com/plugins-modules/external-permalinks-redux/
* Description: Allows users to point WordPress objects (posts, pages, custom post types) to a URL of your choosing. Inspired by and backwards-compatible with <a href="http://txfx.net/wordpress-plugins/page-links-to/">Page Links To</a> by Mark Jaquith. Written for use on WordPress.com VIP.
* Version: 1.2
* Version: 1.3
* Author: Erick Hitter & Oomph, Inc.
* Author URI: http://www.thinkoomph.com/
*
......@@ -24,9 +24,6 @@
* @package External_Permalinks_Redux
*/
// Include singleton trait used by all classes.
require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-singleton.php';
// Include block-editor class.
require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-block-editor.php';
......@@ -34,7 +31,14 @@ require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-block-e
* Class external_permalinks_redux.
*/
// phpcs:ignore PEAR.NamingConventions.ValidClassName, Squiz.Commenting.ClassComment.Missing
class external_permalinks_redux extends External_Permalinks_Redux_Singleton{
class external_permalinks_redux {
/**
* Singleton!
*
* @var self
*/
protected static $instance;
/**
* Redirect URL meta key.
*
......@@ -65,6 +69,25 @@ class external_permalinks_redux extends External_Permalinks_Redux_Singleton{
*/
private $post_types;
/**
* Instantiate class as a singleton.
*
* @return object
*/
public static function get_instance() {
if ( empty( self::$instance ) ) {
self::$instance = new self();
self::$instance->_setup();
}
return self::$instance;
}
/**
* Unused constructor.
*/
final private function __construct() {}
/**
* Allow access to certain private properties.
*
......
......@@ -8,13 +8,63 @@
/**
* Class Block_Editor.
*/
class External_Permalinks_Redux_Block_Editor extends External_Permalinks_Redux_Singleton {
class External_Permalinks_Redux_Block_Editor {
/**
* Singleton!
*
* @var self
*/
protected static $instance;
/**
* Instantiate class as a singleton.
*
* @return object
*/
public static function get_instance() {
if ( empty( self::$instance ) ) {
self::$instance = new self();
self::$instance->_setup();
}
return self::$instance;
}
/**
* Unused constructor.
*/
final private function __construct() {}
/**
* Set up class.
*
* @return void
*/
protected function _setup() {
// TODO: Implement _setup() method.
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue' ) );
}
/**
* Enqueue block-editor script.
*
* @return void
*/
public function enqueue() {
global $pagenow;
if ( 'widgets.php' === $pagenow ) {
return;
}
$asset_data = require_once dirname( dirname( __FILE__ ) ) . '/assets/build/index.asset.php';
$asset_handle = 'external-permalinks-redux';
wp_enqueue_script(
$asset_handle,
plugins_url( 'assets/build/index.js', dirname( __FILE__ ) ),
$asset_data['dependencies'],
$asset_data['version'],
true
);
}
}
<?php
/**
* Singleton base class.
*
* @package External_Permalinks_Redux
*/
abstract class External_Permalinks_Redux_Singleton {
/**
* Singleton!
*
* @var self
*/
protected static $instance;
/**
* Instantiate class as a singleton.
*
* @return object
*/
public static function get_instance() {
if ( ! isset( static::$instance ) ) {
static::$instance = new static();
static::$instance->_setup();
}
return static::$instance;
}
/**
* Unused constructor.
*/
final private function __construct() {}
/**
* Set up class.
*
* @return void
*/
abstract protected function _setup();
}
# Copyright (C) 2021 Erick Hitter & Oomph, Inc.
# Copyright (C) 2022 Erick Hitter & Oomph, Inc.
# This file is distributed under the same license as the External Permalinks Redux package.
msgid ""
msgstr ""
"Project-Id-Version: External Permalinks Redux 1.2\n"
"Project-Id-Version: External Permalinks Redux 1.3\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/external-permalinks-redux\n"
"POT-Creation-Date: 2021-03-27 20:16:07+00:00\n"
"POT-Creation-Date: 2022-06-12 00:49:47+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"X-Generator: grunt-wp-i18n 0.5.4\n"
"X-Poedit-KeywordsList: "
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Country: United States\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: "
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-Bookmarks: \n"
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"
#: external-permalinks-redux.php:97
#: external-permalinks-redux.php:167
msgid "Temporary (302)"
msgstr ""
#: external-permalinks-redux.php:98
#: external-permalinks-redux.php:168
msgid "Permanent (301)"
msgstr ""
......@@ -37,19 +37,19 @@ msgstr ""
msgid "External Permalinks Redux"
msgstr ""
#: external-permalinks-redux.php:136
#: external-permalinks-redux.php:213
msgid "Destination Address:"
msgstr ""
#: external-permalinks-redux.php:140
#: external-permalinks-redux.php:217
msgid "To restore the original permalink, remove the link entered above."
msgstr ""
#: external-permalinks-redux.php:145
#: external-permalinks-redux.php:222
msgid "Redirect Type:"
msgstr ""
#: external-permalinks-redux.php:147
#: external-permalinks-redux.php:224
msgid "-- Select --"
msgstr ""
......
......@@ -4,7 +4,7 @@ Donate link: http://www.thinkoomph.com/plugins-modules/external-permalinks-redux
Tags: link, redirect, external link, permalink
Requires at least: 3.0
Tested up to: 6.0
Stable tag: 1.2
Stable tag: 1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -37,6 +37,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
== Changelog ==
= 1.3 =
* Introduce block-editor (Gutenberg) sidebar component for supported post types..
= 1.2 =
* Introduce `get_redirect_data()` method to look up a post ID's redirect.
* Introduce PHPUnit tests
......@@ -67,6 +70,9 @@ Using the `epr_post_types` filter, one can modify the default array of object ty
== Upgrade Notice ==
= 1.3 =
Introduces block-editor (Gutenberg) sidebar component for supported post types.
= 1.2 =
Introduces `get_redirect_data()` method along with unit tests and PHPCS cleanup.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment