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

PHPDoc for singleton and general PHPDoc cleanup.

parent 1f9d460b
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment