diff --git a/cherry-portfolio.php b/cherry-portfolio.php index dd8e341..d6212f0 100644 --- a/cherry-portfolio.php +++ b/cherry-portfolio.php @@ -3,7 +3,7 @@ * Plugin Name: Cherry Portfolio * Plugin URI: http://www.cherryframework.com/ * Description: A portfolio plugin for WordPress. - * Version: 1.0.4.8 + * Version: 1.0.4.9 * Author: Cherry Team * Author URI: http://www.cherryframework.com/ * Text Domain: cherry-portfolio @@ -88,7 +88,7 @@ function constants() { * * @since 1.0.0 */ - define( 'CHERRY_PORTFOLIO_VERSION', '1.0.4.8' ); + define( 'CHERRY_PORTFOLIO_VERSION', '1.0.4.9' ); /** * Set the slug of the plugin. diff --git a/public/includes/classes/class-cherry-portfolio-page-template.php b/public/includes/classes/class-cherry-portfolio-page-template.php index 0936da2..ef3f515 100644 --- a/public/includes/classes/class-cherry-portfolio-page-template.php +++ b/public/includes/classes/class-cherry-portfolio-page-template.php @@ -53,6 +53,8 @@ public function __construct() { // Add a filter to load a custom template for a given post. add_filter( 'single_template', array( $this, 'get_single_template' ) ); + add_filter( 'theme_page_templates', array( $this, 'add_templates' ) ); + // Add your templates to this array. $this->templates = array( 'template-portfolio.php' => __( 'Portfolio', 'cherry-portfolio' ), @@ -64,6 +66,15 @@ public function __construct() { } + /** + * Add services page templates. + * + * @param array $templates Existing templates array. + * @return array + */ + public function add_templates( $templates = array() ) { + return array_merge( $templates, $this->templates ); + } /** * Adds our template to the pages cache in order to trick WordPress