Skip to content

Commit

Permalink
#47 : Better check if settings api files exists than fatal error.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeCulea committed Dec 5, 2016
1 parent c907e99 commit a69824c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions members-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ function _mpt_load_files( $dir, $files, $prefix = '' ) {
), 'class-' );

// Load class for API settings
if ( ! class_exists( 'WeDevs_Settings_API' ) ) {
$api_settings_file = MPT_DIR . 'vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php';
if ( file_exists( $api_settings_file ) && ! class_exists( 'WeDevs_Settings_API' ) ) {
/**
* Require Tareq's 1.1 version class API
*
Expand All @@ -150,7 +151,7 @@ function _mpt_load_files( $dir, $files, $prefix = '' ) {
*
* @author Maxime CULEA
*/
require_once( MPT_DIR . 'vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php' );
require_once( $api_settings_file );
}
}

Expand Down

0 comments on commit a69824c

Please sign in to comment.