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

PHPCS

parent 11bf59dd
No related branches found
No related tags found
1 merge request!14Add native block-editor support
Pipeline #4802 failed with stages
in 2 minutes and 13 seconds
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
*/ */
// Include block-editor class. // Include block-editor class.
require_once __DIR__ . '/inc/class-external-permalinks-redux-block-editor.php'; require_once dirname( __FILE__ ) . '/inc/class-external-permalinks-redux-block-editor.php';
/** /**
* Class external_permalinks_redux. * Class external_permalinks_redux.
...@@ -123,6 +123,13 @@ class external_permalinks_redux { ...@@ -123,6 +123,13 @@ class external_permalinks_redux {
} }
foreach ( $post_types as $post_type ) { foreach ( $post_types as $post_type ) {
if (
function_exists( 'use_block_editor_for_post_type' )
&& use_block_editor_for_post_type( $post_type )
) {
return;
}
$title = apply_filters( 'epr_metabox_title', '', $post_type ); $title = apply_filters( 'epr_metabox_title', '', $post_type );
if ( ! $title ) { if ( ! $title ) {
...@@ -177,6 +184,13 @@ class external_permalinks_redux { ...@@ -177,6 +184,13 @@ class external_permalinks_redux {
* @param int $post_id Post ID. * @param int $post_id Post ID.
*/ */
public function action_save_post( $post_id ) { public function action_save_post( $post_id ) {
if (
function_exists( 'use_block_editor_for_post' )
&& use_block_editor_for_post( $post_id )
) {
return;
}
if ( isset( $_POST[ $this->meta_key_target . '_nonce' ] ) && wp_verify_nonce( sanitize_text_field( $_POST[ $this->meta_key_target . '_nonce' ] ), 'external-permalinks-redux' ) ) { if ( isset( $_POST[ $this->meta_key_target . '_nonce' ] ) && wp_verify_nonce( sanitize_text_field( $_POST[ $this->meta_key_target . '_nonce' ] ), 'external-permalinks-redux' ) ) {
// Target. // Target.
$url = isset( $_POST[ $this->meta_key_target . '_url' ] ) ? esc_url_raw( $_POST[ $this->meta_key_target . '_url' ] ) : ''; $url = isset( $_POST[ $this->meta_key_target . '_url' ] ) ? esc_url_raw( $_POST[ $this->meta_key_target . '_url' ] ) : '';
......
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