display_error( __( 'Advanced Custom Fields and Polylang are required plugins.', 'bea-acf-options-for-polylang' ) ); return false; } if ( '5.6.0' > acf()->version ) { $this->display_error( __( 'Advanced Custom Fields should be on version 5.6.0 or above.', 'bea-acf-options-for-polylang' ) ); return false; }; return true; } // Display message and handle errors public function display_error( $message ) { trigger_error( $message ); add_action( 'admin_notices', function () use ( $message ) { printf( '

%s

', $message ); } ); // Deactive self add_action( 'admin_init', function () { deactivate_plugins( BEA_ACF_OPTIONS_MAIN_FILE_DIR ); unset( $_GET['activate'] ); } ); } }