| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Themify Portfolio Post |
| 4 |
Version: 1.3.2 |
| 5 |
Author: Themify |
| 6 |
Author URI: https://themify.me |
| 7 |
Description: This plugin will add Portfolio post type. |
| 8 |
Text Domain: themify-portfolio-post |
| 9 |
Domain Path: /languages |
| 10 |
Requires PHP: 7.2 |
| 11 |
Compatibility: 5.0.0 |
| 12 |
|
| 13 |
/* |
| 14 |
* This program is free software; you can redistribute it and/or modify |
| 15 |
* it under the terms of the GNU General Public License as published by |
| 16 |
* the Free Software Foundation; either version 2 of the License, or |
| 17 |
* (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 27 |
* MA 02110-1301, USA. |
| 28 |
* |
| 29 |
*/ |
| 30 |
|
| 31 |
defined( 'ABSPATH' ) or die; |
| 32 |
|
| 33 |
/** |
| 34 |
* Initialize the Portfolio Post plugin |
| 35 |
* |
| 36 |
* @since 1.0 |
| 37 |
*/ |
| 38 |
function themify_portfolio_post_setup() { |
| 39 |
global $themify_portfolio_posts; |
| 40 |
if(!defined('THEMIFY_PORTFOLIO_POST_VERSION')){ |
| 41 |
define( 'THEMIFY_PORTFOLIO_POST_VERSION', '1.3.2' ); |
| 42 |
} |
| 43 |
if( ! defined( 'THEMIFY_PORTFOLIO_POST_DIR' ) ){ |
| 44 |
define( 'THEMIFY_PORTFOLIO_POST_DIR', plugin_dir_path( __FILE__ ) ); |
| 45 |
} |
| 46 |
if( ! defined( 'THEMIFY_PORTFOLIO_POST_URI' ) ){ |
| 47 |
define( 'THEMIFY_PORTFOLIO_POST_URI', plugin_dir_url( __FILE__ ) ); |
| 48 |
} |
| 49 |
if( ! defined( 'THEMIFY_PORTFOLIO_POSTS_COMPAT_MODE' ) ){ |
| 50 |
define( 'THEMIFY_PORTFOLIO_POSTS_COMPAT_MODE', false ); |
| 51 |
} |
| 52 |
include THEMIFY_PORTFOLIO_POST_DIR . 'includes/system.php'; |
| 53 |
|
| 54 |
$themify_portfolio_posts = new Themify_Portfolio_Post( array( |
| 55 |
'url' => THEMIFY_PORTFOLIO_POST_URI, |
| 56 |
'dir' => THEMIFY_PORTFOLIO_POST_DIR, |
| 57 |
'version' => THEMIFY_PORTFOLIO_POST_VERSION |
| 58 |
) ); |
| 59 |
} |
| 60 |
add_action( 'after_setup_theme', 'themify_portfolio_post_setup', 14 ); |
| 61 |
|
| 62 |
/** |
| 63 |
* Plugin activation hook |
| 64 |
* Flush rewrite rules after custom post type has been registered |
| 65 |
*/ |
| 66 |
function themify_portfolio_posts_activation() { |
| 67 |
add_action( 'init', 'flush_rewrite_rules', 100 ); |
| 68 |
} |
| 69 |
register_activation_hook( __FILE__, 'themify_portfolio_posts_activation' ); |
| 70 |
|