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
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
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
3e914baa
Commit
3e914baa
authored
12 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Allow users to rename the metabox for clarity
parent
e51eb61d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
external-permalinks-redux.php
+24
-4
24 additions, 4 deletions
external-permalinks-redux.php
with
24 additions
and
4 deletions
external-permalinks-redux.php
+
24
−
4
View file @
3e914baa
...
@@ -53,7 +53,7 @@ class external_permalinks_redux {
...
@@ -53,7 +53,7 @@ class external_permalinks_redux {
*/
*/
function
__construct
()
{
function
__construct
()
{
add_action
(
'init'
,
array
(
$this
,
'action_init'
),
0
);
// other init actions may rely on permalinks so filter early
add_action
(
'init'
,
array
(
$this
,
'action_init'
),
0
);
// other init actions may rely on permalinks so filter early
add_action
(
'ad
min_init
'
,
array
(
$this
,
'action_ad
min_init
'
)
);
add_action
(
'ad
d_meta_boxes
'
,
array
(
$this
,
'action_ad
d_meta_boxes
'
)
);
add_action
(
'save_post'
,
array
(
$this
,
'action_save_post'
)
);
add_action
(
'save_post'
,
array
(
$this
,
'action_save_post'
)
);
add_filter
(
'post_link'
,
array
(
$this
,
'filter_post_permalink'
),
1
,
2
);
add_filter
(
'post_link'
,
array
(
$this
,
'filter_post_permalink'
),
1
,
2
);
...
@@ -84,18 +84,26 @@ class external_permalinks_redux {
...
@@ -84,18 +84,26 @@ class external_permalinks_redux {
* Add meta box
* Add meta box
*
*
* @uses apply_filters
* @uses apply_filters
* @uses __
* @uses add_meta_box
* @uses add_meta_box
* @action ad
min_init
* @action ad
d_meta_boxes
* @return null
* @return null
*/
*/
function
action_ad
min_init
()
{
function
action_ad
d_meta_boxes
()
{
$post_types
=
apply_filters
(
'epr_post_types'
,
array
(
'post'
,
'page'
)
);
$post_types
=
apply_filters
(
'epr_post_types'
,
array
(
'post'
,
'page'
)
);
if
(
!
is_array
(
$post_types
)
)
if
(
!
is_array
(
$post_types
)
)
return
;
return
;
foreach
(
$post_types
as
$post_type
)
{
foreach
(
$post_types
as
$post_type
)
{
add_meta_box
(
'external-permalinks-redux'
,
__
(
'External Permalinks Redux'
,
'external-permalinks-redux'
),
array
(
$this
,
'meta_box'
),
$post_type
,
'normal'
);
$title
=
apply_filters
(
'epr_metabox_title'
,
''
,
$post_type
);
if
(
!
$title
)
$title
=
__
(
'External Permalinks Redux'
,
'external-permalinks-redux'
);
add_meta_box
(
'external-permalinks-redux'
,
$title
,
array
(
$this
,
'meta_box'
),
$post_type
,
'normal'
);
unset
(
$title
);
}
}
}
}
...
@@ -228,6 +236,18 @@ class external_permalinks_redux {
...
@@ -228,6 +236,18 @@ class external_permalinks_redux {
exit
;
exit
;
}
}
}
}
/**
** BACKWARDS COMPATIBILITY
** FUNCTIONS FOUNDS BELOW ARE DEPRECATED
**/
/**
* Action changed and function renamed in v1.1.
*/
public
function
action_admin_init
()
{
$this
->
action_add_meta_boxes
();
}
}
}
// Initialize the plugin if it hasn't already
// Initialize the plugin if it hasn't already
...
...
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