Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ETH Redirect to Latest Post
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
ETH Redirect to Latest Post
Commits
12422690
Verified
Commit
12422690
authored
9 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Initial plugin skeleton
parents
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
eth-redirect-to-latest.php
+70
-0
70 additions, 0 deletions
eth-redirect-to-latest.php
with
70 additions
and
0 deletions
eth-redirect-to-latest.php
0 → 100644
+
70
−
0
View file @
12422690
<?php
/*
Plugin Name: ETH Redirect to Latest Post
Plugin URI: https://ethitter.com/plugins/
Description: Redirect a chosen slug to the whatever is currently the latest post
Author: Erick Hitter
Version: 0.1
Author URI: https://ethitter.com/
Text Domain: eth_redirect_to_latest_post
Domain Path: /languages/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class
ETH_Redirect_To_Latest_Post
{
/**
* PLUGIN SETUP
*/
/**
* Singleton
*/
private
static
$instance
=
null
;
/**
* Instantiate singleton
*/
public
static
function
get_instance
()
{
if
(
!
is_a
(
self
::
$instance
,
__CLASS__
)
)
{
self
::
$instance
=
new
self
;
}
return
self
::
$instance
;
}
/**
* Dummy magic methods
*/
public
function
__clone
()
{
_doing_it_wrong
(
__FUNCTION__
,
__
(
'Cheatin’ uh?'
),
'0.1'
);
}
public
function
__wakeup
()
{
_doing_it_wrong
(
__FUNCTION__
,
__
(
'Cheatin’ uh?'
),
'0.1'
);
}
public
function
__call
(
$name
=
''
,
$args
=
array
()
)
{
unset
(
$name
,
$args
);
return
null
;
}
/**
* Class properties
*/
private
$name
=
'ETH Redirect to Latest Post'
;
private
$slug
=
'latest'
;
/**
* Register plugin's setup action
*/
private
function
__construct
()
{}
}
/**
* One instance to rule them all
*/
ETH_Redirect_To_Latest_Post
::
get_instance
();
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