Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
External Permalinks Redux
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
External Permalinks Redux
Commits
0755575d
Commit
0755575d
authored
2 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
PHPCS
parent
11bf59dd
No related branches found
No related tags found
1 merge request
!14
Add native block-editor support
Pipeline
#4802
failed with stages
in 2 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
external-permalinks-redux.php
+15
-1
15 additions, 1 deletion
external-permalinks-redux.php
with
15 additions
and
1 deletion
external-permalinks-redux.php
+
15
−
1
View file @
0755575d
...
@@ -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'
]
)
:
''
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment