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
75d2f8f0
Commit
75d2f8f0
authored
12 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
PHPDoc for singleton and general PHPDoc cleanup.
parent
1f9d460b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
external-permalinks-redux.php
+23
-9
23 additions, 9 deletions
external-permalinks-redux.php
with
23 additions
and
9 deletions
external-permalinks-redux.php
+
23
−
9
View file @
75d2f8f0
...
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
...
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
class
external_permalinks_redux
{
class
external_permalinks_redux
{
/*
/*
*
* Class variables
* Class variables
*/
*/
protected
static
$instance
;
protected
static
$instance
;
...
@@ -32,14 +32,21 @@ class external_permalinks_redux {
...
@@ -32,14 +32,21 @@ class external_permalinks_redux {
var
$meta_key_type
=
'_links_to_type'
;
var
$meta_key_type
=
'_links_to_type'
;
var
$status_codes
;
var
$status_codes
;
/**
* Instantiate class as a singleton
*
* @return object
*/
static
function
get_instance
()
{
static
function
get_instance
()
{
if
(
!
isset
(
self
::
$instance
)
)
if
(
!
isset
(
self
::
$instance
)
)
self
::
$instance
=
new
external_permalinks_redux
;
self
::
$instance
=
new
external_permalinks_redux
;
return
self
::
$instance
;
return
self
::
$instance
;
}
}
/*
/*
*
* Register actions and filters
* Register actions and filters
*
* @uses add_action, add_filter
* @uses add_action, add_filter
* @return null
* @return null
*/
*/
...
@@ -72,8 +79,9 @@ class external_permalinks_redux {
...
@@ -72,8 +79,9 @@ class external_permalinks_redux {
$this
->
status_codes
=
apply_filters
(
'epr_status_codes'
,
$status_codes
);
$this
->
status_codes
=
apply_filters
(
'epr_status_codes'
,
$status_codes
);
}
}
/*
/*
*
* Add meta box
* Add meta box
*
* @uses apply_filters, add_meta_box
* @uses apply_filters, add_meta_box
* @action admin_init
* @action admin_init
* @return null
* @return null
...
@@ -89,8 +97,9 @@ class external_permalinks_redux {
...
@@ -89,8 +97,9 @@ class external_permalinks_redux {
}
}
/*
/*
*
* Render meta box
* Render meta box
*
* @param object $post
* @param object $post
* @uses _e, esc_url, get_post_meta, selected, wp_create_nonce
* @uses _e, esc_url, get_post_meta, selected, wp_create_nonce
* @return string
* @return string
...
@@ -123,8 +132,9 @@ class external_permalinks_redux {
...
@@ -123,8 +132,9 @@ class external_permalinks_redux {
<?php
<?php
}
}
/*
/*
*
* Save meta box input
* Save meta box input
*
* @param int $post_id
* @param int $post_id
* @uses wp_verify_nonce, esc_url_raw, update_post_meta, delete_post_meta
* @uses wp_verify_nonce, esc_url_raw, update_post_meta, delete_post_meta
* @action save_post
* @action save_post
...
@@ -150,8 +160,9 @@ class external_permalinks_redux {
...
@@ -150,8 +160,9 @@ class external_permalinks_redux {
}
}
}
}
/*
/*
*
* Filter post and custom post type permalinks
* Filter post and custom post type permalinks
*
* @param string $permalink
* @param string $permalink
* @param object $post
* @param object $post
* @uses get_post_meta
* @uses get_post_meta
...
@@ -165,8 +176,9 @@ class external_permalinks_redux {
...
@@ -165,8 +176,9 @@ class external_permalinks_redux {
return
$permalink
;
return
$permalink
;
}
}
/*
/*
*
* Filter page permalinks
* Filter page permalinks
*
* @param string $link
* @param string $link
* @param int $id
* @param int $id
* @uses get_post_meta
* @uses get_post_meta
...
@@ -180,8 +192,9 @@ class external_permalinks_redux {
...
@@ -180,8 +192,9 @@ class external_permalinks_redux {
return
$link
;
return
$link
;
}
}
/*
/*
*
* Redirect to external link if object requested directly.
* Redirect to external link if object requested directly.
*
* @uses get_post_meta, wp_redirect
* @uses get_post_meta, wp_redirect
* @action pre_get_posts
* @action pre_get_posts
* @return null
* @return null
...
@@ -203,9 +216,10 @@ class external_permalinks_redux {
...
@@ -203,9 +216,10 @@ class external_permalinks_redux {
// Initialize the plugin if it hasn't already
// Initialize the plugin if it hasn't already
external_permalinks_redux
::
get_instance
();
external_permalinks_redux
::
get_instance
();
/*
/*
*
* Wrapper for meta box function
* Wrapper for meta box function
* Can be used as an alternative to the epr_post_types filter found in the plugin classes's action_admin_init function.
* Can be used as an alternative to the epr_post_types filter found in the plugin classes's action_admin_init function.
*
* @param object $post
* @param object $post
* @uses $external_permalinks_redux
* @uses $external_permalinks_redux
* @return string
* @return string
...
...
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