Hotel Raxa - Advanced Booking System Implementation
🏨 Hotel Booking Enhancements: - Implemented Eagle Booking Advanced Pricing add-on - Added Booking.com-style rate management system - Created professional calendar interface for pricing - Integrated deals and discounts functionality 💰 Advanced Pricing Features: - Dynamic pricing models (per room, per person, per adult) - Base rates, adult rates, and child rates management - Length of stay discounts and early bird deals - Mobile rates and secret deals implementation - Seasonal promotions and flash sales 📅 Availability Management: - Real-time availability tracking - Stop sell and restriction controls - Closed to arrival/departure functionality - Minimum/maximum stay requirements - Automatic sold-out management 💳 Payment Integration: - Maintained Redsys payment gateway integration - Seamless integration with existing Eagle Booking - No modifications to core Eagle Booking plugin 🛠️ Technical Implementation: - Custom database tables for advanced pricing - WordPress hooks and filters integration - AJAX-powered admin interface - Data migration from existing Eagle Booking - Professional calendar view for revenue management 📊 Admin Interface: - Booking.com-style management dashboard - Visual rate and availability calendar - Bulk operations for date ranges - Statistics and analytics dashboard - Modal dialogs for quick editing 🔧 Code Quality: - WordPress coding standards compliance - Secure database operations with prepared statements - Proper input validation and sanitization - Error handling and logging - Responsive admin interface 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
/**
|
||||
* CMB2 Conditionals.
|
||||
*
|
||||
* @package WordPress\Plugins\CMB2 Conditionals
|
||||
* @author José Carlos Chávez <jcchavezs@gmail.com>
|
||||
* @link https://github.com/jcchavezs/cmb2-conditionals
|
||||
* @version 1.0.4
|
||||
*
|
||||
* @copyright 2015 José Carlos Chávez
|
||||
* @license http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 3 or higher
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: CMB2 Conditionals
|
||||
* Plugin URI: https://github.com/jcchavezs/cmb2-conditionals
|
||||
* Description: Plugin to establish conditional relationships between fields in a CMB2 metabox.
|
||||
* Author: José Carlos Chávez <jcchavezs@gmail.com>
|
||||
* Author URI: http://github.com/jcchavezs
|
||||
* Github Plugin URI: https://github.com/jcchavezs/cmb2-conditionals
|
||||
* Github Branch: master
|
||||
* Version: 1.0.4
|
||||
* License: GPL v3
|
||||
*
|
||||
* Copyright (C) 2015, José Carlos Chávez - jcchavezs@gmail.com
|
||||
*
|
||||
* GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/3.0/>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'CMB2_Conditionals', false ) ) {
|
||||
|
||||
/**
|
||||
* CMB2_Conditionals Plugin.
|
||||
*/
|
||||
class CMB2_Conditionals {
|
||||
|
||||
/**
|
||||
* Priority on which our actions are hooked in.
|
||||
*
|
||||
* @const int
|
||||
*/
|
||||
const PRIORITY = 99999;
|
||||
|
||||
/**
|
||||
* Version number of the plugin.
|
||||
*
|
||||
* @const string
|
||||
*/
|
||||
const VERSION = '1.0.4';
|
||||
|
||||
/**
|
||||
* CMB2 Form elements which can be set to "required".
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $maybe_required_form_elms = array(
|
||||
'list_input',
|
||||
'input',
|
||||
'textarea',
|
||||
'input',
|
||||
'select',
|
||||
'checkbox',
|
||||
'radio',
|
||||
'radio_inline',
|
||||
'taxonomy_radio',
|
||||
'taxonomy_multicheck',
|
||||
'multicheck_inline',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Constructor - Set up the actions for the plugin.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( ! defined( 'CMB2_LOADED' ) || false === CMB2_LOADED ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_action( 'admin_init', array( $this, 'admin_init' ), self::PRIORITY );
|
||||
add_action( 'admin_footer', array( $this, 'admin_footer' ), self::PRIORITY );
|
||||
|
||||
foreach ( $this->maybe_required_form_elms as $element ) {
|
||||
add_filter( "cmb2_{$element}_attributes", array( $this, 'maybe_set_required_attribute' ), self::PRIORITY );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decide whether to include the js-script or not.
|
||||
*/
|
||||
public function admin_footer() {
|
||||
// enqueue on editor
|
||||
$enqueue_script = in_array( $GLOBALS['pagenow'], array( 'post-new.php', 'post.php' ), true );
|
||||
|
||||
// if not editor, check if current screen contains cmb2 option page
|
||||
if ( is_admin() && ! $enqueue_script ) {
|
||||
// get current screen object
|
||||
$screen = get_current_screen();
|
||||
// get all option page metaboxes
|
||||
$option_page_boxes = CMB2_Boxes::get_by( 'object_types', array('options-page') );
|
||||
// loop option page metaboxes and check if existing on curent screen
|
||||
foreach( $option_page_boxes as $option_box_id => $option_box ) {
|
||||
if ( $enqueue_script === true )
|
||||
break;
|
||||
if ( str_replace( '.php', '', $option_box->meta_box['parent_slug'] ) === $screen->parent_base && strpos( $screen->base, $option_box_id ) !== false )
|
||||
$enqueue_script = true;
|
||||
}
|
||||
}
|
||||
|
||||
// last chance to skip or force enqueue
|
||||
$enqueue_script = apply_filters( 'cmb2_conditionals_enqueue_script', $enqueue_script );
|
||||
|
||||
// possibility to change script source
|
||||
$script_src = apply_filters( 'cmb2_conditionals_enqueue_script_src', plugins_url( '/cmb2-conditionals.js', __FILE__ ) );
|
||||
|
||||
if ( $enqueue_script ) {
|
||||
wp_enqueue_script(
|
||||
'cmb2-conditionals',
|
||||
$script_src,
|
||||
array( 'jquery', 'cmb2-scripts' ),
|
||||
self::VERSION,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ensure valid html for the required attribute.
|
||||
*
|
||||
* @param array $args Array of HTML attributes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function maybe_set_required_attribute( $args ) {
|
||||
if ( ! isset( $args['required'] ) ) {
|
||||
return $args;
|
||||
}
|
||||
|
||||
// Comply with HTML specs.
|
||||
if ( true === $args['required'] ) {
|
||||
$args['required'] = 'required';
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Hook in the filtering of the data being saved.
|
||||
*/
|
||||
public function admin_init() {
|
||||
$cmb2_boxes = CMB2_Boxes::get_all();
|
||||
|
||||
foreach ( $cmb2_boxes as $cmb_id => $cmb2_box ) {
|
||||
add_action(
|
||||
"cmb2_{$cmb2_box->object_type()}_process_fields_{$cmb_id}",
|
||||
array( $this, 'filter_data_to_save' ),
|
||||
self::PRIORITY,
|
||||
2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Filter the data received from the form in order to remove those values
|
||||
* which are not suppose to be enabled to edit according to the declared conditionals.
|
||||
*
|
||||
* @param \CMB2 $cmb2 An instance of the CMB2 class.
|
||||
* @param int $object_id The id of the object being saved, could post_id, comment_id, user_id.
|
||||
*
|
||||
* The potentially adjusted array is returned via reference $cmb2.
|
||||
*/
|
||||
public function filter_data_to_save( CMB2 $cmb2, $object_id ) {
|
||||
foreach ( $cmb2->prop( 'fields' ) as $field_args ) {
|
||||
if ( ! ( 'group' === $field_args['type'] || ( array_key_exists( 'attributes', $field_args ) && array_key_exists( 'data-conditional-id', $field_args['attributes'] ) ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( 'group' === $field_args['type'] ) {
|
||||
foreach ( $field_args['fields'] as $group_field ) {
|
||||
if ( ! ( array_key_exists( 'attributes', $group_field ) && array_key_exists( 'data-conditional-id', $group_field['attributes'] ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field_id = $group_field['id'];
|
||||
$conditional_id = $group_field['attributes']['data-conditional-id'];
|
||||
$decoded_conditional_id = @json_decode( $conditional_id );
|
||||
if ( $decoded_conditional_id ) {
|
||||
$conditional_id = $decoded_conditional_id;
|
||||
}
|
||||
|
||||
if ( is_array( $conditional_id ) && ! empty( $conditional_id ) && ! empty( $cmb2->data_to_save[ $conditional_id[0] ] ) ) {
|
||||
foreach ( $cmb2->data_to_save[ $conditional_id[0] ] as $key => $group_data ) {
|
||||
$cmb2->data_to_save[ $conditional_id[0] ][ $key ] = $this->filter_field_data_to_save( $group_data, $field_id, $conditional_id[1], $group_field['attributes'] );
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$field_id = $field_args['id'];
|
||||
$conditional_id = $field_args['attributes']['data-conditional-id'];
|
||||
|
||||
$cmb2->data_to_save = $this->filter_field_data_to_save( $cmb2->data_to_save, $field_id, $conditional_id, $field_args['attributes'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if the data for one individual field should be saved or not.
|
||||
*
|
||||
* @param array $data_to_save The received $_POST data.
|
||||
* @param string $field_id The CMB2 id of this field.
|
||||
* @param string $conditional_id The CMB2 id of the field this field is conditional on.
|
||||
* @param array $attributes The CMB2 field attributes.
|
||||
*
|
||||
* @return array Array of data to save.
|
||||
*/
|
||||
protected function filter_field_data_to_save( $data_to_save, $field_id, $conditional_id, $attributes ) {
|
||||
if ( array_key_exists( 'data-conditional-value', $attributes ) ) {
|
||||
|
||||
$conditional_value = $attributes['data-conditional-value'];
|
||||
$decoded_conditional_value = @json_decode( $conditional_value );
|
||||
if ( $decoded_conditional_value ) {
|
||||
$conditional_value = $decoded_conditional_value;
|
||||
}
|
||||
|
||||
if ( ! isset( $data_to_save[ $conditional_id ] ) ) {
|
||||
if ( 'off' !== $conditional_value ) {
|
||||
unset( $data_to_save[ $field_id ] );
|
||||
}
|
||||
return $data_to_save;
|
||||
}
|
||||
|
||||
if ( ( ! is_array( $conditional_value ) && ! is_array( $data_to_save[ $conditional_id ] ) ) && $data_to_save[ $conditional_id ] != $conditional_value ) {
|
||||
unset( $data_to_save[ $field_id ] );
|
||||
return $data_to_save;
|
||||
}
|
||||
|
||||
if ( is_array( $conditional_value ) || is_array( $data_to_save[ $conditional_id ] ) ) {
|
||||
$match = array_intersect( (array) $conditional_value, (array) $data_to_save[ $conditional_id ] );
|
||||
if ( empty( $match ) ) {
|
||||
unset( $data_to_save[ $field_id ] );
|
||||
return $data_to_save;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $data_to_save[ $conditional_id ] ) || ! $data_to_save[ $conditional_id ] ) {
|
||||
unset( $data_to_save[ $field_id ] );
|
||||
}
|
||||
|
||||
return $data_to_save;
|
||||
}
|
||||
} /* End of class. */
|
||||
|
||||
|
||||
/**
|
||||
* Instantiate our class.
|
||||
*
|
||||
* {@internal wp_installing() function was introduced in WP 4.4. The function exists and constant
|
||||
* check can be removed once the min version for this plugin has been upped to 4.4.}}
|
||||
*/
|
||||
if ( ( function_exists( 'wp_installing' ) && wp_installing() === false ) || ( ! function_exists( 'wp_installing' ) && ( ! defined( 'WP_INSTALLING' ) || WP_INSTALLING === false ) ) ) {
|
||||
add_action( 'plugins_loaded', 'cmb2_conditionals_init' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'cmb2_conditionals_init' ) ) {
|
||||
/**
|
||||
* Initialize the class.
|
||||
*/
|
||||
function cmb2_conditionals_init() {
|
||||
static $cmb2_conditionals = null;
|
||||
if ( null === $cmb2_conditionals ) {
|
||||
$cmb2_conditionals = new CMB2_Conditionals();
|
||||
}
|
||||
|
||||
return $cmb2_conditionals;
|
||||
}
|
||||
}
|
||||
} /* End of class-exists wrapper. */
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,130 @@
|
||||
# CMB2 Field Type: Font Awesome
|
||||
#### Font Awesome Icon Selector for CMB2
|
||||
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect?ref=badge_shield)
|
||||
|
||||
## Description
|
||||
Font Awesome icon selector for powerful custom metabox generator [CMB2](https://github.com/WebDevStudios/CMB2 "Custom Metaboxes and Fields for WordPress 2")
|
||||
|
||||
You can use as field type in CMB2 function file. Add a new field, set type to `faiconselect` and add font awesome icons to options (look Usage for examples). Plugin uses [jQuery Font Picker](https://codeb.it/fonticonpicker/) for creating a icon selector.
|
||||
|
||||
Plugin capable to use Font Awesome 4.7.0 or 5.7.2 (only Solid and Brands icons) for icons and selector.
|
||||
|
||||
### WordPress Plugin
|
||||
You can download this plugin also here : [CMB2 Field Type: Font Awesome](https://wordpress.org/plugins/cmb2-field-type-font-awesome/)
|
||||
or you can search as `CMB2 Field Type: Font Awesome` on your plugin install page.
|
||||
|
||||
### Install via Composer
|
||||
This plugin available as [Composer Package](https://packagist.org/packages/serkanalgur/cmb2-field-faiconselect) and can be installed via Composer.
|
||||
|
||||
```bash
|
||||
composer require serkanalgur/cmb2-field-faiconselect
|
||||
```
|
||||
### ScreenShot
|
||||
|
||||

|
||||
|
||||
## Usage
|
||||
|
||||
Download this repo and put files into `wp-content/plugins/` directory. When you enable plugin, you can use field type in CMB2.
|
||||
|
||||
Alternatively you can search `CMB2 Field Type: Font Awesome` on WordPress plugin directory.
|
||||
|
||||
Use `faiconselect` for type. For Example;
|
||||
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => __( 'Select Font Awesome Icon', 'cmb' ),
|
||||
'id' => $prefix . 'iconselect',
|
||||
'desc' => 'Select Font Awesome icon',
|
||||
'type' => 'faiconselect',
|
||||
'options' => array(
|
||||
'fa fa-facebook' => 'fa fa-facebook',
|
||||
'fa fa-500px' => 'fa fa-500px',
|
||||
'fa fa-twitter' => 'fa fa-twitter'
|
||||
)
|
||||
) );
|
||||
```
|
||||
After that jQuery Font Picker plugin handle the select.
|
||||
|
||||
Aslo you can use predefined array for Font Awesome. I created a function with this addon to use in `options_cb`. Function called as `returnRayFaPre`.
|
||||
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => __( 'Select Font Awesome Icon', 'cmb' ),
|
||||
'id' => $prefix . 'iconselect',
|
||||
'desc' => 'Select Font Awesome icon',
|
||||
'type' => 'faiconselect',
|
||||
'options_cb' => 'returnRayFaPre'
|
||||
) );
|
||||
```
|
||||
|
||||
## Usage From Template Folder
|
||||
|
||||
Download and place folder into your theme folder. You need to create a function for fixing asset path issue. Fore example;
|
||||
|
||||
```php
|
||||
// Fix for $asset_path issue
|
||||
function asset_path_faiconselect() {
|
||||
return get_template_directory_uri() . '/path/to/folder'; //Change to correct path.
|
||||
}
|
||||
|
||||
add_filter( 'sa_cmb2_field_faiconselect_asset_path', 'asset_path_faiconselect' );
|
||||
|
||||
//Now call faiconselect
|
||||
require get_template_directory() . '/path/to/folder/iconselect.php'; //Again Change to correct path.
|
||||
```
|
||||
|
||||
This function solve assetpath issue for including javascript and css files.
|
||||
|
||||
## Usage With Font Awesome 5
|
||||
|
||||
You need two different options for activate Font Awesome 5. You will need to add an attribute. Also there is a function for predefined list of font-awesome :smile:
|
||||
|
||||
#### Standart Way
|
||||
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => __( 'Select Font Awesome Icon', 'cmb' ),
|
||||
'id' => $prefix . 'iconselect',
|
||||
'desc' => 'Select Font Awesome icon',
|
||||
'type' => 'faiconselect',
|
||||
'options' => array(
|
||||
'fab fa-facebook' => 'fa fa-facebook',
|
||||
'fab fa-500px' => 'fa fa-500px',
|
||||
'fab fa-twitter' => 'fa fa-twitter',
|
||||
'fas fa-address-book' => 'fas fa-address-book'
|
||||
),
|
||||
'attributes' => array(
|
||||
'faver' => 5
|
||||
)
|
||||
) );
|
||||
```
|
||||
|
||||
This attribute needed for selecting right style files. If you don't add these attribute, you can not see icons.
|
||||
|
||||
#### Predefined Way
|
||||
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => __( 'Select Font Awesome Icon', 'cmb' ),
|
||||
'id' => $prefix . 'iconselect',
|
||||
'desc' => 'Select Font Awesome icon',
|
||||
'type' => 'faiconselect',
|
||||
'options_cb' => 'returnRayFapsa',
|
||||
'attributes' => array(
|
||||
'faver' => 5
|
||||
)
|
||||
) );
|
||||
```
|
||||
|
||||
As you can see we define an `options_cb` function named `returnRayFapsa`. This function create an array for options with `solid` and `brands` icons. Also you need `faver` attribute for Font Awesome 5.
|
||||
|
||||
That's All for now :smile: Contributions are welcome
|
||||
|
||||
You can donate me via;
|
||||
|
||||
Paypal : https://paypal.me/serkanalgur
|
||||
|
||||
## License
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fserkanalgur%2Fcmb2-field-faiconselect?ref=badge_large)
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "serkanalgur/cmb2-field-faiconselect",
|
||||
"description": "Font Awesome icon selector for powerful custom metabox generator CMB2",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"type": "wordpress-plugin",
|
||||
"homepage": "https://github.com/serkanalgur/cmb2-field-faiconselect",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Serkan Algur",
|
||||
"homepage": "https://wpadami.com",
|
||||
"email": "info@wpadami.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "3.3.0"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* CSS files for fontIconPicker
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.1.1
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*
|
||||
*/
|
||||
@font-face{font-family:iconpicker;src:url(../../fonts/iconpicker.eot?90190138);src:url(../../fonts/iconpicker.eot?90190138#iefix) format("embedded-opentype"),url(../../fonts/iconpicker.woff?90190138) format("woff"),url(../../fonts/iconpicker.ttf?90190138) format("truetype"),url(../../fonts/iconpicker.svg?90190138#iconpicker) format("svg");font-weight:400;font-style:normal}.icons-selector{display:inline-block;vertical-align:middle;text-align:left}.icons-selector,.icons-selector *,.icons-selector:after,.icons-selector :after,.icons-selector:before,.icons-selector :before{-webkit-box-sizing:content-box;box-sizing:content-box}.icons-selector *{font:inherit;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline}.icons-selector .selector-button{width:39px;height:100%;display:block;text-align:center;cursor:pointer;float:left}.icons-selector .selector-button i{line-height:38px;text-align:center}.icons-selector .selected-icon{display:block;width:60px;height:100%;float:left;text-align:center}.icons-selector .selected-icon i{line-height:40px !important;font-size:18px !important;cursor:default}.icons-selector.selector-popup-wrap,.icons-selector .selector-popup-wrap{position:absolute;z-index:10000;width:352px;height:auto}.icons-selector .selector-popup{margin-top:-1px;padding:5px;width:342px;height:auto;background-color:#fefefe;position:absolute}.icons-selector .selector{width:100px;height:40px}.icons-selector .selector-category select,.icons-selector .selector-search input[type=text]{border:0;line-height:20px;padding:10px 2.5%;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:5px;font-size:12px;display:block}.icons-selector .selector-category select{height:40px}.icons-selector .selector-category select option{padding:10px}.icons-selector input::-webkit-input-placeholder{text-transform:uppercase}.icons-selector input:-ms-input-placeholder,.icons-selector input::-ms-input-placeholder{text-transform:uppercase}.icons-selector input::placeholder{text-transform:uppercase}.icons-selector .selector-search{position:relative}.icons-selector .selector-search i{position:absolute;right:10px;top:7px}.icons-selector .fip-icons-container{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px}.icons-selector .fip-icons-container .loading{font-size:24px;margin:0 auto;padding:20px 0;text-align:center;width:100%}.icons-selector .fip-box{display:inline-block;margin:2px;width:60px;line-height:42px;text-align:center;cursor:pointer;vertical-align:top;height:40px}.icons-selector .selector-footer{line-height:12px;padding:5px 5px 0;text-align:center;font-size:14px}.icons-selector .selector-footer i{font-size:14px}.icons-selector .selector-footer .selector-arrows{float:right}.icons-selector .selector-footer .selector-arrows i{cursor:pointer}.icons-selector .selector-footer .selector-pages{font-size:11px;float:left}.icons-selector .selector-footer em{font-style:italic}.icons-selector .icons-picker-error i:before{color:#eee}.icons-selector [class*=" fip-icon-"]:before,.icons-selector [class^=fip-icon-]:before{font-family:iconpicker;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icons-selector .fip-icon-search:before{content:"\e812";cursor:default}.icons-selector .fip-icon-cancel:before{content:"\e814";cursor:pointer}.icons-selector .fip-icon-block:before{content:"\e84e";color:#fed0d0}.icons-selector .fip-icon-down-dir:before{content:"\e800"}.icons-selector .fip-icon-up-dir:before{content:"\e813"}.icons-selector .fip-icon-left-dir:before{content:"\e801"}.icons-selector .fip-icon-right-dir:before{content:"\e802"}.icons-selector .fip-icon-spin3:before{content:"\e815"}.icons-selector .fip-icon-spin3{-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}
|
||||
/*# sourceMappingURL=jquery.fonticonpicker.css.map */
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* CSS files for fontIconPicker
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.1.1
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*
|
||||
*/
|
||||
.icons-selector.fip-bootstrap{font-size:16px}.icons-selector.fip-bootstrap .selector{border:0 none;background-color:transparent;width:102px}.icons-selector.fip-bootstrap .selector-button{background-color:#fff;border:1px solid #ccc;border-radius:0 4px 4px 0;background-image:linear-gradient(180deg,#fff 0,#e0e0e0);-webkit-box-sizing:border-box;box-sizing:border-box;width:41px;background-repeat:repeat-x}.icons-selector.fip-bootstrap .selector-button i{color:#aaa;text-shadow:0 1px 0 #fff}.icons-selector.fip-bootstrap .selector-button:hover{background-color:#e0e0e0;background-position:0 -15px}.icons-selector.fip-bootstrap .selector-button:hover i{color:#999}.icons-selector.fip-bootstrap .selector-button:active{-webkit-box-shadow:0 3px 5px rgba(0,0,0,.125) inset;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.icons-selector.fip-bootstrap .selected-icon{border:1px solid #ccc;border-right:0 none;background-color:#fff;border-radius:4px 0 0 4px;-webkit-box-sizing:border-box;box-sizing:border-box}.icons-selector.fip-bootstrap .selected-icon i{color:#404040}.icons-selector.fip-bootstrap .selector-popup{-webkit-box-shadow:0 6px 12px rgba(0,0,0,.176);box-shadow:0 6px 12px rgba(0,0,0,.176);border:1px solid rgba(0,0,0,.15);border-radius:4px;background-color:#fff}.icons-selector.fip-bootstrap .selector-category select,.icons-selector.fip-bootstrap .selector-search input[type=text]{border:1px solid #ccc;color:#555;-webkit-box-shadow:none;box-shadow:none;outline:none;border-radius:4px}.icons-selector.fip-bootstrap .selector-category select:focus,.icons-selector.fip-bootstrap .selector-search input[type=text]:focus{border-color:#66afe9;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.icons-selector.fip-bootstrap input::-webkit-input-placeholder{color:#aaa!important}.icons-selector.fip-bootstrap input:-ms-input-placeholder,.icons-selector.fip-bootstrap input::-ms-input-placeholder{color:#aaa!important}.icons-selector.fip-bootstrap input::placeholder{color:#aaa!important}.icons-selector.fip-bootstrap .selector-search i{color:#aaa}.icons-selector.fip-bootstrap .fip-icons-container{background-color:#fff;border:1px solid #ccc;border-radius:4px}.icons-selector.fip-bootstrap .fip-icons-container .loading{color:#ddd}.icons-selector.fip-bootstrap .fip-box{border:1px solid #ccc;border-radius:2px;background-color:#eee}.icons-selector.fip-bootstrap .fip-box:hover{background-color:#fff;border-color:#66afe9;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);font-size:1.6em;text-shadow:0 0 1px #fff}.icons-selector.fip-bootstrap .selector-footer,.icons-selector.fip-bootstrap .selector-footer i{color:#428bca}.icons-selector.fip-bootstrap .selector-footer i:hover{color:#2a6496}.icons-selector.fip-bootstrap span.current-icon,.icons-selector.fip-bootstrap span.current-icon:hover{background-color:#428bca;color:#fff;border:1px solid #428bca}.icons-selector.fip-bootstrap span.current-icon:hover i,.icons-selector.fip-bootstrap span.current-icon i{color:#fff}.icons-selector.fip-bootstrap .icons-picker-error i:before{color:#ccc}.icons-selector.fip-bootstrap .fip-box,.icons-selector.fip-bootstrap .selector-category select,.icons-selector.fip-bootstrap .selector-search input[type=text]{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}
|
||||
/*# sourceMappingURL=jquery.fonticonpicker.bootstrap.css.map */
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* CSS files for fontIconPicker
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.1.1
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*
|
||||
*/
|
||||
.icons-selector.fip-darkgrey{font-size:16px}.icons-selector.fip-darkgrey .selector{border:0 none;background-color:transparent;width:102px}.icons-selector.fip-darkgrey .selector-button{background-color:#eee;border:1px solid #ccc;border-radius:0 4px 4px 0;background-image:-webkit-gradient(linear,left top,left bottom,from(#eee),to(#ddd));background-image:linear-gradient(#eee,#ddd);-webkit-box-sizing:border-box;box-sizing:border-box;width:41px}.icons-selector.fip-darkgrey .selector-button i{color:#aaa;text-shadow:0 1px 0 #fff}.icons-selector.fip-darkgrey .selector-button:hover{background-color:#f1f1f1;background-image:-webkit-gradient(linear,left top,left bottom,from(#f1f1f1),to(#ddd));background-image:linear-gradient(#f1f1f1,#ddd)}.icons-selector.fip-darkgrey .selector-button:hover i{color:#999}.icons-selector.fip-darkgrey .selector-button:active{background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#f1f1f1),to(#eee));background-image:linear-gradient(#f1f1f1,#eee)}.icons-selector.fip-darkgrey .selected-icon{background-color:#fff;border:1px solid #ccc;border-right:0 none;-webkit-box-shadow:inset -1px 0 2px #ddd;box-shadow:inset -1px 0 2px #ddd;border-radius:4px 0 0 4px;-webkit-box-sizing:border-box;box-sizing:border-box}.icons-selector.fip-darkgrey .selected-icon i{color:#404040}.icons-selector.fip-darkgrey .selector-popup{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #ccc;border-radius:4px}.icons-selector.fip-darkgrey .selector-category select,.icons-selector.fip-darkgrey .selector-search input[type=text]{border:1px solid #ddd;color:#404040;-webkit-box-shadow:none;box-shadow:none;outline:none;border-radius:4px}.icons-selector.fip-darkgrey .selector-category select:focus,.icons-selector.fip-darkgrey .selector-search input[type=text]:focus{border-color:#ccc;-webkit-box-shadow:0 0 2px #ccc;box-shadow:0 0 2px #ccc}.icons-selector.fip-darkgrey input::-webkit-input-placeholder{color:#ccc!important}.icons-selector.fip-darkgrey input:-ms-input-placeholder,.icons-selector.fip-darkgrey input::-ms-input-placeholder{color:#ccc!important}.icons-selector.fip-darkgrey input::placeholder{color:#ccc!important}.icons-selector.fip-darkgrey .selector-search i{color:#ccc}.icons-selector.fip-darkgrey .fip-icons-container{background-color:#fff;border:1px solid #ccc;border-radius:4px}.icons-selector.fip-darkgrey .fip-icons-container .loading{color:#ddd}.icons-selector.fip-darkgrey .fip-box{border:1px solid #ddd;border-radius:2px}.icons-selector.fip-darkgrey .fip-box:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,inset 0 0 2px #fff;font-size:1.6em;text-shadow:0 0 1px #fff}.icons-selector.fip-darkgrey .selector-footer,.icons-selector.fip-darkgrey .selector-footer i{color:#666}.icons-selector.fip-darkgrey .selector-arrows i:hover{color:#999}.icons-selector.fip-darkgrey span.current-icon,.icons-selector.fip-darkgrey span.current-icon:hover{background-color:#2ea2cc;color:#fff;border:1px solid #298cba;-webkit-box-shadow:0 0 2px #298cba;box-shadow:0 0 2px #298cba}.icons-selector.fip-darkgrey span.current-icon:hover i,.icons-selector.fip-darkgrey span.current-icon i{color:#fff;text-shadow:0 0 1px #666}.icons-selector.fip-darkgrey .icons-picker-error i:before{color:#eee}.icons-selector.fip-darkgrey .fip-box,.icons-selector.fip-darkgrey .selector-button,.icons-selector.fip-darkgrey .selector-category select,.icons-selector.fip-darkgrey .selector-search input[type=text]{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}
|
||||
/*# sourceMappingURL=jquery.fonticonpicker.darkgrey.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["themes/grey-theme/<no source>","themes/grey-theme/jquery.fonticonpicker.grey.scss"],"names":[],"mappings":"AAAA;;;;;;;GAAA;ACOA,yBAIE,cAAe,CA0Ff,AA9FF,mCAOG,yBAAyB,AACzB,4BAA6B,CAC7B,AATH,0CAYG,yBAAyB,AACzB,6BAA8B,CAa9B,AA1BH,4CAgBI,WAAW,AACX,wBAA6B,CAC7B,AAlBJ,gDAqBI,wBAAyB,CAIzB,AAzBJ,kDAuBK,UAAW,CACX,AAxBL,wCA6BG,qBAAsB,CAItB,AAjCH,0CA+BI,aAAc,CACd,AAhCJ,yCAoCG,6CAAA,AAAsC,qCAAA,AACtC,wBAAyB,CACzB,AAtCH,8GA0CG,yBAAyB,AACzB,cAAc,AACd,wBAAA,AAAgB,gBAAA,AAChB,YAAa,CACb,AA9CH,0DAiDG,oBAAqB,CAjDxB,AAkDG,2GADA,oBAAqB,CAjDxB,AAkDG,4CADA,oBAAqB,CACrB,AAlDH,4CAqDG,UAAW,CACX,AAtDH,8CAyDG,sBAAsB,AACtB,wBAAyB,CAKzB,AA/DH,uDA6DI,UAAU,CACV,AA9DJ,kCAkEG,wBAAyB,CAKzB,AAvEH,wCAqEI,wBAAyB,CACzB,AAtEJ,sFA4EG,UAAW,CACX,AA7EH,kDAiFG,UAAW,CACX,AAlFH,4FAsFG,yBAAyB,AACzB,WAAW,AACX,wBAAyB,CACzB,AAzFH,sDA4FG,UAAW,CACX","file":"jquery.fonticonpicker.grey.css","sourcesContent":[null,"/**\n * Grey Theme file for fontIconPicker\n * {@link https://github.com/micc83/fontIconPicker}\n */\n@import '../../partials/variables';\n@import '../../partials/mixins';\n/** main selector */\n.#{$main-selector} {\n\t/** scoped to theme */\n\t&.fip-grey {\n\t\t/* Main Container */\n\t\tfont-size: 16px;\n\t\t/* Icon selector */\n\t\t.selector {\n\t\t\tborder: 1px solid #EDEDED;\n\t\t\tbackground-color: transparent;\n\t\t}\n\t\t/* Selector open button */\n\t\t.selector-button {\n\t\t\tbackground-color: #F4F4F4;\n\t\t\tborder-left: 1px solid #E1E1E1;\n\t\t\t/* Selector open button icon */\n\t\t\ti {\n\t\t\t\tcolor: #aaa;\n\t\t\t\ttext-shadow: 0px 1px 0px #FFF;\n\t\t\t}\n\t\t\t/* Selector open button hover */\n\t\t\t&:hover {\n\t\t\t\tbackground-color: #f1f1f1;\n\t\t\t\ti {\n\t\t\t\t\tcolor: #999;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Selected icon */\n\t\t.selected-icon {\n\t\t\tbackground-color: #fff;\n\t\t\ti {\n\t\t\t\tcolor: #404040;\n\t\t\t}\n\t\t}\n\t\t/* IconPicker Popup */\n\t\t.selector-popup {\n\t\t\tbox-shadow: 0 1px 1px rgba(0,0,0,0.04);\n\t\t\tborder: 1px solid #E5E5E5;\n\t\t}\n\t\t/* Search input & category selector */\n\t\t.selector-search input[type=\"text\"],\n\t\t.selector-category select {\n\t\t\tborder: 1px solid #EDEDED;\n\t\t\tcolor: #404040;\n\t\t\tbox-shadow: none;\n\t\t\toutline: none;\n\t\t}\n\t\t/* Search input placeholder */\n\t\tinput::placeholder {\n\t\t\tcolor:#ddd !important;\n\t\t}\n\t\t/* Search and cancel icon */\n\t\t.selector-search i {\n\t\t\tcolor: #eee;\n\t\t}\n\t\t/* Icon Container inside Popup */\n\t\t.fip-icons-container {\n\t\t\tbackground-color: #fff;\n\t\t\tborder: 1px solid #EDEDED;\n\t\t\t/* Icon container loading */\n\t\t\t.loading {\n\t\t\t\tcolor:#eee;\n\t\t\t}\n\t\t}\n\t\t/* Single icon box */\n\t\t.fip-box {\n\t\t\tborder: 1px solid #EFEFEF;\n\t\t\t/* Single icon box hover */\n\t\t\t&:hover {\n\t\t\t\tbackground-color: #f6f6f6;\n\t\t\t}\n\t\t}\n\n\t\t/* Pagination and footer icons */\n\t\t.selector-footer,\n\t\t.selector-footer i {\n\t\t\tcolor: #ddd;\n\t\t}\n\n\t\t/* Pagination arrows icons hover */\n\t\t.selector-arrows i:hover {\n\t\t\tcolor: #777;\n\t\t}\n\t\t/* Currently selected icon color */\n\t\tspan.current-icon,\n\t\tspan.current-icon:hover {\n\t\t\tbackground-color: #2EA2CC;\n\t\t\tcolor: #fff;\n\t\t\tborder: 1px solid #298CBA;\n\t\t}\n\t\t/* No icons found */\n\t\t.icons-picker-error i:before {\n\t\t\tcolor: #eee;\n\t\t}\n\t}\n}\n"]}
|
||||
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* CSS files for fontIconPicker
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.1.1
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*
|
||||
*/
|
||||
.icons-selector.fip-grey{font-size:16px}.icons-selector.fip-grey .selector{border:1px solid #ededed;background-color:transparent}.icons-selector.fip-grey .selector-button{background-color:#f4f4f4;border-left:1px solid #e1e1e1}.icons-selector.fip-grey .selector-button i{color:#aaa;text-shadow:0 1px 0 #fff}.icons-selector.fip-grey .selector-button:hover{background-color:#f1f1f1}.icons-selector.fip-grey .selector-button:hover i{color:#999}.icons-selector.fip-grey .selected-icon{background-color:#fff}.icons-selector.fip-grey .selected-icon i{color:#404040}.icons-selector.fip-grey .selector-popup{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5}.icons-selector.fip-grey .selector-category select,.icons-selector.fip-grey .selector-search input[type=text]{border:1px solid #ededed;color:#404040;-webkit-box-shadow:none;box-shadow:none;outline:none}.icons-selector.fip-grey input::-webkit-input-placeholder{color:#ddd!important}.icons-selector.fip-grey input:-ms-input-placeholder,.icons-selector.fip-grey input::-ms-input-placeholder{color:#ddd!important}.icons-selector.fip-grey input::placeholder{color:#ddd!important}.icons-selector.fip-grey .selector-search i{color:#eee}.icons-selector.fip-grey .fip-icons-container{background-color:#fff;border:1px solid #ededed}.icons-selector.fip-grey .fip-icons-container .loading{color:#eee}.icons-selector.fip-grey .fip-box{border:1px solid #efefef}.icons-selector.fip-grey .fip-box:hover{background-color:#f6f6f6}.icons-selector.fip-grey .selector-footer,.icons-selector.fip-grey .selector-footer i{color:#ddd}.icons-selector.fip-grey .selector-arrows i:hover{color:#777}.icons-selector.fip-grey span.current-icon,.icons-selector.fip-grey span.current-icon:hover{background-color:#2ea2cc;color:#fff;border:1px solid #298cba}.icons-selector.fip-grey .icons-picker-error i:before{color:#eee}
|
||||
/*# sourceMappingURL=jquery.fonticonpicker.grey.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["themes/inverted-theme/<no source>","themes/inverted-theme/jquery.fonticonpicker.inverted.scss"],"names":[],"mappings":"AAAA;;;;;;;GAAA;ACOA,6BAGE,eAAe,AACf,UAAW,CAgGX,AApGF,uCAQG,sBAAsB,AACtB,4BAA6B,CAC7B,AAVH,8CAaG,sBAAsB,AACtB,0BAA2B,CAY3B,AA1BH,gDAiBI,UAAW,CACX,AAlBJ,oDAqBI,qBAAsB,CAItB,AAzBJ,sDAuBK,UAAW,CACX,AAxBL,4CA8BG,qBAAsB,CAKtB,AAnCH,8CAgCI,WAAW,AACX,wBAAyB,CACzB,AAlCJ,6CAsCG,iDAAA,AAA4C,yCAAA,AAC5C,sBAAsB,AACtB,wBAAyB,CACzB,AAzCH,sHA6CG,sBAAsB,AACtB,gBAAgB,AAChB,WAAW,AACX,wBAAA,AAAgB,gBAAA,AAChB,YAAa,CACb,AAlDH,8DAqDG,oBAAqB,CArDxB,AAsDG,mHADA,oBAAqB,CArDxB,AAsDG,gDADA,oBAAqB,CACrB,AAtDH,gDAyDG,UAAW,CACX,AA1DH,kDA6DG,sBAAsB,AACtB,qBAAsB,CAKtB,AAnEH,2DAiEI,UAAU,CACV,AAlEJ,sCAsEG,qBAAsB,CAMtB,AA5EH,4CAyEI,sBAAsB,AACtB,UAAW,CACX,AA3EJ,8FAiFG,UAAW,CACX,AAlFH,sDAsFG,UAAW,CACX,AAvFH,oGA2FG,sBAAsB,AACtB,UAAW,CACX,AA7FH,8GAiGG,WAAc,AACd,gBAAiB,CAChB","file":"jquery.fonticonpicker.inverted.css","sourcesContent":[null,"/**\n * inverted Theme file for fontIconPicker\n * {@link https://github.com/micc83/fontIconPicker}\n */\n@import '../../partials/variables';\n@import '../../partials/mixins';\n/* Main Container */\n.#{$main-selector} {\n\t/** scoped to theme */\n\t&.fip-inverted {\n\t\tfont-size: 16px;\n\t\tcolor: #aaa;\n\n\t\t/* Icon selector */\n\t\t.selector {\n\t\t\tborder: 1px solid #111;\n\t\t\tbackground-color: transparent;\n\t\t}\n\t\t/* Selector open button */\n\t\t.selector-button {\n\t\t\tbackground-color: #222;\n\t\t\tborder-left: 1px solid #111;\n\t\t\t/* Selector open button icon */\n\t\t\ti {\n\t\t\t\tcolor: #eee;\n\t\t\t}\n\t\t\t/* Selector open button hover */\n\t\t\t&:hover {\n\t\t\t\tbackground-color: #000;\n\t\t\t\ti {\n\t\t\t\t\tcolor: #fff;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Selected icon */\n\t\t.selected-icon {\n\t\t\tbackground-color: #333;\n\t\t\ti {\n\t\t\t\tcolor: #ccc;\n\t\t\t\ttext-shadow: 0 0 1px #000;\n\t\t\t}\n\t\t}\n\t\t/* IconPicker Popup */\n\t\t.selector-popup {\n\t\t\tbox-shadow: 0 1px 1px rgba(255,255,255,0.04);\n\t\t\tborder: 1px solid #111;\n\t\t\tbackground-color: #101010;\n\t\t}\n\t\t/* Search input & category selector */\n\t\t.selector-search input[type=\"text\"],\n\t\t.selector-category select {\n\t\t\tborder: 1px solid #111;\n\t\t\tbackground: #333;\n\t\t\tcolor: #aaa;\n\t\t\tbox-shadow: none;\n\t\t\toutline: none;\n\t\t}\n\t\t/* Search input placeholder */\n\t\tinput::placeholder {\n\t\t\tcolor:#aaa !important;\n\t\t}\n\t\t/* Search and cancel icon */\n\t\t.selector-search i {\n\t\t\tcolor: #aaa;\n\t\t}\n\t\t/* Icon Container inside Popup */\n\t\t.fip-icons-container {\n\t\t\tbackground-color: #333;\n\t\t\tborder: 1px solid #111;\n\t\t\t/* Icon container loading */\n\t\t\t.loading {\n\t\t\t\tcolor:#aaa;\n\t\t\t}\n\t\t}\n\t\t/* Single icon box */\n\t\t.fip-box {\n\t\t\tborder: 1px solid #111;\n\t\t\t/* Single icon box hover */\n\t\t\t&:hover {\n\t\t\t\tbackground-color: #000;\n\t\t\t\tcolor: #eee;\n\t\t\t}\n\t\t}\n\n\t\t/* Pagination and footer icons */\n\t\t.selector-footer,\n\t\t.selector-footer i {\n\t\t\tcolor: #aaa;\n\t\t}\n\n\t\t/* Pagination arrows icons hover */\n\t\t.selector-arrows i:hover {\n\t\t\tcolor: #000;\n\t\t}\n\t\t/* Currently selected icon color */\n\t\tspan.current-icon,\n\t\tspan.current-icon:hover {\n\t\t\tbackground-color: #000;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t/* No icons found */\n\t\t.icons-picker-error i:before,\n\t\t.fip-icon-block:before {\n\t\t\tcolor: #663333;\n\t\t\ttext-shadow: none;\n\t\t }\n\t}\n}\n\n"]}
|
||||
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* CSS files for fontIconPicker
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.1.1
|
||||
* {@link https://github.com/micc83/fontIconPicker}
|
||||
*
|
||||
*/
|
||||
.icons-selector.fip-inverted{font-size:16px;color:#aaa}.icons-selector.fip-inverted .selector{border:1px solid #111;background-color:transparent}.icons-selector.fip-inverted .selector-button{background-color:#222;border-left:1px solid #111}.icons-selector.fip-inverted .selector-button i{color:#eee}.icons-selector.fip-inverted .selector-button:hover{background-color:#000}.icons-selector.fip-inverted .selector-button:hover i{color:#fff}.icons-selector.fip-inverted .selected-icon{background-color:#333}.icons-selector.fip-inverted .selected-icon i{color:#ccc;text-shadow:0 0 1px #000}.icons-selector.fip-inverted .selector-popup{-webkit-box-shadow:0 1px 1px hsla(0,0%,100%,.04);box-shadow:0 1px 1px hsla(0,0%,100%,.04);border:1px solid #111;background-color:#101010}.icons-selector.fip-inverted .selector-category select,.icons-selector.fip-inverted .selector-search input[type=text]{border:1px solid #111;background:#333;color:#aaa;-webkit-box-shadow:none;box-shadow:none;outline:none}.icons-selector.fip-inverted input::-webkit-input-placeholder{color:#aaa!important}.icons-selector.fip-inverted input:-ms-input-placeholder,.icons-selector.fip-inverted input::-ms-input-placeholder{color:#aaa!important}.icons-selector.fip-inverted input::placeholder{color:#aaa!important}.icons-selector.fip-inverted .selector-search i{color:#aaa}.icons-selector.fip-inverted .fip-icons-container{background-color:#333;border:1px solid #111}.icons-selector.fip-inverted .fip-icons-container .loading{color:#aaa}.icons-selector.fip-inverted .fip-box{border:1px solid #111}.icons-selector.fip-inverted .fip-box:hover{background-color:#000;color:#eee}.icons-selector.fip-inverted .selector-footer,.icons-selector.fip-inverted .selector-footer i{color:#aaa}.icons-selector.fip-inverted .selector-arrows i:hover{color:#000}.icons-selector.fip-inverted span.current-icon,.icons-selector.fip-inverted span.current-icon:hover{background-color:#000;color:#fff}.icons-selector.fip-inverted .fip-icon-block:before,.icons-selector.fip-inverted .icons-picker-error i:before{color:#633;text-shadow:none}
|
||||
/*# sourceMappingURL=jquery.fonticonpicker.inverted.css.map */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 434 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="iconpicker" horiz-adv-x="1000" >
|
||||
<font-face font-family="iconpicker" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="spin3" unicode="" d="m494 850c-266 0-483-210-494-472c-1-19 13-20 13-20l84 0c16 0 19 10 19 18c10 199 176 358 378 358c107 0 205-45 273-118l-58-57c-11-12-11-27 5-31l247-50c21-5 46 11 37 44l-58 227c-2 9-16 22-29 13l-65-60c-89 91-214 148-352 148z m409-508c-16 0-19-10-19-18c-10-199-176-358-377-358c-108 0-205 45-274 118l59 57c10 12 10 27-5 31l-248 50c-21 5-46-11-37-44l58-227c2-9 16-22 30-13l64 60c89-91 214-148 353-148c265 0 482 210 493 473c1 18-13 19-13 19l-84 0z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="search" unicode="" d="m643 386q0 103-74 176t-176 74t-177-74t-73-176t73-177t177-73t176 73t74 177z m286-465q0-29-22-50t-50-21q-30 0-50 21l-191 191q-100-69-223-69q-80 0-153 31t-125 84t-84 125t-31 153t31 152t84 126t125 84t153 31t152-31t126-84t84-126t31-152q0-123-69-223l191-191q21-21 21-51z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="cancel" unicode="" d="m724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165l-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164l-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164l164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164l164-164q15-15 15-38z" horiz-adv-x="785.7" />
|
||||
<glyph glyph-name="block" unicode="" d="m732 352q0 90-48 164l-421-420q76-50 166-50q62 0 118 25t96 65t65 97t24 119z m-557-167l421 421q-75 50-167 50q-83 0-153-40t-110-112t-41-152q0-91 50-167z m682 167q0-88-34-168t-91-137t-137-92t-166-34t-167 34t-137 92t-91 137t-34 168t34 167t91 137t137 91t167 34t166-34t137-91t91-137t34-167z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="down-dir" unicode="" d="m571 457q0-14-10-25l-250-250q-11-11-25-11t-25 11l-250 250q-11 11-11 25t11 25t25 11h500q14 0 25-11t10-25z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="up-dir" unicode="" d="m571 171q0-14-10-25t-25-10h-500q-15 0-25 10t-11 25t11 26l250 250q10 10 25 10t25-10l250-250q10-11 10-26z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="left-dir" unicode="" d="m357 600v-500q0-14-10-25t-26-11t-25 11l-250 250q-10 11-10 25t10 25l250 250q11 11 25 11t26-11t10-25z" horiz-adv-x="357.1" />
|
||||
<glyph glyph-name="right-dir" unicode="" d="m321 350q0-14-10-25l-250-250q-11-11-25-11t-25 11t-11 25v500q0 15 11 25t25 11t25-11l250-250q10-10 10-25z" horiz-adv-x="357.1" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Plugin Name: CMB2 Field Type: Font Awesome
|
||||
Plugin URI: https://github.com/serkanalgur/cmb2-field-faiconselect
|
||||
GitHub Plugin URI: https://github.com/serkanalgur/cmb2-field-faiconselect
|
||||
Description: Font Awesome icon selector for CMB2
|
||||
Version: 1.4
|
||||
Author: Serkan Algur
|
||||
Author URI: https://wpadami.com/
|
||||
License: GPLv3
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class IConSelectFA
|
||||
*/
|
||||
|
||||
if( !class_exists( 'CMBS_SerkanA_Plugin_IConSelectFA' ) ) {
|
||||
|
||||
class CMBS_SerkanA_Plugin_IConSelectFA {
|
||||
|
||||
|
||||
const VERSION = '1.4';
|
||||
|
||||
public function __construct() {
|
||||
add_filter( 'cmb2_render_faiconselect', array( $this, 'render_faiconselect' ), 10, 5 );
|
||||
}
|
||||
|
||||
public function render_faiconselect( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) {
|
||||
$this->Sesetup_my_cssjs( $field );
|
||||
|
||||
if ( version_compare( CMB2_VERSION, '2.2.2', '>=' ) ) {
|
||||
$field_type_object->type = new CMB2_Type_Select( $field_type_object );
|
||||
}
|
||||
|
||||
echo $field_type_object->select(
|
||||
array(
|
||||
'class' => 'iconselectfa',
|
||||
'desc' => $field_type_object->_desc( true ),
|
||||
'options' => '<option></option>' . $field_type_object->concat_items(),
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function Sesetup_my_cssjs( $field ) {
|
||||
$asset_path = apply_filters( 'sa_cmb2_field_faiconselect_asset_path', plugins_url( '', __FILE__ ) );
|
||||
|
||||
$font_args = $field->args( 'attributes', 'fatype' );
|
||||
$font_awesome_ver = $field->args( 'attributes', 'faver' );
|
||||
|
||||
if ( $font_awesome_ver && $font_awesome_ver === 5 ) {
|
||||
|
||||
// loads all over admin via enqueue.php
|
||||
// wp_enqueue_style( 'fontawesome5', 'https://use.fontawesome.com/releases/v5.10.2/css/all.css', array( 'jqueryfontselector' ), self::VERSION, 'all' );
|
||||
|
||||
} else {
|
||||
|
||||
wp_enqueue_style( 'fontawesomeiselect', $asset_path . '/css/faws/css/font-awesome.min.css', array( 'jqueryfontselector' ), self::VERSION );
|
||||
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'jqueryfontselectormain', $asset_path . '/css/css/base/jquery.fonticonpicker.min.css', array(), self::VERSION );
|
||||
wp_enqueue_style( 'jqueryfontselector', $asset_path . '/css/css/themes/grey-theme/jquery.fonticonpicker.grey.min.css', array(), self::VERSION );
|
||||
wp_enqueue_script( 'jqueryfontselector', $asset_path . '/js/jquery.fonticonpicker.min.js', array( 'jquery' ), self::VERSION, true );
|
||||
wp_enqueue_script( 'mainjsiselect', $asset_path . '/js/main.js', array( 'jqueryfontselector' ), self::VERSION, true );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function returnRayFaPre() {
|
||||
include 'predefined-array-fontawesome.php';
|
||||
return $fontAwesome;
|
||||
}
|
||||
|
||||
function returnRayFapsa() {
|
||||
include 'predefined-array-fontawesome.php';
|
||||
|
||||
$fa5a = array_combine( $fa5all, $fa5all );
|
||||
|
||||
return $fa5a;
|
||||
}
|
||||
|
||||
|
||||
new CMBS_SerkanA_Plugin_IConSelectFA();
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,81 @@
|
||||
(function($) {
|
||||
'use strict';
|
||||
|
||||
$('.iconselectfa').each(function(){
|
||||
$(this).fontIconPicker({
|
||||
theme: 'fip-grey'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
// Before a new group row is added, destroy Select2. We'll reinitialise after the row is added
|
||||
$('.cmb-repeatable-group').on('cmb2_add_group_row_start', function (event, instance) {
|
||||
var $table = $(document.getElementById($(instance).data('selector')));
|
||||
var $oldRow = $table.find('.cmb-repeatable-grouping').last();
|
||||
|
||||
$oldRow.find('.iconselectfa').each(function () {
|
||||
$(this).fontIconPicker().destroyPicker();
|
||||
});
|
||||
});
|
||||
|
||||
// When a new group row is added, clear selection and initialise Select2
|
||||
$('.cmb-repeatable-group').on('cmb2_add_row', function (event, newRow) {
|
||||
$(newRow).find('.iconselectfa').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).fontIconPicker().refreshPicker({
|
||||
theme: 'fip-grey'
|
||||
});
|
||||
});
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.iconselectfa').each(function () {
|
||||
$(this).fontIconPicker().refreshPicker({
|
||||
theme: 'fip-grey'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Before a group row is shifted, destroy Select2. We'll reinitialise after the row shift
|
||||
$('.cmb-repeatable-group').on('cmb2_shift_rows_start', function (event, instance) {
|
||||
var groupWrap = $(instance).closest('.cmb-repeatable-group');
|
||||
groupWrap.find('.iconselectfa').each(function () {
|
||||
$(this).fontIconPicker().destroyPicker();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// When a group row is shifted, reinitialise Select2
|
||||
$('.cmb-repeatable-group').on('cmb2_shift_rows_complete', function (event, instance) {
|
||||
var groupWrap = $(instance).closest('.cmb-repeatable-group');
|
||||
groupWrap.find('.iconselectfa').each(function () {
|
||||
$(this).fontIconPicker().refreshPicker({
|
||||
theme: 'fip-grey'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Before a new repeatable field row is added, destroy Select2. We'll reinitialise after the row is added
|
||||
$('.cmb-add-row-button').on('click', function (event) {
|
||||
var $table = $(document.getElementById($(event.target).data('selector')));
|
||||
var $oldRow = $table.find('.cmb-row').last();
|
||||
|
||||
$oldRow.find('.iconselectfa').each(function () {
|
||||
$(this).fontIconPicker().destroyPicker();
|
||||
});
|
||||
});
|
||||
|
||||
// When a new repeatable field row is added, clear selection and initialise Select2
|
||||
$('.cmb-repeat-table').on('cmb2_add_row', function (event, newRow) {
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.iconselectfa').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).fontIconPicker().refreshPicker({
|
||||
theme: 'fip-grey'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
=== CMB2 Field Type: Font Awesome ===
|
||||
Contributors: kaisercrazy
|
||||
Donate link: https://paypal.me/serkanalgur
|
||||
Tags: font-awesome,cmb2,plugins,font awesome
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Requires at least: 3.6
|
||||
Tested up to: 5.2
|
||||
Stable tag: trunk
|
||||
|
||||
Font Awesome icon selector for powerful custom metabox generator CMB2
|
||||
|
||||
== Description ==
|
||||
|
||||
Font Awesome icon selector for powerful custom metabox generator [CMB2](https://github.com/WebDevStudios/CMB2 "Custom Metaboxes and Fields for WordPress 2")
|
||||
|
||||
You can use as field type in CMB2 function file. Add a new field, set type to `faiconselect` and add font awesome icons to options (look Usage for examples). Plugin uses [jQuery Font Picker](https://codeb.it/fonticonpicker/) for creating a icon selector.
|
||||
|
||||
== Sample Usage ==
|
||||
Detailed instructions on [Github ](https://github.com/serkanalgur/cmb2-field-faiconselect)
|
||||
|
||||
`
|
||||
$cmb->add_field( array(
|
||||
'name' => __( 'Select Font Awesome Icon', 'cmb' ),
|
||||
'id' => $prefix . 'iconselect',
|
||||
'desc' => 'Select Font Awesome icon',
|
||||
'type' => 'faiconselect',
|
||||
'options' => array(
|
||||
'fa fa-facebook' => 'fa fa-facebook',
|
||||
'fa fa-500px' => 'fa fa-500px',
|
||||
'fa fa-twitter' => 'fa fa-twitter'
|
||||
)
|
||||
) );
|
||||
`
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload `cmb2-field-type-font-awesome` folder to the `/wp-content/plugins/` directory
|
||||
2. Activate the plugin through the 'Plugins' menu in WordPress
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Selector
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= Version 1.2 =
|
||||
* Version corrections and tests
|
||||
* fontawesome & mainjs definition fix
|
||||
|
||||
= Version 1.0 =
|
||||
* Released
|
||||
|
||||
== Upgrade Notice ==
|
||||
No need any changes
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: CMB2 Radio Image
|
||||
Description: https://github.com/satwinderrathore/CMB2-Radio-Image/
|
||||
Version: 0.1
|
||||
Author: Satwinder Rathore
|
||||
Author URI: http://satwinderrathore.wordpress.com
|
||||
License: GPL-2.0+
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
if( !defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if( !class_exists( 'CMB2_Radio_Image' ) ) {
|
||||
/**
|
||||
* Class CMB2_Radio_Image
|
||||
*/
|
||||
class CMB2_Radio_Image {
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'cmb2_render_radio_image', array( $this, 'callback' ), 10, 5 );
|
||||
add_filter( 'cmb2_list_input_attributes', array( $this, 'attributes' ), 10, 4 );
|
||||
add_action( 'admin_head', array( $this, 'admin_head' ) );
|
||||
}
|
||||
|
||||
public function callback($field, $escaped_value, $object_id, $object_type, $field_type_object) {
|
||||
echo $field_type_object->radio();
|
||||
}
|
||||
|
||||
|
||||
public function attributes($args, $defaults, $field, $cmb) {
|
||||
if ($field->args['type'] == 'radio_image' && isset($field->args['images'])) {
|
||||
foreach ($field->args['images'] as $field_id => $image) {
|
||||
if ($field_id == $args['value']) {
|
||||
$image = trailingslashit($field->args['images_path']) . $image;
|
||||
$args['label'] = '<img src="' . $image . '" alt="' . $args['value'] . '" title="' . $args['label'] . '" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
||||
public function admin_head() {
|
||||
?>
|
||||
<style>
|
||||
.cmb-type-radio-image .cmb2-radio-list {
|
||||
display: block;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.cmb-type-radio-image .cmb2-radio-list input[type="radio"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cmb-type-radio-image .cmb2-radio-list li {
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.cmb-type-radio-image .cmb2-radio-list input[type="radio"] + label {
|
||||
border: 3px solid #eee;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.cmb-type-radio-image .cmb2-radio-list input[type="radio"] + label:hover,
|
||||
.cmb-type-radio-image .cmb2-radio-list input[type="radio"]:checked + label {
|
||||
border-color: #0085ba;
|
||||
}
|
||||
|
||||
.cmb-type-radio-image .cmb2-radio-list li label img {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
$cmb2_radio_image = new CMB2_Radio_Image();
|
||||
|
||||
}
|
||||
14
wp-content/plugins/eagle-booking/include/metabox/cmb2-custom-fields/cmb2-select2/.gitignore
vendored
Normal file
14
wp-content/plugins/eagle-booking/include/metabox/cmb2-custom-fields/cmb2-select2/.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# OS or IDE folders/files to ignore
|
||||
*~
|
||||
._*
|
||||
*.lock
|
||||
*.DS_Store
|
||||
*.swp
|
||||
*.out
|
||||
.cache
|
||||
.project
|
||||
.settings
|
||||
nbproject
|
||||
thumb.db
|
||||
Thumbs.db
|
||||
.idea/
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: CMB2 Field Type: Select2
|
||||
Plugin URI: https://github.com/mustardBees/cmb-field-select2
|
||||
GitHub Plugin URI: https://github.com/mustardBees/cmb-field-select2
|
||||
Description: Select2 field type for CMB2.
|
||||
Version: 3.0.3
|
||||
Author: Phil Wylie
|
||||
Author URI: https://www.philwylie.co.uk/
|
||||
License: GPLv2+
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class PW_CMB2_Field_Select2
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
if( !defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if( !class_exists( 'PW_CMB2_Field_Select2' ) ) {
|
||||
|
||||
class PW_CMB2_Field_Select2 {
|
||||
|
||||
/**
|
||||
* Current version number
|
||||
*/
|
||||
const VERSION = '3.0.3';
|
||||
|
||||
/**
|
||||
* Initialize the plugin by hooking into CMB2
|
||||
*/
|
||||
public function __construct() {
|
||||
add_filter( 'cmb2_render_pw_select', array( $this, 'render_pw_select' ), 10, 5 );
|
||||
add_filter( 'cmb2_render_pw_multiselect', array( $this, 'render_pw_multiselect' ), 10, 5 );
|
||||
add_filter( 'cmb2_sanitize_pw_multiselect', array( $this, 'pw_multiselect_sanitize' ), 10, 4 );
|
||||
add_filter( 'cmb2_types_esc_pw_multiselect', array( $this, 'pw_multiselect_escaped_value' ), 10, 3 );
|
||||
add_filter( 'cmb2_repeat_table_row_types', array( $this, 'pw_multiselect_table_row_class' ), 10, 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render select box field
|
||||
*/
|
||||
public function render_pw_select( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) {
|
||||
$this->setup_admin_scripts();
|
||||
|
||||
if ( version_compare( CMB2_VERSION, '2.2.2', '>=' ) ) {
|
||||
$field_type_object->type = new CMB2_Type_Select( $field_type_object );
|
||||
}
|
||||
|
||||
echo $field_type_object->select( array(
|
||||
'class' => 'pw_select2 pw_select',
|
||||
'desc' => $field_type_object->_desc( true ),
|
||||
'options' => '<option></option>' . $field_type_object->concat_items(),
|
||||
'data-placeholder' => $field->args( 'attributes', 'placeholder' ) ? $field->args( 'attributes', 'placeholder' ) : $field->args( 'description' ),
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render multi-value select input field
|
||||
*/
|
||||
public function render_pw_multiselect( $field, $field_escaped_value, $field_object_id, $field_object_type, $field_type_object ) {
|
||||
$this->setup_admin_scripts();
|
||||
|
||||
if ( version_compare( CMB2_VERSION, '2.2.2', '>=' ) ) {
|
||||
$field_type_object->type = new CMB2_Type_Select( $field_type_object );
|
||||
}
|
||||
|
||||
$a = $field_type_object->parse_args( 'pw_multiselect', array(
|
||||
'multiple' => 'multiple',
|
||||
'style' => 'width: 99%',
|
||||
'class' => 'pw_select2 pw_multiselect',
|
||||
'name' => $field_type_object->_name() . '[]',
|
||||
'id' => $field_type_object->_id(),
|
||||
'desc' => $field_type_object->_desc( true ),
|
||||
'options' => $this->get_pw_multiselect_options( $field_escaped_value, $field_type_object ),
|
||||
'data-placeholder' => $field->args( 'attributes', 'placeholder' ) ? $field->args( 'attributes', 'placeholder' ) : $field->args( 'description' ),
|
||||
) );
|
||||
|
||||
$attrs = $field_type_object->concat_attrs( $a, array( 'desc', 'options' ) );
|
||||
echo sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of options for pw_multiselect
|
||||
*
|
||||
* Return the list of options, with selected options at the top preserving their order. This also handles the
|
||||
* removal of selected options which no longer exist in the options array.
|
||||
*/
|
||||
public function get_pw_multiselect_options( $field_escaped_value = array(), $field_type_object = '' ) {
|
||||
$options = (array) $field_type_object->field->options();
|
||||
|
||||
// If we have selected items, we need to preserve their order
|
||||
if ( ! empty( $field_escaped_value ) ) {
|
||||
$options = $this->sort_array_by_array( $options, $field_escaped_value );
|
||||
}
|
||||
|
||||
$selected_items = '';
|
||||
$other_items = '';
|
||||
|
||||
foreach ( $options as $option_value => $option_label ) {
|
||||
|
||||
// Clone args & modify for just this item
|
||||
$option = array(
|
||||
'value' => $option_value,
|
||||
'label' => $option_label,
|
||||
);
|
||||
|
||||
// Split options into those which are selected and the rest
|
||||
if ( in_array( $option_value, (array) $field_escaped_value ) ) {
|
||||
$option['checked'] = true;
|
||||
$selected_items .= $field_type_object->select_option( $option );
|
||||
} else {
|
||||
$other_items .= $field_type_object->select_option( $option );
|
||||
}
|
||||
}
|
||||
|
||||
return $selected_items . $other_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort an array by the keys of another array
|
||||
*
|
||||
* @author Eran Galperin
|
||||
* @link http://link.from.pw/1Waji4l
|
||||
*/
|
||||
public function sort_array_by_array( array $array, array $orderArray ) {
|
||||
$ordered = array();
|
||||
|
||||
foreach ( $orderArray as $key ) {
|
||||
if ( array_key_exists( $key, $array ) ) {
|
||||
$ordered[ $key ] = $array[ $key ];
|
||||
unset( $array[ $key ] );
|
||||
}
|
||||
}
|
||||
|
||||
return $ordered + $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle sanitization for repeatable fields
|
||||
*/
|
||||
public function pw_multiselect_sanitize( $check, $meta_value, $object_id, $field_args ) {
|
||||
if ( ! is_array( $meta_value ) || ! $field_args['repeatable'] ) {
|
||||
return $check;
|
||||
}
|
||||
|
||||
foreach ( $meta_value as $key => $val ) {
|
||||
$meta_value[$key] = array_map( 'sanitize_text_field', $val );
|
||||
}
|
||||
|
||||
return $meta_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle escaping for repeatable fields
|
||||
*/
|
||||
public function pw_multiselect_escaped_value( $check, $meta_value, $field_args ) {
|
||||
if ( ! is_array( $meta_value ) || ! $field_args['repeatable'] ) {
|
||||
return $check;
|
||||
}
|
||||
|
||||
foreach ( $meta_value as $key => $val ) {
|
||||
$meta_value[$key] = array_map( 'esc_attr', $val );
|
||||
}
|
||||
|
||||
return $meta_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add 'table-layout' class to multi-value select field
|
||||
*/
|
||||
public function pw_multiselect_table_row_class( $check ) {
|
||||
$check[] = 'pw_multiselect';
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
public function setup_admin_scripts() {
|
||||
$asset_path = apply_filters( 'pw_cmb2_field_select2_asset_path', plugins_url( '', __FILE__ ) );
|
||||
|
||||
wp_register_script( 'pw-select2', $asset_path . '/js/select2.min.js', array( 'jquery-ui-sortable' ), '4.0.3' );
|
||||
wp_enqueue_script( 'pw-select2-init', $asset_path . '/js/script.js', array( 'cmb2-scripts', 'pw-select2' ), self::VERSION );
|
||||
wp_register_style( 'pw-select2', $asset_path . '/css/select2.min.css', array(), '4.0.3' );
|
||||
wp_enqueue_style( 'pw-select2-tweaks', $asset_path . '/css/style.css', array( 'pw-select2' ), self::VERSION );
|
||||
}
|
||||
}
|
||||
|
||||
$pw_cmb2_field_select2 = new PW_CMB2_Field_Select2();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "mustardBees/cmb-field-select2",
|
||||
"description": "Select2 field type for CMB2",
|
||||
"license": "GPL-2.0+",
|
||||
"type": "wordpress-plugin",
|
||||
"keywords": ["wordpress", "plugin"],
|
||||
"homepage": "https://github.com/mustardBees/cmb-field-select2",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Phil Wylie",
|
||||
"homepage": "http://www.philwylie.co.uk/"
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
.cmb-type-pw-multiselect .select2-selection__choice,
|
||||
.cmb-type-pw-multiselect .select2-search--inline {
|
||||
margin-bottom: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.cmb-type-pw-multiselect .select2-selection__choice {
|
||||
cursor: move !important;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$('.pw_select').each(function () {
|
||||
$(this).select2({
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
|
||||
$.fn.extend({
|
||||
select2_sortable: function () {
|
||||
var select = $(this);
|
||||
$(select).select2();
|
||||
var ul = $(select).next('.select2-container').first('ul.select2-selection__rendered');
|
||||
ul.sortable({
|
||||
containment: 'parent',
|
||||
items : 'li:not(.select2-search--inline)',
|
||||
tolerance : 'pointer',
|
||||
stop : function () {
|
||||
$($(ul).find('.select2-selection__choice').get().reverse()).each(function () {
|
||||
var id = $(this).data('data').id;
|
||||
var option = select.find('option[value="' + id + '"]')[0];
|
||||
$(select).prepend(option);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.pw_multiselect').each(function () {
|
||||
$(this).select2_sortable();
|
||||
});
|
||||
|
||||
// Before a new group row is added, destroy Select2. We'll reinitialise after the row is added
|
||||
$('.cmb-repeatable-group').on('cmb2_add_group_row_start', function (event, instance) {
|
||||
var $table = $(document.getElementById($(instance).data('selector')));
|
||||
var $oldRow = $table.find('.cmb-repeatable-grouping').last();
|
||||
|
||||
$oldRow.find('.pw_select2').each(function () {
|
||||
$(this).select2('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
// When a new group row is added, clear selection and initialise Select2
|
||||
$('.cmb-repeatable-group').on('cmb2_add_row', function (event, newRow) {
|
||||
$(newRow).find('.pw_select').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).select2({
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
|
||||
$(newRow).find('.pw_multiselect').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).select2_sortable();
|
||||
});
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.pw_select').each(function () {
|
||||
$(this).select2({
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.pw_multiselect').each(function () {
|
||||
$(this).select2_sortable();
|
||||
});
|
||||
});
|
||||
|
||||
// Before a group row is shifted, destroy Select2. We'll reinitialise after the row shift
|
||||
$('.cmb-repeatable-group').on('cmb2_shift_rows_start', function (event, instance) {
|
||||
var groupWrap = $(instance).closest('.cmb-repeatable-group');
|
||||
groupWrap.find('.pw_select2').each(function () {
|
||||
$(this).select2('destroy');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// When a group row is shifted, reinitialise Select2
|
||||
$('.cmb-repeatable-group').on('cmb2_shift_rows_complete', function (event, instance) {
|
||||
var groupWrap = $(instance).closest('.cmb-repeatable-group');
|
||||
groupWrap.find('.pw_select').each(function () {
|
||||
$(this).select2({
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
|
||||
groupWrap.find('.pw_multiselect').each(function () {
|
||||
$(this).select2_sortable();
|
||||
});
|
||||
});
|
||||
|
||||
// Before a new repeatable field row is added, destroy Select2. We'll reinitialise after the row is added
|
||||
$('.cmb-add-row-button').on('click', function (event) {
|
||||
var $table = $(document.getElementById($(event.target).data('selector')));
|
||||
var $oldRow = $table.find('.cmb-row').last();
|
||||
|
||||
$oldRow.find('.pw_select2').each(function () {
|
||||
$(this).select2('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
// When a new repeatable field row is added, clear selection and initialise Select2
|
||||
$('.cmb-repeat-table').on('cmb2_add_row', function (event, newRow) {
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.pw_select').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).select2({
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
|
||||
// Reinitialise the field we previously destroyed
|
||||
$(newRow).prev().find('.pw_multiselect').each(function () {
|
||||
$('option:selected', this).removeAttr("selected");
|
||||
$(this).select2_sortable();
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,125 @@
|
||||
# CMB2 Field Type: Select2
|
||||
|
||||
## Description
|
||||
|
||||
[Select2](https://select2.github.io/) field type for [CMB2](https://github.com/WebDevStudios/CMB2 "Custom Metaboxes and Fields for WordPress 2").
|
||||
|
||||
This plugin gives you two additional field types based on Select2:
|
||||
|
||||
1. The `pw_select` field acts much like the default `select` field. However, it adds typeahead-style search allowing you to quickly make a selection from a large list
|
||||
2. The `pw_multiselect` field allows you to select multiple values with typeahead-style search. The values can be dragged and dropped to reorder
|
||||
|
||||
## Installation
|
||||
|
||||
You can install this field type as you would a WordPress plugin:
|
||||
|
||||
1. Download the plugin
|
||||
2. Place the plugin folder in your `/wp-content/plugins/` directory
|
||||
3. Activate the plugin in the Plugin dashboard
|
||||
|
||||
Alternatively, you can include this field type within your plugin/theme. The path to front end assets (JS/CSS) can be filtered using `pw_cmb2_field_select2_asset_path`. See an example where we [load assets from the current active theme](http://link.from.pw/pw_cmb2_field_select2_asset_path).
|
||||
|
||||
## Usage
|
||||
|
||||
`pw_select` - Select box with with typeahead-style search. Example:
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => 'Cooking time',
|
||||
'id' => $prefix . 'cooking_time',
|
||||
'desc' => 'Cooking time',
|
||||
'type' => 'pw_select',
|
||||
'options' => array(
|
||||
'5' => '5 minutes',
|
||||
'10' => '10 minutes',
|
||||
'30' => 'Half an hour',
|
||||
'60' => '1 hour',
|
||||
),
|
||||
) );
|
||||
|
||||
```
|
||||
|
||||
`pw_multiselect` - Multi-value select box with drag and drop reordering. Example:
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => 'Ingredients',
|
||||
'id' => $prefix . 'ingredients',
|
||||
'desc' => 'Select ingredients. Drag to reorder.',
|
||||
'type' => 'pw_multiselect',
|
||||
'options' => array(
|
||||
'flour' => 'Flour',
|
||||
'salt' => 'Salt',
|
||||
'eggs' => 'Eggs',
|
||||
'milk' => 'Milk',
|
||||
'butter' => 'Butter',
|
||||
),
|
||||
) );
|
||||
```
|
||||
|
||||
### Placeholder
|
||||
|
||||
You can specify placeholder text through the attributes array. Example:
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => 'Ingredients',
|
||||
'id' => $prefix . 'ingredients',
|
||||
'desc' => 'Select this recipes ingredients.',
|
||||
'type' => 'pw_multiselect',
|
||||
'options' => array(
|
||||
'flour' => 'Flour',
|
||||
'salt' => 'Salt',
|
||||
'eggs' => 'Eggs',
|
||||
'milk' => 'Milk',
|
||||
'butter' => 'Butter',
|
||||
),
|
||||
'attributes' => array(
|
||||
'placeholder' => 'Select ingredients. Drag to reorder'
|
||||
),
|
||||
) );
|
||||
```
|
||||
|
||||
### Custom Select2 configuration and overriding default configuration options
|
||||
|
||||
You can define Select2 configuration options using HTML5 `data-*` attributes. It's worth reading up on the [available options](https://select2.github.io/options.html#data-attributes) over on the Select2 website. Example:
|
||||
```php
|
||||
$cmb->add_field( array(
|
||||
'name' => 'Ingredients',
|
||||
'id' => $prefix . 'ingredients',
|
||||
'desc' => 'Select ingredients. Drag to reorder.',
|
||||
'type' => 'pw_multiselect',
|
||||
'options' => array(
|
||||
'flour' => 'Flour',
|
||||
'salt' => 'Salt',
|
||||
'eggs' => 'Eggs',
|
||||
'milk' => 'Milk',
|
||||
'butter' => 'Butter',
|
||||
),
|
||||
'attributes' => array(
|
||||
'data-maximum-selection-length' => '2',
|
||||
),
|
||||
) );
|
||||
```
|
||||
|
||||
## Helper functions
|
||||
|
||||
You may want to populate the options array dynamically. Common use cases include listing out posts and taxonomy terms. I've written a number of generic helper functions which can be used to return a CMB2 style array for both [posts](http://link.from.pw/1PkJmWc) and [terms](http://link.from.pw/1TDArjR).
|
||||
|
||||
## Limitations/known issues
|
||||
|
||||
If you’d like to help out, pull requests are more than welcome!
|
||||
|
||||
* This field does not work well as a repeatable field within a repeatable group.
|
||||
* Yoast SEO also loads Select2. Currently a version behind, there is an issue with the previous version of Select2 and it's ability to position the dropdown relative to the field.
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Select box
|
||||
|
||||

|
||||
|
||||
### Multi-value select box
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Plugin Name: Eagle Switch Button
|
||||
*/
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if( !function_exists( 'cmb2_render_switch' ) ) {
|
||||
|
||||
function cmb2_render_switch( $field, $escaped_value, $object_id, $object_type, $field_type_object ) {
|
||||
$switch = '<div class="cmb2-switch">';
|
||||
$conditional_value =(isset($field->args['attributes']['data-conditional-value'])?'data-conditional-value="' .esc_attr($field->args['attributes']['data-conditional-value']).'"':'');
|
||||
$conditional_id =(isset($field->args['attributes']['data-conditional-id'])?' data-conditional-id="'.esc_attr($field->args['attributes']['data-conditional-id']).'"':'');
|
||||
$label_on =(isset($field->args['label'])?esc_attr($field->args['label']['true']):'On');
|
||||
$label_off =(isset($field->args['label'])?esc_attr($field->args['label']['false']):'Off');
|
||||
$switch .= '<input '.$conditional_value.$conditional_id.' type="radio" id="' . $field->args['_id'] . '1" value="1" '. ($escaped_value == 1 ? 'checked="checked"' : '') . ' name="' . esc_attr($field->args['_name']) . '" />
|
||||
<input '.$conditional_value.$conditional_id.' type="radio" id="' . $field->args['_id'] . '2" value="0" '. (($escaped_value == '' || $escaped_value == 0) ? 'checked="checked"' : '') . ' name="' . esc_attr($field->args['_name']) . '" />
|
||||
<label for="' . $field->args['_id'] . '1" class="cmb2-enable '.($escaped_value == 1?'selected':'').'"><span>'.$label_on.'</span></label>
|
||||
<label for="' . $field->args['_id'] . '2" class="cmb2-disable '.(($escaped_value == '' || $escaped_value == 0)?'selected':'').'"><span>'.$label_off.'</span></label>';
|
||||
|
||||
$switch .= '</div>';
|
||||
$switch .= $field_type_object->_desc( true );
|
||||
echo $switch;
|
||||
}
|
||||
|
||||
add_action( 'cmb2_render_switch', 'cmb2_render_switch', 10, 5 );
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
# Travis CI (MIT License) configuration file
|
||||
# @link https://travis-ci.org/
|
||||
|
||||
# Use new container based environment
|
||||
sudo: false
|
||||
|
||||
# Declare project language.
|
||||
# @link http://about.travis-ci.org/docs/user/languages/php/
|
||||
language: php
|
||||
|
||||
# Declare versions of PHP to use. Use one decimal max.
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
include:
|
||||
# aliased to 5.3.29
|
||||
- php: '5.3'
|
||||
# aliased to a recent 5.4.x version
|
||||
- php: '5.4'
|
||||
# aliased to a recent 5.5.x version
|
||||
- php: '5.5'
|
||||
env: SNIFF=1
|
||||
# aliased to a recent 5.6.x version
|
||||
- php: '5.6'
|
||||
# aliased to a recent 7.0.x version
|
||||
- php: '7.0'
|
||||
# aliased to a recent 7.1.x version
|
||||
- php: '7.1'
|
||||
# aliased to a recent hhvm version
|
||||
- php: 'hhvm'
|
||||
|
||||
allow_failures:
|
||||
- php: 'hhvm'
|
||||
|
||||
before_script:
|
||||
- export PHPCS_DIR=/tmp/phpcs
|
||||
- export SNIFFS_DIR=/tmp/sniffs
|
||||
# Install CodeSniffer for WordPress Coding Standards checks.
|
||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
|
||||
# Install WordPress Coding Standards.
|
||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi
|
||||
# Install PHP Compatibility sniffs.
|
||||
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi
|
||||
# Set install path for WordPress Coding Standards.
|
||||
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
|
||||
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi
|
||||
# After CodeSniffer install you should refresh your path.
|
||||
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
|
||||
|
||||
|
||||
# Run test script commands.
|
||||
# All commands must exit with code 0 on success. Anything else is considered failure.
|
||||
script:
|
||||
# Search for PHP syntax errors.
|
||||
- find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
|
||||
# WordPress Coding Standards.
|
||||
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
|
||||
# @link http://pear.php.net/package/PHP_CodeSniffer/
|
||||
# -p flag: Show progress of the run.
|
||||
# -s flag: Show sniff codes in all reports.
|
||||
# -v flag: Print verbose output.
|
||||
# -n flag: Do not print warnings. (shortcut for --warning-severity=0)
|
||||
# --standard: Use WordPress as the standard.
|
||||
# --extensions: Only sniff PHP files.
|
||||
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./phpcs.xml --extensions=php; fi
|
||||
|
||||
# Receive notifications for build results.
|
||||
# @link http://docs.travis-ci.com/user/notifications/#Email-notifications
|
||||
notifications:
|
||||
email: false
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Cmb2Grid\Cmb2;
|
||||
/**
|
||||
* Description of Utils.
|
||||
*
|
||||
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
if ( ! class_exists( '\Cmb2Grid\Cmb2\Utils' ) ) {
|
||||
class Utils {
|
||||
|
||||
public static function initializeFieldArg( \CMB2_Field $field, $arg ) {
|
||||
if ( ! isset( $field->args[ $arg ] ) ) {
|
||||
$field->args[ $arg ] = '';
|
||||
}
|
||||
return $field;
|
||||
}
|
||||
|
||||
public static function initializeGroupFieldArg( \CMB2_Field $field, $arg ) {
|
||||
if ( ! isset( $field[ $arg ] ) ) {
|
||||
$field[ $arg ] = '';
|
||||
}
|
||||
return $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
|
||||
namespace Cmb2Grid;
|
||||
|
||||
if ( ! defined( 'CMB2GRID_DIR' ) ) {
|
||||
define( 'CMB2GRID_DIR', trailingslashit( dirname( __FILE__ ) ) );
|
||||
}
|
||||
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Cmb2GridPlugin' ) ) {
|
||||
|
||||
require_once dirname( __FILE__ ) . '/DesignPatterns/Singleton.php';
|
||||
|
||||
class Cmb2GridPlugin extends DesignPatterns\Singleton {
|
||||
|
||||
const VERSION = '1.0';
|
||||
private $url;
|
||||
|
||||
protected function __construct() {
|
||||
spl_autoload_register( array( $this, 'auto_load' ) );
|
||||
|
||||
add_action( 'admin_head', array( $this, 'wpHead' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
||||
//$this->test();
|
||||
}
|
||||
|
||||
private function test() {
|
||||
new Test\Test();
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto load our class files.
|
||||
*
|
||||
* @param string $class Class name.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function auto_load( $class ) {
|
||||
static $prefix;
|
||||
static $base_dir;
|
||||
static $sep;
|
||||
static $length;
|
||||
|
||||
if ( ! isset( $prefix, $base_dir, $sep ) ) {
|
||||
// Project-specific namespace prefix.
|
||||
$prefix = __NAMESPACE__ . '\\';
|
||||
|
||||
// Base directory for the namespace prefix.
|
||||
$base_dir = plugin_dir_path( __FILE__ ); // Has trailing slash.
|
||||
|
||||
// Set directory separator.
|
||||
$sep = '/';
|
||||
if ( defined( 'DIRECTORY_SEPARATOR' ) ) {
|
||||
$sep = DIRECTORY_SEPARATOR;
|
||||
}
|
||||
$length = strlen( $prefix );
|
||||
}
|
||||
|
||||
// Does the class use the namespace prefix?
|
||||
if ( strncmp( $prefix, $class, $length ) !== 0 ) {
|
||||
// No, move to the next registered autoloader.
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the relative class name.
|
||||
$relative_class = substr( $class, $length );
|
||||
|
||||
/*
|
||||
* Add the base directory, replace namespace separators with directory
|
||||
* separators in the relative class name and append with .php.
|
||||
*/
|
||||
$file = $base_dir . str_replace( '\\', $sep, $relative_class ) . '.php';
|
||||
|
||||
// If the file exists, require it.
|
||||
if ( file_exists( $file ) ) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_enqueue_scripts() {
|
||||
$suffix = ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min' );
|
||||
wp_enqueue_style( 'cmb2_grid_bootstrap_light', $this->url( 'assets/css/bootstrap' . $suffix . '.css' ), null, self::VERSION );
|
||||
}
|
||||
|
||||
public function wpHead() {
|
||||
?>
|
||||
<style>
|
||||
.cmb2GridRow .cmb-row{border:none !important;padding:0 !important}
|
||||
.cmb2GridRow .cmb-th label:after{border:none !important}
|
||||
.cmb2GridRow .cmb-th{width:100% !important}
|
||||
.cmb2GridRow .cmb-td{width:100% !important}
|
||||
.cmb2GridRow input[type="text"]:not( '.hasDatepicker' ), .cmb2GridRow textarea, .cmb2GridRow select{width:100%}
|
||||
|
||||
.cmb2GridRow .cmb-repeat-group-wrap{max-width:100% !important;}
|
||||
.cmb2GridRow .cmb-group-title{margin:0 !important;}
|
||||
.cmb2GridRow .cmb-repeat-group-wrap .cmb-row .cmbhandle, .cmb2GridRow .postbox-container .cmb-row .cmbhandle{right:0 !important}
|
||||
|
||||
.cmb2GridRow .cmb-type-group .cmb-remove-field-row{padding-bottom: 1.8em !important;padding-top: 1.8em !important;}
|
||||
.cmb2GridRow .cmb-td.cmb-nested{padding-left: 15px;padding-right: 15px;}
|
||||
</style>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
// Based on CMB2_Utils url() method.
|
||||
public function url( $path = '' ) {
|
||||
if ( isset( $this->url ) ) {
|
||||
return $this->url . $path;
|
||||
}
|
||||
|
||||
if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
|
||||
// Windows
|
||||
$content_dir = str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR );
|
||||
$content_url = str_replace( $content_dir, WP_CONTENT_URL, CMB2GRID_DIR );
|
||||
$cmb2_url = str_replace( DIRECTORY_SEPARATOR, '/', $content_url );
|
||||
} else {
|
||||
$cmb2_url = str_replace(
|
||||
array( WP_CONTENT_DIR, WP_PLUGIN_DIR ),
|
||||
array( WP_CONTENT_URL, WP_PLUGIN_URL ),
|
||||
CMB2GRID_DIR
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the CMB location url.
|
||||
*
|
||||
* @param string $cmb2_url Currently registered url.
|
||||
*/
|
||||
$this->url = trailingslashit( apply_filters( 'cmb2_meta_box_url', set_url_scheme( $cmb2_url ), CMB2_VERSION ) );
|
||||
|
||||
return $this->url . $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Instantiate the class on plugins_loaded. */
|
||||
// wp_installing() function was introduced in WP 4.4.
|
||||
if ( ( function_exists( 'wp_installing' ) && wp_installing() === false ) || ( ! function_exists( 'wp_installing' ) && ( ! defined( 'WP_INSTALLING' ) || WP_INSTALLING === false ) ) ) {
|
||||
add_action( 'plugins_loaded', '\\' . __NAMESPACE__ . '\init' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( '\Cmb2Grid\init' ) ) {
|
||||
/**
|
||||
* Initialize the class only if CMB2 is detected.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
if ( defined( 'CMB2_LOADED' ) ) {
|
||||
if ( ! defined( 'CMB2GRID_DIR' ) ) {
|
||||
define( 'CMB2GRID_DIR', trailingslashit( dirname( __FILE__ ) ) );
|
||||
}
|
||||
Cmb2GridPlugin::getInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'cmb2_init', '\Cmb2Grid\init' );
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Cmb2Grid\DesignPatterns;
|
||||
/**
|
||||
* Description of Singleton.
|
||||
*
|
||||
* Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
if ( ! class_exists( '\Cmb2Grid\DesignPatterns\Singleton' ) ) {
|
||||
|
||||
abstract class Singleton {
|
||||
|
||||
abstract protected function __construct();
|
||||
|
||||
/**
|
||||
* Returns the *Singleton* instance of this class.
|
||||
*
|
||||
* @staticvar Singleton $instance The *Singleton* instances of this class.
|
||||
*
|
||||
* @return Current_Class_Name
|
||||
*/
|
||||
public static function getInstance() {
|
||||
static $instance = null;
|
||||
if ( null === $instance ) {
|
||||
$instance = new static();
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace Cmb2Grid\Grid;
|
||||
|
||||
/**
|
||||
* Description of Cmb2Grid.
|
||||
*
|
||||
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Cmb2Grid' ) ) {
|
||||
class Cmb2Grid {
|
||||
|
||||
private $cmb2Obj;
|
||||
private $cmb2Id;
|
||||
private $metaBoxConfig;
|
||||
private $rows = array();
|
||||
|
||||
|
||||
public function __construct( $meta_box_config ) {
|
||||
$this->setMetaBoxConfig( $meta_box_config );
|
||||
$this->setCmb2Obj( \cmb2_get_metabox( $this->getMetaBoxConfig() ) );
|
||||
//$cmb2Obj = $this->getCmb2Obj();
|
||||
//error_log( '--- DEBUG: $cmb2Obj ---' );
|
||||
//error_log( print_r( $cmb2Obj, true ) );
|
||||
//add_action( 'admin_init', array( $this, 'adminInit' ), 15 );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $field
|
||||
* @return \Cmb2Grid\Grid\Group\Cmb2GroupGrid
|
||||
*/
|
||||
public function addCmb2GroupGrid( $field ) {
|
||||
$cmb2GroupGrid = new Group\Cmb2GroupGrid( $this->getMetaBoxConfig() );
|
||||
$cmb2GroupGrid->setParentFieldId( $field );
|
||||
return $cmb2GroupGrid;
|
||||
}
|
||||
|
||||
public function addRow() {
|
||||
$rows = $this->getRows();
|
||||
$newRow = new Row( $this );
|
||||
$rows[] = $newRow;
|
||||
$this->setRows( $rows );
|
||||
return $newRow;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return \CMB2
|
||||
*/
|
||||
function getCmb2Obj() {
|
||||
return $this->cmb2Obj;
|
||||
}
|
||||
|
||||
function setCmb2Obj( $cmb2Obj ) {
|
||||
$this->cmb2Obj = $cmb2Obj;
|
||||
}
|
||||
|
||||
function getCmb2Id() {
|
||||
return $this->cmb2Id;
|
||||
}
|
||||
|
||||
function setCmb2Id( $cmb2Id ) {
|
||||
$this->cmb2Id = $cmb2Id;
|
||||
}
|
||||
|
||||
function getMetaBoxConfig() {
|
||||
return $this->metaBoxConfig;
|
||||
}
|
||||
|
||||
function setMetaBoxConfig( $metaBoxConfig ) {
|
||||
$this->metaBoxConfig = $metaBoxConfig;
|
||||
}
|
||||
|
||||
function getRows() {
|
||||
return $this->rows;
|
||||
}
|
||||
|
||||
function setRows( $rows ) {
|
||||
$this->rows = $rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace Cmb2Grid\Grid;
|
||||
|
||||
/**
|
||||
* Description of Cmb2GridColumn.
|
||||
*
|
||||
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Column' ) ) {
|
||||
|
||||
class Column {
|
||||
|
||||
private $field;
|
||||
private $fieldId;
|
||||
private $grid;
|
||||
private $columnClassWidth;
|
||||
private $columnClass;
|
||||
|
||||
public function __construct( $field, Cmb2Grid $grid ) {
|
||||
$this->setGrid( $grid );
|
||||
if ( is_string( $field ) ) {
|
||||
$this->setFieldId( $field );
|
||||
} elseif ( is_array( $field ) ) {
|
||||
$this->setFieldId( $field[0] );
|
||||
} elseif ( is_a( $field, '\Cmb2Grid\Grid\Group\Cmb2GroupGrid' ) ) {
|
||||
$this->setFieldId( $field->getParentFieldId() );
|
||||
}
|
||||
$fieldId = $this->getFieldId();
|
||||
|
||||
|
||||
$finalField = cmb2_get_field( $grid->getCmb2Obj(), $fieldId );
|
||||
|
||||
$this->setField( $finalField );
|
||||
|
||||
if ( is_array( $field ) ) {
|
||||
if ( isset( $field['class'] ) ) {
|
||||
$this->setColumnClass( $field['class'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getColumnClassWidth() {
|
||||
return $this->columnClassWidth;
|
||||
}
|
||||
|
||||
public function setColumnClassCmb2() {
|
||||
$columnClass = $this->getColumnClass();
|
||||
$field = $this->getField();
|
||||
//error_log( print_r( $field, true ) );
|
||||
|
||||
|
||||
if ( $field->args['type'] === 'group' ) {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_group' );
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_group' );
|
||||
$field->args['before_group'] .= "<div class=\"{$columnClass}\">";
|
||||
$field->args['after_group'] .= '</div>';
|
||||
} else {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_row' );
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_row' );
|
||||
$field->args['before_row'] .= "<div class=\"{$columnClass}\">";
|
||||
$field->args['after_row'] .= '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setColumnClass( $columnClass ) {
|
||||
$this->columnClass = $columnClass;
|
||||
}
|
||||
|
||||
function setBootstrapColumnClass( $columnClassNum, $prefix = 'col-md' ) {
|
||||
$this->columnClassWidth = $columnClassNum;
|
||||
$this->setColumnClass( "{$prefix}-{$columnClassNum}" );
|
||||
$this->setColumnClassCmb2();
|
||||
}
|
||||
|
||||
function getField() {
|
||||
return $this->field;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return CMB2_Field
|
||||
*/
|
||||
function getFieldId() {
|
||||
return $this->fieldId;
|
||||
}
|
||||
|
||||
function setField( $field ) {
|
||||
$this->field = $field;
|
||||
}
|
||||
|
||||
function setFieldId( $fieldId ) {
|
||||
$this->fieldId = $fieldId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Cmb2Grid
|
||||
*/
|
||||
function getGrid() {
|
||||
return $this->grid;
|
||||
}
|
||||
|
||||
function setGrid( $grid ) {
|
||||
$this->grid = $grid;
|
||||
}
|
||||
|
||||
function getColumnClass() {
|
||||
return $this->columnClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Cmb2Grid\Grid\Group;
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Group\Cmb2GroupGrid' ) ) {
|
||||
|
||||
/**
|
||||
* Description of Cmb2GroupGrid.
|
||||
*
|
||||
* @author Pablo
|
||||
*/
|
||||
class Cmb2GroupGrid extends \Cmb2Grid\Grid\Cmb2Grid {
|
||||
|
||||
protected $parentFieldId;
|
||||
|
||||
public function addRow() {
|
||||
//parent::addRow();
|
||||
$rows = $this->getRows();
|
||||
$newRow = new GroupRow( $this );
|
||||
$newRow->setParentFieldId( $this->getParentFieldId() );
|
||||
$rows[] = $newRow;
|
||||
$this->setRows( $rows );
|
||||
return $newRow;
|
||||
}
|
||||
|
||||
function getParentFieldId() {
|
||||
return $this->parentFieldId;
|
||||
}
|
||||
|
||||
function setParentFieldId( $parentFieldId ) {
|
||||
$this->parentFieldId = $parentFieldId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Cmb2Grid\Grid\Group;
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Group\GroupColumn' ) ) {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Description of GroupColumn.
|
||||
*
|
||||
* @author Pablo
|
||||
*/
|
||||
class GroupColumn extends \Cmb2Grid\Grid\Column {
|
||||
|
||||
protected $parentFieldId;
|
||||
|
||||
public function setColumnClassCmb2() {
|
||||
$columnClass = $this->getColumnClass();
|
||||
$field = $this->getField();
|
||||
$fieldID = $this->getFieldId();
|
||||
|
||||
//\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field->args['fields'][$fieldID], 'before_row' );
|
||||
//\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field->args['fields'][$fieldID], 'after_row' );
|
||||
|
||||
if ( ! empty( $fieldID['before_row'] ) && ! empty( $fieldID['after_row'] ) ) {
|
||||
$field->args['fields'][ $fieldID ]['before_row'] .= "<div class=\"{$columnClass}\">";
|
||||
$field->args['fields'][ $fieldID ]['after_row'] .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct( $field, \Cmb2Grid\Grid\Cmb2Grid $grid ) {
|
||||
$this->setParentFieldId( $field[0] );
|
||||
$this->setFieldId( $field[1] );
|
||||
$field = cmb2_get_field( $grid->getCmb2Obj(), $this->getParentFieldId() );
|
||||
$this->setField( $field );
|
||||
|
||||
//parent::__construct( $field, $grid );
|
||||
|
||||
/* $this->setGrid( $grid );
|
||||
if ( is_string( $field ) ) {
|
||||
$this->setFieldId( $field );
|
||||
} elseif ( is_array( $field ) ) {
|
||||
$this->setFieldId( $field[0] );
|
||||
}
|
||||
$fieldId = $this->getFieldId();
|
||||
|
||||
|
||||
$field = cmb2_get_field( $grid->getCmb2Obj(), $fieldId );
|
||||
|
||||
$this->setField( $field );
|
||||
|
||||
if ( is_array( $field ) ) {
|
||||
if ( isset( $field['class'] ) ) {
|
||||
$this->setColumnClass( $field['class'] );
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
function getParentFieldId() {
|
||||
return $this->parentFieldId;
|
||||
}
|
||||
|
||||
function setParentFieldId( $parentFieldId ) {
|
||||
$this->parentFieldId = $parentFieldId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Cmb2Grid\Grid\Group;
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Group\GroupRow' ) ) {
|
||||
|
||||
/**
|
||||
* Description of GroupRow.
|
||||
*
|
||||
* @author Pablo
|
||||
*/
|
||||
class GroupRow extends \Cmb2Grid\Grid\Row {
|
||||
|
||||
protected $parentFieldId;
|
||||
|
||||
/* protected function openRow( \CMB2_Field $field ) {
|
||||
//error_log( print_r( $field, true ) );
|
||||
//$fieldID = $field[1];
|
||||
|
||||
//@$field->args['fields'][ $fieldID ]['before_row'] .= "<div class=\"{$columnClass}\">";
|
||||
//@$field->args['fields'][ $fieldID ]['after_row'] .= '</div>';
|
||||
|
||||
//\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_row' );
|
||||
@$field->args['fields'][ $fieldID ]['before_row'] .= '<div class="row cmb2GridRow">';
|
||||
}
|
||||
|
||||
protected function closeRow( \CMB2_Field $field ) {
|
||||
//error_log( print_r( $field, true ) );
|
||||
|
||||
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_row' );
|
||||
$field->args['after_row'].= '</div>';
|
||||
} */
|
||||
|
||||
protected function closeGroupRow( \CMB2_Field $field, $fieldID ) {
|
||||
if ( !empty( $fieldID['after_row'] ) ) {
|
||||
@$field->args['fields'][ $fieldID ]['after_row'] .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
protected function openGroupRow( \CMB2_Field $field, $fieldID ) {
|
||||
if ( !empty( $fieldID['before_row'] ) ) {
|
||||
@$field->args['fields'][ $fieldID ]['before_row'] .= '<div class="row cmb2GridRow">';
|
||||
}
|
||||
}
|
||||
|
||||
protected function handleRow() {
|
||||
$columns = $this->getColumns();
|
||||
|
||||
/* @var $firstColumn GroupColumn */
|
||||
$firstColumn = $columns[0];
|
||||
$field = $firstColumn->getField();
|
||||
$fieldID = $firstColumn->getFieldId();
|
||||
$this->openGroupRow( $field, $fieldID );
|
||||
|
||||
$lastColumn = $columns[ ( count( $columns ) - 1 ) ];
|
||||
$field = $lastColumn->getField();
|
||||
$fieldID = $lastColumn->getFieldId();
|
||||
$this->closeGroupRow( $field, $fieldID );
|
||||
}
|
||||
|
||||
protected function addColumn( $field ) {
|
||||
//parent::addColumn( $field );
|
||||
$column = new GroupColumn( $field, $this->getGrid() );
|
||||
$columns = $this->getColumns();
|
||||
$columns[] = $column;
|
||||
$this->setColumns( $columns );
|
||||
return $column;
|
||||
}
|
||||
|
||||
public function addColumns( array $fields = array() ) {
|
||||
//parent::addColumns($fields);
|
||||
foreach ( $fields as $key => $field ) {
|
||||
$this->addColumn( $field );
|
||||
}
|
||||
//$this->handleColumnsCssClasses();
|
||||
$this->handleRow();
|
||||
$this->handleColumnsCssClasses();
|
||||
}
|
||||
|
||||
function getParentFieldId() {
|
||||
return $this->parentFieldId;
|
||||
}
|
||||
|
||||
function setParentFieldId( $parentFieldId ) {
|
||||
$this->parentFieldId = $parentFieldId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace Cmb2Grid\Grid;
|
||||
|
||||
/**
|
||||
* Description of Cmb2GridRow.
|
||||
*
|
||||
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
|
||||
if ( ! class_exists( '\Cmb2Grid\Grid\Row' ) ) {
|
||||
class Row {
|
||||
|
||||
private $grid;
|
||||
private $columns = array();
|
||||
|
||||
public function __construct( Cmb2Grid $grid ) {
|
||||
$this->setGrid( $grid );
|
||||
}
|
||||
|
||||
protected function openRow( \CMB2_Field $field ) {
|
||||
//error_log( print_r( $field, true ) );
|
||||
|
||||
if ( $field->args['type'] === 'group' ) {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_group' );
|
||||
$field->args['before_group'] .= '<div class="row cmb2GridRow">';
|
||||
} else {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_row' );
|
||||
$field->args['before_row'] .= '<div class="cmb-th"><label for="room_price_mon">Week Price</label></div><div class="row cmb2GridRow">';
|
||||
}
|
||||
}
|
||||
|
||||
protected function closeRow( \CMB2_Field $field ) {
|
||||
//error_log( print_r( $field, true ) );
|
||||
|
||||
if ( $field->args['type'] === 'group' ) {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_group' );
|
||||
$field->args['after_group'] .= '</div>';
|
||||
} else {
|
||||
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_row' );
|
||||
$field->args['after_row'] .= '</div>';
|
||||
}
|
||||
/*\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_row' );
|
||||
$field->args['after_row'].= '</div>';*/
|
||||
}
|
||||
|
||||
protected function handleRow() {
|
||||
$columns = $this->getColumns();
|
||||
|
||||
/* @var $firstColumn Column */
|
||||
$firstColumn = $columns[0];
|
||||
$field = $firstColumn->getField();
|
||||
$this->openRow( $field );
|
||||
|
||||
$lastColumn = $columns[ ( count( $columns ) - 1 ) ];
|
||||
$field = $lastColumn->getField();
|
||||
$this->closeRow( $field );
|
||||
}
|
||||
|
||||
public function addColumns( array $fields = array() ) {
|
||||
foreach ( $fields as $key => $field ) {
|
||||
$this->addColumn( $field );
|
||||
}
|
||||
$this->handleRow();
|
||||
$this->handleColumnsCssClasses();
|
||||
}
|
||||
|
||||
protected function handleColumnsCssClasses() {
|
||||
$columns = $this->getColumns();
|
||||
$columnsCount = count( $columns );
|
||||
$columnWidth = round( 12 / $columnsCount );
|
||||
/*@var $column Column*/
|
||||
foreach ( $columns as $key => $column ) {
|
||||
if ( ! $column->getColumnClass() ) {
|
||||
$column->setBootstrapColumnClass( $columnWidth );
|
||||
} else {
|
||||
$column->setColumnClassCmb2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function addColumn( $field ) {
|
||||
$column = new Column( $field,$this->getGrid() );
|
||||
$columns = $this->getColumns();
|
||||
$columns[] = $column;
|
||||
$this->setColumns( $columns );
|
||||
return $column;
|
||||
}
|
||||
|
||||
/*protected function handleRow( $column ) {
|
||||
|
||||
}*/
|
||||
|
||||
function getGrid() {
|
||||
return $this->grid;
|
||||
}
|
||||
|
||||
function setGrid( $grid ) {
|
||||
$this->grid = $grid;
|
||||
}
|
||||
|
||||
function getColumns() {
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
function setColumns( $columns ) {
|
||||
$this->columns = $columns;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,78 @@
|
||||
# CMB2-grid
|
||||
A grid system for Wordpress [CMB2](https://github.com/WebDevStudios/cmb2) library that allows the creation of columns for a better layout in the admin.
|
||||
|
||||
## Installation
|
||||
|
||||
For now you have to install this as a WordPress plugin:
|
||||
|
||||
1. Download the plugin
|
||||
2. Place the plugin folder in your `/wp-content/plugins/` directory
|
||||
3. Activate the plugin in the Plugin dashboard
|
||||
|
||||
|
||||
## Usage
|
||||
Create your cmb2 metabox like you always do:
|
||||
|
||||
```php
|
||||
$prefix = '_yourprefix_demo_';
|
||||
$cmb = new_cmb2_box(array(
|
||||
'id' => $prefix . 'metabox',
|
||||
'title' => __('Test Metabox', 'cmb2'),
|
||||
'object_types' => array('page',), // Post type
|
||||
));
|
||||
|
||||
$field1 = $cmb->add_field(array(
|
||||
'name' => __('Test Text', 'cmb2'),
|
||||
'desc' => __('field description (optional)', 'cmb2'),
|
||||
'id' => $prefix . 'text',
|
||||
'type' => 'text',
|
||||
));
|
||||
|
||||
$field2 = $cmb->add_field(array(
|
||||
'name' => __('Test Text2', 'cmb2'),
|
||||
'desc' => __('field description2 (optional2)', 'cmb2'),
|
||||
'id' => $prefix . 'text2',
|
||||
'type' => 'text',
|
||||
));
|
||||
```
|
||||
Now, create your columns like this:
|
||||
|
||||
```php
|
||||
if(!is_admin()){
|
||||
return;
|
||||
}
|
||||
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb);
|
||||
$row = $cmb2Grid->addRow();
|
||||
$row->addColumns(array($field1, $field2));
|
||||
```
|
||||
|
||||
You can also use custom bootstrap column classes if you want, like this
|
||||
|
||||
```
|
||||
$row->addColumns(array(
|
||||
array($field1, 'class' => 'col-md-8'),
|
||||
array($field2, 'class' => 'col-md-4')
|
||||
));
|
||||
```
|
||||
|
||||
**FAQ**
|
||||
- It works on [group fields](https://github.com/origgami/CMB2-grid/wiki/Group-fields) also
|
||||
- If you want, you can opt to use the metabox and the field IDs also.
|
||||
- Currently the grid system is using a lite version of Twitter Bootstrap
|
||||
- You can create as much rows as you want
|
||||
- You have to put the fields in the columns in the same order they were created
|
||||
- You can follow exactly what is in [Test/Test.php](https://github.com/origgami/CMB2-grid/blob/master/Test/Test.php) file to see it in action
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
**This is what you get using columns**
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
|
||||
namespace Cmb2Grid\Test;
|
||||
|
||||
/**
|
||||
* Description of Test.
|
||||
*
|
||||
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
||||
*/
|
||||
if ( ! class_exists( '\Cmb2Grid\Test\Test' ) ) {
|
||||
|
||||
class Test {
|
||||
|
||||
public function __construct() {
|
||||
$this->addTestCmb2();
|
||||
}
|
||||
|
||||
private function addTestCmb2() {
|
||||
add_action( 'cmb2_admin_init', array( $this, 'testCmb' ) );
|
||||
add_action( 'cmb2_admin_init', array( $this, 'testGroupCmb' ) );
|
||||
}
|
||||
|
||||
public function testGroupCmb() {
|
||||
$prefix = '_yourgridprefix_group_';
|
||||
$cmb_group = new_cmb2_box( array(
|
||||
'id' => $prefix . 'metabox',
|
||||
'title' => __( 'Repeating Field Group using a Grid', 'cmb2' ),
|
||||
'object_types' => array( 'page' ),
|
||||
) );
|
||||
$field1 = $cmb_group->add_field( array(
|
||||
'name' => __( 'Test Text', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'text',
|
||||
'type' => 'text',
|
||||
) );
|
||||
$field2 = $cmb_group->add_field( array(
|
||||
'name' => __( 'Test Text Small', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'textsmall',
|
||||
'type' => 'text',
|
||||
) );
|
||||
|
||||
// $group_field_id is the field id string, so in this case: $prefix . 'demo'
|
||||
$group_field_id = $cmb_group->add_field( array(
|
||||
'id' => $prefix . 'demo',
|
||||
'type' => 'group',
|
||||
'options' => array(
|
||||
'group_title' => __( 'Entry {#}', 'cmb2' ), // {#} gets replaced by row number.
|
||||
'add_button' => __( 'Add Another Entry', 'cmb2' ),
|
||||
'remove_button' => __( 'Remove Entry', 'cmb2' ),
|
||||
'sortable' => true,
|
||||
),
|
||||
) );
|
||||
$gField1 = $cmb_group->add_group_field( $group_field_id, array(
|
||||
'name' => __( 'Entry Title', 'cmb2' ),
|
||||
'id' => 'title',
|
||||
'type' => 'text',
|
||||
) );
|
||||
$gField2 = $cmb_group->add_group_field( $group_field_id, array(
|
||||
'name' => __( 'Description', 'cmb2' ),
|
||||
'description' => __( 'Write a short description for this entry', 'cmb2' ),
|
||||
'id' => 'description',
|
||||
'type' => 'textarea_small',
|
||||
));
|
||||
|
||||
// Create a default grid.
|
||||
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid( $cmb_group );
|
||||
|
||||
// Create now a Grid of group fields.
|
||||
$cmb2GroupGrid = $cmb2Grid->addCmb2GroupGrid( $group_field_id );
|
||||
$row = $cmb2GroupGrid->addRow();
|
||||
$row->addColumns( array(
|
||||
$gField1,
|
||||
$gField2,
|
||||
) );
|
||||
|
||||
// Now setup your columns like you generally do, even with group fields.
|
||||
$row = $cmb2Grid->addRow();
|
||||
$row->addColumns( array(
|
||||
$field1,
|
||||
$field2,
|
||||
) );
|
||||
$row = $cmb2Grid->addRow();
|
||||
$row->addColumns( array(
|
||||
$cmb2GroupGrid, // Can be $group_field_id also.
|
||||
) );
|
||||
}
|
||||
|
||||
public function testCmb() {
|
||||
// Start with an underscore to hide fields from custom fields list.
|
||||
$prefix = '_yourgridprefix_demo_';
|
||||
/**
|
||||
* Sample metabox to demonstrate each field type included.
|
||||
*/
|
||||
$cmb = new_cmb2_box( array(
|
||||
'id' => $prefix . 'metabox',
|
||||
'title' => __( 'Test Metabox using a Grid', 'cmb2' ),
|
||||
'object_types' => array( 'page' ), // Post type.
|
||||
));
|
||||
$field1 = $cmb->add_field( array(
|
||||
'name' => __( 'Test Text', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'text',
|
||||
'type' => 'text',
|
||||
));
|
||||
$field2 = $cmb->add_field( array(
|
||||
'name' => __( 'Test Text Small', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'textsmall',
|
||||
'type' => 'text',
|
||||
));
|
||||
$field3 = $cmb->add_field( array(
|
||||
'name' => __( 'Test Text Medium', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'textmedium',
|
||||
'type' => 'text',
|
||||
));
|
||||
$field4 = $cmb->add_field( array(
|
||||
'name' => __( 'Website URL', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'url',
|
||||
'type' => 'text',
|
||||
));
|
||||
$field5 = $cmb->add_field( array(
|
||||
'name' => __( 'Test Text Email', 'cmb2' ),
|
||||
'desc' => __( 'field description (optional)', 'cmb2' ),
|
||||
'id' => $prefix . 'email',
|
||||
'type' => 'text',
|
||||
));
|
||||
|
||||
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid( $cmb );
|
||||
$row = $cmb2Grid->addRow();
|
||||
$row->addColumns( array(
|
||||
//$field1,
|
||||
//$field2
|
||||
array( $field1, 'class' => 'col-md-8' ),
|
||||
array( $field2, 'class' => 'col-md-4' ),
|
||||
));
|
||||
$row = $cmb2Grid->addRow();
|
||||
$row->addColumns( array(
|
||||
$field3,
|
||||
$field4,
|
||||
$field5,
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
680
wp-content/plugins/eagle-booking/include/metabox/cmb2-grid/assets/css/bootstrap.css
vendored
Normal file
680
wp-content/plugins/eagle-booking/include/metabox/cmb2-grid/assets/css/bootstrap.css
vendored
Normal file
@@ -0,0 +1,680 @@
|
||||
/*!
|
||||
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=bf4843be8d63248ed843)
|
||||
* Config saved to config.json and https://gist.github.com/bf4843be8d63248ed843
|
||||
*/
|
||||
/*!
|
||||
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||
* Copyright 2011-2015 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
.cmb2-wrap *, .cmb2-wrap {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.cmb2-wrap *:before,
|
||||
.cmb2-wrap *:after {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
.row {
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
|
||||
float: left;
|
||||
}
|
||||
.col-xs-12 {
|
||||
width: 100%;
|
||||
}
|
||||
.col-xs-11 {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.col-xs-10 {
|
||||
width: 83.33333333%;
|
||||
}
|
||||
.col-xs-9 {
|
||||
width: 75%;
|
||||
}
|
||||
.col-xs-8 {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.col-xs-7 {
|
||||
width: 58.33333333%;
|
||||
}
|
||||
.col-xs-6 {
|
||||
width: 50%;
|
||||
}
|
||||
.col-xs-5 {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.col-xs-4 {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.col-xs-3 {
|
||||
width: 25%;
|
||||
}
|
||||
.col-xs-2 {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.col-xs-1 {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.col-xs-pull-12 {
|
||||
right: 100%;
|
||||
}
|
||||
.col-xs-pull-11 {
|
||||
right: 91.66666667%;
|
||||
}
|
||||
.col-xs-pull-10 {
|
||||
right: 83.33333333%;
|
||||
}
|
||||
.col-xs-pull-9 {
|
||||
right: 75%;
|
||||
}
|
||||
.col-xs-pull-8 {
|
||||
right: 66.66666667%;
|
||||
}
|
||||
.col-xs-pull-7 {
|
||||
right: 58.33333333%;
|
||||
}
|
||||
.col-xs-pull-6 {
|
||||
right: 50%;
|
||||
}
|
||||
.col-xs-pull-5 {
|
||||
right: 41.66666667%;
|
||||
}
|
||||
.col-xs-pull-4 {
|
||||
right: 33.33333333%;
|
||||
}
|
||||
.col-xs-pull-3 {
|
||||
right: 25%;
|
||||
}
|
||||
.col-xs-pull-2 {
|
||||
right: 16.66666667%;
|
||||
}
|
||||
.col-xs-pull-1 {
|
||||
right: 8.33333333%;
|
||||
}
|
||||
.col-xs-pull-0 {
|
||||
right: auto;
|
||||
}
|
||||
.col-xs-push-12 {
|
||||
left: 100%;
|
||||
}
|
||||
.col-xs-push-11 {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.col-xs-push-10 {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.col-xs-push-9 {
|
||||
left: 75%;
|
||||
}
|
||||
.col-xs-push-8 {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.col-xs-push-7 {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.col-xs-push-6 {
|
||||
left: 50%;
|
||||
}
|
||||
.col-xs-push-5 {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.col-xs-push-4 {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.col-xs-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-xs-push-2 {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.col-xs-push-1 {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.col-xs-push-0 {
|
||||
left: auto;
|
||||
}
|
||||
.col-xs-offset-12 {
|
||||
margin-left: 100%;
|
||||
}
|
||||
.col-xs-offset-11 {
|
||||
margin-left: 91.66666667%;
|
||||
}
|
||||
.col-xs-offset-10 {
|
||||
margin-left: 83.33333333%;
|
||||
}
|
||||
.col-xs-offset-9 {
|
||||
margin-left: 75%;
|
||||
}
|
||||
.col-xs-offset-8 {
|
||||
margin-left: 66.66666667%;
|
||||
}
|
||||
.col-xs-offset-7 {
|
||||
margin-left: 58.33333333%;
|
||||
}
|
||||
.col-xs-offset-6 {
|
||||
margin-left: 50%;
|
||||
}
|
||||
.col-xs-offset-5 {
|
||||
margin-left: 41.66666667%;
|
||||
}
|
||||
.col-xs-offset-4 {
|
||||
margin-left: 33.33333333%;
|
||||
}
|
||||
.col-xs-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-xs-offset-2 {
|
||||
margin-left: 16.66666667%;
|
||||
}
|
||||
.col-xs-offset-1 {
|
||||
margin-left: 8.33333333%;
|
||||
}
|
||||
.col-xs-offset-0 {
|
||||
margin-left: 0%;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
|
||||
float: left;
|
||||
}
|
||||
.col-sm-12 {
|
||||
width: 100%;
|
||||
}
|
||||
.col-sm-11 {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.col-sm-10 {
|
||||
width: 83.33333333%;
|
||||
}
|
||||
.col-sm-9 {
|
||||
width: 75%;
|
||||
}
|
||||
.col-sm-8 {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.col-sm-7 {
|
||||
width: 58.33333333%;
|
||||
}
|
||||
.col-sm-6 {
|
||||
width: 50%;
|
||||
}
|
||||
.col-sm-5 {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.col-sm-4 {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.col-sm-3 {
|
||||
width: 25%;
|
||||
}
|
||||
.col-sm-2 {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.col-sm-1 {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.col-sm-pull-12 {
|
||||
right: 100%;
|
||||
}
|
||||
.col-sm-pull-11 {
|
||||
right: 91.66666667%;
|
||||
}
|
||||
.col-sm-pull-10 {
|
||||
right: 83.33333333%;
|
||||
}
|
||||
.col-sm-pull-9 {
|
||||
right: 75%;
|
||||
}
|
||||
.col-sm-pull-8 {
|
||||
right: 66.66666667%;
|
||||
}
|
||||
.col-sm-pull-7 {
|
||||
right: 58.33333333%;
|
||||
}
|
||||
.col-sm-pull-6 {
|
||||
right: 50%;
|
||||
}
|
||||
.col-sm-pull-5 {
|
||||
right: 41.66666667%;
|
||||
}
|
||||
.col-sm-pull-4 {
|
||||
right: 33.33333333%;
|
||||
}
|
||||
.col-sm-pull-3 {
|
||||
right: 25%;
|
||||
}
|
||||
.col-sm-pull-2 {
|
||||
right: 16.66666667%;
|
||||
}
|
||||
.col-sm-pull-1 {
|
||||
right: 8.33333333%;
|
||||
}
|
||||
.col-sm-pull-0 {
|
||||
right: auto;
|
||||
}
|
||||
.col-sm-push-12 {
|
||||
left: 100%;
|
||||
}
|
||||
.col-sm-push-11 {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.col-sm-push-10 {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.col-sm-push-9 {
|
||||
left: 75%;
|
||||
}
|
||||
.col-sm-push-8 {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.col-sm-push-7 {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.col-sm-push-6 {
|
||||
left: 50%;
|
||||
}
|
||||
.col-sm-push-5 {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.col-sm-push-4 {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.col-sm-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-sm-push-2 {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.col-sm-push-1 {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.col-sm-push-0 {
|
||||
left: auto;
|
||||
}
|
||||
.col-sm-offset-12 {
|
||||
margin-left: 100%;
|
||||
}
|
||||
.col-sm-offset-11 {
|
||||
margin-left: 91.66666667%;
|
||||
}
|
||||
.col-sm-offset-10 {
|
||||
margin-left: 83.33333333%;
|
||||
}
|
||||
.col-sm-offset-9 {
|
||||
margin-left: 75%;
|
||||
}
|
||||
.col-sm-offset-8 {
|
||||
margin-left: 66.66666667%;
|
||||
}
|
||||
.col-sm-offset-7 {
|
||||
margin-left: 58.33333333%;
|
||||
}
|
||||
.col-sm-offset-6 {
|
||||
margin-left: 50%;
|
||||
}
|
||||
.col-sm-offset-5 {
|
||||
margin-left: 41.66666667%;
|
||||
}
|
||||
.col-sm-offset-4 {
|
||||
margin-left: 33.33333333%;
|
||||
}
|
||||
.col-sm-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-sm-offset-2 {
|
||||
margin-left: 16.66666667%;
|
||||
}
|
||||
.col-sm-offset-1 {
|
||||
margin-left: 8.33333333%;
|
||||
}
|
||||
.col-sm-offset-0 {
|
||||
margin-left: 0%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
|
||||
float: left;
|
||||
}
|
||||
.col-md-12 {
|
||||
width: 100%;
|
||||
}
|
||||
.col-md-11 {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.col-md-10 {
|
||||
width: 83.33333333%;
|
||||
}
|
||||
.col-md-9 {
|
||||
width: 75%;
|
||||
}
|
||||
.col-md-8 {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.col-md-7 {
|
||||
width: 58.33333333%;
|
||||
}
|
||||
.col-md-6 {
|
||||
width: 50%;
|
||||
}
|
||||
.col-md-5 {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.col-md-4 {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.col-md-3 {
|
||||
width: 25%;
|
||||
}
|
||||
.col-md-2 {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.col-md-1 {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.col-md-pull-12 {
|
||||
right: 100%;
|
||||
}
|
||||
.col-md-pull-11 {
|
||||
right: 91.66666667%;
|
||||
}
|
||||
.col-md-pull-10 {
|
||||
right: 83.33333333%;
|
||||
}
|
||||
.col-md-pull-9 {
|
||||
right: 75%;
|
||||
}
|
||||
.col-md-pull-8 {
|
||||
right: 66.66666667%;
|
||||
}
|
||||
.col-md-pull-7 {
|
||||
right: 58.33333333%;
|
||||
}
|
||||
.col-md-pull-6 {
|
||||
right: 50%;
|
||||
}
|
||||
.col-md-pull-5 {
|
||||
right: 41.66666667%;
|
||||
}
|
||||
.col-md-pull-4 {
|
||||
right: 33.33333333%;
|
||||
}
|
||||
.col-md-pull-3 {
|
||||
right: 25%;
|
||||
}
|
||||
.col-md-pull-2 {
|
||||
right: 16.66666667%;
|
||||
}
|
||||
.col-md-pull-1 {
|
||||
right: 8.33333333%;
|
||||
}
|
||||
.col-md-pull-0 {
|
||||
right: auto;
|
||||
}
|
||||
.col-md-push-12 {
|
||||
left: 100%;
|
||||
}
|
||||
.col-md-push-11 {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.col-md-push-10 {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.col-md-push-9 {
|
||||
left: 75%;
|
||||
}
|
||||
.col-md-push-8 {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.col-md-push-7 {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.col-md-push-6 {
|
||||
left: 50%;
|
||||
}
|
||||
.col-md-push-5 {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.col-md-push-4 {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.col-md-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-md-push-2 {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.col-md-push-1 {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.col-md-push-0 {
|
||||
left: auto;
|
||||
}
|
||||
.col-md-offset-12 {
|
||||
margin-left: 100%;
|
||||
}
|
||||
.col-md-offset-11 {
|
||||
margin-left: 91.66666667%;
|
||||
}
|
||||
.col-md-offset-10 {
|
||||
margin-left: 83.33333333%;
|
||||
}
|
||||
.col-md-offset-9 {
|
||||
margin-left: 75%;
|
||||
}
|
||||
.col-md-offset-8 {
|
||||
margin-left: 66.66666667%;
|
||||
}
|
||||
.col-md-offset-7 {
|
||||
margin-left: 58.33333333%;
|
||||
}
|
||||
.col-md-offset-6 {
|
||||
margin-left: 50%;
|
||||
}
|
||||
.col-md-offset-5 {
|
||||
margin-left: 41.66666667%;
|
||||
}
|
||||
.col-md-offset-4 {
|
||||
margin-left: 33.33333333%;
|
||||
}
|
||||
.col-md-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-md-offset-2 {
|
||||
margin-left: 16.66666667%;
|
||||
}
|
||||
.col-md-offset-1 {
|
||||
margin-left: 8.33333333%;
|
||||
}
|
||||
.col-md-offset-0 {
|
||||
margin-left: 0%;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
|
||||
float: left;
|
||||
}
|
||||
.col-lg-12 {
|
||||
width: 100%;
|
||||
}
|
||||
.col-lg-11 {
|
||||
width: 91.66666667%;
|
||||
}
|
||||
.col-lg-10 {
|
||||
width: 83.33333333%;
|
||||
}
|
||||
.col-lg-9 {
|
||||
width: 75%;
|
||||
}
|
||||
.col-lg-8 {
|
||||
width: 66.66666667%;
|
||||
}
|
||||
.col-lg-7 {
|
||||
width: 58.33333333%;
|
||||
}
|
||||
.col-lg-6 {
|
||||
width: 50%;
|
||||
}
|
||||
.col-lg-5 {
|
||||
width: 41.66666667%;
|
||||
}
|
||||
.col-lg-4 {
|
||||
width: 33.33333333%;
|
||||
}
|
||||
.col-lg-3 {
|
||||
width: 25%;
|
||||
}
|
||||
.col-lg-2 {
|
||||
width: 16.66666667%;
|
||||
}
|
||||
.col-lg-1 {
|
||||
width: 8.33333333%;
|
||||
}
|
||||
.col-lg-pull-12 {
|
||||
right: 100%;
|
||||
}
|
||||
.col-lg-pull-11 {
|
||||
right: 91.66666667%;
|
||||
}
|
||||
.col-lg-pull-10 {
|
||||
right: 83.33333333%;
|
||||
}
|
||||
.col-lg-pull-9 {
|
||||
right: 75%;
|
||||
}
|
||||
.col-lg-pull-8 {
|
||||
right: 66.66666667%;
|
||||
}
|
||||
.col-lg-pull-7 {
|
||||
right: 58.33333333%;
|
||||
}
|
||||
.col-lg-pull-6 {
|
||||
right: 50%;
|
||||
}
|
||||
.col-lg-pull-5 {
|
||||
right: 41.66666667%;
|
||||
}
|
||||
.col-lg-pull-4 {
|
||||
right: 33.33333333%;
|
||||
}
|
||||
.col-lg-pull-3 {
|
||||
right: 25%;
|
||||
}
|
||||
.col-lg-pull-2 {
|
||||
right: 16.66666667%;
|
||||
}
|
||||
.col-lg-pull-1 {
|
||||
right: 8.33333333%;
|
||||
}
|
||||
.col-lg-pull-0 {
|
||||
right: auto;
|
||||
}
|
||||
.col-lg-push-12 {
|
||||
left: 100%;
|
||||
}
|
||||
.col-lg-push-11 {
|
||||
left: 91.66666667%;
|
||||
}
|
||||
.col-lg-push-10 {
|
||||
left: 83.33333333%;
|
||||
}
|
||||
.col-lg-push-9 {
|
||||
left: 75%;
|
||||
}
|
||||
.col-lg-push-8 {
|
||||
left: 66.66666667%;
|
||||
}
|
||||
.col-lg-push-7 {
|
||||
left: 58.33333333%;
|
||||
}
|
||||
.col-lg-push-6 {
|
||||
left: 50%;
|
||||
}
|
||||
.col-lg-push-5 {
|
||||
left: 41.66666667%;
|
||||
}
|
||||
.col-lg-push-4 {
|
||||
left: 33.33333333%;
|
||||
}
|
||||
.col-lg-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-lg-push-2 {
|
||||
left: 16.66666667%;
|
||||
}
|
||||
.col-lg-push-1 {
|
||||
left: 8.33333333%;
|
||||
}
|
||||
.col-lg-push-0 {
|
||||
left: auto;
|
||||
}
|
||||
.col-lg-offset-12 {
|
||||
margin-left: 100%;
|
||||
}
|
||||
.col-lg-offset-11 {
|
||||
margin-left: 91.66666667%;
|
||||
}
|
||||
.col-lg-offset-10 {
|
||||
margin-left: 83.33333333%;
|
||||
}
|
||||
.col-lg-offset-9 {
|
||||
margin-left: 75%;
|
||||
}
|
||||
.col-lg-offset-8 {
|
||||
margin-left: 66.66666667%;
|
||||
}
|
||||
.col-lg-offset-7 {
|
||||
margin-left: 58.33333333%;
|
||||
}
|
||||
.col-lg-offset-6 {
|
||||
margin-left: 50%;
|
||||
}
|
||||
.col-lg-offset-5 {
|
||||
margin-left: 41.66666667%;
|
||||
}
|
||||
.col-lg-offset-4 {
|
||||
margin-left: 33.33333333%;
|
||||
}
|
||||
.col-lg-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-lg-offset-2 {
|
||||
margin-left: 16.66666667%;
|
||||
}
|
||||
.col-lg-offset-1 {
|
||||
margin-left: 8.33333333%;
|
||||
}
|
||||
.col-lg-offset-0 {
|
||||
margin-left: 0%;
|
||||
}
|
||||
}
|
||||
|
||||
.row:before,
|
||||
.row:after {
|
||||
content: " ";
|
||||
display: table;
|
||||
}
|
||||
|
||||
.row:after {
|
||||
clear: both;
|
||||
}
|
||||
1
wp-content/plugins/eagle-booking/include/metabox/cmb2-grid/assets/css/bootstrap.min.css
vendored
Normal file
1
wp-content/plugins/eagle-booking/include/metabox/cmb2-grid/assets/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Show admin notice & de-activate itself if PHP < 5.3 is detected.
|
||||
*/
|
||||
if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
|
||||
add_action( 'admin_init', 'cmb2_grid_deactivate' );
|
||||
|
||||
if ( ! function_exists( 'cmb2_grid_deactivate' ) ) {
|
||||
/**
|
||||
* Check for parent plugin.
|
||||
*/
|
||||
function cmb2_grid_deactivate() {
|
||||
$file = plugin_basename( __FILE__ );
|
||||
|
||||
if ( is_admin() && current_user_can( 'activate_plugins' ) && is_plugin_active( plugin_basename( $file ) ) ) {
|
||||
add_action( 'admin_notices', create_function( null, 'echo \'<div class="error"><p>\', __( \'Activation failed: The CMB2 Grid plugin requires PHP 5.3+. Please contact your webhost and ask them to upgrade the PHP version for your webhosting account.\', \'cmb2-grid\' ), \'</a></p></div>\';' ) );
|
||||
|
||||
deactivate_plugins( $file, false, is_network_admin() );
|
||||
|
||||
// Add to recently active plugins list.
|
||||
if ( ! is_network_admin() ) {
|
||||
update_option( 'recently_activated', array( $file => time() ) + (array) get_option( 'recently_activated' ) );
|
||||
} else {
|
||||
update_site_option( 'recently_activated', array( $file => time() ) + (array) get_site_option( 'recently_activated' ) );
|
||||
}
|
||||
|
||||
// Prevent trying again on page reload.
|
||||
if ( isset( $_GET['activate'] ) ) {
|
||||
unset( $_GET['activate'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* PHP 5.3+, so load the plugin. */
|
||||
include_once dirname( __FILE__ ) . '/Cmb2GridPluginLoad.php';
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "origgami/cmb2-grid",
|
||||
"type": "wordpress-plugin",
|
||||
"require": {
|
||||
"composer/installers": ">=v1.1.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Nothing to see here.
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="CMB2 Grid">
|
||||
<description>The code standard for CMB2 Grid is WordPress.</description>
|
||||
|
||||
<!-- PHP cross-version compatibility -->
|
||||
<config name="testVersion" value="5.3-99.0"/>
|
||||
<rule ref="PHPCompatibility"/>
|
||||
|
||||
<!-- Code style -->
|
||||
<rule ref="WordPress">
|
||||
<exclude name="Generic.Files.LowercasedFilename" />
|
||||
<exclude name="WordPress.NamingConventions" />
|
||||
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
|
||||
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
|
||||
|
||||
<!-- Temporarily exclude documentation checks until all classes, methods and properties have been documented. -->
|
||||
<exclude name="WordPress-Docs" />
|
||||
</rule>
|
||||
|
||||
<!-- exclude the 'empty' index files from some documentation checks -->
|
||||
<rule ref="Squiz.Commenting.FileComment.WrongStyle">
|
||||
<exclude-pattern>*/index.php</exclude-pattern>
|
||||
</rule>
|
||||
<rule ref="Squiz.Commenting.InlineComment.SpacingAfter">
|
||||
<exclude-pattern>*/index.php</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
</ruleset>
|
||||
@@ -0,0 +1,465 @@
|
||||
<?php
|
||||
/**
|
||||
* CMB2 Tabs.
|
||||
*
|
||||
* @package WordPress\Plugins\CMB2 Tabs
|
||||
* @author Team StackAdroit <stackstudio@stackadroit.com>
|
||||
* @link https://stackadroit.com
|
||||
* @version 1.0.6
|
||||
*
|
||||
* @copyright 2017 Team StackAdroit
|
||||
* @license http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 3 or higher
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: CMB2 Tabs
|
||||
* Plugin URI: https://github.com/stackadroit/cmb2-extensions
|
||||
* Description: CMB2 Tabs is an extension for CMB2 which allow you to organize fields into tabs.
|
||||
* Author: Team StackAdroit <stackstudio@stackadroit.com>
|
||||
* Author URI: https://stackadroit.com
|
||||
* Github Plugin URI: https://github.com/stackadroit/cmb2-extensions
|
||||
* Github Branch: master
|
||||
* Version: 1.0.6
|
||||
* License: GPL v3
|
||||
*
|
||||
* Copyright (C) 2017, Team StackAdroit - stackstudio@stackadroit.com
|
||||
*
|
||||
* GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/3.0/>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
// Exit if accessed directly
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!class_exists('CMB2_Tabs', false)) {
|
||||
|
||||
/**
|
||||
* Class CMB2_Tabs
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @category WordPress_Plugin
|
||||
* @package CMB2 Tabs
|
||||
* @author Team StackAdroit
|
||||
* @license GPL-3.0+
|
||||
* @link https://stackadroit.com
|
||||
*/
|
||||
class CMB2_Tabs {
|
||||
|
||||
/**
|
||||
* Priority on which our actions are hooked in.
|
||||
*
|
||||
* @const int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
const PRIORITY = 99996;
|
||||
|
||||
/**
|
||||
* Current version number
|
||||
*
|
||||
* @const string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
const VERSION = '1.0.6';
|
||||
|
||||
/**
|
||||
* The url which is used to load local resources
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $url = '';
|
||||
|
||||
/**
|
||||
* Current CMB2 instance
|
||||
*
|
||||
* @var CMB2
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $cmb = '';
|
||||
|
||||
/**
|
||||
* Indicate that the instance of the class is working on a meta box that has tabs or not
|
||||
* It will be set 'true' BEFORE meta box is display and 'false' AFTER
|
||||
*
|
||||
* @var boolean
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $active = false;
|
||||
|
||||
/**
|
||||
* Active Panel
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $active_panel = '';
|
||||
|
||||
/**
|
||||
* Deactive Conditional tabs "show_on_cb"
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $conditional = array();
|
||||
|
||||
/**
|
||||
* Store all output of fields
|
||||
* This is used to put fields in correct <div> for tabs
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $fields_output = array();
|
||||
|
||||
/**
|
||||
* Initialize the hooking into CMB2
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
// Hook all the functions
|
||||
add_action('cmb2_before_form', array($this, 'opening_div'), 10, 4);
|
||||
add_action('cmb2_after_form', array($this, 'closing_div'), 20, 4);
|
||||
|
||||
add_action('cmb2_before_form', array($this, 'render_nav'), 20, 4);
|
||||
add_action('cmb2_after_form', array($this, 'show_panels'), 10, 4);
|
||||
|
||||
add_filter('cmb2_wrap_classes', array($this, 'panel_wraper_class'), 10, 2);
|
||||
add_filter('cmb_output_html_row', array($this, 'capture_fields'), 10, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display opening div for tabs for meta box
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function opening_div($cmb_id, $object_id, $object_type, $cmb)
|
||||
{
|
||||
if (!$cmb->prop("tabs")) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tab_style = $cmb->prop("tab_style");
|
||||
$class = 'cmb-tabs clearfix';
|
||||
|
||||
if (isset($tab_style) && 'default' != $tab_style) {
|
||||
$class .= ' cmb-tabs-'.$tab_style;
|
||||
}
|
||||
|
||||
echo '<div class="'.$class.'">';
|
||||
|
||||
// Current cmb2 instance
|
||||
CMB2_Tabs::$cmb = $cmb;
|
||||
|
||||
// Add cmb2_tabs custome render callback to instance
|
||||
CMB2_Field::$callable_fields[] = 'cmb2_tabs_render_row_cb';
|
||||
|
||||
// Set 'true' to let us know that we're working on a meta box that has tabs
|
||||
$this->active = true;
|
||||
//setup style and script for tabs
|
||||
$this->setup_admin_scripts();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display closing div for tabs for meta box
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function closing_div()
|
||||
{
|
||||
if (!$this->active) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
// Reset to initial state to be ready for other meta boxes
|
||||
$this->active = false;
|
||||
$this->fields_output = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render Navigration
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function render_nav($cmb_id, $object_id, $object_type, $cmb)
|
||||
{
|
||||
|
||||
$tabs = $cmb->prop("tabs");
|
||||
|
||||
if ($tabs) {
|
||||
|
||||
echo '<ul class="cmb-tab-nav">';
|
||||
$active_nav = true;
|
||||
|
||||
foreach ($tabs as $key => $tab_data)
|
||||
{
|
||||
|
||||
if (is_string($tab_data))
|
||||
{
|
||||
$tab_data = array('label' => $tab_data);
|
||||
}
|
||||
|
||||
$tab_data = wp_parse_args($tab_data, array(
|
||||
'icon' => '',
|
||||
'label' => '',
|
||||
'show_on_cb' => null,
|
||||
));
|
||||
|
||||
if ($tab_data['show_on_cb'] && $this->do_callback($tab_data['show_on_cb'])) {
|
||||
$this->conditional[] = $key;
|
||||
continue;
|
||||
}
|
||||
|
||||
//set icon defult it it's emty
|
||||
$tab_data['icon'] = $tab_data['icon'] ? $tab_data['icon'] : "dashicons-admin-post";
|
||||
|
||||
// If icon is URL to image
|
||||
if (filter_var($tab_data['icon'], FILTER_VALIDATE_URL))
|
||||
{
|
||||
$icon = '<img src="'.$tab_data['icon'].'">';
|
||||
}
|
||||
// If icon is icon font
|
||||
else
|
||||
{
|
||||
// If icon is dashicon, auto add class 'dashicons' for users
|
||||
if (false !== strpos($tab_data['icon'], 'dashicons'))
|
||||
{
|
||||
$tab_data['icon'] .= ' dashicons';
|
||||
}
|
||||
// Remove duplicate classes
|
||||
$tab_data['icon'] = array_filter(array_map('trim', explode(' ', $tab_data['icon'])));
|
||||
$tab_data['icon'] = implode(' ', array_unique($tab_data['icon']));
|
||||
|
||||
$icon = $tab_data['icon'] ? '<i class="'.$tab_data['icon'].'"></i>' : '';
|
||||
}
|
||||
|
||||
$class = "cmb-tab-$key";
|
||||
if ($active_nav) {
|
||||
$class .= ' cmb-tab-active';
|
||||
$this->active_panel = $key;
|
||||
$active_nav = false;
|
||||
}
|
||||
|
||||
printf(
|
||||
'<li class="%s" data-panel="%s"><a href="#">%s<span>%s</span></a></li>',
|
||||
$class,
|
||||
$key,
|
||||
$icon,
|
||||
$tab_data['label']
|
||||
);
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add class to wraper div of CMB2 panel
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function panel_wraper_class($classes, $box)
|
||||
{
|
||||
|
||||
if ($this->active) {
|
||||
$classes[] = 'cmb-tabs-panel';
|
||||
}
|
||||
if ($this->active && $this->fields_output) {
|
||||
$classes[] = 'cmb2-wrap-tabs';
|
||||
}
|
||||
|
||||
return array_unique($classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modified CMB2 render row function to capture rows in a output string
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function tabs_render_row_cb($field_args, $field)
|
||||
{
|
||||
|
||||
// Ok, callback is good, let's run it and store the result.
|
||||
ob_start();
|
||||
|
||||
if ( 'group' === $field_args['type'] ) {
|
||||
self::tabs_render_group_row_cb($field_args, $field);
|
||||
}else{
|
||||
if ($field->args( 'cmb2_tabs_render_row_cb' )) {
|
||||
CMB2_Tabs::$cmb->peform_param_callback( 'cmb2_tabs_render_row_cb' );
|
||||
} else {
|
||||
$field->render_field_callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Grab the result from the output buffer and store it.
|
||||
|
||||
// Custom fix for show_on
|
||||
if (isset($returned)) {
|
||||
$returned = $returned;
|
||||
} else {
|
||||
$returned = '';
|
||||
}
|
||||
|
||||
$echoed = ob_get_clean();
|
||||
$outer_html = $echoed ? $echoed : $returned;
|
||||
$outer_html = apply_filters('cmb_output_html_row', $outer_html, $field_args, $field);
|
||||
echo $outer_html;
|
||||
//return $field;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Modified CMB2 render row function to capture Group rows in a output string
|
||||
*
|
||||
* @since 1.0.5
|
||||
*/
|
||||
public static function tabs_render_group_row_cb($field_args, $field_group)
|
||||
{
|
||||
|
||||
// Ok, callback is good, let's run it and store the result.
|
||||
ob_start();
|
||||
|
||||
if ($field_group->args( 'cmb2_tabs_render_row_cb' )) {
|
||||
CMB2_Tabs::$cmb->render_group_callback( 'cmb2_tabs_render_row_cb' );
|
||||
} else {
|
||||
CMB2_Tabs::$cmb->render_group_callback($field_args, $field_group);
|
||||
}
|
||||
|
||||
// Grab the result from the output buffer and store it.
|
||||
$echoed = ob_get_clean();
|
||||
$outer_html = $echoed ? $echoed : $returned;
|
||||
$outer_html = apply_filters('cmb_output_html_row', $outer_html, $field_args, $field_group);
|
||||
|
||||
echo $outer_html;
|
||||
|
||||
//return $field_group;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display tab navigation for meta box
|
||||
* Note that: this public function is hooked to 'cmb2_after_form', when all fields are outputted
|
||||
* (and captured by 'capture_fields' public function)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function show_panels($cmb_id, $object_id, $object_type, $cmb)
|
||||
{
|
||||
if (!$this->active) {return; }
|
||||
|
||||
echo '<div class="', esc_attr($cmb->box_classes()), '"><div id="cmb2-metabox-', sanitize_html_class($cmb_id), '" class="cmb2-metabox cmb-field-list">';
|
||||
|
||||
foreach ($this->fields_output as $tab => $fields)
|
||||
{
|
||||
if (!in_array($tab, $this->conditional, TRUE)) {
|
||||
$active_panel = $this->active_panel == $tab ? "show" : "";
|
||||
echo '<div class="'.$active_panel.' cmb-tab-panel cmb-tab-panel-'.$tab.'">';
|
||||
echo implode('', $fields);
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</div></div>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Save field output into class variable to output later
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function capture_fields($output, $field_args, $field)
|
||||
{
|
||||
// If meta box doesn't have tabs, do nothing
|
||||
if (!$this->active || !isset($field_args['tab'])) { return $output; }
|
||||
|
||||
$tab = $field_args['tab'];
|
||||
|
||||
if (!isset($this->fields_output[$tab])) {
|
||||
$this->fields_output[$tab] = array();
|
||||
}
|
||||
$this->fields_output[$tab][] = $output;
|
||||
|
||||
// Return empty string to let Meta Box plugin echoes nothing
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setup_admin_scripts() {
|
||||
|
||||
wp_register_script('cmb-tabs-js', self::url('js/tabs.js'), array('jquery'), self::VERSION);
|
||||
wp_enqueue_script('cmb-tabs-js');
|
||||
|
||||
wp_enqueue_style('cmb2-tabs-style', self::url('css/tabs.css'), array(), self::VERSION);
|
||||
wp_enqueue_style('cmb2-tabs-style');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the url which is used to load local resources. Based on, and uses,
|
||||
* the CMB2_Utils class from the CMB2 library.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function url($path = '') {
|
||||
if (self::$url) { return self::$url.$path; }
|
||||
|
||||
/**
|
||||
* Set the variable cmb2_tabs_dir
|
||||
*/
|
||||
$cmb2_tabs_dir = trailingslashit(dirname(__FILE__));
|
||||
|
||||
/**
|
||||
* Use CMB2_Utils to gather the url from cmb2_tabs_dir
|
||||
*/
|
||||
$cmb2_tabs_url = CMB2_Utils::get_url_from_dir($cmb2_tabs_dir);
|
||||
|
||||
/**
|
||||
* Filter the CMB2 FPSA location url
|
||||
*/
|
||||
self::$url = trailingslashit(apply_filters('cmb2_tabs_url', $cmb2_tabs_url, self::VERSION));
|
||||
|
||||
return self::$url.$path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles metabox property callbacks, and passes this $cmb object as property.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected function do_callback($cb) {
|
||||
return call_user_func($cb, CMB2_Tabs::$cmb, $this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Boot the hole thing
|
||||
$cmb2_tabs = new CMB2_Tabs();
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
/**
|
||||
* CMB2 Tabs Styling
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Helper
|
||||
--------------------------------------------------------------*/
|
||||
.clearfix:after {
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
font-size: 0;
|
||||
content: " ";
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
.clearfix { display: inline-block; }
|
||||
/* start commented backslash hack \*/
|
||||
* html .clearfix { height: 1%; }
|
||||
.clearfix { display: block; }
|
||||
/* close commented backslash hack */
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Base style
|
||||
--------------------------------------------------------------*/
|
||||
.cmb-tabs .cmb-th label {
|
||||
color: #555;
|
||||
font-size: 12px;
|
||||
}
|
||||
.cmb-tabs .cmb-type-group .cmb-row,
|
||||
.cmb-tabs .cmb2-postbox .cmb-row {
|
||||
margin: 0 0 0.8em;
|
||||
padding: 0 0 0.8em;
|
||||
}
|
||||
.cmb-tabs span.cmb2-metabox-description {
|
||||
display: block;
|
||||
}
|
||||
.cmb-tabs .cmb-remove-row-button {
|
||||
background-color: #e60000;
|
||||
border: medium none;
|
||||
border-radius: 25px;
|
||||
color: #fff;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
text-indent: -999em;
|
||||
width: 20px;
|
||||
position: relative;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
/*.cmb-tabs .cmb-remove-row-button:hover {
|
||||
background-color: #ff0000;
|
||||
color: #fff;
|
||||
}
|
||||
.cmb-tabs .cmb-remove-row-button:after {
|
||||
box-shadow: none;
|
||||
content: "";
|
||||
cursor: help;
|
||||
font-family: Dashicons;
|
||||
font-variant: normal;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
padding: 4px 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
text-indent: 0;
|
||||
top: 0;
|
||||
vertical-align: middle;
|
||||
}*/
|
||||
|
||||
.cmb-tabs .cmb-repeat-row{
|
||||
position: relative;
|
||||
}
|
||||
.cmb-tabs .cmb-remove-row {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.cmb-tabs .cmb-repeat-row .cmb-td{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
CMB2 Tabs
|
||||
--------------------------------------------------------------*/
|
||||
.cmb-tabs {
|
||||
margin: -6px -12px -12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav:after {
|
||||
background-color: #fafafa;
|
||||
border-right: 1px solid #eee;
|
||||
bottom: -9999em;
|
||||
content: "";
|
||||
display: block;
|
||||
height: 9999em;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
width: calc(100% - 1px);
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav{
|
||||
background-color: #fafafa;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
line-height: 1em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
width: 20%;
|
||||
float: left;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
.cmb-tabs i,
|
||||
.cmb-tabs i:before {
|
||||
font-size: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li a {
|
||||
border-right: 1px solid #eee;
|
||||
border-left: 2px solid #fafafa;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
text-decoration: none;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li i {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li i,
|
||||
.cmb-tabs ul.cmb-tab-nav li img{
|
||||
padding: 0 5px 0 0px;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li a {
|
||||
color: #555;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.cmb-tabs ul.cmb-tab-nav li.cmb-tab-active a {
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
border: 1px solid #eee;
|
||||
border-left: 3px solid #00a0d2;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
|
||||
.cmb-tabs ul.cmb-tab-nav li:first-of-type.cmb-tab-active a {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.cmb-tabs .cmb-tabs-panel {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
color: #555;
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex;
|
||||
width: 80%;
|
||||
padding: 0;
|
||||
}
|
||||
.cmb-tabs .cmb2-metabox{
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.cmb-tabs .cmb-th {
|
||||
width: 18%;
|
||||
}
|
||||
.cmb-tabs .cmb-th,
|
||||
.cmb-tabs .cmb-td {
|
||||
padding: 0 2% 0 2%;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.cmb-tabs .cmb-th + .cmb-td,
|
||||
.cmb-tabs .cmb-th + .cmb-td {
|
||||
float: right;
|
||||
width: 82%;
|
||||
}
|
||||
.cmb2-wrap-tabs .cmb-tab-panel{
|
||||
display: none;
|
||||
}
|
||||
.cmb2-wrap-tabs .cmb-tab-panel.show{
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Classic Tab
|
||||
--------------------------------------------------------------*/
|
||||
.cmb-tabs.cmb-tabs-classic ul.cmb-tab-nav {
|
||||
width: 100%;
|
||||
float: none;
|
||||
background-color: #fafafa;
|
||||
border-right: medium none;
|
||||
padding: 0;
|
||||
border-bottom: 1px solid #dedede;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.cmb-tabs.cmb-tabs-classic .cmb-tab-nav li {
|
||||
background: #ebebeb none repeat scroll 0 0;
|
||||
margin: 0 5px -1px 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.cmb-tabs.cmb-tabs-classic .cmb-tab-nav li:first-of-type {
|
||||
margin-left: 18px;
|
||||
}
|
||||
|
||||
.cmb-tabs.cmb-tabs-classic ul.cmb-tab-nav::after {
|
||||
display: none;
|
||||
}
|
||||
.cmb-tabs.cmb-tabs-classic .cmb-tabs-panel {
|
||||
width: 100%;
|
||||
}
|
||||
.cmb-tabs.cmb-tabs-classic .cmb-tab-panel{
|
||||
/*background: #ebebeb none repeat scroll 0 0;*/
|
||||
padding-top: 10px;
|
||||
}
|
||||
.cmb-tabs.cmb-tabs-classic ul.cmb-tab-nav li a{
|
||||
padding: 8px 12px;
|
||||
background-color: #fafafa;
|
||||
border: none;
|
||||
border-bottom: 1px solid #dedede;
|
||||
}
|
||||
.cmb-tabs.cmb-tabs-classic ul.cmb-tab-nav li.cmb-tab-active a{
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
border: none;
|
||||
border-top: 2px solid #00a0d2;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
Media Query
|
||||
--------------------------------------------------------------*/
|
||||
@media (max-width: 750px) {
|
||||
.cmb-tabs ul.cmb-tab-nav {
|
||||
width: 10%;
|
||||
}
|
||||
.cmb-tabs .cmb-tabs-panel {
|
||||
width: 90%;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li i,
|
||||
.cmb-tabs ul.cmb-tab-nav li img {
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
display: block;
|
||||
max-width: 25px;
|
||||
}
|
||||
.cmb-tabs ul.cmb-tab-nav li span{
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
text-indent: -999px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 500px) {
|
||||
|
||||
.cmb-tabs .cmb-th,
|
||||
.cmb-tabs .cmb-th + .cmb-td,
|
||||
.cmb-tabs .cmb-th + .cmb-td {
|
||||
float: none;
|
||||
width: 96%;
|
||||
}
|
||||
|
||||
.cmb-tabs .cmb-repeat-row .cmb-td {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/* global jQuery */
|
||||
|
||||
jQuery( function ( $ )
|
||||
{
|
||||
'use strict';
|
||||
$( '.cmb-tab-nav' ).on( 'click', 'a', function ( e )
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var $li = $( this ).parent(),
|
||||
panel = $li.data( 'panel' ),
|
||||
$wrapper = $li.parents( ".cmb-tabs" ).find( '.cmb2-wrap-tabs' ),
|
||||
$panel = $wrapper.find( '.cmb-tab-panel-' + panel );
|
||||
|
||||
$li.addClass( 'cmb-tab-active' ).siblings().removeClass( 'cmb-tab-active' );
|
||||
|
||||
$panel.addClass('show').siblings().removeClass('show');
|
||||
} );
|
||||
|
||||
|
||||
});
|
||||
@@ -0,0 +1,744 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## Unreleased
|
||||
### Enhancements
|
||||
|
||||
* Repeatable fields are now drag-sortable. Props [@lipemat](https://github.com/lipemat) ([#1142](https://github.com/CMB2/CMB2/pull/1142)).
|
||||
* Update the `sv_SE` translation. Props [@edvind](https://github.com/edvind) ([#370](https://github.com/CMB2/CMB2/issues/370)).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
## [2.4.2 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.2)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Do not enqueue/register WordPress code editor JS if there are no `textarea_code` fields registered on the page. Fixes [#1110](https://github.com/CMB2/CMB2/issues/1110).
|
||||
* Do not set repeated `wysiwyg` field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138) (again!).
|
||||
|
||||
## [2.4.1 - 2018-05-25](https://github.com/CMB2/CMB2/releases/tag/v2.4.1)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Do not set repeated field values to string "false" when boolean false. Fixes [#1138](https://github.com/CMB2/CMB2/issues/1138).
|
||||
|
||||
## [2.4.0 - 2018-05-24](https://github.com/CMB2/CMB2/releases/tag/v2.4.0)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Enable linking options pages via tabbed-navigation. Will output tabbed navigation for options-pages which share the same `'tab_group'` CMB2 box property. [This snippet](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php) demonstrates how to create a top-level menu options page with multiple submenu pages, each with the tabbed navigation. To specify a different tab title than the options-page title, set the `'tab_title'` CMB2 box property. See [#301](https://github.com/CMB2/CMB2/issues/301), [#627](https://github.com/CMB2/CMB2/issues/627).
|
||||
* Complete the `zh-CN` translation. Props [@uicestone](https://github.com/uicestone) ([#1089](https://github.com/CMB2/CMB2/issues/1089)).
|
||||
* Update the `nl_NL` translation. Props [@tammohaannl](https://github.com/tammohaannl) ([#1101](https://github.com/CMB2/CMB2/issues/1101)).
|
||||
* Better display for white over transparent images (e.g. logos) by using a checkered background for images. ([#1103](https://github.com/CMB2/CMB2/issues/1103))
|
||||
* Ability to disable the options [autoload parameter](https://codex.wordpress.org/Function_Reference/add_option#Parameters) via filter (`"cmb2_should_autoload_{$options_key}"`) or via a box parameter for `'options-page'` box registrations (`'autoload' => false,`). ([#1093](https://github.com/CMB2/CMB2/issues/1093))
|
||||
* `'textarea_code'` field type now uses CodeMirror that is [used by WordPress](https://make.wordpress.org/core/2017/10/22/code-editing-improvements-in-wordpress-4-9/) ([#1096](https://github.com/CMB2/CMB2/issues/1096)). A field can opt-out to return to the previous behavior by specifying an `'options'` parameter:
|
||||
`'options' => array( 'disable_codemirror' => true )`
|
||||
As with the other javascript-enabled fields, the code-editor defaults can be overridden via a `data-codeeditor` attribute. E.g:
|
||||
|
||||
```php
|
||||
'attributes' => array(
|
||||
'data-codeeditor' => json_encode( array(
|
||||
'codemirror' => array(
|
||||
'mode' => 'css',
|
||||
),
|
||||
) ),
|
||||
),
|
||||
```
|
||||
* Improve/add comment info banners at top of CMB2 CSS files.
|
||||
* Added `resetBoxes`/`resetBox` Javascript methods for resetting CMB2 box forms.
|
||||
* Improved styles for fields in the new-term form.
|
||||
* New `CMB2_Boxes` methods for filtering instances of `CMB2`, `CMB2_Boxes::get_by( $property, $optional_compare )` and `CMB2_Boxes::filter_by( $property, $to_ignore = null )`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix the `'taxonomy_*'` fields when used for term fields/meta. Save the value to term-meta.
|
||||
* Clear the CMB2 fields when a term is added. Fixes [#794](https://github.com/CMB2/CMB2/issues/794).
|
||||
* Repeated fields now use registered field defaults for values. Fixes [#1137](https://github.com/CMB2/CMB2/issues/1137).
|
||||
* Fixed the formatting for deprecated messages in the log.
|
||||
* Prevent opening of media modal when clicking the file "Download" link. Fixes [#1130](https://github.com/CMB2/CMB2/issues/1130).
|
||||
|
||||
## [2.3.0 - 2017-12-20](https://github.com/CMB2/CMB2/releases/tag/v2.3.0)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Updated Italian translation. Props [@Mte90](https://github.com/Mte90) ([#1067](https://github.com/CMB2/CMB2/issues/1067)).
|
||||
* Starting with this release, we are fully switching to the more communicative and standard [Semantic Versioning](https://semver.org/). ([#1061](https://github.com/CMB2/CMB2/issues/1061)).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update for compatibility with PHP 7.2 (e.g. fixes `Fatal error: Declaration of CMB2_Type_Colorpicker::render() must be compatible with CMB2_Type_Text::render($args = Array)...`). ([#1070](https://github.com/CMB2/CMB2/issues/1070), [#1074](https://github.com/CMB2/CMB2/issues/1074), [#1075](https://github.com/CMB2/CMB2/issues/1075)).
|
||||
|
||||
## [2.2.6.2 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.2)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix another issue (introduced in 2.2.6) with repeatable fields not being able to save additional fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#1059](https://github.com/CMB2/CMB2/pull/1059), [#1058](https://github.com/CMB2/CMB2/issues/1058)).
|
||||
* Only dequeue `jw-cmb2-rgba-picker-js` script (and enqueue our `wp-color-picker-alpha`) if it is actually found.
|
||||
|
||||
## [2.2.6.1 - 2017-11-24](https://github.com/CMB2/CMB2/releases/tag/v2.2.6.1)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Merge in the [CMB2 RGBa Colorpicker](https://github.com/JayWood/CMB2_RGBa_Picker) field type functionality to the CMB2 colopicker field type. Adds the ability to add an alpha (transparency) slider to the colorpicker by adding the `'alpha'` option [to the field options array](https://github.com/CMB2/CMB2/blob/6fce2e7ba8f41345a23bc2064e30433bdb11c16c/example-functions.php#L263-L265). Thank you to [JayWood](https://github.com/JayWood) for his work on his custom field type.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue (introduced in 2.2.6) with complex fields set as repeatable not being able to save additional fields. Fixes [#1054](https://github.com/CMB2/CMB2/issues/1054).
|
||||
|
||||
## [2.2.6 - 2017-11-14](https://github.com/CMB2/CMB2/releases/tag/v2.2.6)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Move the fetching of group label and description to _after_ calling `'before_group'` parameter.
|
||||
* Allow using the `'render_row_cb'` param for group fields. Fixes [#1041](https://github.com/CMB2/CMB2/issues/1041).
|
||||
* Allow resetting cached CMB2 field objects (new 3rd parameter to `CMB2::get_field()`).
|
||||
* Allow resetting cached callback results (`CMB2_Base::unset_param_callback_cache()`).
|
||||
* Persian translation provided by [@reza-irdev](https://github.com/reza-irdev) ([#1046](https://github.com/CMB2/CMB2/issues/1046)).
|
||||
* Added a `'message_cb'` box property, which allows defining a custom callback for adding options-save messages on `options-page` boxes. An example has been added to [example-functions.php](https://github.com/CMB2/CMB2/commit/43d513c135e52c327bafa06309821c29323ae2dd#diff-378c74d0ffffc1759b8779a135476777).
|
||||
* Updated many the oembed-related unit tests to more reliably test the relevant parts, and not so much the actual success of the WordPress functions.
|
||||
* Updated travis config to Install PHP5.2/5.3 on trusty for unit tests. Stolen from [gutenberg/pull/2049](https://github.com/WordPress/gutenberg/pull/2049). Intended to compensate for Travis removing support for PHP 5.2/5.3.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Ensure `'file'` field type ID is removed from the database if the `'file'` field type's value is empty ([Support thread](https://wordpress.org/support/topic/bug-field-of-type-file-does-not-delete-postmeta-properly/)).
|
||||
* Fix JS errors when `user_can_richedit()` is false ("Disable the visual editor when writing" user option is checked, or various unsupported browsers). See [#1031](https://github.com/CMB2/CMB2/pull/1031).
|
||||
* Fix issue where some European date formats (e.g. `F j, Y`) would not properly translate into jQuery UI date formats. [Support thread](https://wordpress.org/support/topic/using-wordpresss-date-time-format-settings)
|
||||
* Fix repeating fields within repeating groups having the values/indexes incorrectly associated. Props [@daggerhart](https://github.com/daggerhart) ([#1047](https://github.com/CMB2/CMB2/pull/1047)). Fixes [#1035](https://github.com/CMB2/CMB2/issues/1035), [#348](https://github.com/CMB2/CMB2/issues/348).
|
||||
* Fixed multiple update messages on settings pages when CMB2 option pages were registered ([#1049](https://github.com/CMB2/CMB2/issues/1049)).
|
||||
* Fix issue where using multiple oembed fields could cause incorrectly cached arguments to be used.
|
||||
* Fix bug where `'select_all_button' => false` was not working for `'taxonomy_multicheck'` field type ([#1005](https://github.com/CMB2/CMB2/issues/1005)).
|
||||
|
||||
## [2.2.5.3 - 2017-08-22](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.3)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Update to instead initate CMB2 hookup via `"cmb2_init_hookup_{$cmb_id}"` hook. Allows plugins to unhook/rehook/etc.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Spelling/Grammar fixes. Props [@garrett-eclipse](https://github.com/garrett-eclipse) ([#1012](https://github.com/CMB2/CMB2/pull/1012)).
|
||||
* Fix "PHP Strict Standards: Static function should not be abstract" notice.
|
||||
* Add `CMB2_Utils::normalize_if_numeric()` to address problems when using floats as select/radio values. Fixes [#869](https://github.com/CMB2/CMB2/issues/869). See [#1013](https://github.com/CMB2/CMB2/pull/1013).
|
||||
* Fix issues with apostrophes in money values. (e.g. in Swiss German the thousand separator is an apostrophe). Props [@ocean90](https://github.com/ocean90) ([#1014](https://github.com/CMB2/CMB2/issues/1014), [#1015](https://github.com/CMB2/CMB2/pull/1015)).
|
||||
* Provide public access to the `CMB2_Options_Hookup::$option_key` property.
|
||||
* Change the updated-settings notice query variable so that WordPress does not auto-add settings notices on top of ours.
|
||||
* For settings pages, only output settings errors if WordPress does not do it by default (for sub-pages of `options-general.php`), and if the errors are not disabled via the `'disable_settings_errors'` box property.
|
||||
|
||||
## [2.2.5.2 - 2017-08-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.2)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue in 2.2.5 with non-sortable repeatable groups not having new groups values be emptied on creation/clone. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/page/2/)
|
||||
* Fix issue in 2.2.5 with options pages not saving when `'parent_slug'` box property was used. Fixes [#1008](https://github.com/CMB2/CMB2/issues/1008).
|
||||
|
||||
## [2.2.5.1 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5.1)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue in 2.2.5 which caused empty repeatable groups having the buttons set to have a disabled "Remove Group" button. [Support thread](https://wordpress.org/support/topic/the-default-parameter-dont-work-in-group-fields/)
|
||||
|
||||
## [2.2.5 - 2017-08-07](https://github.com/CMB2/CMB2/releases/tag/v2.2.5)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Options pages are now first-class CMB2 citizens, and registering a box to show on an options page will automatically register the menu page and output the form on the page. [See example](https://github.com/CMB2/CMB2/blob/v2.2.5/example-functions.php#L640-L683). (The [snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages) in the snippet library will be updated to reflect this change)
|
||||
* Improved Options Page styling. Props [@anhskohbo](https://github.com/anhskohbo) ([#1006](https://github.com/CMB2/CMB2/pull/1006)).
|
||||
* Improved cohesive styles for repeatable fields. Props [@anhskohbo](https://github.com/anhskohbo) ([#819](https://github.com/CMB2/CMB2/pull/819)).
|
||||
* New field types, `'taxonomy_radio_hierarchical'`, and `'taxonomy_multicheck_hierarchical'`, for displaying taxonomy options in a hierarchial layout. Props to [eriktelepovsky](https://github.com/eriktelepovsky) for the [working code](https://github.com/CMB2/CMB2/issues/640#issuecomment-246938690). ([#640](https://github.com/CMB2/CMB2/issues/640))
|
||||
* Removing last repeat item row (and repeat group row) is now somewhat allowed in that the "remove" button simply resets the last item to empty. Fixes [#312](https://github.com/CMB2/CMB2/issues/312).
|
||||
* Enable the additional media library modal filters. Fixes [#873](https://github.com/CMB2/CMB2/issues/873).
|
||||
* Sanitize the attributes added via the `cmb2_group_wrap_attributes` filter.
|
||||
* New field parameter, `'query_args'`, which can be used by the `'taxonomy_*'` fields. Provides ability to override the arguments passed to `get_terms()`.
|
||||
* The `cmb2_can_save` filter now passes the CMB2 object as the 2nd parameter. Props [@Arno33](https://github.com/Arno33) ([#994](https://github.com/CMB2/CMB2/pull/994)).
|
||||
* Update the file field type to work properly within a custom field context by allowing the passing of override arguments to `CMB2_Types::file()` method.
|
||||
* Many WordPress Code Standards improvements/updates. Props [@bradp](https://github.com/bradp)
|
||||
* Include absolute paths when including the core php files. Props [@anhskohbo](https://github.com/anhskohbo) ([#998](https://github.com/CMB2/CMB2/pull/998)).
|
||||
* Change language throught to reflect CMB2's move to its own organization.
|
||||
* Break `CMB2_Field:options()` method apart to allow re-setting options from field params. Related: [reaktivstudios/cmb2-flexible-content/pull/8](https://github.com/reaktivstudios/cmb2-flexible-content/pull/8).
|
||||
* New `CMB2:box_types()` method for getting the array of registered `'object_types'` for a box. Ensures the return is an array.
|
||||
* Improved inline hooks documentation.
|
||||
* Updated several CMB2 methods to return the CMB2 object (for method chaining). Methods include:
|
||||
* `CMB2::show_form()`
|
||||
* `CMB2::render_form_open()`
|
||||
* `CMB2::render_form_close()`
|
||||
* `CMB2::render_group_row()`
|
||||
* `CMB2::render_hidden_fields()`
|
||||
* `CMB2::save_fields()`
|
||||
* `CMB2::process_fields()`
|
||||
* `CMB2::process_field()`
|
||||
* `CMB2::pre_process()`
|
||||
* `CMB2::after_save()`
|
||||
* `CMB2::add_fields()`
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update for `file`/`file_list` fields to properly show a preview for SVG images. Fixes [#874](https://github.com/CMB2/CMB2/pull/874).
|
||||
* Fix and standardize inconsistent button classes. Update all buttons to use the `.button-secondary` class instead of the `.button` class. This alleviates some front-end issues for themes which target the `.button` class. _This is a backwards-compatibility break._ If your theme or plugin targets the `.button` class within CMB2, you will need to update to use `.button-secondary`.
|
||||
* Correct the before/after form hooks order. For more details see ([#954](https://github.com/CMB2/CMB2/pull/954)).
|
||||
* Fix regression with custom fields not properly repeating. Props [@desrosj](https://github.com/desrosj) ([#969](https://github.com/CMB2/CMB2/pull/969)). Fixes [#901](https://github.com/CMB2/CMB2/issues/901).
|
||||
* Fix "Illegal string offset" notices when `CMB2_Option` methods are called when the option value is empty, as well as additional unit tests for the `CMB2_Option` class. Props [@anhskohbo](https://github.com/anhskohbo) ([#993](https://github.com/CMB2/CMB2/pull/993)).
|
||||
* Fix bug where select fields or checkbox fields occasionally would retain previous group's value when adding new groups. Fixes [#853](https://github.com/CMB2/CMB2/issues/853).
|
||||
* Fix JS to prevent meta keys with `|` or `/` from breaking file fields. Props [@lipemat](https://github.com/lipemat) ([#1003](https://github.com/CMB2/CMB2/pull/1003)).
|
||||
* Fix jQuery Migrate's `jQuery.fn.attr('value', val) no longer sets properties` warning.
|
||||
* Fix issue with CMB2 being too aggressive with stripping slashes from values. Fixes [#981](https://github.com/CMB2/CMB2/issues/981).
|
||||
|
||||
## [2.2.4 - 2017-02-27](https://github.com/CMB2/CMB2/releases/tag/v2.2.4)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Modify `'taxonomy_*'` fields to return stored terms for non-post objects.
|
||||
* Modify `CMB2::get_sanitized_values()` to return the sanitized `'taxonomy_*'` field values. Also added `"cmb2_return_taxonomy_values_{$cmb_id}"` filter to modify if `'taxonomy_*'` field values are returned. Fixes [#538](https://github.com/CMB2/CMB2/issues/538).
|
||||
* Allow outputting CMB2 boxes/fields in additional locations in the post-editor.
|
||||
|
||||
**The new locations are:** [`form_top`](https://developer.wordpress.org/reference/hooks/edit_form_top/), [`before_permalink`](https://developer.wordpress.org/reference/hooks/edit_form_before_permalink/), [`after_title`](https://developer.wordpress.org/reference/hooks/edit_form_after_title/), and [`after_editor`](https://developer.wordpress.org/reference/hooks/edit_form_after_editor/)
|
||||
|
||||
These would be defined by setting the `context` property for your box:
|
||||
|
||||
```php
|
||||
$cmb_demo = new_cmb2_box( array(
|
||||
...
|
||||
'context' => 'before_permalink',
|
||||
) );
|
||||
```
|
||||
|
||||
If it is preferred that the fields are output without the metabox, then omit the `'title'` property from the metabox registration array, and instead add ` 'remove_box_wrap' => true,`.
|
||||
|
||||
Props [@norcross](https://github.com/norcross) ([#836](https://github.com/CMB2/CMB2/pull/836)).
|
||||
* New field parameter, `'render_class'`, allowing you to override the default `'CMB2_Type_Base'` class that is used when rendering the field. This provides interesting object-oriented ways to override default CMB2 behavior by subclassing the default class and overriding methods. The render class can also be overridden with the `"cmb2_render_class_{$fieldtype}"` filter, which is passed the default render class name as well as the `CMB2_Types` object, but this should be used sparingly, and within the context of your project's boxes/fields or you could break other plugins'/themes' CMB2 fields.
|
||||
* Improvements to the `file`/`file_list` fields javascript APIs, including using undersore templates.
|
||||
* Small improvements to the styling for the `file_list` field type.
|
||||
* New action hook, `cmb2_footer_enqueue`, which occurs after CMB2 enqueues its assets.
|
||||
* Example functions clean up. Props [@PavelK27](https://github.com/PavelK27) ([#866](https://github.com/CMB2/CMB2/pull/866)).
|
||||
* New `CMB2_Utils` methods, `get_available_image_sizes()` and `get_named_size()`. Props [@Cai333](https://github.com/Cai333).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix datepicker month/year dropdown text color. On windows, the option text was showing as white (invisible). Fixes [#770](https://github.com/CMB2/CMB2/issues/770).
|
||||
* Repeatable WYSIWYG no longer breaks if `'quicktags'` param is set to false. Props [@timburden](https://github.com/timburden) ([#797](https://github.com/CMB2/CMB2/pull/797), [#796](https://github.com/CMB2/CMB2/issues/796)).
|
||||
* Do not process title fields during group field save process.
|
||||
* Fix issue where term-meta values were not being displayed for some users. Props [@sbussetti](https://github.com/sbussetti) ([#763](https://github.com/CMB2/CMB2/pull/763), [#700](https://github.com/CMB2/CMB2/issues/700)).
|
||||
* Fix issue where term meta would not be applied when using the new term form if multiple object types were specified. Props [@ADC07](https://github.com/ADC07) ([#842](https://github.com/CMB2/CMB2/pull/842), [#841](https://github.com/CMB2/CMB2/issues/841)).
|
||||
* Fix WordPress spinner styling when boxes/fields used on the frontend.
|
||||
* Fix issue where clicking to remove a `file_list` item could occasionally remove the field row. ([#828](https://github.com/CMB2/CMB2/pull/828)).
|
||||
* Fix issue where empty file field in group would still cause non-empty values to store to database. ([#721](https://github.com/CMB2/CMB2/issues/721)).
|
||||
* Make `file`/`file_list` field preview images work with named sizes. Props [@Cai333](https://github.com/Cai333) ([#848](https://github.com/CMB2/CMB2/pull/848), [#844](https://github.com/CMB2/CMB2/issues/844)).
|
||||
* Fix incorrect text-domain. ([#798](https://github.com/CMB2/CMB2/issues/798))
|
||||
* Do not silence notices/errors in `CMB2_Utils::get_file_ext()`.
|
||||
* If `title` field type has no name value, then only output a span element (instead of a header element).
|
||||
|
||||
## [2.2.3.1 - 2016-11-08](https://github.com/CMB2/CMB2/releases/tag/v2.2.3.1)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Better styling for disabled group "X" buttons, and add title attr. Fixes [#773](https://github.com/CMB2/CMB2/issues/773).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Use quotes for `label[for=""]` selector. Fixed `Syntax error, unrecognized expression`. Props [@anhskohbo](https://github.com/anhskohbo) ([#789](https://github.com/CMB2/CMB2/pull/789)).
|
||||
* Fix `ReferenceError: tinyMCE is not defined` javascript errors (happening when trying to remove a repeatable field/group). Fixes [#790](https://github.com/CMB2/CMB2/issues/790), and [#730](https://github.com/CMB2/CMB2/issues/730).
|
||||
* Fix REST API `'show_in_rest'` examples in `example-functions.php`. Any REST API boxes/fields must use the `'cmb2_init'` hook (as opposed to the `'cmb2_admin_init'` hook).
|
||||
|
||||
## [2.2.3 - 2016-10-25](https://github.com/CMB2/CMB2/releases/tag/v2.2.3)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* CMB2 REST API! CMB2 now has WP REST API endpoints for displaying your boxes and fields data, as well as registers rest fields in the existing post, user, term, and comment endpoints (in the cmb2 namespace). Enabling the REST API for your boxes/fields is opt-in, meaning it will not be automatically enabled. For more info, [check out the wiki](https://github.com/CMB2/CMB2/wiki/REST-API).
|
||||
* Small string improvement, move a period inside the translatable string. Props [@pedro-mendonca](https://github.com/pedro-mendonca) ([#672](https://github.com/CMB2/CMB2/pull/672)).
|
||||
* Introduce the `'save_field'` boolean field parameter for disabling the saving of a field. Useful if you want to display the value of another field, or use a disabled/read-only field. Props [@jamesgol](https://github.com/jamesgol) ([#674](https://github.com/CMB2/CMB2/pull/674), [#346](https://github.com/CMB2/CMB2/issues/346), [#500](https://github.com/CMB2/CMB2/issues/500)).
|
||||
* Update docblocks for `CMB2_Field::save_field_from_data()` and `CMB2_Field::save_field()`. Props [@jamesgol](https://github.com/jamesgol) ([#675](https://github.com/CMB2/CMB2/pull/675)).
|
||||
* More javascript events tied to the media modal actions (related to the `'file'` and '`file_list'` fields). `'cmb_media_modal_init'`, `'cmb_media_modal_open'`, and `'cmb_media_modal_select'`.
|
||||
* All CMB2 JS events now also get the CMB2 JS object passed in the list of arguments.
|
||||
* CMB2 JS object is now instantiated without stomping existing object, to enable extending.
|
||||
* New field parameter for taxonomy fields, `'remove_default'` which allows disabling the default taxonomy metabox. Props [@c3mdigital](https://github.com/c3mdigital) ([#593](https://github.com/CMB2/CMB2/pull/593)).
|
||||
* Change `'row_classes'` to just `'classes'`, to mirror the metabox `'classes'` property. Also now accepts a `'classes_cb'` parameter for specifying a callback which returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. (`'row_classes'` will continue to work, but is deprecated)
|
||||
* Make wysiwyg editors work in the repeatable groups context. A standard repeatable (non-group) wysiwyg field is not supported (but will possibly be included in a future update). Props [@johnsonpaul1014](https://github.com/johnsonpaul1014) ([#26](https://github.com/CMB2/CMB2/pull/26), [#99](https://github.com/CMB2/CMB2/pull/99), [#260](https://github.com/CMB2/CMB2/pull/260), [#264](https://github.com/CMB2/CMB2/pull/264), [#356](https://github.com/CMB2/CMB2/pull/356), [#431](https://github.com/CMB2/CMB2/pull/431), [#462](https://github.com/CMB2/CMB2/pull/462), [#657](https://github.com/CMB2/CMB2/pull/657), [#693](https://github.com/CMB2/CMB2/pull/693)).
|
||||
* Add an id to the heading tag in the title field. This allows linking to a particular title using the id.
|
||||
* Internationalization improvements. Props [ramiy](https://github.com/ramiy) ([#696](https://github.com/CMB2/CMB2/pull/696)).
|
||||
* Ensure that saving does not happen during a switch-to-blog session, as data would be saved to the wrong object. [See more](https://wordpress.org/support/topic/bug-in-lastest-version?replies=2).
|
||||
* Add `'cmb2_group_wrap_attributes'` filter to modifying the group wrap div's attributes. Filter gets passed an array of attributes and expects the return to be an array. Props [jrfnl](https://github.com/jrfnl) ([#582](https://github.com/CMB2/CMB2/pull/582)).
|
||||
* Update the unit-tests README and inline docs. Props [bobbingwide](https://github.com/bobbingwide) ([#714](https://github.com/CMB2/CMB2/pull/714), [#715](https://github.com/CMB2/CMB2/pull/715)).
|
||||
* Minor update to make naming-conventions consistent. Props [ramiy](https://github.com/ramiy) ([#718](https://github.com/CMB2/CMB2/pull/718)).
|
||||
* Update files to be compatible with PHP7 CodeSniffer standards. Props [ryanshoover](https://github.com/ryanshoover) ([#719](https://github.com/CMB2/CMB2/pull/719), [#720](https://github.com/CMB2/CMB2/pull/720)).
|
||||
* Make exception message translatable. Props [ramiy](https://github.com/ramiy) ([#724](https://github.com/CMB2/CMB2/pull/724)).
|
||||
* Portuguese translation provided by [@alvarogois](https://github.com/alvarogois) and [@pedro-mendonca](https://github.com/pedro-mendonca) - [#709](https://github.com/CMB2/CMB2/pull/709), [#727](https://github.com/CMB2/CMB2/pull/727).
|
||||
* Stop using `$wp_version` global. Props [ramiy](https://github.com/ramiy) ([#731](https://github.com/CMB2/CMB2/pull/731)).
|
||||
* Closures (anonymous functions) are now supported for any box/field `'*_cb'` parameters. E.g.
|
||||
```php
|
||||
...
|
||||
'show_on_cb' => function( $cmb ) { return has_tag( 'cats', $cmb->object_id ); },
|
||||
...
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* If custom field types use a method and the Type object has not been instantiated, Try to guess the Type object and instantiate.
|
||||
* Normalize WordPress root path (`ABSPATH`) and theme rooth path (`get_theme_root()`). Props [@rianbotha](https://github.com/rianbotha) ([#677](https://github.com/CMB2/CMB2/pull/677), [#676](https://github.com/CMB2/CMB2/pull/676)).
|
||||
* Fix issue with `'cmb2_remove_row'` Javascript callback for non-group row removal. Fixes [#729](https://github.com/CMB2/CMB2/pull/729)).
|
||||
* Fix issue with missing assignment of variable (undefined variable). Props [@anhskohbo](https://github.com/anhskohbo) ([#779](https://github.com/CMB2/CMB2/pull/779)).
|
||||
|
||||
## 2.2.2.1 - 2016-06-27
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue that kept CMB2 stylesheet from being enqueued when using the [options-page snippets](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/options-and-settings-pages).
|
||||
* Fix issue which caused the CMB2 column display styles to be enqueued in the wrong pages. Now only enqueues on admin pages with columns.
|
||||
|
||||
## 2.2.2 - 2016-06-27
|
||||
|
||||
### Enhancements
|
||||
|
||||
* You can now set admin post-listing columns with an extra field parameter, `'column' => true,`. If you want to dictate what position the column is, use `'column' => array( 'position' => 2 ),`. If you want to dictate the column title (instead of using the field `'name'` value), use `'column' => array( 'name' => 'My Column' ),`. If you need to specify the column display callback, set the `'display_cb'` parameter to [a callback function](https://github.com/CMB2/CMB2/wiki/Field-Parameters#render_row_cb). Columns work for post (all post-types), comment, user, and term object types.
|
||||
* Updated Datepicker styles using JJJ's "jQuery UI Datepicker CSS for WordPress", so props Props [@stuttter](https://github.com/stuttter), [@johnjamesjacoby](https://github.com/johnjamesjacoby). Also cleaned up the timepicker styles (specifically the buttons) to more closely align with the datepicker and WordPress styles.
|
||||
* CMB2 is now a lot more intelligent about where it is located in your installation. This update should solve almost all of the reasons to use the `'cmb2_meta_box_url'` filter (thought it will continue to work as expected). ([#27](https://github.com/CMB2/CMB2/issues/27), [#118](https://github.com/CMB2/CMB2/issues/118), [#432](https://github.com/CMB2/CMB2/issues/432), [related wiki item](https://github.com/CMB2/CMB2/wiki/Troubleshooting#cmb2-urls-issues))
|
||||
* Implement CMB2_Ajax as a singleton. Props [jrfnl](https://github.com/jrfnl) ([#602](https://github.com/CMB2/CMB2/pull/602)).
|
||||
* Add `classes` and `classes_cb` CMB2 box params which allows you to add additional classes to the cmb-wrap. The `classes` parameter can take a string or array, and the `classes_cb` takes a callback which returns a string or array. The callback will receive `$cmb` as an argument. These classes are also passed through a new filter, `'cmb2_wrap_classes'`, which receives the array of classes as the first argument, and the CMB2 object as the second. Reported/requested in [#364](https://github.com/CMB2/CMB2/issues/364#issuecomment-213223692).
|
||||
* Make the `'title'` field type accept extra arguments. Props [@vladolaru](https://github.com/vladolaru), [@pixelgrade](https://github.com/pixelgrade) ([#656](https://github.com/CMB2/CMB2/pull/656)).
|
||||
* Updated `cmb2_get_oembed()` function to NOT return the "remove" link, as it's intended for outputting the oembed only. **This is a backwards-compatibility concern.** If you were depending on the "remove" link, use `cmb2_ajax()->get_oembed( $args )` instead.
|
||||
* New function, `cmb2_do_oembed()`', which is hooked to `'cmb2_do_oembed'`, so you can use `do_action( 'cmb2_do_oembed', $args )` in your themes without `function_exists()` checks.
|
||||
* New method, `CMB2:set_prop( $property, $value )`, for setting a CMB2 metabox object property.
|
||||
* The `CMB2_Field` object instances will now have a `cmb_id` property and a `get_cmb` method to enable access to the field's `CMB2` parent object's instance, in places like field callbacks and filters (e.g. `$cmb = $field->get_cmb();`).
|
||||
* Add a `data-fieldtype` attribute to the field rows for simpler identification in Javascript.
|
||||
* Moved each type in `CMB2_Types` to it's own class so that each field type can handle it's own field display, and added the infrastructure to maintainn back-compatibility.
|
||||
* New `CMB2_Utils` methods, `notempty()` and `filter_empty()`, both of which consider `null`, `''` and `false` as empty, but allow `0` (for saving `0` as a field value).
|
||||
* New `CMB2_Utils` public methods, `get_url_from_dir()`, `get_file_ext()`, `get_file_name_from_path()`, and `wp_at_least()`.
|
||||
* Add a `cmb_pre_init` Javascript event to allow overriding CMB2 defaults via JS.
|
||||
|
||||
### Bug Fixes
|
||||
* Fix issue with 'default' callback not being applied in all instances. Introduced new `CMB2_Field::get_default()` method, and `'default_cb'` field parameter. Using the `'default'` field parameter with a callback will be deprecated in the next few releases. ([#572](https://github.com/CMB2/CMB2/issues/572)).
|
||||
* Be sure to call `CMB2_Field::row_classes()` for group field rows. Also, update CSS to use the "cmb-type-group" classname instead of "cmb-repeat-group-wrap".
|
||||
* Introduce new `'text'` and `'text_cb'` field parameters for overriding CMB2 text strings instead of using the `'options'` array. ([#630](https://github.com/CMB2/CMB2/pull/630))
|
||||
* Fix bug where the value of '0' could not be saved in group fields.
|
||||
* Fix bug where a serialized empty array value in the database for a repeatable field would output as "Array".
|
||||
* Allow for optional/empty money field. Props [@jrfnl](https://github.com/jrfnl) ([#577](https://github.com/CMB2/CMB2/pull/577)).
|
||||
* The `CMB2::$updated` parameter (which contains field ids for all fields updated during a save) now also correctly adds group field ids to the array.
|
||||
|
||||
## 2.2.1 - 2016-02-29
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixes back-compatibility issue which could allow multiple CMB2 instances to load (causing fatal errors). ([#520](https://github.com/CMB2/CMB2/pull/520))
|
||||
|
||||
## 2.2.0 - 2016-02-27
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Term Meta! As of WordPress 4.4, [WordPress will have the ability to use term metadata](https://make.wordpress.org/core/2015/10/23/4-4-taxonomy-roundup/). CMB2 will work with term meta out of the box. To do so, see the example cmb registration in the `yourprefix_register_taxonomy_metabox` function in [example-functions.php](https://github.com/CMB2/CMB2/blob/master/example-functions.php).
|
||||
* New hooks which hook in after save field action: `'cmb2_save_field'` and `"cmb2_save_field_{$field_id}"`. Props [wpsmith](https://github.com/wpsmith) ([#475](https://github.com/CMB2/CMB2/pull/475)).
|
||||
* The "cmb2_sanitize_{$field_type}" hook now runs for every field type (not just custom types) so you can override the sanitization for all field types via a filter.
|
||||
* `CMB2::show_form()` is now composed of 3 smaller methods, `CMB2::render_form_open()`, `CMB2::render_field()`, `CMB2::render_form_close()` ([#506](https://github.com/CMB2/CMB2/pull/506)).
|
||||
* RTL Style generated. Props [@devinsays](https://github.com/devinsays) ([#510](https://github.com/CMB2/CMB2/pull/510)).
|
||||
* Properly scope date/time-pickers styling by adding a class to only cmb2 picker instances. ([#527](https://github.com/CMB2/CMB2/pull/527))
|
||||
* Allow per-field overrides for the date/time/color picker options (wiki documentation: [Modify Field Date, Time, or Color Picker options](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#modify-field-date-time-or-color-picker-options))
|
||||
* Fix some inline documentation issues. Props [@jrfnl](https://github.com/jrfnl) ([#579](https://github.com/CMB2/CMB2/pull/579)).
|
||||
* Include `.gitattributes` file for excluding development resources when using Composer. Props [@benoitchantre](https://github.com/benoitchantre) ([#575](https://github.com/CMB2/CMB2/pull/575), [#53](https://github.com/CMB2/CMB2/pull/53)).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed issue with `'taxonomy_select'` field type where a term which evaluated falsey would not be displayed properly. Props [adamcapriola](https://github.com/adamcapriola) ([#477](https://github.com/CMB2/CMB2/pull/477)).
|
||||
* Fix issue with colorpickers not changing when sorting groups.
|
||||
* `'show_option_none'` field parameter now works on taxonomy fields when explicitly setting to false.
|
||||
* Fix so the date/time-picker javascript respects the `'date_format'` and `'time_format'` field parameters. Props [@yivi](https://github.com/yivi) ([#39](https://github.com/CMB2/CMB2/pull/39), [#282](https://github.com/CMB2/CMB2/pull/282), [#300](https://github.com/CMB2/CMB2/pull/300), [#318](https://github.com/CMB2/CMB2/pull/318), [#330](https://github.com/CMB2/CMB2/pull/330), [#446](https://github.com/CMB2/CMB2/pull/446), [#498](https://github.com/CMB2/CMB2/pull/498)).
|
||||
* Fix a sometimes-broken unit test. Props [JPry](https://github.com/JPry) ([#539](https://github.com/CMB2/CMB2/pull/539)).
|
||||
* Fix issue with oembed fields not working correctly on options pages. ([#542](https://github.com/CMB2/CMB2/pull/542)).
|
||||
* Fix issue with repeatable field <button> elements stealing focus from "submit" button.
|
||||
|
||||
## 2.1.2 - 2015-10-01
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixes back-compatibility issue when adding fields array to the metabox registration. ([#472](https://github.com/CMB2/CMB2/pull/472))
|
||||
|
||||
## 2.1.1 - 2015-09-30
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Make all CMB2::save_fields arguments optional to fall-back to `$_POST` data. Props [JPry](https://github.com/JPry).
|
||||
* New filter, `cmb2_non_repeatable_fields` for adding additional fields to the blacklist of repeatable field-types. Props [JPry](https://github.com/JPry) ([#430](https://github.com/CMB2/CMB2/pull/430)).
|
||||
* New recommended hook for adding metaboxes, `cmb2_admin_init`. Most metabox registration only needs to happen if in wp-admin, so there is no reason to register them when loading the front-end (and increase the memory usage). `cmb2_init` still exists to register metaboxes that will be used on the front-end or used on both the front and back-end. Instances of `cmb2_init` in example-functions.php have been switched to `cmb2_admin_init`.
|
||||
* Add `'render_row_cb'` field parameter for overriding the field render method.
|
||||
* Add `'label_cb'` field parameter for overriding the field label render method.
|
||||
* Allow `CMB2_Types::checkbox()` method to be more flexible for extending by taking an args array and an `$is_checked` second argument.
|
||||
* More thorough unit tests. Props [pglewis](https://github.com/pglewis), ([#447](https://github.com/CMB2/CMB2/pull/447),[#448](https://github.com/CMB2/CMB2/pull/448)).
|
||||
* Update `CMB2_Utils::image_id_from_url` to be more reliable. Props [wpscholar](https://github.com/wpscholar), ([#453](https://github.com/CMB2/CMB2/pull/453)).
|
||||
* `cmb2_get_option` now takes a default fallback value as a third parameter.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Address issue where `'file'` and `'file_list'` field results were getting mixed. Props [augustuswm](https://github.com/augustuswm) ([#382](https://github.com/CMB2/CMB2/pull/382), [#250](https://github.com/CMB2/CMB2/pull/250), [#296](https://github.com/CMB2/CMB2/pull/296)).
|
||||
* Fix long-standing issues with radio and multicheck fields in repeatable groups losing their values when new rows are added. ([#341](https://github.com/CMB2/CMB2/pull/341), [#304](https://github.com/CMB2/CMB2/pull/304), [#263](https://github.com/CMB2/CMB2/pull/263), [#246](https://github.com/CMB2/CMB2/pull/246), [#150](https://github.com/CMB2/CMB2/pull/150))
|
||||
* Fixes issue where currently logged-in user's profile data would display in the "Add New User" screen fields. ([#427](https://github.com/CMB2/CMB2/pull/427))
|
||||
* Fixes issue where radio values/selections would not always properly transfer when shifting rows (up/down). Props [jamiechong](https://github.com/jamiechong) ([#429](https://github.com/CMB2/CMB2/pull/429), [#152](https://github.com/CMB2/CMB2/pull/152)).
|
||||
* Fixes issue where repeatable groups display "Array" as the field values if group is left completely empty. ([#332](https://github.com/CMB2/CMB2/pull/332),[#390](https://github.com/CMB2/CMB2/pull/390)).
|
||||
* Fixes issue with `'file_list'` fields not saving properly when in repeatable groups display. Props [jamiechong](https://github.com/jamiechong) ([#433](https://github.com/CMB2/CMB2/pull/433),[#187](https://github.com/CMB2/CMB2/pull/187)).
|
||||
* Update `'taxonomy_radio_inline'` and `'taxonomy_multicheck_inline'` fields sanitization method to use the same method as the non-inline versions. Props [superfreund](https://github.com/superfreund) ([#454](https://github.com/CMB2/CMB2/pull/454)).
|
||||
|
||||
## 2.1.0 - 2015-08-05
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix user fields not saving. Props [achavez](https://github.com/achavez), ([#417](https://github.com/CMB2/CMB2/pull/417)).
|
||||
|
||||
## 2.0.9 - 2015-07-28
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Updated/Added many translations. Props [fxbenard](https://github.com/fxbenard), ([#203](https://github.com/CMB2/CMB2/pull/344)) and [Mte90](https://github.com/Mte90) for the Italian translation.
|
||||
* Updated `'file_list'` field type to have a more intuitive selection in the media library, and updated the 'Use file' text in the button. Props [SteveHoneyNZ](https://github.com/SteveHoneyNZ) ([#357](https://github.com/CMB2/CMB2/pull/357), [#358](https://github.com/CMB2/CMB2/pull/358)).
|
||||
* `'closed'` group field option parameter introduced in order to set the groups as collapsed by default. Requested in [#391](https://github.com/CMB2/CMB2/issues/391).
|
||||
* Added `"cmb2_{$object_type}_process_fields_{$cmb_id}"` hook for hooking in and modifying the metabox or fields before the fields are processed/sanitized for saving.
|
||||
* Added Comment Metabox support. Props [GregLancaster71](https://github.com/GregLancaster71) ([#238](https://github.com/CMB2/CMB2/pull/238), [#244](https://github.com/CMB2/CMB2/pull/244)).
|
||||
* New `"cmb2_{$field_id}_is_valid_img_ext"`` filter for determining if a field value has a valid image file-type extension.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `'multicheck_inline'`, `'taxonomy_radio_inline'`, and `'taxonomy_multicheck_inline'` field types were not outputting anything since it's value was not being returned. Props [ediamin](https://github.com/ediamin), ([#367](https://github.com/CMB2/CMB2/pull/367), ([#405](https://github.com/CMB2/CMB2/pull/405)).
|
||||
* `'hidden'` type fields were not honoring the `'show_on_cb'` callback. Props [JPry](https://github.com/JPry), ([commits](https://github.com/CMB2/CMB2/compare/5a4146eec546089fbe1a1c859d680dfda3a86ee2...1ef5ef1e3b2260ab381090c4abe9dc7234cfa0a6)).
|
||||
* Fixed: There was no minified cmb2-front.min.css file.
|
||||
* Fallback for fatal error with invalid timezone. Props [ryanduff](https://github.com/ryanduff) ([#385](https://github.com/CMB2/CMB2/pull/385)).
|
||||
* Fix issues with deleting a row from repeatable group. Props [yuks](https://github.com/yuks) ([#387](https://github.com/CMB2/CMB2/pull/387)).
|
||||
* Ensure value passed to `strtotime` in `make_valid_time_stamp` is cast to a string. Props [vajrasar](https://github.com/vajrasar) ([#389](https://github.com/CMB2/CMB2/pull/389)).
|
||||
* Fixed issue with Windows IIS and bundling CMB2 in the theme. Props [DevinWalker](https://github.com/DevinWalker), ([#400](https://github.com/CMB2/CMB2/pull/400), [#401](https://github.com/CMB2/CMB2/pull/401))
|
||||
|
||||
## 2.0.8 - 2015-06-01
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix color-picker field not enqueueing the colorpicker script. ([#333](https://github.com/CMB2/CMB2/issues/333))
|
||||
|
||||
## 2.0.7 - 2015-05-28
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Ability to use non-repeatable group fields by setting the `'repeatable'` field param to `false` when registering a group field type. Props [marcusbattle](https://github.com/marcusbattle), ([#159](https://github.com/CMB2/CMB2/pull/159)).
|
||||
* Add and enqeueue a front-end specific CSS file which adds additional styles which are typically covered by wp-admin css. ([#311](https://github.com/CMB2/CMB2/issues/311))
|
||||
* Better handling of the CMB2 javascript (and CSS) required dependencies array. Dependencies are now only added conditionally based on the field types that are actually visible. ([#136](https://github.com/CMB2/CMB2/issues/136))
|
||||
* **THIS IS A BREAKING CHANGE:** The `group` field type's `'show_on_cb'` parameter now receives the `CMB2_Field` object instance as an argument instead of the `CMB2` instance. If you're using the `'show_on_cb'` parameter for a `group` field, please adjust accordingly. _note: you can still retrieve the `CMB2` instance via the `cmb2_get_metabox` helper function._
|
||||
* New dynamic hook, `"cmb2_save_{$object_type}_fields_{$this->cmb_id}"`, to complement the existing `"cmb2_save_{$object_type}_fields"` hook.
|
||||
* New CMB2 parameter, `enqueue_js`, to disable the enqueueing of the CMB2 Javascript.
|
||||
* German translation provided by Friedhelm Jost.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix incorrect repeatable group title number. ([#310](https://github.com/CMB2/CMB2/pull/310))
|
||||
* Fix obscure bug which prevented group field arguments from being passed to the sub-fields (like `show_names` and `context`).
|
||||
* Fixed occasional issue when adding a group row, the previous row's content would be cloned. ([#257](https://github.com/CMB2/CMB2/pull/257))
|
||||
|
||||
## 2.0.6 - 2015-04-30
|
||||
|
||||
### Enhancements
|
||||
|
||||
* New metabox/form parameter, `show_on_cb`, allows you to conditionally display a cmb metabox/form via a callback. The `$cmb` object gets passed as a parameter to the callback. This complements the `'show_on_cb'` parameter that already exists for individual fields. Using this callback is similar to using the `'cmb2_show_on'` filter, but only applies to that specific metabox and it is recommended to use this callback instead as it minimizes th risk that your filter will affect other metaboxes.
|
||||
* Taxonomy types no longer save a value. The value getting saved was causing confusion and is not meant to be used. To use the saved taxonomy data, you need to use the WordPress term api, `get_the_terms `, `get_the_term_list`, etc.
|
||||
* Add `'multiple'` field parameter to store values in individual rows instead of serialized array. Will only work if field is not repeatable or a repeatable group. Props [JohnyGoerend](https://github.com/JohnyGoerend). ([#262](https://github.com/CMB2/CMB2/pull/262), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
|
||||
* Portuguese (Brazil) translation provided by [@lucascdsilva](https://github.com/lucascdsilva) - [#293](https://github.com/CMB2/CMB2/pull/293).
|
||||
* Spanish (Spain) translation updated by [@yivi](https://github.com/yivi) - [#272](https://github.com/CMB2/CMB2/pull/272).
|
||||
* Added group field callback parameters, `'before_group'`, `'before_group_row'`, `'after_group_row'`, `'after_group'` to complement the `'before_row'`, `'before'`, `'after'`, `'after_row'` field parameters.
|
||||
* Better styling for `title` fields and `title` descriptions on options pages.
|
||||
* Add a `sanitization_cb` field parameter check for the `group` field type.
|
||||
* Better function/file doc-blocks to provide better documentation for automated documentation tools. See: [cmb2.io/api](http://cmb2.io/api/).
|
||||
* `cmb2_print_metabox_form`, `cmb2_metabox_form`, and `cmb2_get_metabox_form` helper functions now accept two new parameters:
|
||||
* an `'object_type'` parameter to explictly set that in the `$cmb` object.
|
||||
* an `'enqueue_js'` parameter to explicitly disable the CMB JS enqueue. This is handy if you're not planning on using any of the fields which require JS (like color/date pickers, wysiwyg, file, etc).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue with oembed fields in repeatable groups where changing video changed it for all fields in a group.
|
||||
* Fix empty arrays (like in the group field) saving as a value.
|
||||
* Move `'cmb2_override_meta_value'` and `"cmb2_override_{$field_id}_meta_value"` filters to the `CMB2_Field::get_data()` method so that the filters are applied every time the data is requested. **THIS IS A BREAKING CHANGE:** The parameters for those filters have changed a bit. Previously, the filters accepted 5 arguments, `$value`, `$object_id`, `$field_args`, `$object_type`, `$field`. They have changed to accept 4 arguments instead, `$value`, `$object_id`, `$args`, `$field`, where `$args` is an array that contains the following:
|
||||
* @type string $type The current object type
|
||||
* @type int $id The current object ID
|
||||
* @type string $field_id The ID of the field being requested
|
||||
* @type bool $repeat Whether current field is repeatable
|
||||
* @type bool $single Whether current field is a single database row
|
||||
|
||||
|
||||
## 2.0.5 - 2015-03-17
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix grouped fields display (first field was being repeated), broken in 2.0.3.
|
||||
|
||||
## 2.0.4 - 2015-03-16
|
||||
|
||||
### Enhancements
|
||||
|
||||
* `select`, `radio`, `radio_inline` field types now all accept the `'show_option_none'` field parameter. This parameter allows you to set the text to display for showing a 'no selection' option. Default will be `false`, which means a 'none' option will not be added. Set to `true` to use the default text, 'None', or specify another value, i.e. 'No selection'.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix back-compatibility when adding group field sub-fields via old array method (vs using the `CMB2:add_group_field()` method). Thanks to [norcross](https://github.com/norcross) for reporting.
|
||||
* Fix occasional jQuery issues with group-field indexes.
|
||||
|
||||
## 2.0.3 - 2015-03-15
|
||||
|
||||
### Enhancements
|
||||
|
||||
* New constant, `CMB2_DIR`, which stores the file-path to the CMB2 directory.
|
||||
* `text_date`, `text_time`, `text_date_timestamp`, `text_datetime_timestamp`, and ` text_datetime_timestamp_timezone` field types now take an arguments array so they can be extended by custom field types.
|
||||
* Removed auto-scroll when adding groups. To re-add the feature, use the [snippet/plugin here](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/javascript/cmb2-auto-scroll-to-new-group.php). ([#205](https://github.com/CMB2/CMB2/issues/205))
|
||||
* Updated Timepicker utilizing the [@trentrichardson](https://github.com/trentrichardson) jQuery Timepicker add-on (https://github.com/trentrichardson/jQuery-Timepicker-Addon), and updated Datepicker styles. Props [JonMasterson](https://github.com/JonMasterson). ([#204](https://github.com/CMB2/CMB2/issues/204), [#206](https://github.com/CMB2/CMB2/issues/206), [#45](https://github.com/CMB2/CMB2/issues/45)).
|
||||
* Added a callback option for the field default value. The callback gets passed an array of all the field parameters as the first argument, and the field object as the second argument. (which means you can get the post id using `$field->object_id`). ([#233](https://github.com/CMB2/CMB2/issues/233)).
|
||||
* New `CMB2::get_field()` method and `cmb2_get_field` helper function for retrieving a `CMB2_Field` object from the array of registered fields for a metabox.
|
||||
* New `CMB2::get_sanitized_values()` method and `cmb2_get_metabox_sanitized_values` helper function for retrieving sanitized values from an array of values (usually `$_POST` data).
|
||||
* New `'save_fields'` metabox parameter that can be used to disable (by setting `'save_fields' => false`) the automatic saving of the fields when the form is submitted. These can be useful when you want to handle the saving of the fields yourself, or want to use submitted data for other purposes like generating new posts, or sending emails, etc.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix commented out text_datetime_timestamp_timezone field registration example in `example-functions.php`. Props [cliffordp](https://github.com/cliffordp), ([#203](https://github.com/CMB2/CMB2/pull/203)).
|
||||
* Fix sidebar styling for money fields and fields with textareas. ([#234](https://github.com/CMB2/CMB2/issues/234))
|
||||
* Fix `CMB2_Sanitize` class to properly use the stripslashed value (which was added in [#162](https://github.com/CMB2/CMB2/pull/162) but never used). Props [dustyf](https://github.com/dustyf), ([#241](https://github.com/CMB2/CMB2/pull/241)).
|
||||
|
||||
## 2.0.2 - 2015-02-15
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Use the more appropriate `add_meta_boxes` hook for hooking in metaboxes to post-edit screen. Thanks [@inspiraaz](https://github.com/inspiraaz) for reporting. ([#161](https://github.com/CMB2/CMB2/issues/161))
|
||||
* Add a `row_classes` field param which allows you to add additional classes to the cmb-row wrap. This parameter can take a string, or array, or can take a callback that returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. Reported/requested in [#68](https://github.com/CMB2/CMB2/issues/68).
|
||||
* New constant, `CMB2_LOADED`, which you can use to check if CMB2 is loaded for your plugins/themes with CMB2 dependency.
|
||||
* New hooks, [`cmb2_init_before_hookup` and `cmb2_after_init`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions).
|
||||
* New API for adding metaboxes and fields, demonstrated in [`example-functions.php`](https://github.com/CMB2/CMB2/blob/master/example-functions.php). In keeping with backwards-compatibility, the `cmb2_meta_boxes` filter method will still work, but is not recommended. New API includes `new_cmb2_box` helper function to generate a new metabox, and returns a `$cmb` object to add new fields (via the `CMB2::add_field()` and `CMB2::add_group_field()` methods).
|
||||
* New CMB2 method, [`CMB2::remove_field()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_%24cmb_id-remove-field.php).
|
||||
* New CMB2_Boxes method, [`CMB2_Boxes::remove()`](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_before_hookup-remove-cmb2-metabox.php).
|
||||
* When clicking on a file/image in the `file`, or `file_list` type, the media modal will open with that image selected. Props [johnsonpaul1014](https://github.com/johnsonpaul1014), ([#120](https://github.com/CMB2/CMB2/pull/120)).
|
||||
|
||||
|
||||
## 2.0.1 - 2015-02-02
|
||||
|
||||
2.0.1 is the official version after beta, and includes all the changes from 2.0.0 (beta).
|
||||
|
||||
## 2.0.0(beta) - 2014-08-16
|
||||
|
||||
2.0.0 is the official version number for the transition to CMB2, and 2.0.1 is the official version after beta. It is a complete rewrite. Improvements and fixes are listed below. __Note: This release requires WordPress 3.8+__
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Converted `<table>` markup to more generic `<div>` markup to be more extensible and allow easier styling.
|
||||
* Much better handling and display of repeatable groups.
|
||||
* Entirely translation-ready [with full translations](http://wp-translations.org/project/cmb2/) in Spanish, French (Props [@fredserva](https://github.com/fredserva) - [#127](https://github.com/CMB2/CMB2/pull/127)), Finnish (Props [@onnimonni](https://github.com/onnimonni) - [#108](https://github.com/CMB2/CMB2/pull/108)), Swedish (Props [@EyesX](https://github.com/EyesX) - [#141](https://github.com/CMB2/CMB2/pull/141)), and English.
|
||||
* Add cmb fields to new user page. Props [GioSensation](https://github.com/GioSensation), ([#645](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/645)).
|
||||
* Improved and additional [helper-functions](https://github.com/CMB2/CMB2/blob/master/includes/helper-functions.php).
|
||||
* Added new features and translation for datepicker. Props [kalicki](https://github.com/kalicki), ([#657](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/657)).
|
||||
* General code standards cleanup. Props [gregrickaby](https://github.com/gregrickaby), ([#17](https://github.com/CMB2/CMB2/pull/17) & others).
|
||||
* Use SASS for development. Props [gregrickaby](https://github.com/gregrickaby), ([#18](https://github.com/CMB2/CMB2/pull/18)).
|
||||
* New `hidden` field type.
|
||||
* [Ability to override text strings in fields via field options parameter](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#override-text-strings-in-field).
|
||||
* Added composer.json. Props [nlemoine](https://github.com/nlemoine), ([#19](https://github.com/CMB2/CMB2/pull/19)).
|
||||
* New field 'hooks' can take [static text/html](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-static-content-in-a-field) or a [callback](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#inject-dynamic-content-in-a-field-via-a-callback).
|
||||
* New `preview_size` parameter for `file` field type. Takes an array or named image size.
|
||||
* Empty index.php file to all folders (for more security). Props [brunoramalho](https://github.com/brunoramalho), ([#41](https://github.com/CMB2/CMB2/pull/41)).
|
||||
* Clean up styling. Props [brunoramalho](https://github.com/brunoramalho), ([#43](https://github.com/CMB2/CMB2/pull/43)) and [senicar](https://github.com/senicar).
|
||||
* Collapsible field groups. Props [cluke009](https://github.com/cluke009), ([#59](https://github.com/CMB2/CMB2/pull/59)).
|
||||
* Allow for override of update/remove for CMB2_Field. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#65](https://github.com/CMB2/CMB2/pull/65)).
|
||||
* Use class button-disabled instead of disabled="disabled" for <a> buttons. Props [sc0ttkclark](https://github.com/sc0ttkclark), ([#66](https://github.com/CMB2/CMB2/pull/66)).
|
||||
* [New before/after dynamic form hooks](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-the-dynamic-beforeafter-form-hooks).
|
||||
* Larger unit test coverage. Props to [@pmgarman](https://github.com/pmgarman) for assistance. ([#90](https://github.com/CMB2/CMB2/pull/90) and [#91](https://github.com/CMB2/CMB2/pull/91))
|
||||
* Added helper function to update an option. Props [mAAdhaTTah](https://github.com/mAAdhaTTah), ([#110](https://github.com/CMB2/CMB2/pull/110)).
|
||||
* More JS hooks during repeat group shifting. Props [AlchemyUnited](https://github.com/AlchemyUnited), ([#125](https://github.com/CMB2/CMB2/pull/125)).
|
||||
* [New metabox config option for defaulting to closed](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#setting-a-metabox-to-closed-by-default).
|
||||
* New hooks, [`cmb2_init`](https://github.com/CMB2/CMB2/wiki/Tips-&-Tricks#using-cmb2-helper-functions-and-cmb2_init) and `cmb2_init_{$cmb_id}`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* New mechanism to ensure CMB2 only loads the most recent version of CMB2 in your system. This fixes the issue where another bundled version could conflict or take precendent over your up-to-date version.
|
||||
* Fix issue with field labels being hidden. Props [mustardBees](https://github.com/mustardBees), ([#48](https://github.com/CMB2/CMB2/pull/48)).
|
||||
* Address issues with autoloading before autoloader is setup. Props [JPry](https://github.com/JPry), ([#56](https://github.com/CMB2/CMB2/pull/56)).
|
||||
* Fixed 'show_on_cb' for field groups. Props [marcusbattle](https://github.com/marcusbattle), ([#98](https://github.com/CMB2/CMB2/pull/98)).
|
||||
* Make get_object_terms work with and without object caching. Props [joshlevinson](https://github.com/joshlevinson), ([#105](https://github.com/CMB2/CMB2/pull/105)).
|
||||
* Don't use `__DIR__` in example-functions.php to ensure PHP 5.2 compatibility. Props [bryceadams](https://github.com/bryceadams), ([#129](https://github.com/CMB2/CMB2/pull/129)).
|
||||
* Added support for radio input swapping in repeatable fields. Props [DevinWalker](https://github.com/DevinWalker), ([#138](https://github.com/CMB2/CMB2/pull/138), [#149](https://github.com/CMB2/CMB2/pull/149)).
|
||||
* Fix metabox form not being returned to caller. Props [akshayagarwal](https://github.com/akshayagarwal), ([#145](https://github.com/CMB2/CMB2/pull/145)).
|
||||
* Run stripslashes before saving data, since WordPress forces magic quotes. Props [clifgriffin](https://github.com/clifgriffin), ([#162](https://github.com/CMB2/CMB2/pull/162)).
|
||||
|
||||
## 1.3.0 - (never released, merged into CMB2)
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Localize Date, Time, and Color picker defaults so that they can be overridden via the `cmb_localized_data` filter. ([#528](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/528))
|
||||
* Change third parameter for 'cmb_metabox_form' to be an args array. Optional arguments include `echo`, `form_format`, and `save_button`.
|
||||
* Add support for `show_option_none` argument for `taxonomy_select` and `taxonomy_radio` field types. Also adds the following filters: `cmb_all_or_nothing_types`, `cmb_taxonomy_select_default_value`, `cmb_taxonomy_select_{$this->_id()}_default_value`, `cmb_taxonomy_radio_{$this->_id()}_default_value`, `cmb_taxonomy_radio_default_value`. Props [@pmgarman](https://github.com/pmgarman), ([#569](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/569)).
|
||||
* Make the list items in the `file_list` field type drag & drop sortable. Props [twoelevenjay](https://github.com/twoelevenjay), ([#603](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/603)).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed typo in closing `</th>` tag. Props [@CivicImages](https://github.com/CivicImages). ([#616](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/616))
|
||||
|
||||
## 1.2.0 - 2014-05-03
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Add support for custom date/time formats. Props [@Scrent](https://github.com/Scrent). ([#506](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/506))
|
||||
* Simplify `wysiwyg` escaping and allow it to be overridden via the `escape_cb` parameter. ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/491))
|
||||
* Add a 'Select/Deselect all' button for the `multicheck` field type.
|
||||
* Add title option for [repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group). Title field takes an optional replacement hash, "{#}" that will be replaced by the row number.
|
||||
* New field parameter, `show_on_cb`, allows you to conditionally display a field via a callback. ([#47](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/47))
|
||||
* Unit testing (the beginning). Props [@brichards](https://github.com/brichards) and [@camdensegal](https://github.com/camdensegal).
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed issue where remove file button wouldn't clear the url field. ([#514](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/514))
|
||||
* `wysiwyg` fields now allow underscores. Fixes some wysiwyg display issues in WordPress 3.8. Props [@lswilson](https://github.com/lswilson). ([#491](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/491))
|
||||
* Nonce field should only be added once per page. ([#521](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/521))
|
||||
* Fix `in_array` issue when a post does not have any saved terms for a taxonomy multicheck. ([#527](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/527))
|
||||
* Fixed error: 'Uninitialized string offset: 0 in cmb_Meta_Box_field.php...`. Props [@DevinWalker](https://github.com/DevinWalker). ([#539](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/539), [#549](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/549)))
|
||||
* Fix missing `file` field description. ([#543](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/543), [#547](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/547))
|
||||
|
||||
|
||||
|
||||
## 1.1.3 - 2014-04-07
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update `cmb_get_field_value` function as it was passing the parameters to `cmb_get_field` in the wrong order.
|
||||
* Fix repeating fields not working correctly if meta key or prefix contained an integer. ([#503](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/503))
|
||||
|
||||
## 1.1.2 - 2014-04-05
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix issue with `cmb_Meta_Box_types.php` calling a missing method, `image_id_from_url`. ([#502](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/502))
|
||||
|
||||
|
||||
## 1.1.1 - 2014-04-03
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Radio button values were not showing saved value. ([#500](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/500))
|
||||
|
||||
## 1.1.0 - 2014-04-02
|
||||
|
||||
### Enhancements
|
||||
|
||||
* [Repeatable groups](https://github.com/CMB2/CMB2/wiki/Field-Types#group)
|
||||
* Support for more fields to be repeatable, including oEmbed field, and date, time, and color picker fields, etc.
|
||||
* Codebase has been revamped to be more modular and object-oriented.
|
||||
* New filter, `"cmb_{$element}_attributes" ` for modifying an element's attributes.
|
||||
* Every field now supports an `attributes` parameter that takes an array of attributes. [Read more](https://github.com/CMB2/CMB2/wiki/Field-Types#attributes).
|
||||
* Removed `cmb_std_filter` in favor of `cmb_default_filter`. **THIS IS A BREAKING CHANGE**
|
||||
* Better handling of labels in sidebar. They are now placed on top of the input rather than adjacent.
|
||||
* Added i18n compatibility to text_money. props [@ArchCarrier](https://github.com/ArchCarrier), ([#485](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/485))
|
||||
* New helper functions: `cmb_get_field` and `cmb_get_field_value` for getting access to CMB's field object and/or value.
|
||||
* New JavaScript events, `cmb_add_row` and `cmb_remove_row` for hooking in and manipulating the new row's data.
|
||||
* New filter, `cmb_localized_data`, for modifiying localized data passed to the CMB JS.
|
||||
|
||||
### Bug Fixes
|
||||
* Resolved occasional issue where only the first character of the label/value was diplayed. props [@mustardBees](https://github.com/mustardBees), ([#486](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/486))
|
||||
|
||||
|
||||
## 1.0.2 - 2014-03-03
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Change the way the `'cmb_validate_{$field['type']}'` filter works.
|
||||
It is now passed a null value vs saved value. If null is returned, default sanitization will follow. **THIS IS A BREAKING CHANGE**. If you're already using this filter, take note.
|
||||
* All field types that take an option array have been simplified to take `key => value` pairs (vs `array( 'name' => 'value', 'value' => 'key', )`). This effects the 'select', 'radio', 'radio_inline' field types. The 'multicheck' field type was already using the `key => value` format. Backwards compatibility has been maintained for those using the older style.
|
||||
* Added default value option for `taxonomy_select` field type. props [@darlantc](https://github.com/darlantc), ([#473](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/473))
|
||||
* Added `preview_size` parameter for `file_list` field type. props [@IgorCode](https://github.com/IgorCode), ([#471](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/471))
|
||||
* Updated `file_list` images to be displayed horizontally instead of vertically. props [@IgorCode](https://github.com/IgorCode), ([#467](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/467))
|
||||
* Use `get_the_terms` where possible since the data is cached.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed wysiwyg escaping slashes. props [@gregrickaby](https://github.com/gregrickaby), ([#465](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/465))
|
||||
* Replaced `__DIR__`, as `dirname( __FILE__ )` is easier to maintain back-compatibility.
|
||||
* Fixed missing table styling on new posts. props [@mustardBees](https://github.com/mustardBees), ([#438](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/438))
|
||||
* Fix undeclared JS variable. [@veelen](https://github.com/veelen), ([#451](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/451))
|
||||
* Fix `file_list` errors when removing all files and saving.
|
||||
* Set correct `object_id` to be used later in `cmb_show_on` filter. [@lauravaq](https://github.com/lauravaq), ([#445](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/445))
|
||||
* Fix sanitization recursion memeory issues.
|
||||
|
||||
## 1.0.1 - 2014-01-24
|
||||
|
||||
### Enhancements
|
||||
|
||||
* Now works with option pages and site settings. ([view example in wiki](https://github.com/CMB2/CMB2/wiki/Using-CMB-to-create-an-Admin-Theme-Options-Page))
|
||||
* two filters to override the setting and getting of options, `cmb_override_option_get_$option_key` and `cmb_override_option_save_$option_key` respectively. Handy for using plugins like [WP Large Options](https://github.com/voceconnect/wp-large-options/) ([also here](http://vip.wordpress.com/plugins/wp-large-options/)).
|
||||
* Improved styling on taxonomy (\*tease\*) and options pages and for new 3.8 admin UI.
|
||||
* New sanitization class to sanitize data when saved.
|
||||
* New callback field parameter, `sanitization_cb`, for performing your own sanitization.
|
||||
* new `cmb_Meta_Box_types::esc()` method that handles escaping data for display.
|
||||
* New callback field parameter, `escape_cb`, for performing your own data escaping, as well as a new filter, `'cmb_types_esc_'. $field['type']`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed wysiwyg editor button padding. props [@corvannoorloos](https://github.com/corvannoorloos), ([#391](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/pull/391))
|
||||
* A few php < 5.3 errors were addressed.
|
||||
* Fields with quotation marks no longer break the input/textarea fields.
|
||||
* metaboxes for Attachment pages now save correctly. Thanks [@nciske](https://github.com/nciske) for reporting. ([#412](https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress/issues/412))
|
||||
* Occasionally fields wouldn't save because of the admin show_on filter.
|
||||
* Smaller images loaded to the file field type will no longer be blown up larger than their dimensions.
|
||||
|
||||
## 1.0.0 - 2013-11-30
|
||||
|
||||
* Added `text_datetime_timestamp_timezone` type, a datetime combo field with an additional timezone drop down, props [@dessibelle](https://github.com/dessibelle)
|
||||
* Added `select_timezone` type, a standalone time zone select dropdown. The time zone select can be used with standalone `text_datetime_timestamp` if desired. Props [@dessibelle](https://github.com/dessibelle)
|
||||
* Added `text_url` type, a basic url field. Props [@dessibelle](https://github.com/dessibelle)
|
||||
* Added `text_email` type, a basic email field. Props [@dessibelle](https://github.com/dessibelle)
|
||||
* Added ability to display metabox fields in frontend. Default is true, but can be overriden using the `cmb_allow_frontend filter`. If set to true, an entire metabox form can be output with the `cmb_metabox_form( $meta_box, $object_id, $echo )` function. Props [@dessibelle](https://github.com/dessibelle), [@messenlehner](https://github.com/messenlehner) & [@jtsternberg](https://github.com/jtsternberg).
|
||||
* Added hook `cmb_after_table` after all metabox output. Props [@wpsmith](https://github.com/wpsmith)
|
||||
* `file_list` now works like a repeatable field. Add as many files as you want. Props [@coreymcollins](https://github.com/coreymcollins)
|
||||
* `text`, `text_small`, `text_medium`, `text_url`, `text_email`, & `text_money` fields now all have the option to be repeatable. Props [@jtsternberg](https://github.com/jtsternberg)
|
||||
* Custom metaboxes can now be added for user meta. Add them on the user add/edit screen, or in a custom user profile edit page on the front-end. Props [@tw2113](https://github.com/tw2113), [@jtsternberg](https://github.com/jtsternberg)
|
||||
|
||||
## 0.9.4
|
||||
|
||||
* Added field "before" and "after" options for each field. Solves issue with '$' not being the desired text_money monetary symbol, props [@GaryJones](https://github.com/GaryJones)
|
||||
* Added filter for 'std' default fallback value, props [@messenlehner](https://github.com/messenlehner)
|
||||
* Ensure oEmbed videos fit in their respective metaboxes, props [@jtsternberg](https://github.com/jtsternberg)
|
||||
* Fixed issue where an upload field with 'show_names' disabled wouldn't have the correct button label, props [@jtsternberg](https://github.com/jtsternberg)
|
||||
* Better file-extension check for images, props [@GhostToast](https://github.com/GhostToast)
|
||||
* New filter, `cmb_valid_img_types`, for whitelisted image file-extensions, props [@jtsternberg](https://github.com/jtsternberg)
|
||||
|
||||
## 0.9.3
|
||||
* Added field type and field id classes to each cmb table row, props [@jtsternberg](https://github.com/jtsternberg)
|
||||
|
||||
## 0.9.2
|
||||
* Added post type comparison to prevent storing null values for taxonomy selectors, props [@norcross](https://github.com/norcross)
|
||||
|
||||
## 0.9.1
|
||||
* Added `oEmbed` field type with ajax display, props [@jtsternberg](https://github.com/jtsternberg)
|
||||
|
||||
## 0.9
|
||||
* __Note: This release requires WordPress 3.3+__
|
||||
* Cleaned up scripts being queued, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Cleaned up and reorganized jQuery, props [@GaryJones](https://github.com/GaryJones)
|
||||
* Use $pagenow instead of custom $current_page, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed CSS, removed inline styles, now all in style.css, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed multicheck issues (issue #48), props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed jQuery UI datepicker CSS conflicting with WordPress UI elements, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed zeros not saving in fields, props [@GaryJones](https://github.com/GaryJones)
|
||||
* Fixed improper labels on radio and multicheck fields, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed fields not rendering properly when in sidebar, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Fixed bug where datepicker triggers extra space after footer in Firefox (issue #14), props [@jaredatch](https://github.com/jaredatch)
|
||||
* Added jQuery UI datepicker packaged with 3.3 core, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Added date time combo picker, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Added color picker, props [@jaredatch](https://github.com/jaredatch)
|
||||
* Added readme.md markdown file, props [@jaredatch](https://github.com/jaredatch)
|
||||
|
||||
## 0.8 - 2012-01-19
|
||||
* Added jQuery timepicker, props [@norcross](https://github.com/norcross)
|
||||
* Added 'raw' textarea to convert special HTML entities back to characters, props [@norcross](https://github.com/norcross)
|
||||
* Added missing examples on example-functions.php, props [@norcross](https://github.com/norcross)
|
||||
|
||||
## 0.7
|
||||
* Added the new wp_editor() function for the WYSIWYG dialog box, props [@jcpry](https://github.com/jcpry)
|
||||
* Created 'cmb_show_on' filter to define your own Show On Filters, props [@billerickson](https://github.com/billerickson)
|
||||
* Added page template show_on filter, props [@billerickson](https://github.com/billerickson)
|
||||
* Improvements to the 'file' field type, props [@randyhoyt](https://github.com/randyhoyt)
|
||||
* Allow for default values on 'radio' and 'radio_inline' field types, props [@billerickson](https://github.com/billerickson)
|
||||
|
||||
## 0.6.1
|
||||
* Enabled the ability to define your own custom field types (issue #28). props [@randyhoyt](https://github.com/randyhoyt)
|
||||
|
||||
## 0.6
|
||||
* Added the ability to limit metaboxes to certain posts by id. props [@billerickson](https://github.com/billerickson)
|
||||
|
||||
## 0.5
|
||||
* Fixed define to prevent notices. props [@destos](https://github.com/destos)
|
||||
* Added text_date_timestap option. props [@andrewyno](https://github.com/andrewyno)
|
||||
* Fixed WYSIWYG paragraph breaking/spacing bug. props [@wpsmith](https://github.com/wpsmith)
|
||||
* Added taxonomy_radio and taxonomies_select options. props [@c3mdigital](https://github.com/c3mdigital)
|
||||
* Fixed script causing the dashboard widgets to not be collapsible.
|
||||
* Fixed various spacing and whitespace inconsistencies
|
||||
|
||||
## 0.4
|
||||
* Think we have a release that is mostly working. We'll say the initial release :)
|
||||
@@ -0,0 +1,52 @@
|
||||
# Contributing to CMB2
|
||||
|
||||
Thank you for your interest in contributing back to CMB2. Please help us review your issues and/or merge your pull requests by following the below guidelines.
|
||||
|
||||
#### NOTE: The issues section is for bug reports and feature requests only.
|
||||
_Support is not offered for this library, and the likelihood that the maintainers will respond is very low. If you need help, please use [stackoverflow](http://stackoverflow.com/search?q=cmb), or the [wordpress.org plugin forums](http://wordpress.org/support/plugin/cmb2)._
|
||||
|
||||
Before reporting a bug
|
||||
---
|
||||
1. Please review the [documentation](https://github.com/CMB2/CMB2/wiki). Most questions revolve around the [field types](https://github.com/CMB2/CMB2/wiki/Field-Types), [field parameters](https://github.com/CMB2/CMB2/wiki/Field-Parameters), or are addressed in the [troubleshooting](https://github.com/CMB2/CMB2/wiki/Troubleshooting) section.
|
||||
2. Search [issues](https://github.com/CMB2/CMB2/issues) to see if the issue has been previously reported.
|
||||
3. Install the trunk version of CMB2 and test there.
|
||||
|
||||
|
||||
How to report a bug
|
||||
---
|
||||
1. Specify the version number for both WordPress and CMB2.
|
||||
3. Describe the problem in detail. Explain what happened, and what you expected would happen.
|
||||
4. Provide a small test-case and a link to a [gist](https://gist.github.com/) containing your entire metabox registration code.
|
||||
5. If helpful, include a screenshot. Annotate the screenshot for clarity.
|
||||
|
||||
|
||||
How to contribute to CMB2
|
||||
---
|
||||
All contributions welcome. If you would like to submit a pull request, please follow the steps below.
|
||||
|
||||
1. Make sure you have a GitHub account.
|
||||
2. Fork the repository on GitHub.
|
||||
3. **Check out the trunk version of CMB2.** If you submit to the master branch, the PR will be closed with a link back to this document.
|
||||
4. **Verify your issue still exists in the trunk branch.**
|
||||
5. Make changes to your clone of the repository.
|
||||
1. Please follow the [WordPress code standards](https://make.wordpress.org/core/handbook/coding-standards).
|
||||
2. If possible, and if applicable, please also add/update unit tests for your changes.
|
||||
3. Please add documentation to any new functions, methods, actions and filters.
|
||||
4. When committing, reference your issue (if present) and include a note about the fix.
|
||||
6. [Submit a pull request](https://help.github.com/articles/creating-a-pull-request/).
|
||||
|
||||
**Note:** You may gain more ground and avoid unecessary effort if you first open an issue with the proposed changes, but this step is not necessary.
|
||||
|
||||
Translations
|
||||
---
|
||||
If you are looking to provide language translation files, Please do so via [WordPress Plugin Translations](https://translate.wordpress.org/projects/wp-plugins/cmb2).
|
||||
|
||||
Additional Resources
|
||||
---
|
||||
|
||||
* [CMB2 Documentation Wiki](https://github.com/CMB2/CMB2/wiki)
|
||||
* [CMB2 Snippet Library](https://github.com/CMB2/CMB2-Snippet-Library)
|
||||
* [CMB2 API Documentation](http://cmb2.io/api/)
|
||||
* [General GitHub Documentation](http://help.github.com/)
|
||||
* [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
|
||||
* [PHPUnit Tests Guide](http://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Bootstraps the CMB2 process
|
||||
*
|
||||
* @category WordPress_Plugin
|
||||
* @package CMB2
|
||||
* @author CMB2
|
||||
* @license GPL-2.0+
|
||||
* @link https://cmb2.io
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function to encapsulate the CMB2 bootstrap process.
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @return void
|
||||
*/
|
||||
function cmb2_bootstrap() {
|
||||
|
||||
if ( is_admin() ) {
|
||||
/**
|
||||
* Fires on the admin side when CMB2 is included/loaded.
|
||||
*
|
||||
* In most cases, this should be used to add metaboxes. See example-functions.php
|
||||
*/
|
||||
do_action( 'cmb2_admin_init' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when CMB2 is included/loaded
|
||||
*
|
||||
* Can be used to add metaboxes if needed on the front-end or WP-API (or the front and backend).
|
||||
*/
|
||||
do_action( 'cmb2_init' );
|
||||
|
||||
/**
|
||||
* For back-compat. Does the dirty-work of instantiating all the
|
||||
* CMB2 instances for the cmb2_meta_boxes filter
|
||||
*
|
||||
* @since 2.0.2
|
||||
*/
|
||||
$cmb_config_arrays = apply_filters( 'cmb2_meta_boxes', array() );
|
||||
foreach ( (array) $cmb_config_arrays as $cmb_config ) {
|
||||
new CMB2( $cmb_config );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after all CMB2 instances are created
|
||||
*/
|
||||
do_action( 'cmb2_init_before_hookup' );
|
||||
|
||||
/**
|
||||
* Get all created metaboxes, and instantiate CMB2_hookup
|
||||
* on metaboxes which require it.
|
||||
*
|
||||
* @since 2.0.2
|
||||
*/
|
||||
foreach ( CMB2_Boxes::get_all() as $cmb ) {
|
||||
|
||||
/**
|
||||
* Initiates the box "hookup" into WordPress.
|
||||
*
|
||||
* Unless the 'hookup' box property is `false`, the box will be hooked in as
|
||||
* a post/user/comment/option/term box.
|
||||
*
|
||||
* And if the 'show_in_rest' box property is set, the box will be hooked
|
||||
* into the CMB2 REST API.
|
||||
*
|
||||
* The dynamic portion of the hook name, $cmb->cmb_id, is the box id.
|
||||
*
|
||||
* @since 2.2.6
|
||||
*
|
||||
* @param array $cmb The CMB2 object to hookup.
|
||||
*/
|
||||
do_action( "cmb2_init_hookup_{$cmb->cmb_id}", $cmb );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after CMB2 initiation process has been completed
|
||||
*/
|
||||
do_action( 'cmb2_after_init' );
|
||||
}
|
||||
|
||||
/* End. That's it, folks! */
|
||||
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* CMB2 - v2.4.2 - 2018-06-09
|
||||
* https://cmb2.io
|
||||
* Copyright (c) 2018
|
||||
* Licensed GPLv2+
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
* CMB2 Display Styling
|
||||
--------------------------------------------------------------*/
|
||||
/* line 6, sass/partials/_display.scss */
|
||||
.cmb2-colorpicker-swatch span {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
border-radius: 1em;
|
||||
float: right;
|
||||
margin-top: 3px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* line 17, sass/partials/_display.scss */
|
||||
.cmb2-code {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/* line 21, sass/partials/_display.scss */
|
||||
.cmb-image-display {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* line 26, sass/partials/_display.scss */
|
||||
.cmb2-display-file-list li {
|
||||
display: inline;
|
||||
margin: 0 0 .5em .5em;
|
||||
}
|
||||
|
||||
/* line 31, sass/partials/_display.scss */
|
||||
.cmb2-oembed * {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=cmb2-display.css.map */
|
||||
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-display-rtl.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-display-rtl.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! CMB2 - v2.4.2 - 2018-06-09 | https://cmb2.io | Copyright (c) 2018 CMB2 team | Licensed GPLv2 */
|
||||
.cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:right;margin-top:3px;margin-left:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 0 .5em .5em}.cmb2-oembed *{max-width:100%;height:auto}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* CMB2 - v2.4.2 - 2018-06-09
|
||||
* https://cmb2.io
|
||||
* Copyright (c) 2018
|
||||
* Licensed GPLv2+
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
* CMB2 Display Styling
|
||||
--------------------------------------------------------------*/
|
||||
/* line 6, sass/partials/_display.scss */
|
||||
.cmb2-colorpicker-swatch span {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
border-radius: 1em;
|
||||
float: left;
|
||||
margin-top: 3px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
/* line 17, sass/partials/_display.scss */
|
||||
.cmb2-code {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
/* line 21, sass/partials/_display.scss */
|
||||
.cmb-image-display {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* line 26, sass/partials/_display.scss */
|
||||
.cmb2-display-file-list li {
|
||||
display: inline;
|
||||
margin: 0 .5em .5em 0;
|
||||
}
|
||||
|
||||
/* line 31, sass/partials/_display.scss */
|
||||
.cmb2-oembed * {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=cmb2-display.css.map */
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": "AAAA;;gEAEgE;;AAG/D,6BAAK;EACJ,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;EACX,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG;EACf,YAAY,EAAE,GAAG;;;;AAInB,UAAW;EACV,QAAQ,EAAE,MAAM;;;;AAGjB,kBAAmB;EAClB,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI;;;;AAGb,0BAA2B;EAC1B,OAAO,EAAE,MAAM;EACf,MAAM,EAAE,aAAa;;;;AAGtB,cAAe;EACd,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,IAAI",
|
||||
"sources": ["sass/partials/_display.scss"],
|
||||
"names": [],
|
||||
"file": "cmb2-display.css"
|
||||
}
|
||||
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-display.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-display.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! CMB2 - v2.4.2 - 2018-06-09 | https://cmb2.io | Copyright (c) 2018 CMB2 team | Licensed GPLv2 */
|
||||
.cmb2-colorpicker-swatch span{display:inline-block;width:1em;height:1em;border-radius:1em;float:left;margin-top:3px;margin-right:2px}.cmb2-code{overflow:scroll}.cmb-image-display{max-width:100%;height:auto}.cmb2-display-file-list li{display:inline;margin:0 .5em .5em 0}.cmb2-oembed *{max-width:100%;height:auto}
|
||||
File diff suppressed because it is too large
Load Diff
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-front-rtl.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-front-rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-front.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-front.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-rtl.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2-rtl.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2097
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2.css
Normal file
2097
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2.css
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2.min.css
vendored
Normal file
2
wp-content/plugins/eagle-booking/include/metabox/cmb2/css/cmb2.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Silence is golden
|
||||
@@ -0,0 +1 @@
|
||||
@import "partials/display";
|
||||
@@ -0,0 +1,14 @@
|
||||
@import "partials/variables";
|
||||
@import "partials/mixins";
|
||||
|
||||
@import "partials/main_wrap";
|
||||
@import "partials/post_metaboxes";
|
||||
@import "partials/context_metaboxes";
|
||||
@import "partials/misc";
|
||||
@import "partials/collapsible_ui";
|
||||
@import "partials/jquery_ui";
|
||||
|
||||
/**
|
||||
* CMB2 Frontend
|
||||
*/
|
||||
@import "partials/front";
|
||||
@@ -0,0 +1,12 @@
|
||||
@import "partials/variables";
|
||||
@import "partials/mixins";
|
||||
|
||||
@import "partials/main_wrap";
|
||||
@import "partials/post_metaboxes";
|
||||
@import "partials/context_metaboxes";
|
||||
@import "partials/options-page";
|
||||
@import "partials/new_term";
|
||||
@import "partials/misc";
|
||||
@import "partials/sidebar_placements";
|
||||
@import "partials/collapsible_ui";
|
||||
@import "partials/jquery_ui";
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
// Silence is golden
|
||||
@@ -0,0 +1,56 @@
|
||||
/*--------------------------------------------------------------
|
||||
* Collapsible UI
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.cmb2-metabox {
|
||||
.cmbhandle {
|
||||
color: $gray;
|
||||
float: right;
|
||||
width: 27px;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
right: -1em;
|
||||
position: relative;
|
||||
&:before {
|
||||
content: '\f142';
|
||||
right: 12px;
|
||||
font: normal 20px/1 'dashicons';
|
||||
speak: none;
|
||||
display: inline-block;
|
||||
padding: 8px 10px;
|
||||
top: 0;
|
||||
position: relative;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.postbox.closed {
|
||||
.cmbhandle {
|
||||
&:before {
|
||||
content: '\f140';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button.dashicons-before.dashicons-no-alt.cmb-remove-group-row {
|
||||
-webkit-appearance: none !important;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: .5em;
|
||||
line-height: 1em;
|
||||
padding: 2px 6px 3px;
|
||||
opacity: .5;
|
||||
&:not([disabled]) {
|
||||
cursor: pointer;
|
||||
color: $dark-red;
|
||||
opacity: 1;
|
||||
&:hover {
|
||||
color: $red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user