芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/popup-maker/includes/integrations/class-pum-ninja-forms.php
register_actions(); add_filter( 'pum_registered_cookies', [ $this, 'register_cookies' ] ); } /** * Register Actions * * Register custom form actions to integrate with popups. */ public function register_actions() { Ninja_Forms()->actions['closepopup'] = new NF_PUM_Actions_ClosePopup(); Ninja_Forms()->actions['openpopup'] = new NF_PUM_Actions_OpenPopup(); } /** * Optional. If your extension creates a new field interaction or display template... */ public function register_cookies( $cookies ) { $cookies['ninja_form_success'] = [ 'labels' => [ 'name' => __( 'Ninja Form Success (deprecated. Use Form Submission instead.)', 'popup-maker' ), ], 'fields' => pum_get_cookie_fields(), ]; return $cookies; } /* * Optional methods for convenience. */ public static function autoloader( $class_name ) { if ( class_exists( $class_name ) ) { return; } if ( false === strpos( $class_name, self::PREFIX ) ) { return; } $class_name = str_replace( self::PREFIX, '', $class_name ); $classes_dir = realpath( plugin_dir_path( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'ninja-forms' . DIRECTORY_SEPARATOR; $class_file = str_replace( '_', DIRECTORY_SEPARATOR, $class_name ) . '.php'; if ( file_exists( $classes_dir . $class_file ) ) { require_once $classes_dir . $class_file; } } /** * Template * * @param string $file_name * @param array $data */ public static function template( $file_name = '', array $data = [] ) { if ( ! $file_name ) { return; } extract( $data ); include self::$dir . 'includes/Templates/' . $file_name; } /** * Config * * @param $file_name * * @return mixed */ public static function config( $file_name ) { return include self::$dir . 'includes/Config/' . $file_name . '.php'; } } /** * The main function responsible for returning The Highlander Plugin * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * @since 3.0 * @return {class} Highlander Instance */ function NF_PUM() { return NF_PUM::instance(); } /** * */ function pum_nf_should_init() { if ( ! class_exists( 'Ninja_Forms' ) ) { return; } if ( version_compare( get_option( 'ninja_forms_version', '0.0.0' ), '3.0', '<' ) || get_option( 'ninja_forms_load_deprecated', false ) ) { return; } NF_PUM(); } add_action( 'init', 'pum_nf_should_init', 0 );