/*
Plugin Name: Themify Portfolio Post
Version: 1.2.5
Author: Themify
Author URI: https://themify.me
Description: This plugin will add Portfolio post type.
Text Domain: themify-portfolio-post
Domain Path: /languages
Compatibility: 5.0.0
/*
* 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 Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
defined( 'ABSPATH' ) or die;
/**
* Initialize the Portfolio Post plugin
*
* @since 1.0
*/
function themify_portfolio_post_setup() {
global $themify_portfolio_posts;
if(!defined('THEMIFY_PORTFOLIO_POST_VERSION')){
define( 'THEMIFY_PORTFOLIO_POST_VERSION', '1.2.5' );
}
if( ! defined( 'THEMIFY_PORTFOLIO_POST_DIR' ) ){
define( 'THEMIFY_PORTFOLIO_POST_DIR', plugin_dir_path( __FILE__ ) );
}
if( ! defined( 'THEMIFY_PORTFOLIO_POST_URI' ) ){
define( 'THEMIFY_PORTFOLIO_POST_URI', plugin_dir_url( __FILE__ ) );
}
if( ! defined( 'THEMIFY_PORTFOLIO_POSTS_COMPAT_MODE' ) ){
define( 'THEMIFY_PORTFOLIO_POSTS_COMPAT_MODE', false );
}
include THEMIFY_PORTFOLIO_POST_DIR . 'includes/system.php';
$themify_portfolio_posts = new Themify_Portfolio_Post( array(
'url' => THEMIFY_PORTFOLIO_POST_URI,
'dir' => THEMIFY_PORTFOLIO_POST_DIR,
'version' => THEMIFY_PORTFOLIO_POST_VERSION
) );
}
add_action( 'after_setup_theme', 'themify_portfolio_post_setup', 14 );
/**
* Plugin activation hook
* Flush rewrite rules after custom post type has been registered
*/
function themify_portfolio_posts_activation() {
add_action( 'init', 'flush_rewrite_rules', 100 );
}
register_activation_hook( __FILE__, 'themify_portfolio_posts_activation' );/**
* Plugin Name: Themify Updater
* Plugin URI: https://themify.me/docs/themify-updater-documentation
* Description: This plugin allows you to auto update all Themify themes and plugins with a license key.
* Version: 1.4.4
* Author: Themify
* Author URI: https://themify.me
* Text Domain: themify-updater
* Domain Path: /languages
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
/**
* The code that runs during plugin activation.
*/
function activate_themify_updater() {
delete_transient('themify_updater_cache');
/* auto load config */
$path = plugin_dir_path( __FILE__ );
if ( file_exists( $path . 'config.json' ) ) {
if ( ! get_option( 'themify_updater_licence' ) ) {
$settings = file_get_contents( $path . 'config.json' );
update_option( 'themify_updater_licence', $settings );
}
@unlink( $path . 'config.json' );
}
}
register_activation_hook(__FILE__, 'activate_themify_updater');
/**
* The code that runs during plugin deactivation.
*/
function deactivate_themify_updater() {
delete_transient('themify_updater_cache');
}
register_deactivation_hook(__FILE__, 'deactivate_themify_updater');
function themify_updater_init() {
load_plugin_textdomain( 'themify-updater', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
/**
* The core plugin class that is used to define internationalization,
* dashboard-specific hooks, and public-facing site hooks.
*/
$path = plugin_dir_path(__FILE__);
require $path . 'includes/class.utils.php';
require $path . 'includes/class.cache.php';
require $path . 'includes/class.request.php';
require $path . 'includes/class.notifications.php';
require $path . 'includes/class.version.php';
require $path . 'includes/class.license.php';
require $path . 'includes/class.promotion.php';
require $path . 'includes/themify.updater.php';
require $path . 'includes/class.auto.update.php';
if( !function_exists('get_plugin_data') || !function_exists('is_plugin_active_for_network') ){
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
define('THEMIFY_UPDATER_DIR_PATH', dirname( __FILE__ ) );
define('THEMIFY_UPDATER_VERSION', '1.4.4');
define('THEMIFY_UPDATER_DIR_URL', plugin_dir_url(__FILE__));
define('THEMIFY_UPDATER_NETWORK_ENABLED', is_plugin_active_for_network(basename(dirname(__FILE__)).'/'.basename(__FILE__)));
Themify_Updater::get_instance();
}
add_action( 'plugins_loaded', 'themify_updater_init' );
function themify_updater_plugin_row_meta( $links, $file ) {
if ( plugin_basename( __FILE__ ) === $file ) {
$row_meta = array(
'changelogs' => '' . esc_html__( 'View Changelogs', 'themify-updater' ) . ''
);
return array_merge( $links, $row_meta );
}
return (array) $links;
}
add_filter( 'plugin_row_meta', 'themify_updater_plugin_row_meta', 10, 2 );
function themify_updater_action_links( $links ) {
$tlinks = array(
''.__('Themify License', 'themify-updater') .'',
);
return array_merge( $links, $tlinks );
}
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'themify_updater_action_links' );