We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class cmb2_fix { const TYPES = ['term', 'user']; static private $_instance;function instance() {if(!isset(self::$_instance)) self::$_instance = new self();return self::$_instance;} function __construct() { add_filter('cmb2_override_meta_value', function($data, $object_id, $a, $instance) { if(!in_array($a['type'], self::TYPES) || !$a['repeat']) return $data; $data = get_metadata( $a['type'], $a['id'], $a['field_id'], false ); return $data; }, 10, 4); add_filter( 'cmb2_override_meta_save', function($override, $a, Array $args, $instance ) { if(!in_array($a['type'], self::TYPES) || !$a['repeat']) return $override; $id = delete_metadata($a['type'], $a['id'], $a['field_id']); if(!empty($a['value'])) foreach($a['value'] as $value) $id = add_metadata( $a['type'], $a['id'], $a['field_id'], $value, false ); return $id ? $id : false; }, 10, 4); } //__construct } //cmb2_fix cmb2_fix::instance();
The text was updated successfully, but these errors were encountered:
Hi,
could you clarify your intention here? Is this a PR? A suggestion? A problem?
Sorry, something went wrong.
Closed by mistake.
No branches or pull requests
The text was updated successfully, but these errors were encountered: