* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com * @support http://www.wpopal.com/support/forum.html */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class Opalestate_Field_Adduser { /** * Current version number */ const VERSION = '1.0.0'; /** * Initialize the plugin by hooking into CMB2 */ public static function init() { add_filter( 'cmb2_render_adduser', array( __CLASS__, 'render_map' ), 10, 5 ); add_filter( 'cmb2_sanitize_adduser', array( __CLASS__, 'sanitize_map' ), 10, 4 ); } /** * Render field */ public static function render_map( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) { self::setup_admin_scripts(); $users = $field->value; // echo '
'.print_r( $value, 1 );die;
		echo '
'; ?> '; } /** * Optionally save the latitude/longitude values into two custom fields */ public static function sanitize_map( $override_value, $value, $object_id, $field_args ) { return $value; } /** * Enqueue scripts and styles */ public static function setup_admin_scripts() { wp_enqueue_script( 'opalestate-adduser', plugins_url( 'assets/script.js', __FILE__ ), array( ), self::VERSION ); wp_enqueue_style( 'opalestate-adduser', plugins_url( 'assets/style.css', __FILE__ ), array(), self::VERSION ); } } Opalestate_Field_Adduser::init();