Last active
April 4, 2017 21:21
-
-
Save jetfire21/3356002cd85108b3cb45a1c813ce9cd3 to your computer and use it in GitHub Desktop.
functions used for development wp plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** проверка активирован ли плагин ******* */ | |
/* Check if should include install file */ | |
public function check_install() { | |
$current_version = get_option( 'wp_job_manager_field_editor_version' ); | |
$plugin_activated = get_option( 'wp_job_manager_field_editor_activated' ); | |
$force_install = isset( $_GET['jmfe_force_install'] ) ? TRUE : FALSE; | |
if ( $force_install || $plugin_activated || ! $current_version || version_compare( WPJM_FIELD_EDITOR_VERSION, $current_version, '>' ) ) { | |
// Remove option if was set on plugin activation | |
if( $plugin_activated ) delete_option( 'wp_job_manager_field_editor_activated' ); | |
// Include install class | |
include_once( WPJM_FIELD_EDITOR_PLUGIN_DIR . '/classes/install.php' ); | |
} | |
} | |
// если-true тогда подключаем кастомный код расширяющий функционал плагина,использовать главный класс для этого | |
if(class_exists("WP_Job_Manager_Field_Editor")) require_once 'job_manager/wp-job-manager-groups/index.php'; | |
/*** проверка активирован ли плагин ******* */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment