Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/0.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
obstschale committed Jun 29, 2014
2 parents 314fb43 + 8052f68 commit cd9bccd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 49 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: obstschale
Tags: podcast, podcasts, feed, rss, episode, episodes, audio, video, cm,
Requires at least: 3.6
Tested up to: 3.9.1
Stable tag: 0.1.2
Stable tag: 0.1.3
License: GPLv2 or later
License URI: [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)

Expand All @@ -19,6 +19,9 @@ You can download and install Dicentis using the built in WordPress plugin instal
FAQ will surely come in the future.

## Changelog
### 0.1.3 [2014-06-29]
* [FIX] Revert changes. Fix from 0.1.2 cause more trouble than it solve -.-

### 0.1.2 [2014-06-29]
* [FIX] Redirect `/podcasts/` to a page and not to archive if a page with that slug exists

Expand Down
47 changes: 0 additions & 47 deletions classes/post-type-podcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,56 +124,9 @@ public function register_podcast_post_type() {
// with the same name.
} else {
register_post_type( self::POST_TYPE, $podcast_args );
if ( $this->podcasts_page_exists() ) {
$this->rewrite_podcasts_permalink_rule();
}
}
} // END public function register_podcast_post_type()

public function podcasts_page_exists() {
$args = array(
'sort_order' => 'ASC',
'sort_column' => 'post_name',
'post_status' => 'publish',
);
$pages = get_pages($args);

foreach ($pages as $page) {
if ('podcasts' == $page->post_name) {
return true;
}
}

return false;
}

public function rewrite_podcasts_permalink_rule() {
global $wp_rewrite;

$args = array(
'sort_order' => 'ASC',
'sort_column' => 'post_name',
'post_status' => 'publish',
);
$pages = get_pages($args);

$podcasts_guid = "";
foreach ($pages as $page) {
if ('podcasts' == $page->post_name) {
$podcasts_guid = $page->guid;
}
}

$podcasts_guid = substr($podcasts_guid,
strrpos($podcasts_guid, "page_id")-1);

add_rewrite_rule( 'podcasts/?$',
'index.php'. $podcasts_guid,
'top' );

flush_rewrite_rules();
}

/**
/$$$$$$$$
|__ $$__/
Expand Down
2 changes: 1 addition & 1 deletion dicentis-podcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Dicentis Podcast
Plugin URI: http://hanshelgebuerger.de
Description: Manage multiple podcasts with ease in one plugin
Version: 0.1.2
Version: 0.1.3
Author: Hans-Helge Buerger
Author URI: http://hanshelgebuerger.de
Text Domain: dicentis
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ You can download and install Dicentis using the built in WordPress plugin instal
FAQ will surely come in the future.

== Changelog ==
= 0.1.3 =
* [FIX] Revert changes. Fix from 0.1.2 cause more trouble than it solve -.-

= 0.1.2 =
* [FIX] Redirect `/podcasts/` to a page and not to archive if a page with that slug exists

Expand Down

0 comments on commit cd9bccd

Please sign in to comment.