Skip to content

Commit

Permalink
Merge pull request #365 from TheCraigHewitt/feature/defer-register-po…
Browse files Browse the repository at this point in the history
…st-types

Feature/defer register post types
  • Loading branch information
jonathanbossenger authored Jun 5, 2019
2 parents 268bce5 + b868e68 commit 56893cb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 1 addition & 2 deletions php/classes/controllers/class-admin-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function bootstrap() {
add_action( 'init', array( $this, 'load_localisation' ), 0 );

// Regsiter podcast post type, taxonomies and meta fields.
add_action( 'init', array( $this, 'register_post_type' ), 1 );
add_action( 'init', array( $this, 'register_post_type' ), 11 );

// Register podcast feed.
add_action( 'init', array( $this, 'add_feed' ), 1 );
Expand Down Expand Up @@ -241,7 +241,6 @@ public function register_post_type() {
* @return void
*/
private function register_taxonomies() {

$podcast_post_types = ssp_post_types( true );

$series_labels = array(
Expand Down
1 change: 0 additions & 1 deletion php/classes/controllers/class-frontend-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace SeriouslySimplePodcasting\Controllers;

use SeriouslySimplePodcasting\Helpers\Log_Helper;
use stdClass;
use WP_Query;

Expand Down
12 changes: 12 additions & 0 deletions php/classes/helpers/class-log-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Log_Helper {
public $log_path;
public $log_url;

/**
* Log_Helper constructor.
*/
public function __construct() {
$this->log_dir_path = SSP_PLUGIN_PATH . 'log' . DIRECTORY_SEPARATOR;
$this->log_dir_url = SSP_PLUGIN_URL . 'log' . DIRECTORY_SEPARATOR;
Expand All @@ -22,7 +25,16 @@ public function __construct() {
$this->check_paths();
}

/**
* Checks if the logging paths exist, and attempts to create them
* Will only fire if SSP_DEBUG is set and true
*
* @return bool
*/
public function check_paths() {
if ( ! defined( 'SSP_DEBUG' ) || ! SSP_DEBUG ) {
return false;
}
if ( ! is_dir( $this->log_dir_path ) ) {
mkdir( $this->log_dir_path );
}
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ You can find complete user and developer documentation (along with the FAQs) on

== Changelog ==

= 1.20.2-beta =
* 2019-05-30
* [FIX] Fixes a legacy bug where post type registration was prioritised over other custom post types

= 1.20.1 =
* 2019-05-28
* [FIX] Fixes a bug where subscribe links still show, even if not url has been set
Expand Down
4 changes: 2 additions & 2 deletions seriously-simple-podcasting.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: Seriously Simple Podcasting
* Version: 1.20.1
* Version: 1.20.2-beta
* Plugin URI: https://www.castos.com/seriously-simple-podcasting
* Description: Podcasting the way it's meant to be. No mess, no fuss - just you and your content taking over the world.
* Author: Castos
Expand All @@ -26,7 +26,7 @@
use SeriouslySimplePodcasting\Controllers\Options_Controller;
use SeriouslySimplePodcasting\Rest\Rest_Api_Controller;

define( 'SSP_VERSION', '1.20.1' );
define( 'SSP_VERSION', '1.20.2-beta' );
define( 'SSP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SSP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );

Expand Down

0 comments on commit 56893cb

Please sign in to comment.