|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/nandedex/www/s.nandedexpress.com/ |
helpers/class-vc-color-helper.php 0000644 00000026660 15121635560 0013041 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Author: Arlo Carreon <http://arlocarreon.com>
* Info: http://mexitek.github.io/phpColors/
* License: http://arlo.mit-license.org/
*
* @modified by js_composer
* @since 4.8
*/
class Vc_Color_Helper {
/**
* A color utility that helps manipulate HEX colors
* @var string
*/
private $hex;
private $hsl;
private $rgb;
/**
* Auto darkens/lightens by 10% for sexily-subtle gradients.
* Set this to FALSE to adjust automatic shade to be between given color
* and black (for darken) or white (for lighten)
*/
const DEFAULT_ADJUST = 10;
/**
* Instantiates the class with a HEX value
*
* @param string $hex
*
* @throws Exception "Bad color format".
*/
public function __construct( $hex ) {
// Strip # sign is present
$color = str_replace( '#', '', $hex );
// Make sure it's 6 digits
if ( strlen( $color ) === 3 ) {
$color = $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2];
} elseif ( strlen( $color ) !== 6 ) {
throw new Exception( 'HEX color needs to be 6 or 3 digits long' );
}
$this->hsl = self::hexToHsl( $color );
$this->hex = $color;
$this->rgb = self::hexToRgb( $color );
}
/**
* @param $val
* @param int $max
* @return mixed
*/
public static function clamp( $val, $max = 1 ) {
return min( max( $val, 0 ), $max );
}
// ====================
// = Public Interface =
// ====================
/**
* Given a HEX string returns a HSL array equivalent.
*
* @param string $color
*
* @return array HSL associative array
* @throws \Exception
*/
public static function hexToHsl( $color ) {
// Sanity check
$color = self::check_hex_private( $color );
// Convert HEX to DEC
$R = hexdec( $color[0] . $color[1] );
$G = hexdec( $color[2] . $color[3] );
$B = hexdec( $color[4] . $color[5] );
$HSL = array();
$var_R = ( $R / 255.0 );
$var_G = ( $G / 255.0 );
$var_B = ( $B / 255.0 );
$var_Min = min( $var_R, $var_G, $var_B );
$var_Max = max( $var_R, $var_G, $var_B );
$del_Max = floatval( $var_Max - $var_Min );
$L = ( $var_Max + $var_Min ) / 2.0;
$H = 0.0;
$S = 0.0;
if ( $del_Max > 0 ) {
if ( $L < 0.5 ) {
$S = $del_Max / ( $var_Max + $var_Min );
} else {
$S = $del_Max / ( 2 - $var_Max - $var_Min );
}
switch ( $var_Max ) {
case $var_R:
$H = ( $var_G - $var_B ) / $del_Max + ( $var_G < $var_B ? 6 : 0 );
break;
case $var_G:
$H = ( $var_B - $var_R ) / $del_Max + 2;
break;
case $var_B:
$H = ( $var_R - $var_G ) / $del_Max + 4;
break;
}
$H /= 6;
}
$HSL['H'] = ( $H * 360.0 );
$HSL['S'] = $S;
$HSL['L'] = $L;
return $HSL;
}
/**
* Given a HSL associative array returns the equivalent HEX string
*
* @param array $hsl
*
* @return string HEX string
* @throws Exception "Bad HSL Array".
*/
public static function hslToHex( $hsl = array() ) {
// Make sure it's HSL
if ( empty( $hsl ) || ! isset( $hsl['H'] ) || ! isset( $hsl['S'] ) || ! isset( $hsl['L'] ) ) {
throw new Exception( 'Param was not an HSL array' );
}
list( $H, $S, $L ) = array(
fmod( $hsl['H'], 360 ) / 360.0,
$hsl['S'],
$hsl['L'],
);
if ( ! $S ) {
$r = $L * 255.0;
$g = $L * 255.0;
$b = $L * 255.0;
} else {
if ( $L < 0.5 ) {
$var_2 = $L * ( 1.0 + $S );
} else {
$var_2 = ( $L + $S ) - ( $S * $L );
}
$var_1 = 2.0 * $L - $var_2;
$r = self::clamp( round( 255.0 * self::huetorgb_private( $var_1, $var_2, $H + ( 1 / 3 ) ) ), 255 );
$g = self::clamp( round( 255.0 * self::huetorgb_private( $var_1, $var_2, $H ) ), 255 );
$b = self::clamp( round( 255.0 * self::huetorgb_private( $var_1, $var_2, $H - ( 1 / 3 ) ) ), 255 );
}
// Convert to hex
$r = dechex( $r );
$g = dechex( $g );
$b = dechex( $b );
// Make sure we get 2 digits for decimals
$r = ( strlen( '' . $r ) === 1 ) ? '0' . $r : $r;
$g = ( strlen( '' . $g ) === 1 ) ? '0' . $g : $g;
$b = ( strlen( '' . $b ) === 1 ) ? '0' . $b : $b;
return $r . $g . $b;
}
/**
* Given a HEX string returns a RGB array equivalent.
*
* @param string $color
*
* @return array RGB associative array
* @throws \Exception
*/
public static function hexToRgb( $color ) {
// Sanity check
$color = self::check_hex_private( $color );
// Convert HEX to DEC
$R = hexdec( $color[0] . $color[1] );
$G = hexdec( $color[2] . $color[3] );
$B = hexdec( $color[4] . $color[5] );
$RGB['R'] = $R;
$RGB['G'] = $G;
$RGB['B'] = $B;
return $RGB;
}
/**
* Given an RGB associative array returns the equivalent HEX string
*
* @param array $rgb
*
* @return string RGB string
* @throws Exception "Bad RGB Array".
*/
public static function rgbToHex( $rgb = array() ) {
// Make sure it's RGB
if ( empty( $rgb ) || ! isset( $rgb['R'] ) || ! isset( $rgb['G'] ) || ! isset( $rgb['B'] ) ) {
throw new Exception( 'Param was not an RGB array' );
}
// Convert RGB to HEX
$hex[0] = dechex( $rgb['R'] );
if ( 1 === strlen( $hex[0] ) ) {
$hex[0] .= $hex[0];
}
$hex[1] = dechex( $rgb['G'] );
if ( 1 === strlen( $hex[1] ) ) {
$hex[1] .= $hex[1];
}
$hex[2] = dechex( $rgb['B'] );
if ( 1 === strlen( $hex[2] ) ) {
$hex[2] .= $hex[2];
}
return implode( '', $hex );
}
/**
* Given a HEX value, returns a darker color. If no desired amount provided, then the color halfway between
* given HEX and black will be returned.
*
* @param int $amount
*
* @return string Darker HEX value
* @throws \Exception
*/
public function darken( $amount = self::DEFAULT_ADJUST ) {
// Darken
$darkerHSL = $this->darken_private( $this->hsl, $amount );
// Return as HEX
return self::hslToHex( $darkerHSL );
}
/**
* Given a HEX value, returns a lighter color. If no desired amount provided, then the color halfway between
* given HEX and white will be returned.
*
* @param int $amount
*
* @return string Lighter HEX value
* @throws \Exception.
*/
public function lighten( $amount = self::DEFAULT_ADJUST ) {
// Lighten
$lighterHSL = $this->lighten_private( $this->hsl, $amount );
// Return as HEX
return self::hslToHex( $lighterHSL );
}
/**
* Given a HEX value, returns a mixed color. If no desired amount provided, then the color mixed by this ratio
*
* @param string $hex2 Secondary HEX value to mix with
* @param int $amount = -100..0..+100
*
* @return string mixed HEX value
* @throws \Exception
*/
public function mix( $hex2, $amount = 0 ) {
$rgb2 = self::hexToRgb( $hex2 );
$mixed = $this->mix_private( $this->rgb, $rgb2, $amount );
// Return as HEX
return self::rgbToHex( $mixed );
}
/**
* Creates an array with two shades that can be used to make a gradient
*
* @param int $amount Optional percentage amount you want your contrast color
*
* @return array An array with a 'light' and 'dark' index
* @throws \Exception
*/
public function makeGradient( $amount = self::DEFAULT_ADJUST ) {
// Decide which color needs to be made
if ( $this->isLight() ) {
$lightColor = $this->hex;
$darkColor = $this->darken( $amount );
} else {
$lightColor = $this->lighten( $amount );
$darkColor = $this->hex;
}
// Return our gradient array
return array(
'light' => $lightColor,
'dark' => $darkColor,
);
}
/**
* Returns whether or not given color is considered "light"
*
* @param string|Boolean $color
*
* @return boolean
*/
public function isLight( $color = false ) {
// Get our color
$color = ( $color ) ? $color : $this->hex;
// Calculate straight from rbg
$r = hexdec( $color[0] . $color[1] );
$g = hexdec( $color[2] . $color[3] );
$b = hexdec( $color[4] . $color[5] );
return ( ( $r * 299 + $g * 587 + $b * 114 ) / 1000 > 130 );
}
/**
* Returns whether or not a given color is considered "dark"
*
* @param string|Boolean $color
*
* @return boolean
*/
public function isDark( $color = false ) {
// Get our color
$color = ( $color ) ? $color : $this->hex;
// Calculate straight from rbg
$r = hexdec( $color[0] . $color[1] );
$g = hexdec( $color[2] . $color[3] );
$b = hexdec( $color[4] . $color[5] );
return ( ( $r * 299 + $g * 587 + $b * 114 ) / 1000 <= 130 );
}
/**
* Returns the complimentary color
* @return string Complementary hex color
* @throws \Exception
*/
public function complementary() {
// Get our HSL
$hsl = $this->hsl;
// Adjust Hue 180 degrees
$hsl['H'] += ( $hsl['H'] > 180 ) ? - 180 : 180;
// Return the new value in HEX
return self::hslToHex( $hsl );
}
/**
* Returns your color's HSL array
*/
public function getHsl() {
return $this->hsl;
}
/**
* Returns your original color
*/
public function getHex() {
return $this->hex;
}
/**
* Returns your color's RGB array
*/
public function getRgb() {
return $this->rgb;
}
// ===========================
// = Private Functions Below =
// ===========================
/**
* Darkens a given HSL array
*
* @param array $hsl
* @param int $amount
*
* @return array $hsl
*/
private function darken_private( $hsl, $amount = self::DEFAULT_ADJUST ) {
// Check if we were provided a number
if ( $amount ) {
$hsl['L'] = ( $hsl['L'] * 100 ) - $amount;
$hsl['L'] = ( $hsl['L'] < 0 ) ? 0 : $hsl['L'] / 100;
} else {
// We need to find out how much to darken
$hsl['L'] = $hsl['L'] / 2;
}
return $hsl;
}
/**
* Lightens a given HSL array
*
* @param array $hsl
* @param int $amount
*
* @return array $hsl
*/
private function lighten_private( $hsl, $amount = self::DEFAULT_ADJUST ) {
// Check if we were provided a number
if ( $amount ) {
$hsl['L'] = ( $hsl['L'] * 100.0 ) + $amount;
$hsl['L'] = ( $hsl['L'] > 100.0 ) ? 1.0 : $hsl['L'] / 100.0;
} else {
// We need to find out how much to lighten
$hsl['L'] += ( 1.0 - $hsl['L'] ) / 2.0;
}
return $hsl;
}
/**
* Mix 2 rgb colors and return an rgb color
*
* @param array $rgb1
* @param array $rgb2
* @param int $amount ranged -100..0..+100
*
* @return array $rgb
*
* ported from http://phpxref.pagelines.com/nav.html?includes/class.colors.php.source.html
*/
private function mix_private( $rgb1, $rgb2, $amount = 0 ) {
$r1 = ( $amount + 100 ) / 100;
$r2 = 2 - $r1;
$rmix = ( ( $rgb1['R'] * $r1 ) + ( $rgb2['R'] * $r2 ) ) / 2;
$gmix = ( ( $rgb1['G'] * $r1 ) + ( $rgb2['G'] * $r2 ) ) / 2;
$bmix = ( ( $rgb1['B'] * $r1 ) + ( $rgb2['B'] * $r2 ) ) / 2;
return array(
'R' => $rmix,
'G' => $gmix,
'B' => $bmix,
);
}
/**
* Given a Hue, returns corresponding RGB value
*
* @param int $v1
* @param int $v2
* @param int $vH
*
* @return int
*/
private static function huetorgb_private( $v1, $v2, $vH ) {
if ( $vH < 0 ) {
$vH ++;
}
if ( $vH > 1 ) {
$vH --;
}
if ( ( 6 * $vH ) < 1 ) {
return ( $v1 + ( $v2 - $v1 ) * 6 * $vH );
}
if ( ( 2 * $vH ) < 1 ) {
return $v2;
}
if ( ( 3 * $vH ) < 2 ) {
return ( $v1 + ( $v2 - $v1 ) * ( ( 2 / 3 ) - $vH ) * 6 );
}
return $v1;
}
/**
* You need to check if you were given a good hex string
*
* @param string $hex
*
* @return string Color
* @throws Exception "Bad color format".
*/
private static function check_hex_private( $hex ) {
// Strip # sign is present
$color = str_replace( '#', '', $hex );
// Make sure it's 6 digits
if ( strlen( $color ) === 3 ) {
$color = $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2];
} elseif ( strlen( $color ) !== 6 ) {
throw new Exception( 'HEX color needs to be 6 or 3 digits long' );
}
return $color;
}
}
helpers/class-vc-image-filter.php 0000644 00000016573 15121635560 0013015 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
class vcImageFilter {
/**
* @var resource
*/
private $image;
/**
* run constructor
*
* @param resource &$image GD image resource
*/
public function __construct( &$image ) {
$this->image = $image;
}
/**
* Get the current image resource
*
* @return resource
*/
public function getImage() {
return $this->image;
}
public function sepia() {
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 100, 50, 0 );
return $this;
}
public function sepia2() {
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 10 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 20 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 60, 30, - 15 );
return $this;
}
public function sharpen() {
$gaussian = array(
array(
1.0,
1.0,
1.0,
),
array(
1.0,
- 7.0,
1.0,
),
array(
1.0,
1.0,
1.0,
),
);
imageconvolution( $this->image, $gaussian, 1, 4 );
return $this;
}
public function emboss() {
$gaussian = array(
array(
- 2.0,
- 1.0,
0.0,
),
array(
- 1.0,
1.0,
1.0,
),
array(
0.0,
1.0,
2.0,
),
);
imageconvolution( $this->image, $gaussian, 1, 5 );
return $this;
}
public function cool() {
imagefilter( $this->image, IMG_FILTER_MEAN_REMOVAL );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 50 );
return $this;
}
public function light() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 10 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 100, 50, 0, 10 );
return $this;
}
public function aqua() {
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 70, 0, 30 );
return $this;
}
public function fuzzy() {
$gaussian = array(
array(
1.0,
1.0,
1.0,
),
array(
1.0,
1.0,
1.0,
),
array(
1.0,
1.0,
1.0,
),
);
imageconvolution( $this->image, $gaussian, 9, 20 );
return $this;
}
public function boost() {
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 35 );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 10 );
return $this;
}
public function gray() {
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 60 );
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
return $this;
}
public function antique() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 0 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 30 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 75, 50, 25 );
return $this;
}
public function blackwhite() {
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 10 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 20 );
return $this;
}
public function boost2() {
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 35 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 25, 25, 25 );
return $this;
}
public function blur() {
imagefilter( $this->image, IMG_FILTER_SELECTIVE_BLUR );
imagefilter( $this->image, IMG_FILTER_GAUSSIAN_BLUR );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 15 );
imagefilter( $this->image, IMG_FILTER_SMOOTH, - 2 );
return $this;
}
public function vintage() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 10 );
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 40, 10, - 15 );
return $this;
}
public function concentrate() {
imagefilter( $this->image, IMG_FILTER_GAUSSIAN_BLUR );
imagefilter( $this->image, IMG_FILTER_SMOOTH, - 10 );
return $this;
}
public function hermajesty() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 10 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 5 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 80, 0, 60 );
return $this;
}
public function everglow() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 30 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 5 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 30, 30, 0 );
return $this;
}
public function freshblue() {
imagefilter( $this->image, IMG_FILTER_CONTRAST, - 5 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 20, 0, 80, 60 );
return $this;
}
public function tender() {
imagefilter( $this->image, IMG_FILTER_CONTRAST, 5 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 80, 20, 40, 50 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 40, 40, 100 );
imagefilter( $this->image, IMG_FILTER_SELECTIVE_BLUR );
return $this;
}
public function dream() {
imagefilter( $this->image, IMG_FILTER_COLORIZE, 150, 0, 0, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 50, 0, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_GAUSSIAN_BLUR );
return $this;
}
public function frozen() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 15 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 0, 100, 50 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 0, 100, 50 );
imagefilter( $this->image, IMG_FILTER_GAUSSIAN_BLUR );
return $this;
}
public function forest() {
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 0, 150, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 0, 150, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_SMOOTH, 10 );
return $this;
}
public function rain() {
imagefilter( $this->image, IMG_FILTER_GAUSSIAN_BLUR );
imagefilter( $this->image, IMG_FILTER_MEAN_REMOVAL );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 80, 50, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_SMOOTH, 10 );
return $this;
}
public function orangepeel() {
imagefilter( $this->image, IMG_FILTER_COLORIZE, 100, 20, - 50, 20 );
imagefilter( $this->image, IMG_FILTER_SMOOTH, 10 );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 10 );
imagefilter( $this->image, IMG_FILTER_CONTRAST, 10 );
imagegammacorrect( $this->image, 1, 1.2 );
return $this;
}
public function darken() {
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 50 );
return $this;
}
public function summer() {
imagefilter( $this->image, IMG_FILTER_COLORIZE, 0, 150, 0, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 25, 50, 0, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
return $this;
}
public function retro() {
imagefilter( $this->image, IMG_FILTER_GRAYSCALE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 100, 25, 25, 50 );
return $this;
}
public function country() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, - 30 );
imagefilter( $this->image, IMG_FILTER_COLORIZE, 50, 50, 50, 50 );
imagegammacorrect( $this->image, 1, 0.3 );
return $this;
}
public function washed() {
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 30 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_COLORIZE, - 50, 0, 20, 50 );
imagefilter( $this->image, IMG_FILTER_NEGATE );
imagefilter( $this->image, IMG_FILTER_BRIGHTNESS, 10 );
imagegammacorrect( $this->image, 1, 1.2 );
return $this;
}
}
helpers/helpers_factory.php 0000644 00000034617 15121635560 0012127 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder Main manager.
*
* @package WPBakeryPageBuilder
* @since 4.2
*/
if ( ! function_exists( 'vc_manager' ) ) {
/**
* WPBakery Page Builder manager.
* @return Vc_Manager
* @since 4.2
*/
function vc_manager() {
return Vc_Manager::getInstance();
}
}
if ( ! function_exists( 'visual_composer' ) ) {
/**
* WPBakery Page Builder instance.
* @return Vc_Base
* @since 4.2
*/
function visual_composer() {
return vc_manager()->vc();
}
}
if ( ! function_exists( 'vc_mapper' ) ) {
/**
* Shorthand for Vc Mapper.
* @return Vc_Mapper
* @since 4.2
*/
function vc_mapper() {
return vc_manager()->mapper();
}
}
if ( ! function_exists( 'vc_settings' ) ) {
/**
* Shorthand for WPBakery Page Builder settings.
* @return Vc_Settings
* @since 4.2
*/
function vc_settings() {
return vc_manager()->settings();
}
}
if ( ! function_exists( 'vc_license' ) ) {
/**
* Get License manager
* @return Vc_License
* @since 4.2
*/
function vc_license() {
return vc_manager()->license();
}
}
if ( ! function_exists( 'vc_automapper' ) ) {
/**
* @return Vc_Automapper
* @since 4.2
*/
function vc_automapper() {
return vc_manager()->automapper();
}
}
if ( ! function_exists( 'vc_frontend_editor' ) ) {
/**
* Shorthand for VC frontend editor
* @return Vc_Frontend_Editor
* @since 4.2
*/
function vc_frontend_editor() {
return vc_manager()->frontendEditor();
}
}
if ( ! function_exists( 'vc_backend_editor' ) ) {
/**
* Shorthand for VC frontend editor
* @return Vc_Backend_Editor
* @since 4.2
*/
function vc_backend_editor() {
return vc_manager()->backendEditor();
}
}
if ( ! function_exists( 'vc_updater' ) ) {
/**
* @return Vc_Updater
* @since 4.2
*/
function vc_updater() {
return vc_manager()->updater();
}
}
if ( ! function_exists( 'vc_is_network_plugin' ) ) {
/**
* Vc is network plugin or not.
* @return bool
* @since 4.2
*/
function vc_is_network_plugin() {
return vc_manager()->isNetworkPlugin();
}
}
if ( ! function_exists( 'vc_path_dir' ) ) {
/**
* Get file/directory path in Vc.
*
* @param string $name - path name
* @param string $file
*
* @return string
* @since 4.2
*/
function vc_path_dir( $name, $file = '' ) {
return vc_manager()->path( $name, $file );
}
}
if ( ! function_exists( 'vc_asset_url' ) ) {
/**
* Get full url for assets.
*
* @param string $file
*
* @return string
* @since 4.2
*/
function vc_asset_url( $file ) {
return vc_manager()->assetUrl( $file );
}
}
if ( ! function_exists( 'vc_upload_dir' ) ) {
/**
* Temporary files upload dir;
* @return string
* @since 4.2
*/
function vc_upload_dir() {
return vc_manager()->uploadDir();
}
}
if ( ! function_exists( 'vc_template' ) ) {
/**
* @param $file
*
* @return string
* @since 4.2
*/
function vc_template( $file ) {
return vc_path_dir( 'TEMPLATES_DIR', $file );
}
}
if ( ! function_exists( 'vc_post_param' ) ) {
/**
* Get param value from $_POST if exists.
*
* @param $param
* @param $default
*
* @param bool $check
* @return null|string - null for undefined param.
* @since 4.2
*/
function vc_post_param( $param, $default = null, $check = false ) {
if ( 'admin' === $check ) {
check_admin_referer();
} elseif ( 'ajax' === $check ) {
check_ajax_referer();
}
return isset( $_POST[ $param ] ) ? $_POST[ $param ] : $default;
}
}
if ( ! function_exists( 'vc_get_param' ) ) {
/**
* Get param value from $_GET if exists.
*
* @param string $param
* @param $default
*
* @param bool $check
* @return null|string - null for undefined param.
* @since 4.2
*/
function vc_get_param( $param, $default = null, $check = false ) {
if ( 'admin' === $check ) {
check_admin_referer();
} elseif ( 'ajax' === $check ) {
check_ajax_referer();
}
// @codingStandardsIgnoreLine
return isset( $_GET[ $param ] ) ? $_GET[ $param ] : $default;
}
}
if ( ! function_exists( 'vc_request_param' ) ) {
/**
* Get param value from $_REQUEST if exists.
*
* @param $param
* @param $default
*
* @param bool $check
* @return null|string - null for undefined param.
* @since 4.4
*/
function vc_request_param( $param, $default = null, $check = false ) {
if ( 'admin' === $check ) {
check_admin_referer();
} elseif ( 'ajax' === $check ) {
check_ajax_referer();
}
// @codingStandardsIgnoreLine
return isset( $_REQUEST[ $param ] ) ? $_REQUEST[ $param ] : $default;
}
}
if ( ! function_exists( 'vc_is_frontend_editor' ) ) {
/**
* @return bool
* @since 4.2
*/
function vc_is_frontend_editor() {
return 'admin_frontend_editor' === vc_mode();
}
}
if ( ! function_exists( 'vc_is_page_editable' ) ) {
/**
* @return bool
* @since 4.2
*/
function vc_is_page_editable() {
return 'page_editable' === vc_mode();
}
}
if ( ! function_exists( 'vc_action' ) ) {
/**
* Get VC special action param.
* @return string|null
* @since 4.2
*/
function vc_action() {
$vc_action = wp_strip_all_tags( vc_request_param( 'vc_action' ) );
return $vc_action;
}
}
if ( ! function_exists( 'vc_is_inline' ) ) {
/**
* Get is inline or not.
* @return bool
* @since 4.2
*/
function vc_is_inline() {
global $vc_is_inline;
if ( is_null( $vc_is_inline ) ) {
$vc_is_inline = ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) && 'vc_inline' === vc_action() || ! is_null( vc_request_param( 'vc_inline' ) ) || 'true' === vc_request_param( 'vc_editable' );
}
return $vc_is_inline;
}
}
if ( ! function_exists( 'vc_is_frontend_ajax' ) ) {
/**
* @return bool
* @since 4.2
*/
function vc_is_frontend_ajax() {
return 'true' === vc_post_param( 'vc_inline' ) || vc_get_param( 'vc_inline' );
}
}
/**
* @depreacted since 4.8 ( use vc_is_frontend_editor )
* @return bool
* @since 4.2
*/
function vc_is_editor() {
return vc_is_frontend_editor();
}
/**
* @param $value
* @param bool $encode
*
* @return string
* @since 4.2
*/
function vc_value_from_safe( $value, $encode = false ) {
// @codingStandardsIgnoreLine
$value = preg_match( '/^#E\-8_/', $value ) ? rawurldecode( base64_decode( preg_replace( '/^#E\-8_/', '', $value ) ) ) : $value;
if ( $encode ) {
$value = htmlentities( $value, ENT_COMPAT, 'UTF-8' );
}
return $value;
}
/**
* @param bool $disable
* @since 4.2
*
*/
function vc_disable_automapper( $disable = true ) {
vc_automapper()->setDisabled( $disable );
}
/**
* @return bool
* @since 4.2
*/
function vc_automapper_is_disabled() {
return vc_automapper()->disabled();
}
/**
* @param $param
* @param $value
*
* @return mixed|string
* @since 4.2
*/
function vc_get_dropdown_option( $param, $value ) {
if ( '' === $value && is_array( $param['value'] ) ) {
$value = array_shift( $param['value'] );
}
if ( is_array( $value ) ) {
reset( $value );
$value = isset( $value['value'] ) ? $value['value'] : current( $value );
}
$value = preg_replace( '/\s/', '_', $value );
return ( '' !== $value ? $value : '' );
}
/**
* @param $prefix
* @param $color
*
* @return string
* @since 4.2
*/
function vc_get_css_color( $prefix, $color ) {
$rgb_color = preg_match( '/rgba/', $color ) ? preg_replace( array(
'/\s+/',
'/^rgba\((\d+)\,(\d+)\,(\d+)\,([\d\.]+)\)$/',
), array(
'',
'rgb($1,$2,$3)',
), $color ) : $color;
$string = $prefix . ':' . $rgb_color . ';';
if ( $rgb_color !== $color ) {
$string .= $prefix . ':' . $color . ';';
}
return $string;
}
/**
* @param $param_value
* @param string $prefix
*
* @return string
* @since 4.2
*/
function vc_shortcode_custom_css_class( $param_value, $prefix = '' ) {
$css_class = preg_match( '/\s*\.([^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/', $param_value ) ? $prefix . preg_replace( '/\s*\.([^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/', '$1', $param_value ) : '';
return $css_class;
}
/**
* @param $subject
* @param $property
* @param bool|false $strict
*
* @return bool
* @since 4.9
*/
function vc_shortcode_custom_css_has_property( $subject, $property, $strict = false ) {
$styles = array();
$pattern = '/\{([^\}]*?)\}/i';
preg_match( $pattern, $subject, $styles );
if ( array_key_exists( 1, $styles ) ) {
$styles = explode( ';', $styles[1] );
}
$new_styles = array();
foreach ( $styles as $val ) {
$val = explode( ':', $val );
if ( is_array( $property ) ) {
foreach ( $property as $prop ) {
$pos = strpos( $val[0], $prop );
$full = ( $strict ) ? ( 0 === $pos && strlen( $val[0] ) === strlen( $prop ) ) : true;
if ( false !== $pos && $full ) {
$new_styles[] = $val;
}
}
} else {
$pos = strpos( $val[0], $property );
$full = ( $strict ) ? ( 0 === $pos && strlen( $val[0] ) === strlen( $property ) ) : true;
if ( false !== $pos && $full ) {
$new_styles[] = $val;
}
}
}
return ! empty( $new_styles );
}
/**
* Plugin name for VC.
*
* @return string
* @since 4.2
*/
function vc_plugin_name() {
return vc_manager()->pluginName();
}
/**
* @param $filename
*
* @return bool|mixed|string
* @since 4.4.3 used in vc_base when getting an custom css output
*
*/
function vc_file_get_contents( $filename ) {
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem( false, false, true );
}
/** @var WP_Filesystem_Base $wp_filesystem */
$output = '';
if ( is_object( $wp_filesystem ) ) {
$output = $wp_filesystem->get_contents( $filename );
}
if ( ! $output ) {
// @codingStandardsIgnoreLine
$output = file_get_contents( $filename );
}
return $output;
}
/**
* HowTo: vc_role_access()->who('administrator')->with('editor')->can('frontend_editor');
* @return Vc_Role_Access;
* @since 4.8
*/
function vc_role_access() {
return vc_manager()->getRoleAccess();
}
/**
* Get access manager for current user.
* HowTo: vc_user_access()->->with('editor')->can('frontend_editor');
* @return Vc_Current_User_Access;
* @since 4.8
*/
function vc_user_access() {
return vc_manager()->getCurrentUserAccess();
}
/**
* @return array
* @throws \Exception
*/
function vc_user_roles_get_all() {
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' );
$vc_roles = new Vc_Roles();
$capabilities = array();
foreach ( $vc_roles->getParts() as $part ) {
$partObj = vc_user_access()->part( $part );
$capabilities[ $part ] = array(
'state' => (is_multisite() && is_super_admin()) ? true : $partObj->getState(),
'state_key' => $partObj->getStateKey(),
'capabilities' => $partObj->getAllCaps(),
);
}
return $capabilities;
}
/**
* @param $data
*
* @return string
*/
function vc_generate_nonce( $data, $from_esi = false ) {
if ( ! $from_esi && ! vc_is_frontend_editor() ) {
if ( method_exists( 'LiteSpeed_Cache_API', 'esi_enabled' ) && LiteSpeed_Cache_API::esi_enabled() ) {
if ( method_exists( 'LiteSpeed_Cache_API', 'v' ) && LiteSpeed_Cache_API::v( '1.3' ) ) {
$params = array( 'data' => $data );
return LiteSpeed_Cache_API::esi_url( 'js_composer', 'WPBakery Page Builder', $params, 'default', true );// The last parameter is to remove ESI comment wrapper
}
}
}
return wp_create_nonce( is_array( $data ) ? ( 'vc-nonce-' . implode( '|', $data ) ) : ( 'vc-nonce-' . $data ) );
}
/**
* @param $params
*
* @return string
*/
function vc_hook_esi( $params ) {
$data = $params['data'];
echo vc_generate_nonce( $data, true );
exit;
}
/**
* @param $nonce
* @param $data
*
* @return bool
*/
function vc_verify_nonce( $nonce, $data ) {
return (bool) wp_verify_nonce( $nonce, ( is_array( $data ) ? ( 'vc-nonce-' . implode( '|', $data ) ) : ( 'vc-nonce-' . $data ) ) );
}
/**
* @param $nonce
*
* @return bool
*/
function vc_verify_admin_nonce( $nonce = '' ) {
return (bool) vc_verify_nonce( ! empty( $nonce ) ? $nonce : vc_request_param( '_vcnonce' ), 'vc-admin-nonce' );
}
/**
* @param $nonce
*
* @return bool
*/
function vc_verify_public_nonce( $nonce = '' ) {
return (bool) vc_verify_nonce( ( ! empty( $nonce ) ? $nonce : vc_request_param( '_vcnonce' ) ), 'vc-public-nonce' );
}
/**
* @param $type
* @return bool|mixed|void
* @throws \Exception
*/
function vc_check_post_type( $type = '' ) {
if ( empty( $type ) ) {
$type = get_post_type();
}
$valid = apply_filters( 'vc_check_post_type_validation', null, $type );
if ( is_null( $valid ) ) {
if ( is_multisite() && is_super_admin() ) {
return true;
}
$state = vc_user_access()->part( 'post_types' )->getState();
if ( null === $state ) {
return in_array( $type, vc_default_editor_post_types(), true );
} elseif ( true === $state && ! in_array( $type, vc_default_editor_post_types(), true ) ) {
$valid = false;
} else {
$valid = vc_user_access()->part( 'post_types' )->can( $type )->get();
}
}
return $valid;
}
/**
* @param $shortcode
* @return bool|mixed|void
*/
function vc_user_access_check_shortcode_edit( $shortcode ) {
$do_check = apply_filters( 'vc_user_access_check-shortcode_edit', null, $shortcode );
if ( is_multisite() && is_super_admin() ) {
return true;
}
if ( is_null( $do_check ) ) {
$state_check = vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'edit', null )->get();
if ( $state_check ) {
return true;
} else {
return vc_user_access()->part( 'shortcodes' )->canAny( $shortcode . '_all', $shortcode . '_edit' )->get();
}
} else {
return $do_check;
}
}
/**
* @param $shortcode
* @return bool|mixed|void
* @throws \Exception
*/
function vc_user_access_check_shortcode_all( $shortcode ) {
$do_check = apply_filters( 'vc_user_access_check-shortcode_all', null, $shortcode );
if ( is_multisite() && is_super_admin() ) {
return true;
}
if ( is_null( $do_check ) ) {
return vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'custom', null )->can( $shortcode . '_all' )->get();
} else {
return $do_check;
}
}
/**
* htmlspecialchars_decode_deep
* Call the htmlspecialchars_decode to a gived multilevel array
*
* @param mixed $value The value to be stripped.
*
* @return mixed Stripped value.
* @since 4.8
*
*/
function vc_htmlspecialchars_decode_deep( $value ) {
if ( is_array( $value ) ) {
$value = array_map( 'vc_htmlspecialchars_decode_deep', $value );
} elseif ( is_object( $value ) ) {
$vars = get_object_vars( $value );
foreach ( $vars as $key => $data ) {
$value->{$key} = vc_htmlspecialchars_decode_deep( $data );
}
} elseif ( is_string( $value ) ) {
$value = htmlspecialchars_decode( $value );
}
return $value;
}
/**
* @param $str
* @return mixed
*/
function vc_str_remove_protocol( $str ) {
return str_replace( array(
'https://',
'http://',
), '//', $str );
}
helpers/helpers_api.php 0000644 00000051330 15121635560 0011220 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $attributes
* @return bool
* @throws \Exception
*/
function wpb_map( $attributes ) {
return vc_map( $attributes );
}
/**
* Lean map shortcodes
*
* @param $tag
* @param null $settings_function
* @param null $settings_file
* @since 4.9
*
*/
function vc_lean_map( $tag, $settings_function = null, $settings_file = null ) {
WPBMap::leanMap( $tag, $settings_function, $settings_file );
}
/**
* @param $attributes
*
* @return bool
* @throws \Exception
* @since 4.2
*/
function vc_map( $attributes ) {
if ( ! isset( $attributes['base'] ) ) {
throw new Exception( esc_html__( 'Wrong vc_map object. Base attribute is required', 'js_composer' ) );
}
return WPBMap::map( $attributes['base'], $attributes );
}
/**
* @param $shortcode
*
* @since 4.2
*/
function vc_remove_element( $shortcode ) {
WPBMap::dropShortcode( $shortcode );
}
/**
* Add new shortcode param.
*
* @param $shortcode - tag for shortcode
* @param $attributes - attribute settings
* @throws \Exception
* @since 4.2
*
*/
function vc_add_param( $shortcode, $attributes ) {
WPBMap::addParam( $shortcode, $attributes );
}
/**
* Mass shortcode params adding function
*
* @param $shortcode - tag for shortcode
* @param $attributes - list of attributes arrays
* @throws \Exception
* @since 4.3
*
*/
function vc_add_params( $shortcode, $attributes ) {
if ( is_array( $attributes ) ) {
foreach ( $attributes as $attr ) {
vc_add_param( $shortcode, $attr );
}
}
}
/**
* Shorthand function for WPBMap::modify
*
* @param string $name
* @param string $setting
* @param string $value
*
* @return array|bool
* @throws \Exception
* @since 4.2
*/
function vc_map_update( $name = '', $setting = '', $value = '' ) {
return WPBMap::modify( $name, $setting, $value );
}
/**
* Shorthand function for WPBMap::mutateParam
*
* @param $name
* @param array $attribute
*
* @return bool
* @throws \Exception
* @since 4.2
*/
function vc_update_shortcode_param( $name, $attribute = array() ) {
return WPBMap::mutateParam( $name, $attribute );
}
/**
* Shorthand function for WPBMap::dropParam
*
* @param $name
* @param $attribute_name
*
* @return bool
* @since 4.2
*/
function vc_remove_param( $name = '', $attribute_name = '' ) {
return WPBMap::dropParam( $name, $attribute_name );
}
if ( ! function_exists( 'vc_set_as_theme' ) ) {
/**
* Sets plugin as theme plugin.
*
* @internal param bool $disable_updater - If value is true disables auto updater options.
*
* @since 4.2
*/
function vc_set_as_theme() {
vc_manager()->setIsAsTheme( true );
}
}
if ( ! function_exists( 'vc_is_as_theme' ) ) {
/**
* Is VC as-theme-plugin.
* @return bool
* @since 4.2
*/
function vc_is_as_theme() {
return vc_manager()->isAsTheme();
}
}
if ( ! function_exists( 'vc_is_updater_disabled' ) ) {
/**
* @return bool
* @since 4.2
*/
function vc_is_updater_disabled() {
return vc_manager()->isUpdaterDisabled();
}
}
if ( ! function_exists( 'vc_default_editor_post_types' ) ) {
/**
* Returns list of default post type.
* @return array
* @since 4.2
*/
function vc_default_editor_post_types() {
return vc_manager()->editorDefaultPostTypes();
}
}
if ( ! function_exists( 'vc_set_default_editor_post_types' ) ) {
/**
* Set post types for VC editor.
* @param array $list - list of valid post types to set
* @since 4.2
*
*/
function vc_set_default_editor_post_types( array $list ) {
vc_manager()->setEditorDefaultPostTypes( $list );
}
}
if ( ! function_exists( ( 'vc_editor_post_types' ) ) ) {
/**
* Returns list of post types where VC editor is enabled.
* @return array
* @since 4.2
*/
function vc_editor_post_types() {
return vc_manager()->editorPostTypes();
}
}
if ( ! function_exists( ( 'vc_editor_set_post_types' ) ) ) {
/**
* Set list of post types where VC editor is enabled.
* @param array $post_types
* @throws \Exception
* @since 4.4
*
*/
function vc_editor_set_post_types( array $post_types ) {
vc_manager()->setEditorPostTypes( $post_types );
}
}
if ( ! function_exists( 'vc_mode' ) ) {
/**
* Return current VC mode.
* @return string
* @see Vc_Mapper::$mode
* @since 4.2
*/
function vc_mode() {
return vc_manager()->mode();
}
}
if ( ! function_exists( 'vc_set_shortcodes_templates_dir' ) ) {
/**
* Sets directory where WPBakery Page Builder should look for template files for content elements.
* @param string - full directory path to new template directory with trailing slash
* @since 4.2
*
*/
function vc_set_shortcodes_templates_dir( $dir ) {
vc_manager()->setCustomUserShortcodesTemplateDir( $dir );
}
}
if ( ! function_exists( 'vc_shortcodes_theme_templates_dir' ) ) {
/**
* Get custom theme template path
* @param $template - filename for template
*
* @return string
* @since 4.2
*
*/
function vc_shortcodes_theme_templates_dir( $template ) {
return vc_manager()->getShortcodesTemplateDir( $template );
}
}
/**
* @param bool $value
*
* @todo check usage.
*
* @since 4.3
*/
function set_vc_is_inline( $value = true ) {
_deprecated_function( 'set_vc_is_inline', '5.2 (will be removed in 5.3)' );
global $vc_is_inline;
$vc_is_inline = $value;
}
/**
* Disable frontend editor for VC
* @param bool $disable
* @since 4.3
*
*/
function vc_disable_frontend( $disable = true ) {
vc_frontend_editor()->disableInline( $disable );
}
/**
* Check is front end enabled.
* @return bool
* @throws \Exception
* @since 4.3
*/
function vc_enabled_frontend() {
return vc_frontend_editor()->frontendEditorEnabled();
}
if ( ! function_exists( 'vc_add_default_templates' ) ) {
/**
* Add custom template in default templates list
*
* @param array $data | template data (name, content, custom_class, image_path)
*
* @return bool
* @since 4.3
*/
function vc_add_default_templates( $data ) {
return visual_composer()->templatesPanelEditor()->addDefaultTemplates( $data );
}
}
/**
* @param $shortcode
* @param string $field_prefix
* @param string $group_prefix
* @param null $change_fields
* @param null $dependency
* @return array
* @throws \Exception
*/
function vc_map_integrate_shortcode( $shortcode, $field_prefix = '', $group_prefix = '', $change_fields = null, $dependency = null ) {
if ( is_string( $shortcode ) ) {
$shortcode_data = WPBMap::getShortCode( $shortcode );
} else {
$shortcode_data = $shortcode;
}
if ( is_array( $shortcode_data ) && ! empty( $shortcode_data ) ) {
/**
* @var WPBakeryShortCodeFishBones $shortcode
*/
$params = isset( $shortcode_data['params'] ) && ! empty( $shortcode_data['params'] ) ? $shortcode_data['params'] : false;
if ( is_array( $params ) && ! empty( $params ) ) {
$keys = array_keys( $params );
$count = count( $keys );
for ( $i = 0; $i < $count; $i ++ ) {
$param = &$params[ $keys[ $i ] ]; // Note! passed by reference to automatically update data
if ( isset( $change_fields ) ) {
$param = vc_map_integrate_include_exclude_fields( $param, $change_fields );
if ( empty( $param ) ) {
continue;
}
}
if ( ! empty( $group_prefix ) ) {
if ( isset( $param['group'] ) ) {
$param['group'] = $group_prefix . ': ' . $param['group'];
} else {
$param['group'] = $group_prefix;
}
}
if ( ! empty( $field_prefix ) && isset( $param['param_name'] ) ) {
$param['param_name'] = $field_prefix . $param['param_name'];
if ( isset( $param['dependency'] ) && is_array( $param['dependency'] ) && isset( $param['dependency']['element'] ) ) {
$param['dependency']['element'] = $field_prefix . $param['dependency']['element'];
}
$param = vc_map_integrate_add_dependency( $param, $dependency );
} elseif ( ! empty( $dependency ) ) {
$param = vc_map_integrate_add_dependency( $param, $dependency );
}
$param['integrated_shortcode'] = is_array( $shortcode ) ? $shortcode['base'] : $shortcode;
$param['integrated_shortcode_field'] = $field_prefix;
}
}
return is_array( $params ) ? array_filter( $params ) : array();
}
return array();
}
/**
* Used to filter params (include/exclude)
*
* @param $param
* @param $change_fields
*
* @return array|null
* @internal
*
*/
function vc_map_integrate_include_exclude_fields( $param, $change_fields ) {
if ( is_array( $change_fields ) ) {
if ( isset( $change_fields['exclude'] ) && in_array( $param['param_name'], $change_fields['exclude'], true ) ) {
$param = null;
return $param; // to prevent group adding to $param
} elseif ( isset( $change_fields['exclude_regex'] ) ) {
if ( is_array( $change_fields['exclude_regex'] ) && ! empty( $change_fields['exclude_regex'] ) ) {
$break_foreach = false;
foreach ( $change_fields['exclude_regex'] as $regex ) {
/** @noinspection PhpUsageOfSilenceOperatorInspection */
// @codingStandardsIgnoreLine
if ( @preg_match( $regex, null ) ) {
if ( preg_match( $regex, $param['param_name'] ) ) {
$param = null;
$break_foreach = true;
}
}
if ( $break_foreach ) {
break;
}
}
if ( $break_foreach ) {
return $param; // to prevent group adding to $param
}
} elseif ( is_string( $change_fields['exclude_regex'] ) && strlen( $change_fields['exclude_regex'] ) > 0 ) {
/** @noinspection PhpUsageOfSilenceOperatorInspection */
// @codingStandardsIgnoreLine
if ( @preg_match( $change_fields['exclude_regex'], null ) ) {
if ( preg_match( $change_fields['exclude_regex'], $param['param_name'] ) ) {
$param = null;
return $param; // to prevent group adding to $param
}
}
}
}
if ( isset( $change_fields['include_only'] ) && ! in_array( $param['param_name'], $change_fields['include_only'], true ) ) {
// if we want to enclude only some fields
$param = null;
return $param; // to prevent group adding to $param
} elseif ( isset( $change_fields['include_only_regex'] ) ) {
if ( is_array( $change_fields['include_only_regex'] ) && ! empty( $change_fields['include_only_regex'] ) ) {
$break_foreach = false;
foreach ( $change_fields['include_only_regex'] as $regex ) {
/** @noinspection PhpUsageOfSilenceOperatorInspection */
// @codingStandardsIgnoreLine
if ( false === @preg_match( $regex, null ) ) {
// Regular expression is invalid, (don't remove @).
} else {
if ( ! preg_match( $regex, $param['param_name'] ) ) {
$param = null;
$break_foreach = true;
}
}
if ( $break_foreach ) {
break;
}
}
if ( $break_foreach ) {
return $param; // to prevent group adding to $param
}
} elseif ( is_string( $change_fields['include_only_regex'] ) && strlen( $change_fields['include_only_regex'] ) > 0 ) {
/** @noinspection PhpUsageOfSilenceOperatorInspection */
// @codingStandardsIgnoreLine
if ( false === @preg_match( $change_fields['include_only_regex'], null ) ) {
// Regular expression is invalid, (don't remove @).
} else {
if ( ! preg_match( $change_fields['include_only_regex'], $param['param_name'] ) ) {
$param = null;
return $param; // to prevent group adding to $param
}
}
}
}
}
return $param;
}
/**
* @param $param
* @param $dependency
*
* @return array
* @internal used to add dependency to existed param
*
*/
function vc_map_integrate_add_dependency( $param, $dependency ) {
// activator must be used for all elements who doesn't have 'dependency'
if ( ! empty( $dependency ) && ( ! isset( $param['dependency'] ) || empty( $param['dependency'] ) ) ) {
if ( is_array( $dependency ) ) {
$param['dependency'] = $dependency;
}
}
return $param;
}
/**
* @param $base_shortcode
* @param $integrated_shortcode
* @param string $field_prefix
* @return array
* @throws \Exception
*/
function vc_map_integrate_get_params( $base_shortcode, $integrated_shortcode, $field_prefix = '' ) {
$shortcode_data = WPBMap::getShortCode( $base_shortcode );
$params = array();
if ( is_array( $shortcode_data ) && is_array( $shortcode_data['params'] ) && ! empty( $shortcode_data['params'] ) ) {
foreach ( $shortcode_data['params'] as $param ) {
if ( is_array( $param ) && isset( $param['integrated_shortcode'] ) && $integrated_shortcode === $param['integrated_shortcode'] ) {
if ( ! empty( $field_prefix ) ) {
if ( isset( $param['integrated_shortcode_field'] ) && $field_prefix === $param['integrated_shortcode_field'] ) {
$params[] = $param;
}
} else {
$params[] = $param;
}
}
}
}
return $params;
}
/**
* @param $base_shortcode
* @param $integrated_shortcode
* @param string $field_prefix
* @return array
* @throws \Exception
*/
function vc_map_integrate_get_atts( $base_shortcode, $integrated_shortcode, $field_prefix = '' ) {
$params = vc_map_integrate_get_params( $base_shortcode, $integrated_shortcode, $field_prefix );
$atts = array();
if ( is_array( $params ) && ! empty( $params ) ) {
foreach ( $params as $param ) {
$value = '';
if ( isset( $param['value'] ) ) {
if ( isset( $param['std'] ) ) {
$value = $param['std'];
} elseif ( is_array( $param['value'] ) ) {
reset( $param['value'] );
$value = current( $param['value'] );
} else {
$value = $param['value'];
}
}
$atts[ $param['param_name'] ] = $value;
}
}
return $atts;
}
/**
* @param $base_shortcode
* @param $integrated_shortcode
* @param $atts
* @param string $field_prefix
* @return array
* @throws \Exception
*/
function vc_map_integrate_parse_atts( $base_shortcode, $integrated_shortcode, $atts, $field_prefix = '' ) {
$params = vc_map_integrate_get_params( $base_shortcode, $integrated_shortcode, $field_prefix );
$data = array();
if ( is_array( $params ) && ! empty( $params ) ) {
foreach ( $params as $param ) {
$value = '';
if ( isset( $atts[ $param['param_name'] ] ) ) {
$value = $atts[ $param['param_name'] ];
}
if ( isset( $value ) ) {
$key = $param['param_name'];
if ( strlen( $field_prefix ) > 0 ) {
$key = substr( $key, strlen( $field_prefix ) );
}
$data[ $key ] = $value;
}
}
}
return $data;
}
/**
* @param bool $label
* @return mixed|void
*/
function vc_map_add_css_animation( $label = true ) {
$data = array(
'type' => 'animation_style',
'heading' => esc_html__( 'CSS Animation', 'js_composer' ),
'param_name' => 'css_animation',
'admin_label' => $label,
'value' => '',
'settings' => array(
'type' => 'in',
'custom' => array(
array(
'label' => esc_html__( 'Default', 'js_composer' ),
'values' => array(
esc_html__( 'Top to bottom', 'js_composer' ) => 'top-to-bottom',
esc_html__( 'Bottom to top', 'js_composer' ) => 'bottom-to-top',
esc_html__( 'Left to right', 'js_composer' ) => 'left-to-right',
esc_html__( 'Right to left', 'js_composer' ) => 'right-to-left',
esc_html__( 'Appear from center', 'js_composer' ) => 'appear',
),
),
),
),
'description' => esc_html__( 'Select type of animation for element to be animated when it "enters" the browsers viewport (Note: works only in modern browsers).', 'js_composer' ),
);
return apply_filters( 'vc_map_add_css_animation', $data, $label );
}
/**
* Get settings of the mapped shortcode.
*
* @param $tag
*
* @return array|null - settings or null if shortcode not mapped
* @throws \Exception
* @since 4.4.3
*/
function vc_get_shortcode( $tag ) {
return WPBMap::getShortCode( $tag );
}
/**
* Remove all mapped shortcodes and the moment when function is called.
*
* @since 4.5
*/
function vc_remove_all_elements() {
WPBMap::dropAllShortcodes();
}
/**
* Function to get defaults values for shortcode.
* @param $tag - shortcode tag
*
* @return array - list of param=>default_value
* @throws \Exception
* @since 4.6
*
*/
function vc_map_get_defaults( $tag ) {
$shortcode = vc_get_shortcode( $tag );
$params = array();
if ( is_array( $shortcode ) && isset( $shortcode['params'] ) && ! empty( $shortcode['params'] ) ) {
$params = vc_map_get_params_defaults( $shortcode['params'] );
}
return $params;
}
/**
* @param $params
*
* @return array
* @since 4.12
*/
function vc_map_get_params_defaults( $params ) {
$resultParams = array();
foreach ( $params as $param ) {
if ( isset( $param['param_name'] ) && 'content' !== $param['param_name'] ) {
$value = '';
if ( isset( $param['std'] ) ) {
$value = $param['std'];
} elseif ( isset( $param['value'] ) ) {
if ( is_array( $param['value'] ) ) {
$value = current( $param['value'] );
if ( is_array( $value ) ) {
// in case if two-dimensional array provided (vc_basic_grid)
$value = current( $value );
}
// return first value from array (by default)
} else {
$value = $param['value'];
}
}
$resultParams[ $param['param_name'] ] = apply_filters( 'vc_map_get_param_defaults', $value, $param );
}
}
return $resultParams;
}
/**
* @param $tag - shortcode tag3
* @param array $atts - shortcode attributes
*
* @return array - return merged values with provided attributes (
* 'a'=>1,'b'=>2 + 'b'=>3,'c'=>4 --> 'a'=>1,'b'=>3 )
*
* @throws \Exception
* @see vc_shortcode_attribute_parse - return union of provided attributes (
* 'a'=>1,'b'=>2 + 'b'=>3,'c'=>4 --> 'a'=>1,
* 'b'=>3, 'c'=>4 )
*/
function vc_map_get_attributes( $tag, $atts = array() ) {
$atts = shortcode_atts( vc_map_get_defaults( $tag ), $atts, $tag );
return apply_filters( 'vc_map_get_attributes', $atts, $tag );
}
/**
* @param $name
* @return mixed|string
*/
function vc_convert_vc_color( $name ) {
$colors = array(
'blue' => '#5472d2',
'turquoise' => '#00c1cf',
'pink' => '#fe6c61',
'violet' => '#8d6dc4',
'peacoc' => '#4cadc9',
'chino' => '#cec2ab',
'mulled-wine' => '#50485b',
'vista-blue' => '#75d69c',
'orange' => '#f7be68',
'sky' => '#5aa1e3',
'green' => '#6dab3c',
'juicy-pink' => '#f4524d',
'sandy-brown' => '#f79468',
'purple' => '#b97ebb',
'black' => '#2a2a2a',
'grey' => '#ebebeb',
'white' => '#ffffff',
);
$name = str_replace( '_', '-', $name );
if ( isset( $colors[ $name ] ) ) {
return $colors[ $name ];
}
return '';
}
/**
* Extract width/height from string
*
* @param string $dimensions WxH
*
* @return mixed array(width, height) or false
* @since 4.7
*
*/
function vc_extract_dimensions( $dimensions ) {
$dimensions = str_replace( ' ', '', $dimensions );
$matches = null;
if ( preg_match( '/(\d+)x(\d+)/', $dimensions, $matches ) ) {
return array(
$matches[1],
$matches[2],
);
}
return false;
}
/**
* @param string $asset
*
* @return array|string
*/
function vc_get_shared( $asset = '' ) {
switch ( $asset ) {
case 'colors':
$asset = VcSharedLibrary::getColors();
break;
case 'colors-dashed':
$asset = VcSharedLibrary::getColorsDashed();
break;
case 'icons':
$asset = VcSharedLibrary::getIcons();
break;
case 'sizes':
$asset = VcSharedLibrary::getSizes();
break;
case 'button styles':
case 'alert styles':
$asset = VcSharedLibrary::getButtonStyles();
break;
case 'message_box_styles':
$asset = VcSharedLibrary::getMessageBoxStyles();
break;
case 'cta styles':
$asset = VcSharedLibrary::getCtaStyles();
break;
case 'text align':
$asset = VcSharedLibrary::getTextAlign();
break;
case 'cta widths':
case 'separator widths':
$asset = VcSharedLibrary::getElementWidths();
break;
case 'separator styles':
$asset = VcSharedLibrary::getSeparatorStyles();
break;
case 'separator border widths':
$asset = VcSharedLibrary::getBorderWidths();
break;
case 'single image styles':
$asset = VcSharedLibrary::getBoxStyles();
break;
case 'single image external styles':
$asset = VcSharedLibrary::getBoxStyles( array(
'default',
'round',
) );
break;
case 'toggle styles':
$asset = VcSharedLibrary::getToggleStyles();
break;
case 'animation styles':
$asset = VcSharedLibrary::getAnimationStyles();
break;
}
return $asset;
}
/**
* Helper function to register new shortcode attribute hook.
*
* @param $name - attribute name
* @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
* param list
* @param $script_url - javascript file url which will be attached at the end of settings form.
*
* @return bool
* @since 4.4
*/
function vc_add_shortcode_param( $name, $form_field_callback, $script_url = null ) {
return WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url );
}
/**
* Call hook for attribute.
*
* @param $name - attribute name
* @param $param_settings - attribute settings from shortcode
* @param $param_value - attribute value
* @param $tag - attribute tag
*
* @return mixed|string - returns html which will be render in hook
* @since 4.4
*/
function vc_do_shortcode_param_settings_field( $name, $param_settings, $param_value, $tag ) {
return WpbakeryShortcodeParams::renderSettingsField( $name, $param_settings, $param_value, $tag );
}
helpers/helpers.php 0000644 00000105337 15121635560 0010376 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder helpers functions
*
* @package WPBakeryPageBuilder
*
*/
// Check if this file is loaded in js_composer
if ( ! defined( 'WPB_VC_VERSION' ) ) {
die( '-1' );
}
/**
* @param array $params
*
* @return array|bool
* @since 4.2
* vc_filter: vc_wpb_getimagesize - to override output of this function
*/
function wpb_getImageBySize( $params = array() ) {
$params = array_merge( array(
'post_id' => null,
'attach_id' => null,
'thumb_size' => 'thumbnail',
'class' => '',
), $params );
if ( ! $params['thumb_size'] ) {
$params['thumb_size'] = 'thumbnail';
}
if ( ! $params['attach_id'] && ! $params['post_id'] ) {
return false;
}
$post_id = $params['post_id'];
$attach_id = $post_id ? get_post_thumbnail_id( $post_id ) : $params['attach_id'];
$attach_id = apply_filters( 'vc_object_id', $attach_id );
$thumb_size = $params['thumb_size'];
$thumb_class = ( isset( $params['class'] ) && '' !== $params['class'] ) ? $params['class'] . ' ' : '';
global $_wp_additional_image_sizes;
$thumbnail = '';
$sizes = array(
'thumbnail',
'thumb',
'medium',
'large',
'full',
);
if ( is_string( $thumb_size ) && ( ( ! empty( $_wp_additional_image_sizes[ $thumb_size ] ) && is_array( $_wp_additional_image_sizes[ $thumb_size ] ) ) || in_array( $thumb_size, $sizes, true ) ) ) {
$attributes = array( 'class' => $thumb_class . 'attachment-' . $thumb_size );
$thumbnail = wp_get_attachment_image( $attach_id, $thumb_size, false, $attributes );
} elseif ( $attach_id ) {
if ( is_string( $thumb_size ) ) {
preg_match_all( '/\d+/', $thumb_size, $thumb_matches );
if ( isset( $thumb_matches[0] ) ) {
$thumb_size = array();
$count = count( $thumb_matches[0] );
if ( $count > 1 ) {
$thumb_size[] = $thumb_matches[0][0]; // width
$thumb_size[] = $thumb_matches[0][1]; // height
} elseif ( 1 === $count ) {
$thumb_size[] = $thumb_matches[0][0]; // width
$thumb_size[] = $thumb_matches[0][0]; // height
} else {
$thumb_size = false;
}
}
}
if ( is_array( $thumb_size ) ) {
// Resize image to custom size
$p_img = wpb_resize( $attach_id, null, $thumb_size[0], $thumb_size[1], true );
$alt = trim( wp_strip_all_tags( get_post_meta( $attach_id, '_wp_attachment_image_alt', true ) ) );
$attachment = get_post( $attach_id );
if ( ! empty( $attachment ) ) {
$title = trim( wp_strip_all_tags( $attachment->post_title ) );
if ( empty( $alt ) ) {
$alt = trim( wp_strip_all_tags( $attachment->post_excerpt ) ); // If not, Use the Caption
}
if ( empty( $alt ) ) {
$alt = $title;
}
if ( $p_img ) {
$attributes = vc_stringify_attributes( array(
'class' => $thumb_class,
'src' => $p_img['url'],
'width' => $p_img['width'],
'height' => $p_img['height'],
'alt' => $alt,
'title' => $title,
) );
$thumbnail = '<img ' . $attributes . ' />';
}
}
}
}
$p_img_large = wp_get_attachment_image_src( $attach_id, 'large' );
return apply_filters( 'vc_wpb_getimagesize', array(
'thumbnail' => $thumbnail,
'p_img_large' => $p_img_large,
), $attach_id, $params );
}
/**
* @param $id
* @param $size
* @return array|false|mixed|string
*/
function vc_get_image_by_size( $id, $size ) {
global $_wp_additional_image_sizes;
$sizes = array(
'thumbnail',
'thumb',
'medium',
'large',
'full',
);
if ( is_string( $size ) && ( ( ! empty( $_wp_additional_image_sizes[ $size ] ) && is_array( $_wp_additional_image_sizes[ $size ] ) ) || in_array( $size, $sizes, true ) ) ) {
return wp_get_attachment_image_src( $id, $size );
} else {
if ( is_string( $size ) ) {
preg_match_all( '/\d+/', $size, $thumb_matches );
if ( isset( $thumb_matches[0] ) ) {
$size = array();
$count = count( $thumb_matches[0] );
if ( $count > 1 ) {
$size[] = $thumb_matches[0][0]; // width
$size[] = $thumb_matches[0][1]; // height
} elseif ( 1 === $count ) {
$size[] = $thumb_matches[0][0]; // width
$size[] = $thumb_matches[0][0]; // height
} else {
$size = false;
}
}
}
if ( is_array( $size ) ) {
// Resize image to custom size
$p_img = wpb_resize( $id, null, $size[0], $size[1], true );
return $p_img['url'];
}
}
return '';
}
/**
* Convert vc_col-sm-3 to 1/4
* @param $width
*
* @return string
* @since 4.2
*/
function wpb_translateColumnWidthToFractional( $width ) {
switch ( $width ) {
case 'vc_col-sm-2':
$w = '1/6';
break;
case 'vc_col-sm-3':
$w = '1/4';
break;
case 'vc_col-sm-4':
$w = '1/3';
break;
case 'vc_col-sm-6':
$w = '1/2';
break;
case 'vc_col-sm-8':
$w = '2/3';
break;
case 'vc_col-sm-9':
$w = '3/4';
break;
case 'vc_col-sm-12':
$w = '1/1';
break;
default:
$w = is_string( $width ) ? $width : '1/1';
}
return $w;
}
/**
* @param $width
*
* @return bool|string
* @since 4.2
*/
function wpb_translateColumnWidthToSpan( $width ) {
$output = $width;
preg_match( '/(\d+)\/(\d+)/', $width, $matches );
if ( ! empty( $matches ) ) {
$part_x = (int) $matches[1];
$part_y = (int) $matches[2];
if ( $part_x > 0 && $part_y > 0 ) {
$value = ceil( $part_x / $part_y * 12 );
if ( $value > 0 && $value <= 12 ) {
$output = 'vc_col-sm-' . $value;
}
}
}
if ( preg_match( '/\d+\/5$/', $width ) ) {
$output = 'vc_col-sm-' . $width;
}
return apply_filters( 'vc_translate_column_width_class', $output, $width );
}
/**
* @param $content
* @param bool $autop
*
* @return string
* @since 4.2
*/
function wpb_js_remove_wpautop( $content, $autop = false ) {
if ( $autop ) {
$content = wpautop( preg_replace( '/<\/?p\>/', "\n", $content ) . "\n" );
}
return do_shortcode( shortcode_unautop( $content ) );
}
if ( ! function_exists( 'shortcode_exists' ) ) {
/**
* Check if a shortcode is registered in WordPress.
*
* Examples: shortcode_exists( 'caption' ) - will return true.
* shortcode_exists( 'blah' ) - will return false.
*
* @param bool $shortcode
*
* @return bool
* @since 4.2
*/
function shortcode_exists( $shortcode = false ) {
global $shortcode_tags;
if ( ! $shortcode ) {
return false;
}
if ( array_key_exists( $shortcode, $shortcode_tags ) ) {
return true;
}
return false;
}
}
if ( ! function_exists( 'vc_siteAttachedImages' ) ) {
/**
* Helper function which returns list of site attached images, and if image is attached to the current post it adds class 'added'
* @param array $att_ids
*
* @return string
* @since 4.11
*/
function vc_siteAttachedImages( $att_ids = array() ) {
$output = '';
$limit = (int) apply_filters( 'vc_site_attached_images_query_limit', - 1 );
$media_images = get_posts( 'post_type=attachment&orderby=ID&numberposts=' . $limit );
foreach ( $media_images as $image_post ) {
$thumb_src = wp_get_attachment_image_src( $image_post->ID, 'thumbnail' );
$thumb_src = $thumb_src[0];
$class = ( in_array( $image_post->ID, $att_ids, true ) ) ? ' class="added"' : '';
$output .= '<li' . $class . '>
<img rel="' . esc_attr( $image_post->ID ) . '" src="' . esc_url( $thumb_src ) . '" />
<span class="img-added">' . esc_html__( 'Added', 'js_composer' ) . '</span>
</li>';
}
if ( '' !== $output ) {
$output = '<ul class="gallery_widget_img_select">' . $output . '</ul>';
}
return $output;
}
}
/**
* @param array $images IDs or srcs of images
*
* @return string
* @since 5.8
*/
function vc_field_attached_images( $images = array() ) {
$output = '';
foreach ( $images as $image ) {
if ( is_numeric( $image ) ) {
$thumb_src = wp_get_attachment_image_src( $image, 'thumbnail' );
$thumb_src = isset( $thumb_src[0] ) ? $thumb_src[0] : '';
} else {
$thumb_src = $image;
}
if ( $thumb_src ) {
$output .= '
<li class="added">
<img rel="' . esc_attr( $image ) . '" src="' . esc_url( $thumb_src ) . '" />
<a href="javascript:;" class="vc_icon-remove"><i class="vc-composer-icon vc-c-icon-close"></i></a>
</li>';
}
}
return $output;
}
/**
* @param $param_value
*
* @return array
* @since 4.2
*/
function wpb_removeNotExistingImgIDs( $param_value ) {
$tmp = explode( ',', $param_value );
$return_ar = array();
foreach ( $tmp as $id ) {
if ( wp_get_attachment_image( $id ) ) {
$return_ar[] = $id;
}
}
$tmp = implode( ',', $return_ar );
return $tmp;
}
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*/
if ( ! function_exists( 'wpb_resize' ) ) {
/**
* @param int $attach_id
* @param string $img_url
* @param int $width
* @param int $height
* @param bool $crop
*
* @return array
* @since 4.2
*/
function wpb_resize( $attach_id, $img_url, $width, $height, $crop = false ) {
// this is an attachment, so we have the ID
$image_src = array();
if ( $attach_id ) {
$image_src = wp_get_attachment_image_src( $attach_id, 'full' );
$actual_file_path = get_attached_file( $attach_id );
// this is not an attachment, let's use the image url
} elseif ( $img_url ) {
$file_path = wp_parse_url( $img_url );
$actual_file_path = rtrim( ABSPATH, '/' ) . $file_path['path'];
$orig_size = getimagesize( $actual_file_path );
$image_src[0] = $img_url;
$image_src[1] = $orig_size[0];
$image_src[2] = $orig_size[1];
}
if ( ! empty( $actual_file_path ) ) {
$file_info = pathinfo( $actual_file_path );
$extension = '.' . $file_info['extension'];
// the image path without the extension
$no_ext_path = $file_info['dirname'] . '/' . $file_info['filename'];
$cropped_img_path = $no_ext_path . '-' . $width . 'x' . $height . $extension;
// checking if the file size is larger than the target size
// if it is smaller or the same size, stop right here and return
if ( $image_src[1] > $width || $image_src[2] > $height ) {
// the file is larger, check if the resized version already exists (for $crop = true but will also work for $crop = false if the sizes match)
if ( file_exists( $cropped_img_path ) ) {
$cropped_img_url = str_replace( basename( $image_src[0] ), basename( $cropped_img_path ), $image_src[0] );
$vt_image = array(
'url' => $cropped_img_url,
'width' => $width,
'height' => $height,
);
return $vt_image;
}
if ( ! $crop ) {
// calculate the size proportionaly
$proportional_size = wp_constrain_dimensions( $image_src[1], $image_src[2], $width, $height );
$resized_img_path = $no_ext_path . '-' . $proportional_size[0] . 'x' . $proportional_size[1] . $extension;
// checking if the file already exists
if ( file_exists( $resized_img_path ) ) {
$resized_img_url = str_replace( basename( $image_src[0] ), basename( $resized_img_path ), $image_src[0] );
$vt_image = array(
'url' => $resized_img_url,
'width' => $proportional_size[0],
'height' => $proportional_size[1],
);
return $vt_image;
}
}
// no cache files - let's finally resize it
$img_editor = wp_get_image_editor( $actual_file_path );
if ( is_wp_error( $img_editor ) || is_wp_error( $img_editor->resize( $width, $height, $crop ) ) ) {
return array(
'url' => '',
'width' => '',
'height' => '',
);
}
$new_img_path = $img_editor->generate_filename();
if ( is_wp_error( $img_editor->save( $new_img_path ) ) ) {
return array(
'url' => '',
'width' => '',
'height' => '',
);
}
if ( ! is_string( $new_img_path ) ) {
return array(
'url' => '',
'width' => '',
'height' => '',
);
}
$new_img_size = getimagesize( $new_img_path );
$new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );
// resized output
$vt_image = array(
'url' => $new_img,
'width' => $new_img_size[0],
'height' => $new_img_size[1],
);
return $vt_image;
}
// default output - without resizing
$vt_image = array(
'url' => $image_src[0],
'width' => $image_src[1],
'height' => $image_src[2],
);
return $vt_image;
}
return false;
}
}
/**
* Method adds css class to body tag.
*
* Hooked class method by body_class WP filter. Method adds custom css class to body tag of the page to help
* identify and build design specially for VC shortcodes.
* Used in wp-content/plugins/js_composer/include/classes/core/class-vc-base.php\Vc_Base\bodyClass
*
* @param $classes
*
* @return array
* @since 4.2
*/
function js_composer_body_class( $classes ) {
$classes[] = 'wpb-js-composer js-comp-ver-' . WPB_VC_VERSION;
$disable_responsive = vc_settings()->get( 'not_responsive_css' );
if ( '1' !== $disable_responsive ) {
$classes[] = 'vc_responsive';
} else {
$classes[] = 'vc_non_responsive';
}
return $classes;
}
/**
* @param $m
*
* @return string
* @since 4.2
*/
function vc_convert_shortcode( $m ) {
list( $output, $m_one, $tag, $attr_string, $m_four, $content ) = $m;
if ( 'vc_row' === $tag || 'vc_section' === $tag ) {
return $output;
}
$result = '';
$el_position = '';
$width = '1/1';
$shortcode_attr = shortcode_parse_atts( $attr_string );
extract( shortcode_atts( array(
'width' => '1/1',
'el_class' => '',
'el_position' => '',
), $shortcode_attr ) );
// Start
if ( preg_match( '/first/', $el_position ) || empty( $shortcode_attr['width'] ) || '1/1' === $shortcode_attr['width'] ) {
$result = '[vc_row]';
}
if ( 'vc_column' !== $tag ) {
$result .= '[vc_column width="' . $width . '"]';
}
// Tag
$pattern = get_shortcode_regex();
if ( 'vc_column' === $tag ) {
$result .= "[{$m_one}{$tag} {$attr_string}]" . preg_replace_callback( "/{$pattern}/s", 'vc_convert_inner_shortcode', $content ) . "[/{$tag}{$m_four}]";
} elseif ( 'vc_tabs' === $tag || 'vc_accordion' === $tag || 'vc_tour' === $tag ) {
$result .= "[{$m_one}{$tag} {$attr_string}]" . preg_replace_callback( "/{$pattern}/s", 'vc_convert_tab_inner_shortcode', $content ) . "[/{$tag}{$m_four}]";
} else {
$result .= preg_replace( '/(\"\d\/\d\")/', '"1/1"', $output );
}
// End
if ( 'vc_column' !== $tag ) {
$result .= '[/vc_column]';
}
if ( preg_match( '/last/', $el_position ) || empty( $shortcode_attr['width'] ) || '1/1' === $shortcode_attr['width'] ) {
$result .= '[/vc_row]' . "\n";
}
return trim( $result );
}
/**
* @param $m
*
* @return string
* @since 4.2
*/
function vc_convert_tab_inner_shortcode( $m ) {
list( $output, $m_one, $tag, $attr_string, $m_four, $content ) = $m;
$result = '';
extract( shortcode_atts( array(
'width' => '1/1',
'el_class' => '',
'el_position' => '',
), shortcode_parse_atts( $attr_string ) ) );
$pattern = get_shortcode_regex();
$result .= "[{$m_one}{$tag} {$attr_string}]" . preg_replace_callback( "/{$pattern}/s", 'vc_convert_inner_shortcode', $content ) . "[/{$tag}{$m_four}]";
return $result;
}
/**
* @param $m
*
* @return string
* @since 4.2
*/
function vc_convert_inner_shortcode( $m ) {
list( $output, $m_one, $tag, $attr_string, $m_four, $content ) = $m;
$result = '';
$width = '';
$el_position = '';
extract( shortcode_atts( array(
'width' => '1/1',
'el_class' => '',
'el_position' => '',
), shortcode_parse_atts( $attr_string ) ) );
if ( '1/1' !== $width ) {
if ( preg_match( '/first/', $el_position ) ) {
$result .= '[vc_row_inner]';
}
$result .= "\n" . '[vc_column_inner width="' . esc_attr( $width ) . '" el_position="' . esc_attr( $el_position ) . '"]';
$attr = '';
foreach ( shortcode_parse_atts( $attr_string ) as $key => $value ) {
if ( 'width' === $key ) {
$value = '1/1';
} elseif ( 'el_position' === $key ) {
$value = 'first last';
}
$attr .= ' ' . $key . '="' . $value . '"';
}
$result .= "[{$m_one}{$tag} {$attr}]" . $content . "[/{$tag}{$m_four}]";
$result .= '[/vc_column_inner]';
if ( preg_match( '/last/', $el_position ) ) {
$result .= '[/vc_row_inner]' . "\n";
}
} else {
$result = $output;
}
return $result;
}
global $vc_row_layouts;
$vc_row_layouts = array(
array(
'cells' => '11',
'mask' => '12',
'title' => '1/1',
'icon_class' => '1-1',
),
array(
'cells' => '12_12',
'mask' => '26',
'title' => '1/2 + 1/2',
'icon_class' => '1-2_1-2',
),
array(
'cells' => '23_13',
'mask' => '29',
'title' => '2/3 + 1/3',
'icon_class' => '2-3_1-3',
),
array(
'cells' => '13_13_13',
'mask' => '312',
'title' => '1/3 + 1/3 + 1/3',
'icon_class' => '1-3_1-3_1-3',
),
array(
'cells' => '14_14_14_14',
'mask' => '420',
'title' => '1/4 + 1/4 + 1/4 + 1/4',
'icon_class' => '1-4_1-4_1-4_1-4',
),
array(
'cells' => '14_34',
'mask' => '212',
'title' => '1/4 + 3/4',
'icon_class' => '1-4_3-4',
),
array(
'cells' => '14_12_14',
'mask' => '313',
'title' => '1/4 + 1/2 + 1/4',
'icon_class' => '1-4_1-2_1-4',
),
array(
'cells' => '56_16',
'mask' => '218',
'title' => '5/6 + 1/6',
'icon_class' => '5-6_1-6',
),
array(
'cells' => '16_16_16_16_16_16',
'mask' => '642',
'title' => '1/6 + 1/6 + 1/6 + 1/6 + 1/6 + 1/6',
'icon_class' => '1-6_1-6_1-6_1-6_1-6_1-6',
),
array(
'cells' => '16_23_16',
'mask' => '319',
'title' => '1/6 + 4/6 + 1/6',
'icon_class' => '1-6_2-3_1-6',
),
array(
'cells' => '16_16_16_12',
'mask' => '424',
'title' => '1/6 + 1/6 + 1/6 + 1/2',
'icon_class' => '1-6_1-6_1-6_1-2',
),
array(
'cells' => '15_15_15_15_15',
'mask' => '530',
'title' => '1/5 + 1/5 + 1/5 + 1/5 + 1/5',
'icon_class' => 'l_15_15_15_15_15',
),
);
/**
* @param $width
*
* @return string
* @since 4.2
*/
function wpb_vc_get_column_width_indent( $width ) {
$identy = '11';
if ( 'vc_col-sm-6' === $width ) {
$identy = '12';
} elseif ( 'vc_col-sm-3' === $width ) {
$identy = '14';
} elseif ( 'vc_col-sm-4' === $width ) {
$identy = '13';
} elseif ( 'vc_col-sm-8' === $width ) {
$identy = '23';
} elseif ( 'vc_col-sm-9' === $width ) {
$identy = '34';
} elseif ( 'vc_col-sm-2' === $width ) {
$identy = '16'; // TODO: check why there is no "vc_col-sm-1, -5, -6, -7, -11, -12.
} elseif ( 'vc_col-sm-10' === $width ) {
$identy = '56';
}
return $identy;
}
/**
* Make any HEX color lighter or darker
* @param $colour
* @param $per
*
* @return string
* @since 4.2
*/
function vc_colorCreator( $colour, $per = 10 ) {
require_once 'class-vc-color-helper.php';
$color = $colour;
if ( stripos( $colour, 'rgba(' ) !== false ) {
$rgb = str_replace( array(
'rgba',
'rgb',
'(',
')',
), '', $colour );
$rgb = explode( ',', $rgb );
$rgb_array = array(
'R' => $rgb[0],
'G' => $rgb[1],
'B' => $rgb[2],
);
$alpha = $rgb[3];
try {
$color = Vc_Color_Helper::rgbToHex( $rgb_array );
$color_obj = new Vc_Color_Helper( $color );
if ( $per >= 0 ) {
$color = $color_obj->lighten( $per );
} else {
$color = $color_obj->darken( abs( $per ) );
}
$rgba = $color_obj->hexToRgb( $color );
$rgba[] = $alpha;
$css_rgba_color = 'rgba(' . implode( ', ', $rgba ) . ')';
return $css_rgba_color;
} catch ( Exception $e ) {
// In case of error return same as given
return $colour;
}
} elseif ( stripos( $colour, 'rgb(' ) !== false ) {
$rgb = str_replace( array(
'rgba',
'rgb',
'(',
')',
), '', $colour );
$rgb = explode( ',', $rgb );
$rgb_array = array(
'R' => $rgb[0],
'G' => $rgb[1],
'B' => $rgb[2],
);
try {
$color = Vc_Color_Helper::rgbToHex( $rgb_array );
} catch ( Exception $e ) {
// In case of error return same as given
return $colour;
}
}
try {
$color_obj = new Vc_Color_Helper( $color );
if ( $per >= 0 ) {
$color = $color_obj->lighten( $per );
} else {
$color = $color_obj->darken( abs( $per ) );
}
return '#' . $color;
} catch ( Exception $e ) {
return $colour;
}
}
/**
* HEX to RGB converter
* @param $color
*
* @return array|bool
* @since 4.2
*/
function vc_hex2rgb( $color ) {
$color = str_replace( '#', '', $color );
if ( strlen( $color ) === 6 ) {
list( $r, $g, $b ) = array(
$color[0] . $color[1],
$color[2] . $color[3],
$color[4] . $color[5],
);
} elseif ( strlen( $color ) === 3 ) {
list( $r, $g, $b ) = array(
$color[0] . $color[0],
$color[1] . $color[1],
$color[2] . $color[2],
);
} else {
return false;
}
$r = hexdec( $r );
$g = hexdec( $g );
$b = hexdec( $b );
return array(
$r,
$g,
$b,
);
}
/**
* Parse string like "title:Hello world|weekday:Monday" to array('title' => 'Hello World', 'weekday' => 'Monday')
*
* @param $value
* @param array $default
*
* @return array
* @since 4.2
*/
function vc_parse_multi_attribute( $value, $default = array() ) {
$result = $default;
$params_pairs = explode( '|', $value );
if ( ! empty( $params_pairs ) ) {
foreach ( $params_pairs as $pair ) {
$param = preg_split( '/\:/', $pair );
if ( ! empty( $param[0] ) && isset( $param[1] ) ) {
$result[ $param[0] ] = trim( rawurldecode( $param[1] ) );
}
}
}
return $result;
}
/**
* @param $v
*
* @return string
* @since 4.2
*/
function vc_param_options_parse_values( $v ) {
return rawurldecode( $v );
}
/**
* @param $name
* @param $settings
*
* @return bool
* @since 4.2
*/
function vc_param_options_get_settings( $name, $settings ) {
if ( is_array( $settings ) ) {
foreach ( $settings as $params ) {
if ( isset( $params['name'] ) && $params['name'] === $name && isset( $params['type'] ) ) {
return $params;
}
}
}
return false;
}
/**
* @param $atts
*
* @return string
* @since 4.2
*/
function vc_convert_atts_to_string( $atts ) {
$output = '';
foreach ( $atts as $key => $value ) {
$output .= ' ' . $key . '="' . $value . '"';
}
return $output;
}
/**
* @param $string
* @param $tag
* @param $param
*
* @return array
* @throws \Exception
* @since 4.2
*/
function vc_parse_options_string( $string, $tag, $param ) {
$options = array();
$option_settings_list = array();
$settings = WPBMap::getParam( $tag, $param );
foreach ( preg_split( '/\|/', $string ) as $value ) {
if ( preg_match( '/\:/', $value ) ) {
$split = preg_split( '/\:/', $value );
$option_name = $split[0];
$option_settings = vc_param_options_get_settings( $option_name, $settings['options'] );
$option_settings_list[ $option_name ] = $option_settings;
if ( isset( $option_settings['type'] ) && 'checkbox' === $option_settings['type'] ) {
$option_value = array_map( 'vc_param_options_parse_values', preg_split( '/\,/', $split[1] ) );
} else {
$option_value = rawurldecode( $split[1] );
}
$options[ $option_name ] = $option_value;
}
}
if ( isset( $settings['options'] ) ) {
foreach ( $settings['options'] as $setting_option ) {
if ( 'separator' !== $setting_option['type'] && isset( $setting_option['value'] ) && empty( $options[ $setting_option['name'] ] ) ) {
$options[ $setting_option['name'] ] = 'checkbox' === $setting_option['type'] ? preg_split( '/\,/', $setting_option['value'] ) : $setting_option['value'];
}
if ( isset( $setting_option['name'] ) && isset( $options[ $setting_option['name'] ] ) && isset( $setting_option['value_type'] ) ) {
if ( 'integer' === $setting_option['value_type'] ) {
$options[ $setting_option['name'] ] = (int) $options[ $setting_option['name'] ];
} elseif ( 'float' === $setting_option['value_type'] ) {
$options[ $setting_option['name'] ] = (float) $options[ $setting_option['name'] ];
} elseif ( 'boolean' === $setting_option['value_type'] ) {
$options[ $setting_option['name'] ] = (bool) $options[ $setting_option['name'] ];
}
}
}
}
return $options;
}
/**
* Convert string to a valid css class name.
*
* @param string $class
*
* @return string
* @since 4.3
*
*/
function vc_build_safe_css_class( $class ) {
return preg_replace( '/\W+/', '', strtolower( str_replace( ' ', '_', wp_strip_all_tags( $class ) ) ) );
}
/**
* Include template from templates dir.
*
* @param $template
* @param array $variables - passed variables to the template.
*
* @param bool $once
*
* @return mixed
* @since 4.3
*
*/
function vc_include_template( $template, $variables = array(), $once = false ) {
is_array( $variables ) && extract( $variables );
if ( $once ) {
return require_once vc_template( $template );
} else {
return require vc_template( $template );
}
}
/**
* Output template from templates dir.
*
* @param $template
* @param array $variables - passed variables to the template.
*
* @param bool $once
*
* @return string
* @since 4.4
*
*/
function vc_get_template( $template, $variables = array(), $once = false ) {
ob_start();
$output = vc_include_template( $template, $variables, $once );
if ( 1 === $output ) {
$output = ob_get_contents();
}
ob_end_clean();
return $output;
}
/**
* if php version < 5.3 this function is required.
*/
if ( ! function_exists( 'lcfirst' ) ) {
/**
* @param $str
*
* @return mixed
* @since 4.3, fix #1093
*/
function lcfirst( $str ) {
$str[0] = function_exists( 'mb_strtolower' ) ? mb_strtolower( $str[0] ) : strtolower( $str[0] );
return $str;
}
}
/**
* VC Convert a value to studly caps case.
*
* @param string $value
*
* @return string
* @since 4.3
*
*/
function vc_studly( $value ) {
$value = ucwords( str_replace( array(
'-',
'_',
), ' ', $value ) );
return str_replace( ' ', '', $value );
}
/**
* VC Convert a value to camel case.
*
* @param string $value
*
* @return string
* @since 4.3
*
*/
function vc_camel_case( $value ) {
return lcfirst( vc_studly( $value ) );
}
/**
* Enqueue icon element font
* @param $font
* @since 4.4
*
* @todo move to separate folder
*/
function vc_icon_element_fonts_enqueue( $font ) {
switch ( $font ) {
case 'fontawesome':
wp_enqueue_style( 'vc_font_awesome_5' );
break;
case 'openiconic':
wp_enqueue_style( 'vc_openiconic' );
break;
case 'typicons':
wp_enqueue_style( 'vc_typicons' );
break;
case 'entypo':
wp_enqueue_style( 'vc_entypo' );
break;
case 'linecons':
wp_enqueue_style( 'vc_linecons' );
break;
case 'monosocial':
wp_enqueue_style( 'vc_monosocialiconsfont' );
break;
case 'material':
wp_enqueue_style( 'vc_material' );
break;
default:
do_action( 'vc_enqueue_font_icon_element', $font ); // hook to custom do enqueue style
}
}
/**
* Function merges defaults attributes in attributes by keeping it values
*
* Example
* array defaults | array attributes | result array
* 'color'=>'black', - 'color'=>'black',
* 'target'=>'_self', 'target'=>'_blank', 'target'=>'_blank',
* - 'link'=>'google.com' 'link'=>'google.com'
*
* @param array $defaults
* @param array $attributes
*
* @return array - merged attributes
*
* @since 4.4
*
* @see vc_map_get_attributes
*/
function vc_shortcode_attribute_parse( $defaults = array(), $attributes = array() ) {
$atts = $attributes + shortcode_atts( $defaults, $attributes );
return $atts;
}
/**
* @param string $tagregexp
* @return string
*/
function vc_get_shortcode_regex( $tagregexp = '' ) {
if ( 0 === strlen( $tagregexp ) ) {
return get_shortcode_regex();
}
return '\\[' // Opening bracket
. '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
. "($tagregexp)" // 2: Shortcode name
. '(?![\\w\-])' // Not followed by word character or hyphen
. '(' // 3: Unroll the loop: Inside the opening shortcode tag
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. ')*?' . ')' . '(?:' . '(\\/)' // 4: Self closing tag ...
. '\\]' // ... and closing bracket
. '|' . '\\]' // Closing bracket
. '(?:' . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
. '[^\\[]*+' // Not an opening bracket
. '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
. '[^\\[]*+' // Not an opening bracket
. ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag
. ')?' . ')' . '(\\]?)';
}
/**
* Used to send warning message
*
* @param $message
*
* @return string
* @since 4.5
*
*/
function vc_message_warning( $message ) {
return '<div class="wpb_element_wrapper"><div class="vc_message_box vc_message_box-standard vc_message_box-rounded vc_color-warning">
<div class="vc_message_box-icon"><i class="fa fa-exclamation-triangle"></i>
</div><p class="messagebox_text">' . $message . '</p>
</div></div>';
}
/**
* Extract video ID from youtube url
*
* @param string $url Youtube url
*
* @return string
*/
function vc_extract_youtube_id( $url ) {
parse_str( wp_parse_url( $url, PHP_URL_QUERY ), $vars );
if ( ! isset( $vars['v'] ) ) {
return '';
}
return $vars['v'];
}
/**
* @return string[]|\WP_Taxonomy[]
*/
/**
* @return string[]|\WP_Taxonomy[]
*/
/**
* @return string[]|\WP_Taxonomy[]
*/
/**
* @return string[]|\WP_Taxonomy[]
*/
/**
* @return string[]|\WP_Taxonomy[]
*/
function vc_taxonomies_types( $post_type = null ) {
global $vc_taxonomies_types;
if ( is_null( $vc_taxonomies_types ) || $post_type ) {
$query = array( 'public' => true );
$vc_taxonomies_types = get_taxonomies( $query, 'objects' );
if ( ! empty( $post_type ) && is_array( $vc_taxonomies_types ) ) {
foreach ( $vc_taxonomies_types as $key => $taxonomy ) {
$arr = (array) $taxonomy;
if ( isset( $arr['object_type'] ) && ! in_array( $post_type, $arr['object_type'] ) ) {
unset( $vc_taxonomies_types[ $key ] );
}
}
}
}
return $vc_taxonomies_types;
}
/**
* Since
*
* @param $term
*
* @return array
* @since 4.5.3
*
*/
function vc_get_term_object( $term ) {
$vc_taxonomies_types = vc_taxonomies_types();
return array(
'label' => $term->name,
'value' => $term->term_id,
'group_id' => $term->taxonomy,
'group' => isset( $vc_taxonomies_types[ $term->taxonomy ], $vc_taxonomies_types[ $term->taxonomy ]->labels, $vc_taxonomies_types[ $term->taxonomy ]->labels->name ) ? $vc_taxonomies_types[ $term->taxonomy ]->labels->name : esc_html__( 'Taxonomies', 'js_composer' ),
);
}
/**
* Check if element has specific class
*
* E.g. f('foo', 'foo bar baz') -> true
*
* @param string $class Class to check for
* @param string $classes Classes separated by space(s)
*
* @return bool
*/
function vc_has_class( $class, $classes ) {
return in_array( $class, explode( ' ', strtolower( $classes ), true ), true );
}
/**
* Remove specific class from classes string
*
* E.g. f('foo', 'foo bar baz') -> 'bar baz'
*
* @param string $class Class to remove
* @param string $classes Classes separated by space(s)
*
* @return string
*/
function vc_remove_class( $class, $classes ) {
$list_classes = explode( ' ', strtolower( $classes ) );
$key = array_search( $class, $list_classes, true );
if ( false === $key ) {
return $classes;
}
unset( $list_classes[ $key ] );
return implode( ' ', $list_classes );
}
/**
* Convert array of named params to string version
* All values will be escaped
*
* E.g. f(array('name' => 'foo', 'id' => 'bar')) -> 'name="foo" id="bar"'
*
* @param $attributes
*
* @return string
*/
function vc_stringify_attributes( $attributes ) {
$atts = array();
foreach ( $attributes as $name => $value ) {
$atts[] = $name . '="' . esc_attr( $value ) . '"';
}
return implode( ' ', $atts );
}
/**
* @return bool
*/
/**
* @return bool
*/
/**
* @return bool
*/
/**
* @return bool
*/
/**
* @return bool
*/
function vc_is_responsive_disabled() {
$disable_responsive = vc_settings()->get( 'not_responsive_css' );
return '1' === $disable_responsive;
}
/**
* Do shortcode single render point
*
* @param $atts
* @param null $content
* @param null $tag
*
* @return string
* @throws \Exception
*/
function vc_do_shortcode( $atts, $content = null, $tag = null ) {
ob_start();
echo Vc_Shortcodes_Manager::getInstance()->getElementClass( $tag )->output( $atts, $content );
$content = ob_get_clean();
// @codingStandardsIgnoreStart
global $wp_embed;
if ( is_object( $wp_embed ) ) {
$content = $wp_embed->run_shortcode( $content );
$content = $wp_embed->autoembed( $content );
// @codingStandardsIgnoreEnd
}
return $content;
}
/**
* Return random string
*
* @param int $length
*
* @return string
*/
function vc_random_string( $length = 10 ) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$len = strlen( $characters );
$str = '';
for ( $i = 0; $i < $length; $i ++ ) {
$str .= $characters[ wp_rand( 0, $len - 1 ) ];
}
return $str;
}
/**
* @param $str
* @return string|string[]|null
*/
/**
* @param $str
* @return string|string[]|null
*/
/**
* @param $str
* @return string|string[]|null
*/
/**
* @param $str
* @return string|string[]|null
*/
/**
* @param $str
* @return string|string[]|null
*/
function vc_slugify( $str ) {
$str = strtolower( $str );
$str = html_entity_decode( $str );
$str = preg_replace( '/[^\w ]+/', '', $str );
$str = preg_replace( '/ +/', '-', $str );
return $str;
}
/**
* WPBakery WPBakery Page Builder filter functions
*
* @package WPBakeryPageBuilder
*/
/**
* This filter should be applied to all content elements titles
*
* $params['extraclass'] Extra class name will be added
*
*
* To override content element title default html markup, paste this code in your theme's functions.php file
* vc_filter: wpb_widget_title
* add_filter('wpb_widget_title', 'override_widget_title', 10, 2);
* function override_widget_title($output = '', $params = array('')) {
* $extraclass = (isset($params['extraclass'])) ? " ".$params['extraclass'] : "";
* return '<h1 class="entry-title'.$extraclass.'">'.$params['title'].'</h1>';
* }
*
* @param array $params
*
* @return mixed|string
*/
function wpb_widget_title( $params = array( 'title' => '' ) ) {
if ( '' === $params['title'] ) {
return '';
}
$extraclass = ( isset( $params['extraclass'] ) ) ? ' ' . $params['extraclass'] : '';
$output = '<h2 class="wpb_heading' . esc_attr( $extraclass ) . '">' . esc_html( $params['title'] ) . '</h2>';
return apply_filters( 'wpb_widget_title', $output, $params );
}
/**
* Used to remove raw_html/raw_js elements from content
* @param $content
* @return string|string[]|null
* @since 6.3.0
*/
function wpb_remove_custom_html( $content ) {
if ( ! vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get() ) {
// html encoded shortcodes
$regex = vc_get_shortcode_regex( implode( '|', apply_filters( 'wpb_custom_html_elements', array(
'vc_raw_html',
'vc_raw_js',
) ) ) );
// custom on click
$button_regex = vc_get_shortcode_regex( 'vc_btn' );
$content = preg_replace_callback( '/' . $button_regex . '/', 'wpb_remove_custom_onclick', $content );
$content = preg_replace( '/' . $regex . '/', '', $content );
}
return $content;
}
function wpb_remove_custom_onclick( $match ) {
if ( strpos( $match[3], 'custom_onclick' ) !== false ) {
return '';
}
return $match[0];
}
params/iconpicker/iconpicker.php 0000644 00001340010 15121635560 0013017 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
*
* Class Vc_IconPicker
* @since 4.4
* See example usage in shortcode 'vc_icon'
*
* `` example
* array(
* 'type' => 'iconpicker',
* 'heading' => esc_html__( 'Icon', 'js_composer' ),
* 'param_name' => 'icon_fontawesome',
* 'settings' => array(
* 'emptyIcon' => false, // default true, display an "EMPTY"
* icon? - if false it will display first icon from set as default.
* 'iconsPerPage' => 200, // default 100, how many icons
* per/page to display
* ),
* 'dependency' => array(
* 'element' => 'type',
* 'value' => 'fontawesome',
* ),
* ),
* vc_filter: vc_iconpicker-type-{your_icon_font_name} - filter to add new icon
* font type. see example for vc_iconpicker-type-fontawesome in bottom of
* this file Also // SEE HOOKS FOLDER FOR FONTS REGISTERING/ENQUEUE IN BASE
* @path "/include/autoload/hook-vc-iconpicker-param.php"
*/
class Vc_IconPicker {
/**
* @since 4.4
* @var array - save current param data array from vc_map
*/
protected $settings;
/**
* @since 4.4
* @var string - save a current field value
*/
protected $value;
/**
* @since 4.4
* @var array - optional, can be used as self source from self array., you
* can pass it also with filter see Vc_IconPicker::setDefaults
*/
protected $source = array();
/**
* @param $settings - param field data array
* @param $value - param field value
* @since 4.4
*
*/
public function __construct( $settings, $value ) {
$this->settings = $settings;
$this->setDefaults();
$this->value = $value; // param field value
}
/**
* Set default function will extend current settings with defaults
* It can be used in Vc_IconPicker::render, but also it is passed to input
* field and was hooked in composer-atts.js file See vc.atts.iconpicker in
* wp-content/plugins/js_composer/assets/js/params/composer-atts.js init
* method
* - it initializes javascript logic, you can provide ANY default param to
* it with 'settings' key
* @since 4.4
*/
protected function setDefaults() {
if ( ! isset( $this->settings['settings'], $this->settings['settings']['type'] ) ) {
$this->settings['settings']['type'] = 'fontawesome'; // Default type for icons
}
// More about this you can read in http://codeb.it/fonticonpicker/
if ( ! isset( $this->settings['settings'], $this->settings['settings']['hasSearch'] ) ) {
// Whether or not to show the search bar.
$this->settings['settings']['hasSearch'] = true;
}
if ( ! isset( $this->settings['settings'], $this->settings['settings']['emptyIcon'] ) ) {
// Whether or not empty icon should be shown on the icon picker
$this->settings['settings']['emptyIcon'] = true;
}
if ( ! isset( $this->settings['settings'], $this->settings['settings']['allCategoryText'] ) ) {
// If categorized then use this option
$this->settings['settings']['allCategoryText'] = esc_html__( 'From all categories', 'js_composer' );
}
if ( ! isset( $this->settings['settings'], $this->settings['settings']['unCategorizedText'] ) ) {
// If categorized then use this option
$this->settings['settings']['unCategorizedText'] = esc_html__( 'Uncategorized', 'js_composer' );
}
/**
* Source for icons, can be passed via "mapping" or with filter vc_iconpicker-type-{your_type} (default fontawesome)
* vc_filter: vc_iconpicker-type-{your_type} (default fontawesome)
*/
if ( isset( $this->settings['settings'], $this->settings['settings']['source'] ) ) {
$this->source = $this->settings['settings']['source'];
unset( $this->settings['settings']['source'] ); // We don't need this on frontend.(js)
}
}
/**
* Render edit form field type 'iconpicker' with selected settings and
* provided value. It uses javascript file vc-icon-picker
* (vc_iconpicker_base_register_js, vc_iconpicker_editor_jscss), see
* wp-content/plugins/js_composer/include/autoload/hook-vc-iconpicker-param.php
* folder
* @return string - rendered param field for editor panel
* @since 4.4
*/
public function render() {
$output = '<div class="vc-iconpicker-wrapper"><select class="vc-iconpicker">';
// call filter vc_iconpicker-type-{your_type}, e.g. vc_iconpicker-type-fontawesome with passed source from shortcode(default empty array). to get icons
$arr = apply_filters( 'vc_iconpicker-type-' . esc_attr( $this->settings['settings']['type'] ), $this->source );
if ( isset( $this->settings['settings'], $this->settings['settings']['emptyIcon'] ) && true === $this->settings['settings']['emptyIcon'] ) {
array_unshift( $arr, array() );
}
if ( ! empty( $arr ) ) {
foreach ( $arr as $group => $icons ) {
if ( ! is_array( $icons ) || ! is_array( current( $icons ) ) ) {
$class_key = key( $icons );
$output .= '<option value="' . esc_attr( $class_key ) . '" ' . ( strcmp( $class_key, $this->value ) === 0 ? 'selected' : '' ) . '>' . esc_html( current( $icons ) ) . '</option>' . "\n";
} else {
$output .= '<optgroup label="' . esc_attr( $group ) . '">' . "\n";
foreach ( $icons as $key => $label ) {
$class_key = key( $label );
$output .= '<option value="' . esc_attr( $class_key ) . '" ' . ( strcmp( $class_key, $this->value ) === 0 ? 'selected' : '' ) . '>' . esc_html( current( $label ) ) . '</option>' . "\n";
}
$output .= '</optgroup>' . "\n";
}
}
}
$output .= '</select></div>';
$output .= '<input name="' . esc_attr( $this->settings['param_name'] ) . '" class="wpb_vc_param_value ' . esc_attr( $this->settings['param_name'] ) . ' ' . esc_attr( $this->settings['type'] ) . '_field" type="hidden" value="' . esc_attr( $this->value ) . '" ' . ( ( isset( $this->settings['settings'] ) && ! empty( $this->settings['settings'] ) ) ? ' data-settings="' . esc_attr( wp_json_encode( $this->settings['settings'] ) ) . '" ' : '' ) . ' />';
return $output;
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $settings
* @param $value
* @param $tag
*
* @return string - rendered template for params in edit form
*
* @since 4.4
*/
function vc_iconpicker_form_field( $settings, $value, $tag ) {
$icon_picker = new Vc_IconPicker( $settings, $value );
return apply_filters( 'vc_iconpicker_render_filter', $icon_picker->render() );
}
// SEE HOOKS FOLDER FOR FONTS REGISTERING/ENQUEUE IN BASE @path "/include/autoload/hook-vc-iconpicker-param.php"
add_filter( 'vc_iconpicker-type-fontawesome', 'vc_iconpicker_type_fontawesome' );
/**
* Fontawesome icons from FontAwesome :)
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_fontawesome( $icons ) {
// Categorized icons ( you can also output simple array ( key=> value ), where key = icon class, value = icon readable name ).
/**
* @version 4.7
*/
$fontawesome_icons = array(
'Accessibility' => array(
array( 'fab fa-accessible-icon' => 'Accessible Icon (accessibility,handicap,person,wheelchair,wheelchair-alt)' ),
array( 'fas fa-american-sign-language-interpreting' => 'American Sign Language Interpreting (asl,deaf,finger,hand,interpret,speak)' ),
array( 'fas fa-assistive-listening-systems' => 'Assistive Listening Systems (amplify,audio,deaf,ear,headset,hearing,sound)' ),
array( 'fas fa-audio-description' => 'Audio Description (blind,narration,video,visual)' ),
array( 'fas fa-blind' => 'Blind (cane,disability,person,sight)' ),
array( 'fas fa-braille' => 'Braille (alphabet,blind,dots,raised,vision)' ),
array( 'fas fa-closed-captioning' => 'Closed Captioning (cc,deaf,hearing,subtitle,subtitling,text,video)' ),
array( 'far fa-closed-captioning' => 'Closed Captioning (cc,deaf,hearing,subtitle,subtitling,text,video)' ),
array( 'fas fa-deaf' => 'Deaf (ear,hearing,sign language)' ),
array( 'fas fa-low-vision' => 'Low Vision (blind,eye,sight)' ),
array( 'fas fa-phone-volume' => 'Phone Volume (call,earphone,number,sound,support,telephone,voice,volume-control-phone)' ),
array( 'fas fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'far fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'fas fa-sign-language' => 'Sign Language (Translate,asl,deaf,hands)' ),
array( 'fas fa-tty' => 'TTY (communication,deaf,telephone,teletypewriter,text)' ),
array( 'fas fa-universal-access' => 'Universal Access (accessibility,hearing,person,seeing,visual impairment)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
),
'Alert' => array(
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-exclamation' => 'exclamation (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-circle' => 'Exclamation Circle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-triangle' => 'Exclamation Triangle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-radiation' => 'Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-radiation-alt' => 'Alternate Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
),
'Animals' => array(
array( 'fas fa-cat' => 'Cat (feline,halloween,holiday,kitten,kitty,meow,pet)' ),
array( 'fas fa-crow' => 'Crow (bird,bullfrog,fauna,halloween,holiday,toad)' ),
array( 'fas fa-dog' => 'Dog (animal,canine,fauna,mammal,pet,pooch,puppy,woof)' ),
array( 'fas fa-dove' => 'Dove (bird,fauna,flying,peace,war)' ),
array( 'fas fa-dragon' => 'Dragon (Dungeons & Dragons,d&d,dnd,fantasy,fire,lizard,serpent)' ),
array( 'fas fa-feather' => 'Feather (bird,light,plucked,quill,write)' ),
array( 'fas fa-feather-alt' => 'Alternate Feather (bird,light,plucked,quill,write)' ),
array( 'fas fa-fish' => 'Fish (fauna,gold,seafood,swimming)' ),
array( 'fas fa-frog' => 'Frog (amphibian,bullfrog,fauna,hop,kermit,kiss,prince,ribbit,toad,wart)' ),
array( 'fas fa-hippo' => 'Hippo (animal,fauna,hippopotamus,hungry,mammal)' ),
array( 'fas fa-horse' => 'Horse (equus,fauna,mammmal,mare,neigh,pony)' ),
array( 'fas fa-horse-head' => 'Horse Head (equus,fauna,mammmal,mare,neigh,pony)' ),
array( 'fas fa-kiwi-bird' => 'Kiwi Bird (bird,fauna,new zealand)' ),
array( 'fas fa-otter' => 'Otter (animal,badger,fauna,fur,mammal,marten)' ),
array( 'fas fa-paw' => 'Paw (animal,cat,dog,pet,print)' ),
array( 'fas fa-spider' => 'Spider (arachnid,bug,charlotte,crawl,eight,halloween)' ),
),
'Arrows' => array(
array( 'fas fa-angle-double-down' => 'Angle Double Down (arrows,caret,download,expand)' ),
array( 'fas fa-angle-double-left' => 'Angle Double Left (arrows,back,caret,laquo,previous,quote)' ),
array( 'fas fa-angle-double-right' => 'Angle Double Right (arrows,caret,forward,more,next,quote,raquo)' ),
array( 'fas fa-angle-double-up' => 'Angle Double Up (arrows,caret,collapse,upload)' ),
array( 'fas fa-angle-down' => 'angle-down (arrow,caret,download,expand)' ),
array( 'fas fa-angle-left' => 'angle-left (arrow,back,caret,less,previous)' ),
array( 'fas fa-angle-right' => 'angle-right (arrow,care,forward,more,next)' ),
array( 'fas fa-angle-up' => 'angle-up (arrow,caret,collapse,upload)' ),
array( 'fas fa-arrow-alt-circle-down' => 'Alternate Arrow Circle Down (arrow-circle-o-down,download)' ),
array( 'far fa-arrow-alt-circle-down' => 'Alternate Arrow Circle Down (arrow-circle-o-down,download)' ),
array( 'fas fa-arrow-alt-circle-left' => 'Alternate Arrow Circle Left (arrow-circle-o-left,back,previous)' ),
array( 'far fa-arrow-alt-circle-left' => 'Alternate Arrow Circle Left (arrow-circle-o-left,back,previous)' ),
array( 'fas fa-arrow-alt-circle-right' => 'Alternate Arrow Circle Right (arrow-circle-o-right,forward,next)' ),
array( 'far fa-arrow-alt-circle-right' => 'Alternate Arrow Circle Right (arrow-circle-o-right,forward,next)' ),
array( 'fas fa-arrow-alt-circle-up' => 'Alternate Arrow Circle Up (arrow-circle-o-up)' ),
array( 'far fa-arrow-alt-circle-up' => 'Alternate Arrow Circle Up (arrow-circle-o-up)' ),
array( 'fas fa-arrow-circle-down' => 'Arrow Circle Down (download)' ),
array( 'fas fa-arrow-circle-left' => 'Arrow Circle Left (back,previous)' ),
array( 'fas fa-arrow-circle-right' => 'Arrow Circle Right (forward,next)' ),
array( 'fas fa-arrow-circle-up' => 'Arrow Circle Up (upload)' ),
array( 'fas fa-arrow-down' => 'arrow-down (download)' ),
array( 'fas fa-arrow-left' => 'arrow-left (back,previous)' ),
array( 'fas fa-arrow-right' => 'arrow-right (forward,next)' ),
array( 'fas fa-arrow-up' => 'arrow-up (forward,upload)' ),
array( 'fas fa-arrows-alt' => 'Alternate Arrows (arrow,arrows,bigger,enlarge,expand,fullscreen,move,position,reorder,resize)' ),
array( 'fas fa-arrows-alt-h' => 'Alternate Arrows Horizontal (arrows-h,expand,horizontal,landscape,resize,wide)' ),
array( 'fas fa-arrows-alt-v' => 'Alternate Arrows Vertical (arrows-v,expand,portrait,resize,tall,vertical)' ),
array( 'fas fa-caret-down' => 'Caret Down (arrow,dropdown,expand,menu,more,triangle)' ),
array( 'fas fa-caret-left' => 'Caret Left (arrow,back,previous,triangle)' ),
array( 'fas fa-caret-right' => 'Caret Right (arrow,forward,next,triangle)' ),
array( 'fas fa-caret-square-down' => 'Caret Square Down (arrow,caret-square-o-down,dropdown,expand,menu,more,triangle)' ),
array( 'far fa-caret-square-down' => 'Caret Square Down (arrow,caret-square-o-down,dropdown,expand,menu,more,triangle)' ),
array( 'fas fa-caret-square-left' => 'Caret Square Left (arrow,back,caret-square-o-left,previous,triangle)' ),
array( 'far fa-caret-square-left' => 'Caret Square Left (arrow,back,caret-square-o-left,previous,triangle)' ),
array( 'fas fa-caret-square-right' => 'Caret Square Right (arrow,caret-square-o-right,forward,next,triangle)' ),
array( 'far fa-caret-square-right' => 'Caret Square Right (arrow,caret-square-o-right,forward,next,triangle)' ),
array( 'fas fa-caret-square-up' => 'Caret Square Up (arrow,caret-square-o-up,collapse,triangle,upload)' ),
array( 'far fa-caret-square-up' => 'Caret Square Up (arrow,caret-square-o-up,collapse,triangle,upload)' ),
array( 'fas fa-caret-up' => 'Caret Up (arrow,collapse,triangle)' ),
array( 'fas fa-cart-arrow-down' => 'Shopping Cart Arrow Down (download,save,shopping)' ),
array( 'fas fa-chart-line' => 'Line Chart (activity,analytics,chart,dashboard,gain,graph,increase,line)' ),
array( 'fas fa-chevron-circle-down' => 'Chevron Circle Down (arrow,download,dropdown,menu,more)' ),
array( 'fas fa-chevron-circle-left' => 'Chevron Circle Left (arrow,back,previous)' ),
array( 'fas fa-chevron-circle-right' => 'Chevron Circle Right (arrow,forward,next)' ),
array( 'fas fa-chevron-circle-up' => 'Chevron Circle Up (arrow,collapse,upload)' ),
array( 'fas fa-chevron-down' => 'chevron-down (arrow,download,expand)' ),
array( 'fas fa-chevron-left' => 'chevron-left (arrow,back,bracket,previous)' ),
array( 'fas fa-chevron-right' => 'chevron-right (arrow,bracket,forward,next)' ),
array( 'fas fa-chevron-up' => 'chevron-up (arrow,collapse,upload)' ),
array( 'fas fa-cloud-download-alt' => 'Alternate Cloud Download (download,export,save)' ),
array( 'fas fa-cloud-upload-alt' => 'Alternate Cloud Upload (cloud-upload,import,save,upload)' ),
array( 'fas fa-compress-arrows-alt' => 'Alternate Compress Arrows (collapse,fullscreen,minimize,move,resize,shrink,smaller)' ),
array( 'fas fa-download' => 'Download (export,hard drive,save,transfer)' ),
array( 'fas fa-exchange-alt' => 'Alternate Exchange (arrow,arrows,exchange,reciprocate,return,swap,transfer)' ),
array( 'fas fa-expand-arrows-alt' => 'Alternate Expand Arrows (arrows-alt,bigger,enlarge,move,resize)' ),
array( 'fas fa-external-link-alt' => 'Alternate External Link (external-link,new,open,share)' ),
array( 'fas fa-external-link-square-alt' => 'Alternate External Link Square (external-link-square,new,open,share)' ),
array( 'fas fa-hand-point-down' => 'Hand Pointing Down (finger,hand-o-down,point)' ),
array( 'far fa-hand-point-down' => 'Hand Pointing Down (finger,hand-o-down,point)' ),
array( 'fas fa-hand-point-left' => 'Hand Pointing Left (back,finger,hand-o-left,left,point,previous)' ),
array( 'far fa-hand-point-left' => 'Hand Pointing Left (back,finger,hand-o-left,left,point,previous)' ),
array( 'fas fa-hand-point-right' => 'Hand Pointing Right (finger,forward,hand-o-right,next,point,right)' ),
array( 'far fa-hand-point-right' => 'Hand Pointing Right (finger,forward,hand-o-right,next,point,right)' ),
array( 'fas fa-hand-point-up' => 'Hand Pointing Up (finger,hand-o-up,point)' ),
array( 'far fa-hand-point-up' => 'Hand Pointing Up (finger,hand-o-up,point)' ),
array( 'fas fa-hand-pointer' => 'Pointer (Hand) (arrow,cursor,select)' ),
array( 'far fa-hand-pointer' => 'Pointer (Hand) (arrow,cursor,select)' ),
array( 'fas fa-history' => 'History (Rewind,clock,reverse,time,time machine)' ),
array( 'fas fa-level-down-alt' => 'Alternate Level Down (arrow,level-down)' ),
array( 'fas fa-level-up-alt' => 'Alternate Level Up (arrow,level-up)' ),
array( 'fas fa-location-arrow' => 'location-arrow (address,compass,coordinate,direction,gps,map,navigation,place)' ),
array( 'fas fa-long-arrow-alt-down' => 'Alternate Long Arrow Down (download,long-arrow-down)' ),
array( 'fas fa-long-arrow-alt-left' => 'Alternate Long Arrow Left (back,long-arrow-left,previous)' ),
array( 'fas fa-long-arrow-alt-right' => 'Alternate Long Arrow Right (forward,long-arrow-right,next)' ),
array( 'fas fa-long-arrow-alt-up' => 'Alternate Long Arrow Up (long-arrow-up,upload)' ),
array( 'fas fa-mouse-pointer' => 'Mouse Pointer (arrow,cursor,select)' ),
array( 'fas fa-play' => 'play (audio,music,playing,sound,start,video)' ),
array( 'fas fa-random' => 'random (arrows,shuffle,sort,swap,switch,transfer)' ),
array( 'fas fa-recycle' => 'Recycle (Waste,compost,garbage,reuse,trash)' ),
array( 'fas fa-redo' => 'Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-redo-alt' => 'Alternate Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-reply' => 'Reply (mail,message,respond)' ),
array( 'fas fa-reply-all' => 'reply-all (mail,message,respond)' ),
array( 'fas fa-retweet' => 'Retweet (refresh,reload,share,swap)' ),
array( 'fas fa-share' => 'Share (forward,save,send,social)' ),
array( 'fas fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'far fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'fas fa-sign-in-alt' => 'Alternate Sign In (arrow,enter,join,log in,login,sign in,sign up,sign-in,signin,signup)' ),
array( 'fas fa-sign-out-alt' => 'Alternate Sign Out (arrow,exit,leave,log out,logout,sign-out)' ),
array( 'fas fa-sort' => 'Sort (filter,order)' ),
array( 'fas fa-sort-alpha-down' => 'Sort Alphabetical Down (alphabetical,arrange,filter,order,sort-alpha-asc)' ),
array( 'fas fa-sort-alpha-down-alt' => 'Alternate Sort Alphabetical Down (alphabetical,arrange,filter,order,sort-alpha-asc)' ),
array( 'fas fa-sort-alpha-up' => 'Sort Alphabetical Up (alphabetical,arrange,filter,order,sort-alpha-desc)' ),
array( 'fas fa-sort-alpha-up-alt' => 'Alternate Sort Alphabetical Up (alphabetical,arrange,filter,order,sort-alpha-desc)' ),
array( 'fas fa-sort-amount-down' => 'Sort Amount Down (arrange,filter,number,order,sort-amount-asc)' ),
array( 'fas fa-sort-amount-down-alt' => 'Alternate Sort Amount Down (arrange,filter,order,sort-amount-asc)' ),
array( 'fas fa-sort-amount-up' => 'Sort Amount Up (arrange,filter,order,sort-amount-desc)' ),
array( 'fas fa-sort-amount-up-alt' => 'Alternate Sort Amount Up (arrange,filter,order,sort-amount-desc)' ),
array( 'fas fa-sort-down' => 'Sort Down (Descending) (arrow,descending,filter,order,sort-desc)' ),
array( 'fas fa-sort-numeric-down' => 'Sort Numeric Down (arrange,filter,numbers,order,sort-numeric-asc)' ),
array( 'fas fa-sort-numeric-down-alt' => 'Alternate Sort Numeric Down (arrange,filter,numbers,order,sort-numeric-asc)' ),
array( 'fas fa-sort-numeric-up' => 'Sort Numeric Up (arrange,filter,numbers,order,sort-numeric-desc)' ),
array( 'fas fa-sort-numeric-up-alt' => 'Alternate Sort Numeric Up (arrange,filter,numbers,order,sort-numeric-desc)' ),
array( 'fas fa-sort-up' => 'Sort Up (Ascending) (arrow,ascending,filter,order,sort-asc)' ),
array( 'fas fa-sync' => 'Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-sync-alt' => 'Alternate Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-text-height' => 'text-height (edit,font,format,text,type)' ),
array( 'fas fa-text-width' => 'Text Width (edit,font,format,text,type)' ),
array( 'fas fa-undo' => 'Undo (back,control z,exchange,oops,return,rotate,swap)' ),
array( 'fas fa-undo-alt' => 'Alternate Undo (back,control z,exchange,oops,return,swap)' ),
array( 'fas fa-upload' => 'Upload (hard drive,import,publish)' ),
),
'Audio & Video' => array(
array( 'fas fa-audio-description' => 'Audio Description (blind,narration,video,visual)' ),
array( 'fas fa-backward' => 'backward (previous,rewind)' ),
array( 'fas fa-broadcast-tower' => 'Broadcast Tower (airwaves,antenna,radio,reception,waves)' ),
array( 'fas fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'far fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'fas fa-closed-captioning' => 'Closed Captioning (cc,deaf,hearing,subtitle,subtitling,text,video)' ),
array( 'far fa-closed-captioning' => 'Closed Captioning (cc,deaf,hearing,subtitle,subtitling,text,video)' ),
array( 'fas fa-compress' => 'Compress (collapse,fullscreen,minimize,move,resize,shrink,smaller)' ),
array( 'fas fa-compress-arrows-alt' => 'Alternate Compress Arrows (collapse,fullscreen,minimize,move,resize,shrink,smaller)' ),
array( 'fas fa-eject' => 'eject (abort,cancel,cd,discharge)' ),
array( 'fas fa-expand' => 'Expand (arrow,bigger,enlarge,resize)' ),
array( 'fas fa-expand-arrows-alt' => 'Alternate Expand Arrows (arrows-alt,bigger,enlarge,move,resize)' ),
array( 'fas fa-fast-backward' => 'fast-backward (beginning,first,previous,rewind,start)' ),
array( 'fas fa-fast-forward' => 'fast-forward (end,last,next)' ),
array( 'fas fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'far fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'fas fa-file-video' => 'Video File (document,m4v,movie,mp4,play)' ),
array( 'far fa-file-video' => 'Video File (document,m4v,movie,mp4,play)' ),
array( 'fas fa-film' => 'Film (cinema,movie,strip,video)' ),
array( 'fas fa-forward' => 'forward (forward,next,skip)' ),
array( 'fas fa-headphones' => 'headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt-slash' => 'Alternate Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-music' => 'Music (lyrics,melody,note,sing,sound)' ),
array( 'fas fa-pause' => 'pause (hold,wait)' ),
array( 'fas fa-pause-circle' => 'Pause Circle (hold,wait)' ),
array( 'far fa-pause-circle' => 'Pause Circle (hold,wait)' ),
array( 'fas fa-phone-volume' => 'Phone Volume (call,earphone,number,sound,support,telephone,voice,volume-control-phone)' ),
array( 'fas fa-photo-video' => 'Photo Video (av,film,image,library,media)' ),
array( 'fas fa-play' => 'play (audio,music,playing,sound,start,video)' ),
array( 'fas fa-play-circle' => 'Play Circle (audio,music,playing,sound,start,video)' ),
array( 'far fa-play-circle' => 'Play Circle (audio,music,playing,sound,start,video)' ),
array( 'fas fa-podcast' => 'Podcast (audio,broadcast,music,sound)' ),
array( 'fas fa-random' => 'random (arrows,shuffle,sort,swap,switch,transfer)' ),
array( 'fas fa-redo' => 'Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-redo-alt' => 'Alternate Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-rss' => 'rss (blog,feed,journal,news,writing)' ),
array( 'fas fa-rss-square' => 'RSS Square (blog,feed,journal,news,writing)' ),
array( 'fas fa-step-backward' => 'step-backward (beginning,first,previous,rewind,start)' ),
array( 'fas fa-step-forward' => 'step-forward (end,last,next)' ),
array( 'fas fa-stop' => 'stop (block,box,square)' ),
array( 'fas fa-stop-circle' => 'Stop Circle (block,box,circle,square)' ),
array( 'far fa-stop-circle' => 'Stop Circle (block,box,circle,square)' ),
array( 'fas fa-sync' => 'Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-sync-alt' => 'Alternate Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
array( 'fas fa-undo' => 'Undo (back,control z,exchange,oops,return,rotate,swap)' ),
array( 'fas fa-undo-alt' => 'Alternate Undo (back,control z,exchange,oops,return,swap)' ),
array( 'fas fa-video' => 'Video (camera,film,movie,record,video-camera)' ),
array( 'fas fa-volume-down' => 'Volume Down (audio,lower,music,quieter,sound,speaker)' ),
array( 'fas fa-volume-mute' => 'Volume Mute (audio,music,quiet,sound,speaker)' ),
array( 'fas fa-volume-off' => 'Volume Off (audio,ban,music,mute,quiet,silent,sound)' ),
array( 'fas fa-volume-up' => 'Volume Up (audio,higher,louder,music,sound,speaker)' ),
array( 'fab fa-youtube' => 'YouTube (film,video,youtube-play,youtube-square)' ),
),
'Automotive' => array(
array( 'fas fa-air-freshener' => 'Air Freshener (car,deodorize,fresh,pine,scent)' ),
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-bus' => 'Bus (public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-bus-alt' => 'Bus Alt (mta,public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-car' => 'Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-car-alt' => 'Alternate Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-car-battery' => 'Car Battery (auto,electric,mechanic,power)' ),
array( 'fas fa-car-crash' => 'Car Crash (accident,auto,automobile,insurance,sedan,transportation,vehicle,wreck)' ),
array( 'fas fa-car-side' => 'Car Side (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-charging-station' => 'Charging Station (electric,ev,tesla,vehicle)' ),
array( 'fas fa-gas-pump' => 'Gas Pump (car,fuel,gasoline,petrol)' ),
array( 'fas fa-motorcycle' => 'Motorcycle (bike,machine,transportation,vehicle)' ),
array( 'fas fa-oil-can' => 'Oil Can (auto,crude,gasoline,grease,lubricate,petroleum)' ),
array( 'fas fa-shuttle-van' => 'Shuttle Van (airport,machine,public-transportation,transportation,travel,vehicle)' ),
array( 'fas fa-tachometer-alt' => 'Alternate Tachometer (dashboard,fast,odometer,speed,speedometer)' ),
array( 'fas fa-taxi' => 'Taxi (cab,cabbie,car,car service,lyft,machine,transportation,travel,uber,vehicle)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-truck-monster' => 'Truck Monster (offroad,vehicle,wheel)' ),
array( 'fas fa-truck-pickup' => 'Truck Side (cargo,vehicle)' ),
),
'Autumn' => array(
array( 'fas fa-apple-alt' => 'Fruit Apple (fall,fruit,fuji,macintosh,orchard,seasonal,vegan)' ),
array( 'fas fa-campground' => 'Campground (camping,fall,outdoors,teepee,tent,tipi)' ),
array( 'fas fa-cloud-sun' => 'Cloud with Sun (clear,day,daytime,fall,outdoors,overcast,partly cloudy)' ),
array( 'fas fa-drumstick-bite' => 'Drumstick with Bite Taken Out (bone,chicken,leg,meat,poultry,turkey)' ),
array( 'fas fa-football-ball' => 'Football Ball (ball,fall,nfl,pigskin,seasonal)' ),
array( 'fas fa-hiking' => 'Hiking (activity,backpack,fall,fitness,outdoors,person,seasonal,walking)' ),
array( 'fas fa-mountain' => 'Mountain (glacier,hiking,hill,landscape,travel,view)' ),
array( 'fas fa-tractor' => 'Tractor (agriculture,farm,vehicle)' ),
array( 'fas fa-tree' => 'Tree (bark,fall,flora,forest,nature,plant,seasonal)' ),
array( 'fas fa-wind' => 'Wind (air,blow,breeze,fall,seasonal,weather)' ),
array( 'fas fa-wine-bottle' => 'Wine Bottle (alcohol,beverage,cabernet,drink,glass,grapes,merlot,sauvignon)' ),
),
'Beverage' => array(
array( 'fas fa-beer' => 'beer (alcohol,ale,bar,beverage,brewery,drink,lager,liquor,mug,stein)' ),
array( 'fas fa-blender' => 'Blender (cocktail,milkshake,mixer,puree,smoothie)' ),
array( 'fas fa-cocktail' => 'Cocktail (alcohol,beverage,drink,gin,glass,margarita,martini,vodka)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-flask' => 'Flask (beaker,experimental,labs,science)' ),
array( 'fas fa-glass-cheers' => 'Glass Cheers (alcohol,bar,beverage,celebration,champagne,clink,drink,holiday,new year\'s eve,party,toast)' ),
array( 'fas fa-glass-martini' => 'Martini Glass (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-glass-martini-alt' => 'Alternate Glass Martini (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-glass-whiskey' => 'Glass Whiskey (alcohol,bar,beverage,bourbon,drink,liquor,neat,rye,scotch,whisky)' ),
array( 'fas fa-mug-hot' => 'Mug Hot (caliente,cocoa,coffee,cup,drink,holiday,hot chocolate,steam,tea,warmth)' ),
array( 'fas fa-wine-bottle' => 'Wine Bottle (alcohol,beverage,cabernet,drink,glass,grapes,merlot,sauvignon)' ),
array( 'fas fa-wine-glass' => 'Wine Glass (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
array( 'fas fa-wine-glass-alt' => 'Alternate Wine Glas (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
),
'Brands' => array(
array( 'fab fa-creative-commons' => 'Creative Commons' ),
array( 'fab fa-twitter-square' => 'Twitter Square (social network,tweet)' ),
array( 'fab fa-facebook-square' => 'Facebook Square (social network)' ),
array( 'fab fa-linkedin' => 'LinkedIn (linkedin-square)' ),
array( 'fab fa-github-square' => 'GitHub Square (octocat)' ),
array( 'fab fa-twitter' => 'Twitter (social network,tweet)' ),
array( 'fab fa-facebook-f' => 'Facebook F (facebook)' ),
array( 'fab fa-github' => 'GitHub (octocat)' ),
array( 'fab fa-pinterest' => 'Pinterest' ),
array( 'fab fa-pinterest-square' => 'Pinterest Square' ),
array( 'fab fa-google-plus-square' => 'Google Plus Square (social network)' ),
array( 'fab fa-google-plus-g' => 'Google Plus G (google-plus,social network)' ),
array( 'fab fa-linkedin-in' => 'LinkedIn In (linkedin)' ),
array( 'fab fa-github-alt' => 'Alternate GitHub (octocat)' ),
array( 'fab fa-maxcdn' => 'MaxCDN' ),
array( 'fab fa-html5' => 'HTML 5 Logo' ),
array( 'fab fa-css3' => 'CSS 3 Logo (code)' ),
array( 'fab fa-youtube-square' => 'YouTube Square' ),
array( 'fab fa-xing' => 'Xing' ),
array( 'fab fa-xing-square' => 'Xing Square' ),
array( 'fab fa-dropbox' => 'Dropbox' ),
array( 'fab fa-stack-overflow' => 'Stack Overflow' ),
array( 'fab fa-instagram' => 'Instagram' ),
array( 'fab fa-flickr' => 'Flickr' ),
array( 'fab fa-adn' => 'App.net' ),
array( 'fab fa-bitbucket' => 'Bitbucket (atlassian,bitbucket-square,git)' ),
array( 'fab fa-tumblr' => 'Tumblr' ),
array( 'fab fa-tumblr-square' => 'Tumblr Square' ),
array( 'fab fa-apple' => 'Apple (fruit,ios,mac,operating system,os,osx)' ),
array( 'fab fa-windows' => 'Windows (microsoft,operating system,os)' ),
array( 'fab fa-android' => 'Android (robot)' ),
array( 'fab fa-linux' => 'Linux (tux)' ),
array( 'fab fa-dribbble' => 'Dribbble' ),
array( 'fab fa-skype' => 'Skype' ),
array( 'fab fa-foursquare' => 'Foursquare' ),
array( 'fab fa-trello' => 'Trello (atlassian)' ),
array( 'fab fa-gratipay' => 'Gratipay (Gittip) (favorite,heart,like,love)' ),
array( 'fab fa-vk' => 'VK' ),
array( 'fab fa-weibo' => 'Weibo' ),
array( 'fab fa-renren' => 'Renren' ),
array( 'fab fa-pagelines' => 'Pagelines (eco,flora,leaf,leaves,nature,plant,tree)' ),
array( 'fab fa-stack-exchange' => 'Stack Exchange' ),
array( 'fab fa-vimeo-square' => 'Vimeo Square' ),
array( 'fab fa-slack' => 'Slack Logo (anchor,hash,hashtag)' ),
array( 'fab fa-wordpress' => 'WordPress Logo' ),
array( 'fab fa-openid' => 'OpenID' ),
array( 'fab fa-yahoo' => 'Yahoo Logo' ),
array( 'fab fa-google' => 'Google Logo' ),
array( 'fab fa-reddit' => 'reddit Logo' ),
array( 'fab fa-reddit-square' => 'reddit Square' ),
array( 'fab fa-stumbleupon-circle' => 'StumbleUpon Circle' ),
array( 'fab fa-stumbleupon' => 'StumbleUpon Logo' ),
array( 'fab fa-delicious' => 'Delicious' ),
array( 'fab fa-digg' => 'Digg Logo' ),
array( 'fab fa-pied-piper-pp' => 'Pied Piper PP Logo (Old)' ),
array( 'fab fa-pied-piper-alt' => 'Alternate Pied Piper Logo' ),
array( 'fab fa-drupal' => 'Drupal Logo' ),
array( 'fab fa-joomla' => 'Joomla Logo' ),
array( 'fab fa-behance' => 'Behance' ),
array( 'fab fa-behance-square' => 'Behance Square' ),
array( 'fab fa-deviantart' => 'deviantART' ),
array( 'fab fa-vine' => 'Vine' ),
array( 'fab fa-codepen' => 'Codepen' ),
array( 'fab fa-jsfiddle' => 'jsFiddle' ),
array( 'fab fa-rebel' => 'Rebel Alliance' ),
array( 'fab fa-empire' => 'Galactic Empire' ),
array( 'fab fa-git-square' => 'Git Square' ),
array( 'fab fa-git' => 'Git' ),
array( 'fab fa-hacker-news' => 'Hacker News' ),
array( 'fab fa-tencent-weibo' => 'Tencent Weibo' ),
array( 'fab fa-qq' => 'QQ' ),
array( 'fab fa-weixin' => 'Weixin (WeChat)' ),
array( 'fab fa-slideshare' => 'Slideshare' ),
array( 'fab fa-yelp' => 'Yelp' ),
array( 'fab fa-lastfm' => 'last.fm' ),
array( 'fab fa-lastfm-square' => 'last.fm Square' ),
array( 'fab fa-ioxhost' => 'ioxhost' ),
array( 'fab fa-angellist' => 'AngelList' ),
array( 'fab fa-font-awesome' => 'Font Awesome (meanpath)' ),
array( 'fab fa-buysellads' => 'BuySellAds' ),
array( 'fab fa-connectdevelop' => 'Connect Develop' ),
array( 'fab fa-dashcube' => 'DashCube' ),
array( 'fab fa-forumbee' => 'Forumbee' ),
array( 'fab fa-leanpub' => 'Leanpub' ),
array( 'fab fa-sellsy' => 'Sellsy' ),
array( 'fab fa-shirtsinbulk' => 'Shirts in Bulk' ),
array( 'fab fa-simplybuilt' => 'SimplyBuilt' ),
array( 'fab fa-skyatlas' => 'skyatlas' ),
array( 'fab fa-facebook' => 'Facebook (facebook-official,social network)' ),
array( 'fab fa-pinterest-p' => 'Pinterest P' ),
array( 'fab fa-whatsapp' => 'What\'s App' ),
array( 'fab fa-viacoin' => 'Viacoin' ),
array( 'fab fa-medium' => 'Medium' ),
array( 'fab fa-y-combinator' => 'Y Combinator' ),
array( 'fab fa-optin-monster' => 'Optin Monster' ),
array( 'fab fa-opencart' => 'OpenCart' ),
array( 'fab fa-expeditedssl' => 'ExpeditedSSL' ),
array( 'fab fa-tripadvisor' => 'TripAdvisor' ),
array( 'fab fa-odnoklassniki' => 'Odnoklassniki' ),
array( 'fab fa-odnoklassniki-square' => 'Odnoklassniki Square' ),
array( 'fab fa-get-pocket' => 'Get Pocket' ),
array( 'fab fa-wikipedia-w' => 'Wikipedia W' ),
array( 'fab fa-safari' => 'Safari (browser)' ),
array( 'fab fa-chrome' => 'Chrome (browser)' ),
array( 'fab fa-firefox' => 'Firefox (browser)' ),
array( 'fab fa-opera' => 'Opera' ),
array( 'fab fa-internet-explorer' => 'Internet-explorer (browser,ie)' ),
array( 'fab fa-contao' => 'Contao' ),
array( 'fab fa-500px' => '500px' ),
array( 'fab fa-amazon' => 'Amazon' ),
array( 'fab fa-houzz' => 'Houzz' ),
array( 'fab fa-vimeo-v' => 'Vimeo (vimeo)' ),
array( 'fab fa-black-tie' => 'Font Awesome Black Tie' ),
array( 'fab fa-fonticons' => 'Fonticons' ),
array( 'fab fa-reddit-alien' => 'reddit Alien' ),
array( 'fab fa-edge' => 'Edge Browser (browser,ie)' ),
array( 'fab fa-codiepie' => 'Codie Pie' ),
array( 'fab fa-modx' => 'MODX' ),
array( 'fab fa-fort-awesome' => 'Fort Awesome (castle)' ),
array( 'fab fa-usb' => 'USB' ),
array( 'fab fa-product-hunt' => 'Product Hunt' ),
array( 'fab fa-mixcloud' => 'Mixcloud' ),
array( 'fab fa-scribd' => 'Scribd' ),
array( 'fab fa-gitlab' => 'GitLab (Axosoft)' ),
array( 'fab fa-wpbeginner' => 'WPBeginner' ),
array( 'fab fa-wpforms' => 'WPForms' ),
array( 'fab fa-envira' => 'Envira Gallery (leaf)' ),
array( 'fab fa-glide' => 'Glide' ),
array( 'fab fa-glide-g' => 'Glide G' ),
array( 'fab fa-viadeo' => 'Video' ),
array( 'fab fa-viadeo-square' => 'Video Square' ),
array( 'fab fa-snapchat' => 'Snapchat' ),
array( 'fab fa-snapchat-ghost' => 'Snapchat Ghost' ),
array( 'fab fa-snapchat-square' => 'Snapchat Square' ),
array( 'fab fa-pied-piper' => 'Pied Piper Logo' ),
array( 'fab fa-first-order' => 'First Order' ),
array( 'fab fa-yoast' => 'Yoast' ),
array( 'fab fa-themeisle' => 'ThemeIsle' ),
array( 'fab fa-google-plus' => 'Google Plus (google-plus-circle,google-plus-official)' ),
array( 'fab fa-linode' => 'Linode' ),
array( 'fab fa-quora' => 'Quora' ),
array( 'fab fa-free-code-camp' => 'Free Code Camp' ),
array( 'fab fa-telegram' => 'Telegram' ),
array( 'fab fa-bandcamp' => 'Bandcamp' ),
array( 'fab fa-grav' => 'Grav' ),
array( 'fab fa-etsy' => 'Etsy' ),
array( 'fab fa-imdb' => 'IMDB' ),
array( 'fab fa-ravelry' => 'Ravelry' ),
array( 'fab fa-sellcast' => 'Sellcast (eercast)' ),
array( 'fab fa-superpowers' => 'Superpowers' ),
array( 'fab fa-wpexplorer' => 'WPExplorer' ),
array( 'fab fa-meetup' => 'Meetup' ),
),
'Buildings' => array(
array( 'fas fa-archway' => 'Archway (arc,monument,road,street,tunnel)' ),
array( 'fas fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'far fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'fas fa-campground' => 'Campground (camping,fall,outdoors,teepee,tent,tipi)' ),
array( 'fas fa-church' => 'Church (building,cathedral,chapel,community,religion)' ),
array( 'fas fa-city' => 'City (buildings,busy,skyscrapers,urban,windows)' ),
array( 'fas fa-clinic-medical' => 'Medical Clinic (doctor,general practitioner,hospital,infirmary,medicine,office,outpatient)' ),
array( 'fas fa-dungeon' => 'Dungeon (Dungeons & Dragons,building,d&d,dnd,door,entrance,fantasy,gate)' ),
array( 'fas fa-gopuram' => 'Gopuram (building,entrance,hinduism,temple,tower)' ),
array( 'fas fa-home' => 'home (abode,building,house,main)' ),
array( 'fas fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'far fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'fas fa-hospital-alt' => 'Alternate Hospital (building,emergency room,medical center)' ),
array( 'fas fa-hotel' => 'Hotel (building,inn,lodging,motel,resort,travel)' ),
array( 'fas fa-house-damage' => 'Damaged House (building,devastation,disaster,home,insurance)' ),
array( 'fas fa-igloo' => 'Igloo (dome,dwelling,eskimo,home,house,ice,snow)' ),
array( 'fas fa-industry' => 'Industry (building,factory,industrial,manufacturing,mill,warehouse)' ),
array( 'fas fa-kaaba' => 'Kaaba (building,cube,islam,muslim)' ),
array( 'fas fa-landmark' => 'Landmark (building,historic,memorable,monument,politics)' ),
array( 'fas fa-monument' => 'Monument (building,historic,landmark,memorable)' ),
array( 'fas fa-mosque' => 'Mosque (building,islam,landmark,muslim)' ),
array( 'fas fa-place-of-worship' => 'Place of Worship (building,church,holy,mosque,synagogue)' ),
array( 'fas fa-school' => 'School (building,education,learn,student,teacher)' ),
array( 'fas fa-store' => 'Store (building,buy,purchase,shopping)' ),
array( 'fas fa-store-alt' => 'Alternate Store (building,buy,purchase,shopping)' ),
array( 'fas fa-synagogue' => 'Synagogue (building,jewish,judaism,religion,star of david,temple)' ),
array( 'fas fa-torii-gate' => 'Torii Gate (building,shintoism)' ),
array( 'fas fa-university' => 'University (bank,building,college,higher education - students,institution)' ),
array( 'fas fa-vihara' => 'Vihara (buddhism,buddhist,building,monastery)' ),
array( 'fas fa-warehouse' => 'Warehouse (building,capacity,garage,inventory,storage)' ),
),
'Business' => array(
array( 'fas fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'far fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'fas fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'far fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-balance-scale' => 'Balance Scale (balanced,justice,legal,measure,weight)' ),
array( 'fas fa-balance-scale-left' => 'Balance Scale (Left-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-balance-scale-right' => 'Balance Scale (Right-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-birthday-cake' => 'Birthday Cake (anniversary,bakery,candles,celebration,dessert,frosting,holiday,party,pastry)' ),
array( 'fas fa-book' => 'book (diary,documentation,journal,library,read)' ),
array( 'fas fa-briefcase' => 'Briefcase (bag,business,luggage,office,work)' ),
array( 'fas fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'far fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-bullseye' => 'Bullseye (archery,goal,objective,target)' ),
array( 'fas fa-business-time' => 'Business Time (alarm,briefcase,business socks,clock,flight of the conchords,reminder,wednesday)' ),
array( 'fas fa-calculator' => 'Calculator (abacus,addition,arithmetic,counting,math,multiplication,subtraction)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'far fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'fas fa-certificate' => 'certificate (badge,star,verified)' ),
array( 'fas fa-chart-area' => 'Area Chart (analytics,area,chart,graph)' ),
array( 'fas fa-chart-bar' => 'Bar Chart (analytics,bar,chart,graph)' ),
array( 'far fa-chart-bar' => 'Bar Chart (analytics,bar,chart,graph)' ),
array( 'fas fa-chart-line' => 'Line Chart (activity,analytics,chart,dashboard,gain,graph,increase,line)' ),
array( 'fas fa-chart-pie' => 'Pie Chart (analytics,chart,diagram,graph,pie)' ),
array( 'fas fa-city' => 'City (buildings,busy,skyscrapers,urban,windows)' ),
array( 'fas fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'far fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-columns' => 'Columns (browser,dashboard,organize,panes,split)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-copyright' => 'Copyright (brand,mark,register,trademark)' ),
array( 'far fa-copyright' => 'Copyright (brand,mark,register,trademark)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'far fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-square' => 'Envelope Square (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-fax' => 'Fax (business,communicate,copy,facsimile,send)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-minus' => 'Folder Minus (archive,delete,directory,document,file,negative,remove)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-folder-plus' => 'Folder Plus (add,archive,create,directory,document,file,new,positive)' ),
array( 'fas fa-glasses' => 'Glasses (hipster,nerd,reading,sight,spectacles,vision)' ),
array( 'fas fa-globe' => 'Globe (all,coordinates,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-highlighter' => 'Highlighter (edit,marker,sharpie,update,write)' ),
array( 'fas fa-industry' => 'Industry (building,factory,industrial,manufacturing,mill,warehouse)' ),
array( 'fas fa-landmark' => 'Landmark (building,historic,memorable,monument,politics)' ),
array( 'fas fa-marker' => 'Marker (design,edit,sharpie,update,write)' ),
array( 'fas fa-paperclip' => 'Paperclip (attach,attachment,connect,link)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-fancy' => 'Pen Fancy (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pen-nib' => 'Pen Nib (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pen-square' => 'Pen Square (edit,pencil-square,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-percent' => 'Percent (discount,fraction,proportion,rate,ratio)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-slash' => 'Phone Slash (call,cancel,earphone,mute,number,support,telephone,voice)' ),
array( 'fas fa-phone-square' => 'Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-square-alt' => 'Alternate Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-volume' => 'Phone Volume (call,earphone,number,sound,support,telephone,voice,volume-control-phone)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-project-diagram' => 'Project Diagram (chart,graph,network,pert)' ),
array( 'fas fa-registered' => 'Registered Trademark (copyright,mark,trademark)' ),
array( 'far fa-registered' => 'Registered Trademark (copyright,mark,trademark)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-sitemap' => 'Sitemap (directory,hierarchy,ia,information architecture,organization)' ),
array( 'fas fa-socks' => 'Socks (business socks,business time,clothing,feet,flight of the conchords,wednesday)' ),
array( 'fas fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'far fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'fas fa-stream' => 'Stream (flow,list,timeline)' ),
array( 'fas fa-table' => 'table (data,excel,spreadsheet)' ),
array( 'fas fa-tag' => 'tag (discount,label,price,shopping)' ),
array( 'fas fa-tags' => 'tags (discount,label,price,shopping)' ),
array( 'fas fa-tasks' => 'Tasks (checklist,downloading,downloads,loading,progress,project management,settings,to do)' ),
array( 'fas fa-thumbtack' => 'Thumbtack (coordinates,location,marker,pin,thumb-tack)' ),
array( 'fas fa-trademark' => 'Trademark (copyright,register,symbol)' ),
array( 'fas fa-wallet' => 'Wallet (billfold,cash,currency,money)' ),
),
'Camping' => array(
array( 'fas fa-binoculars' => 'Binoculars (glasses,magnify,scenic,spyglass,view)' ),
array( 'fas fa-campground' => 'Campground (camping,fall,outdoors,teepee,tent,tipi)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-fire' => 'fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-first-aid' => 'First Aid (emergency,emt,health,medical,rescue)' ),
array( 'fas fa-frog' => 'Frog (amphibian,bullfrog,fauna,hop,kermit,kiss,prince,ribbit,toad,wart)' ),
array( 'fas fa-hiking' => 'Hiking (activity,backpack,fall,fitness,outdoors,person,seasonal,walking)' ),
array( 'fas fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'far fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marked' => 'Map Marked (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marked-alt' => 'Alternate Map Marked (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-signs' => 'Map Signs (directions,directory,map,signage,wayfinding)' ),
array( 'fas fa-mountain' => 'Mountain (glacier,hiking,hill,landscape,travel,view)' ),
array( 'fas fa-route' => 'Route (directions,navigation,travel)' ),
array( 'fas fa-toilet-paper' => 'Toilet Paper (bathroom,halloween,holiday,lavatory,prank,restroom,roll)' ),
array( 'fas fa-tree' => 'Tree (bark,fall,flora,forest,nature,plant,seasonal)' ),
),
'Charity' => array(
array( 'fas fa-dollar-sign' => 'Dollar Sign ($,cost,dollar-sign,money,price,usd)' ),
array( 'fas fa-donate' => 'Donate (contribute,generosity,gift,give)' ),
array( 'fas fa-dove' => 'Dove (bird,fauna,flying,peace,war)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-globe' => 'Globe (all,coordinates,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-hand-holding-heart' => 'Hand Holding Heart (carry,charity,gift,lift,package)' ),
array( 'fas fa-hand-holding-usd' => 'Hand Holding US Dollar ($,carry,dollar sign,donation,giving,lift,money,price)' ),
array( 'fas fa-hands-helping' => 'Helping Hands (aid,assistance,handshake,partnership,volunteering)' ),
array( 'fas fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'far fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-leaf' => 'leaf (eco,flora,nature,plant,vegan)' ),
array( 'fas fa-parachute-box' => 'Parachute Box (aid,assistance,rescue,supplies)' ),
array( 'fas fa-piggy-bank' => 'Piggy Bank (bank,save,savings)' ),
array( 'fas fa-ribbon' => 'Ribbon (badge,cause,lapel,pin)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
),
'Chat' => array(
array( 'fas fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-dots' => 'Comment Dots (bubble,chat,commenting,conversation,feedback,message,more,note,notification,reply,sms,speech,texting)' ),
array( 'far fa-comment-dots' => 'Comment Dots (bubble,chat,commenting,conversation,feedback,message,more,note,notification,reply,sms,speech,texting)' ),
array( 'fas fa-comment-medical' => 'Alternate Medical Chat (advice,bubble,chat,commenting,conversation,diagnose,feedback,message,note,notification,prescription,sms,speech,texting)' ),
array( 'fas fa-comment-slash' => 'Comment Slash (bubble,cancel,chat,commenting,conversation,feedback,message,mute,note,notification,quiet,sms,speech,texting)' ),
array( 'fas fa-comments' => 'comments (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comments' => 'comments (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'far fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'fas fa-icons' => 'Icons (bolt,emoji,heart,image,music,photo,symbols)' ),
array( 'fas fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'far fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-slash' => 'Phone Slash (call,cancel,earphone,mute,number,support,telephone,voice)' ),
array( 'fas fa-poo' => 'Poo (crap,poop,shit,smile,turd)' ),
array( 'fas fa-quote-left' => 'quote-left (mention,note,phrase,text,type)' ),
array( 'fas fa-quote-right' => 'quote-right (mention,note,phrase,text,type)' ),
array( 'fas fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'far fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'fas fa-sms' => 'SMS (chat,conversation,message,mobile,notification,phone,sms,texting)' ),
array( 'fas fa-video' => 'Video (camera,film,movie,record,video-camera)' ),
array( 'fas fa-video-slash' => 'Video Slash (add,create,film,new,positive,record,video)' ),
),
'Chess' => array(
array( 'fas fa-chess' => 'Chess (board,castle,checkmate,game,king,rook,strategy,tournament)' ),
array( 'fas fa-chess-bishop' => 'Chess Bishop (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-board' => 'Chess Board (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-king' => 'Chess King (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-knight' => 'Chess Knight (board,checkmate,game,horse,strategy)' ),
array( 'fas fa-chess-pawn' => 'Chess Pawn (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-queen' => 'Chess Queen (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-rook' => 'Chess Rook (board,castle,checkmate,game,strategy)' ),
array( 'fas fa-square-full' => 'Square Full (block,box,shape)' ),
),
'Childhood' => array(
array( 'fas fa-apple-alt' => 'Fruit Apple (fall,fruit,fuji,macintosh,orchard,seasonal,vegan)' ),
array( 'fas fa-baby' => 'Baby (child,diaper,doll,human,infant,kid,offspring,person,sprout)' ),
array( 'fas fa-baby-carriage' => 'Baby Carriage (buggy,carrier,infant,push,stroller,transportation,walk,wheels)' ),
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-biking' => 'Biking (bicycle,bike,cycle,cycling,ride,wheel)' ),
array( 'fas fa-birthday-cake' => 'Birthday Cake (anniversary,bakery,candles,celebration,dessert,frosting,holiday,party,pastry)' ),
array( 'fas fa-cookie' => 'Cookie (baked good,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-cookie-bite' => 'Cookie Bite (baked good,bitten,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-gamepad' => 'Gamepad (arcade,controller,d-pad,joystick,video,video game)' ),
array( 'fas fa-ice-cream' => 'Ice Cream (chocolate,cone,dessert,frozen,scoop,sorbet,vanilla,yogurt)' ),
array( 'fas fa-mitten' => 'Mitten (clothing,cold,glove,hands,knitted,seasonal,warmth)' ),
array( 'fas fa-robot' => 'Robot (android,automate,computer,cyborg)' ),
array( 'fas fa-school' => 'School (building,education,learn,student,teacher)' ),
array( 'fas fa-shapes' => 'Shapes (blocks,build,circle,square,triangle)' ),
array( 'fas fa-snowman' => 'Snowman (decoration,frost,frosty,holiday)' ),
),
'Clothing' => array(
array( 'fas fa-graduation-cap' => 'Graduation Cap (ceremony,college,graduate,learning,school,student)' ),
array( 'fas fa-hat-cowboy' => 'Cowboy Hat (buckaroo,horse,jackeroo,john b.,old west,pardner,ranch,rancher,rodeo,western,wrangler)' ),
array( 'fas fa-hat-cowboy-side' => 'Cowboy Hat Side (buckaroo,horse,jackeroo,john b.,old west,pardner,ranch,rancher,rodeo,western,wrangler)' ),
array( 'fas fa-hat-wizard' => 'Wizard\'s Hat (Dungeons & Dragons,accessory,buckle,clothing,d&d,dnd,fantasy,halloween,head,holiday,mage,magic,pointy,witch)' ),
array( 'fas fa-mitten' => 'Mitten (clothing,cold,glove,hands,knitted,seasonal,warmth)' ),
array( 'fas fa-shoe-prints' => 'Shoe Prints (feet,footprints,steps,walk)' ),
array( 'fas fa-socks' => 'Socks (business socks,business time,clothing,feet,flight of the conchords,wednesday)' ),
array( 'fas fa-tshirt' => 'T-Shirt (clothing,fashion,garment,shirt)' ),
array( 'fas fa-user-tie' => 'User Tie (avatar,business,clothing,formal,professional,suit)' ),
),
'Code' => array(
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-barcode' => 'barcode (info,laser,price,scan,upc)' ),
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-bug' => 'Bug (beetle,error,insect,report)' ),
array( 'fas fa-code' => 'Code (brackets,code,development,html)' ),
array( 'fas fa-code-branch' => 'Code Branch (branch,code-fork,fork,git,github,rebase,svn,vcs,version)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-file-code' => 'Code File (css,development,document,html)' ),
array( 'far fa-file-code' => 'Code File (css,development,document,html)' ),
array( 'fas fa-filter' => 'Filter (funnel,options,separate,sort)' ),
array( 'fas fa-fire-extinguisher' => 'fire-extinguisher (burn,caliente,fire fighter,flame,heat,hot,rescue)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'far fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'fas fa-laptop-code' => 'Laptop Code (computer,cpu,dell,demo,develop,device,mac,macbook,machine,pc)' ),
array( 'fas fa-microchip' => 'Microchip (cpu,hardware,processor,technology)' ),
array( 'fas fa-project-diagram' => 'Project Diagram (chart,graph,network,pert)' ),
array( 'fas fa-qrcode' => 'qrcode (barcode,info,information,scan)' ),
array( 'fas fa-shield-alt' => 'Alternate Shield (achievement,award,block,defend,security,winner)' ),
array( 'fas fa-sitemap' => 'Sitemap (directory,hierarchy,ia,information architecture,organization)' ),
array( 'fas fa-stream' => 'Stream (flow,list,timeline)' ),
array( 'fas fa-terminal' => 'Terminal (code,command,console,development,prompt)' ),
array( 'fas fa-user-secret' => 'User Secret (clothing,coat,hat,incognito,person,privacy,spy,whisper)' ),
array( 'fas fa-window-close' => 'Window Close (browser,cancel,computer,development)' ),
array( 'far fa-window-close' => 'Window Close (browser,cancel,computer,development)' ),
array( 'fas fa-window-maximize' => 'Window Maximize (browser,computer,development,expand)' ),
array( 'far fa-window-maximize' => 'Window Maximize (browser,computer,development,expand)' ),
array( 'fas fa-window-minimize' => 'Window Minimize (browser,collapse,computer,development)' ),
array( 'far fa-window-minimize' => 'Window Minimize (browser,collapse,computer,development)' ),
array( 'fas fa-window-restore' => 'Window Restore (browser,computer,development)' ),
array( 'far fa-window-restore' => 'Window Restore (browser,computer,development)' ),
),
'Communication' => array(
array( 'fas fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'far fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'fas fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'far fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'fas fa-american-sign-language-interpreting' => 'American Sign Language Interpreting (asl,deaf,finger,hand,interpret,speak)' ),
array( 'fas fa-assistive-listening-systems' => 'Assistive Listening Systems (amplify,audio,deaf,ear,headset,hearing,sound)' ),
array( 'fas fa-at' => 'At (address,author,e-mail,email,handle)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fab fa-bluetooth' => 'Bluetooth' ),
array( 'fab fa-bluetooth-b' => 'Bluetooth' ),
array( 'fas fa-broadcast-tower' => 'Broadcast Tower (airwaves,antenna,radio,reception,waves)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-chalkboard' => 'Chalkboard (blackboard,learning,school,teaching,whiteboard,writing)' ),
array( 'fas fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comments' => 'comments (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comments' => 'comments (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-square' => 'Envelope Square (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-fax' => 'Fax (business,communicate,copy,facsimile,send)' ),
array( 'fas fa-inbox' => 'inbox (archive,desk,email,mail,message)' ),
array( 'fas fa-language' => 'Language (dialect,idiom,localize,speech,translate,vernacular)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt-slash' => 'Alternate Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-mobile' => 'Mobile Phone (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-mobile-alt' => 'Alternate Mobile (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'far fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-slash' => 'Phone Slash (call,cancel,earphone,mute,number,support,telephone,voice)' ),
array( 'fas fa-phone-square' => 'Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-square-alt' => 'Alternate Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-volume' => 'Phone Volume (call,earphone,number,sound,support,telephone,voice,volume-control-phone)' ),
array( 'fas fa-rss' => 'rss (blog,feed,journal,news,writing)' ),
array( 'fas fa-rss-square' => 'RSS Square (blog,feed,journal,news,writing)' ),
array( 'fas fa-tty' => 'TTY (communication,deaf,telephone,teletypewriter,text)' ),
array( 'fas fa-voicemail' => 'Voicemail (answer,inbox,message,phone)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
),
'Computers' => array(
array( 'fas fa-database' => 'Database (computer,development,directory,memory,storage)' ),
array( 'fas fa-desktop' => 'Desktop (computer,cpu,demo,desktop,device,imac,machine,monitor,pc,screen)' ),
array( 'fas fa-download' => 'Download (export,hard drive,save,transfer)' ),
array( 'fas fa-ethernet' => 'Ethernet (cable,cat 5,cat 6,connection,hardware,internet,network,wired)' ),
array( 'fas fa-hdd' => 'HDD (cpu,hard drive,harddrive,machine,save,storage)' ),
array( 'far fa-hdd' => 'HDD (cpu,hard drive,harddrive,machine,save,storage)' ),
array( 'fas fa-headphones' => 'headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'far fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'fas fa-laptop' => 'Laptop (computer,cpu,dell,demo,device,mac,macbook,machine,pc)' ),
array( 'fas fa-memory' => 'Memory (DIMM,RAM,hardware,storage,technology)' ),
array( 'fas fa-microchip' => 'Microchip (cpu,hardware,processor,technology)' ),
array( 'fas fa-mobile' => 'Mobile Phone (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-mobile-alt' => 'Alternate Mobile (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-mouse' => 'Mouse (click,computer,cursor,input,peripheral)' ),
array( 'fas fa-plug' => 'Plug (connect,electric,online,power)' ),
array( 'fas fa-power-off' => 'Power Off (cancel,computer,on,reboot,restart)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-satellite' => 'Satellite (communications,hardware,orbit,space)' ),
array( 'fas fa-satellite-dish' => 'Satellite Dish (SETI,communications,hardware,receiver,saucer,signal)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-sd-card' => 'Sd Card (image,memory,photo,save)' ),
array( 'fas fa-server' => 'Server (computer,cpu,database,hardware,network)' ),
array( 'fas fa-sim-card' => 'SIM Card (hard drive,hardware,portable,storage,technology,tiny)' ),
array( 'fas fa-stream' => 'Stream (flow,list,timeline)' ),
array( 'fas fa-tablet' => 'tablet (apple,device,ipad,kindle,screen)' ),
array( 'fas fa-tablet-alt' => 'Alternate Tablet (apple,device,ipad,kindle,screen)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
array( 'fas fa-upload' => 'Upload (hard drive,import,publish)' ),
),
'Construction' => array(
array( 'fas fa-brush' => 'Brush (art,bristles,color,handle,paint)' ),
array( 'fas fa-drafting-compass' => 'Drafting Compass (design,map,mechanical drawing,plot,plotting)' ),
array( 'fas fa-dumpster' => 'Dumpster (alley,bin,commercial,trash,waste)' ),
array( 'fas fa-hammer' => 'Hammer (admin,fix,repair,settings,tool)' ),
array( 'fas fa-hard-hat' => 'Hard Hat (construction,hardhat,helmet,safety)' ),
array( 'fas fa-paint-roller' => 'Paint Roller (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-pencil-ruler' => 'Pencil Ruler (design,draft,draw,pencil)' ),
array( 'fas fa-ruler' => 'Ruler (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-combined' => 'Ruler Combined (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-horizontal' => 'Ruler Horizontal (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-vertical' => 'Ruler Vertical (design,draft,length,measure,planning)' ),
array( 'fas fa-screwdriver' => 'Screwdriver (admin,fix,mechanic,repair,settings,tool)' ),
array( 'fas fa-toolbox' => 'Toolbox (admin,container,fix,repair,settings,tools)' ),
array( 'fas fa-tools' => 'Tools (admin,fix,repair,screwdriver,settings,tools,wrench)' ),
array( 'fas fa-truck-pickup' => 'Truck Side (cargo,vehicle)' ),
array( 'fas fa-wrench' => 'Wrench (construction,fix,mechanic,plumbing,settings,spanner,tool,update)' ),
),
'Currency' => array(
array( 'fab fa-bitcoin' => 'Bitcoin' ),
array( 'fab fa-btc' => 'BTC' ),
array( 'fas fa-dollar-sign' => 'Dollar Sign ($,cost,dollar-sign,money,price,usd)' ),
array( 'fab fa-ethereum' => 'Ethereum' ),
array( 'fas fa-euro-sign' => 'Euro Sign (currency,dollar,exchange,money)' ),
array( 'fab fa-gg' => 'GG Currency' ),
array( 'fab fa-gg-circle' => 'GG Currency Circle' ),
array( 'fas fa-hryvnia' => 'Hryvnia (currency,money,ukraine,ukrainian)' ),
array( 'fas fa-lira-sign' => 'Turkish Lira Sign (currency,money,try,turkish)' ),
array( 'fas fa-money-bill' => 'Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'far fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-wave' => 'Wavy Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-wave-alt' => 'Alternate Wavy Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-check' => 'Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-money-check-alt' => 'Alternate Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-pound-sign' => 'Pound Sign (currency,gbp,money)' ),
array( 'fas fa-ruble-sign' => 'Ruble Sign (currency,money,rub)' ),
array( 'fas fa-rupee-sign' => 'Indian Rupee Sign (currency,indian,inr,money)' ),
array( 'fas fa-shekel-sign' => 'Shekel Sign (currency,ils,money)' ),
array( 'fas fa-tenge' => 'Tenge (currency,kazakhstan,money,price)' ),
array( 'fas fa-won-sign' => 'Won Sign (currency,krw,money)' ),
array( 'fas fa-yen-sign' => 'Yen Sign (currency,jpy,money)' ),
),
'Date & Time' => array(
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'far fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'far fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'fas fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'far fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'fas fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'far fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'fas fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'far fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'fas fa-clock' => 'Clock (date,late,schedule,time,timer,timestamp,watch)' ),
array( 'far fa-clock' => 'Clock (date,late,schedule,time,timer,timestamp,watch)' ),
array( 'fas fa-hourglass' => 'Hourglass (hour,minute,sand,stopwatch,time)' ),
array( 'far fa-hourglass' => 'Hourglass (hour,minute,sand,stopwatch,time)' ),
array( 'fas fa-hourglass-end' => 'Hourglass End (hour,minute,sand,stopwatch,time)' ),
array( 'fas fa-hourglass-half' => 'Hourglass Half (hour,minute,sand,stopwatch,time)' ),
array( 'fas fa-hourglass-start' => 'Hourglass Start (hour,minute,sand,stopwatch,time)' ),
array( 'fas fa-stopwatch' => 'Stopwatch (clock,reminder,time)' ),
),
'Design' => array(
array( 'fas fa-adjust' => 'adjust (contrast,dark,light,saturation)' ),
array( 'fas fa-bezier-curve' => 'Bezier Curve (curves,illustrator,lines,path,vector)' ),
array( 'fas fa-brush' => 'Brush (art,bristles,color,handle,paint)' ),
array( 'fas fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'far fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-crop' => 'crop (design,frame,mask,resize,shrink)' ),
array( 'fas fa-crop-alt' => 'Alternate Crop (design,frame,mask,resize,shrink)' ),
array( 'fas fa-crosshairs' => 'Crosshairs (aim,bullseye,gpd,picker,position)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-drafting-compass' => 'Drafting Compass (design,map,mechanical drawing,plot,plotting)' ),
array( 'fas fa-draw-polygon' => 'Draw Polygon (anchors,lines,object,render,shape)' ),
array( 'fas fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'far fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-dropper' => 'Eye Dropper (beaker,clone,color,copy,eyedropper,pipette)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-fill' => 'Fill (bucket,color,paint,paint bucket)' ),
array( 'fas fa-fill-drip' => 'Fill Drip (bucket,color,drop,paint,paint bucket,spill)' ),
array( 'fas fa-highlighter' => 'Highlighter (edit,marker,sharpie,update,write)' ),
array( 'fas fa-icons' => 'Icons (bolt,emoji,heart,image,music,photo,symbols)' ),
array( 'fas fa-layer-group' => 'Layer Group (arrange,develop,layers,map,stack)' ),
array( 'fas fa-magic' => 'magic (autocomplete,automatic,mage,magic,spell,wand,witch,wizard)' ),
array( 'fas fa-marker' => 'Marker (design,edit,sharpie,update,write)' ),
array( 'fas fa-object-group' => 'Object Group (combine,copy,design,merge,select)' ),
array( 'far fa-object-group' => 'Object Group (combine,copy,design,merge,select)' ),
array( 'fas fa-object-ungroup' => 'Object Ungroup (copy,design,merge,select,separate)' ),
array( 'far fa-object-ungroup' => 'Object Ungroup (copy,design,merge,select,separate)' ),
array( 'fas fa-paint-brush' => 'Paint Brush (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-paint-roller' => 'Paint Roller (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-palette' => 'Palette (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-fancy' => 'Pen Fancy (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pen-nib' => 'Pen Nib (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-pencil-ruler' => 'Pencil Ruler (design,draft,draw,pencil)' ),
array( 'fas fa-ruler-combined' => 'Ruler Combined (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-horizontal' => 'Ruler Horizontal (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-vertical' => 'Ruler Vertical (design,draft,length,measure,planning)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-splotch' => 'Splotch (Ink,blob,blotch,glob,stain)' ),
array( 'fas fa-spray-can' => 'Spray Can (Paint,aerosol,design,graffiti,tag)' ),
array( 'fas fa-stamp' => 'Stamp (art,certificate,imprint,rubber,seal)' ),
array( 'fas fa-swatchbook' => 'Swatchbook (Pantone,color,design,hue,palette)' ),
array( 'fas fa-tint' => 'tint (color,drop,droplet,raindrop,waterdrop)' ),
array( 'fas fa-tint-slash' => 'Tint Slash (color,drop,droplet,raindrop,waterdrop)' ),
array( 'fas fa-vector-square' => 'Vector Square (anchors,lines,object,render,shape)' ),
),
'Editors' => array(
array( 'fas fa-align-center' => 'align-center (format,middle,paragraph,text)' ),
array( 'fas fa-align-justify' => 'align-justify (format,paragraph,text)' ),
array( 'fas fa-align-left' => 'align-left (format,paragraph,text)' ),
array( 'fas fa-align-right' => 'align-right (format,paragraph,text)' ),
array( 'fas fa-bold' => 'bold (emphasis,format,text)' ),
array( 'fas fa-border-all' => 'Border All (cell,grid,outline,stroke,table)' ),
array( 'fas fa-border-none' => 'Border None (cell,grid,outline,stroke,table)' ),
array( 'fas fa-border-style' => 'Border Style' ),
array( 'fas fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'far fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'fas fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'far fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'fas fa-columns' => 'Columns (browser,dashboard,organize,panes,split)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'far fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-font' => 'font (alphabet,glyph,text,type,typeface)' ),
array( 'fas fa-glasses' => 'Glasses (hipster,nerd,reading,sight,spectacles,vision)' ),
array( 'fas fa-heading' => 'heading (format,header,text,title)' ),
array( 'fas fa-highlighter' => 'Highlighter (edit,marker,sharpie,update,write)' ),
array( 'fas fa-i-cursor' => 'I Beam Cursor (editing,i-beam,type,writing)' ),
array( 'fas fa-icons' => 'Icons (bolt,emoji,heart,image,music,photo,symbols)' ),
array( 'fas fa-indent' => 'Indent (align,justify,paragraph,tab)' ),
array( 'fas fa-italic' => 'italic (edit,emphasis,font,format,text,type)' ),
array( 'fas fa-link' => 'Link (attach,attachment,chain,connect)' ),
array( 'fas fa-list' => 'List (checklist,completed,done,finished,ol,todo,ul)' ),
array( 'fas fa-list-alt' => 'Alternate List (checklist,completed,done,finished,ol,todo,ul)' ),
array( 'far fa-list-alt' => 'Alternate List (checklist,completed,done,finished,ol,todo,ul)' ),
array( 'fas fa-list-ol' => 'list-ol (checklist,completed,done,finished,numbers,ol,todo,ul)' ),
array( 'fas fa-list-ul' => 'list-ul (checklist,completed,done,finished,ol,todo,ul)' ),
array( 'fas fa-marker' => 'Marker (design,edit,sharpie,update,write)' ),
array( 'fas fa-outdent' => 'Outdent (align,justify,paragraph,tab)' ),
array( 'fas fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'far fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'fas fa-paperclip' => 'Paperclip (attach,attachment,connect,link)' ),
array( 'fas fa-paragraph' => 'paragraph (edit,format,text,writing)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-fancy' => 'Pen Fancy (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pen-nib' => 'Pen Nib (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-quote-left' => 'quote-left (mention,note,phrase,text,type)' ),
array( 'fas fa-quote-right' => 'quote-right (mention,note,phrase,text,type)' ),
array( 'fas fa-redo' => 'Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-redo-alt' => 'Alternate Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-remove-format' => 'Remove Format (cancel,font,format,remove,style,text)' ),
array( 'fas fa-reply' => 'Reply (mail,message,respond)' ),
array( 'fas fa-reply-all' => 'reply-all (mail,message,respond)' ),
array( 'fas fa-screwdriver' => 'Screwdriver (admin,fix,mechanic,repair,settings,tool)' ),
array( 'fas fa-share' => 'Share (forward,save,send,social)' ),
array( 'fas fa-spell-check' => 'Spell Check (dictionary,edit,editor,grammar,text)' ),
array( 'fas fa-strikethrough' => 'Strikethrough (cancel,edit,font,format,text,type)' ),
array( 'fas fa-subscript' => 'subscript (edit,font,format,text,type)' ),
array( 'fas fa-superscript' => 'superscript (edit,exponential,font,format,text,type)' ),
array( 'fas fa-sync' => 'Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-sync-alt' => 'Alternate Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-table' => 'table (data,excel,spreadsheet)' ),
array( 'fas fa-tasks' => 'Tasks (checklist,downloading,downloads,loading,progress,project management,settings,to do)' ),
array( 'fas fa-text-height' => 'text-height (edit,font,format,text,type)' ),
array( 'fas fa-text-width' => 'Text Width (edit,font,format,text,type)' ),
array( 'fas fa-th' => 'th (blocks,boxes,grid,squares)' ),
array( 'fas fa-th-large' => 'th-large (blocks,boxes,grid,squares)' ),
array( 'fas fa-th-list' => 'th-list (checklist,completed,done,finished,ol,todo,ul)' ),
array( 'fas fa-tools' => 'Tools (admin,fix,repair,screwdriver,settings,tools,wrench)' ),
array( 'fas fa-trash' => 'Trash (delete,garbage,hide,remove)' ),
array( 'fas fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'far fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'fas fa-trash-restore' => 'Trash Restore (back,control z,oops,undo)' ),
array( 'fas fa-trash-restore-alt' => 'Alternative Trash Restore (back,control z,oops,undo)' ),
array( 'fas fa-underline' => 'Underline (edit,emphasis,format,text,writing)' ),
array( 'fas fa-undo' => 'Undo (back,control z,exchange,oops,return,rotate,swap)' ),
array( 'fas fa-undo-alt' => 'Alternate Undo (back,control z,exchange,oops,return,swap)' ),
array( 'fas fa-unlink' => 'unlink (attachment,chain,chain-broken,remove)' ),
array( 'fas fa-wrench' => 'Wrench (construction,fix,mechanic,plumbing,settings,spanner,tool,update)' ),
),
'Education' => array(
array( 'fas fa-apple-alt' => 'Fruit Apple (fall,fruit,fuji,macintosh,orchard,seasonal,vegan)' ),
array( 'fas fa-atom' => 'Atom (atheism,chemistry,ion,nuclear,science)' ),
array( 'fas fa-award' => 'Award (honor,praise,prize,recognition,ribbon,trophy)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-book-open' => 'Book Open (flyer,library,notebook,open book,pamphlet,reading)' ),
array( 'fas fa-book-reader' => 'Book Reader (flyer,library,notebook,open book,pamphlet,reading)' ),
array( 'fas fa-chalkboard' => 'Chalkboard (blackboard,learning,school,teaching,whiteboard,writing)' ),
array( 'fas fa-chalkboard-teacher' => 'Chalkboard Teacher (blackboard,instructor,learning,professor,school,whiteboard,writing)' ),
array( 'fas fa-graduation-cap' => 'Graduation Cap (ceremony,college,graduate,learning,school,student)' ),
array( 'fas fa-laptop-code' => 'Laptop Code (computer,cpu,dell,demo,develop,device,mac,macbook,machine,pc)' ),
array( 'fas fa-microscope' => 'Microscope (electron,lens,optics,science,shrink)' ),
array( 'fas fa-music' => 'Music (lyrics,melody,note,sing,sound)' ),
array( 'fas fa-school' => 'School (building,education,learn,student,teacher)' ),
array( 'fas fa-shapes' => 'Shapes (blocks,build,circle,square,triangle)' ),
array( 'fas fa-theater-masks' => 'Theater Masks (comedy,perform,theatre,tragedy)' ),
array( 'fas fa-user-graduate' => 'User Graduate (cap,clothing,commencement,gown,graduation,person,student)' ),
),
'Emoji' => array(
array( 'fas fa-angry' => 'Angry Face (disapprove,emoticon,face,mad,upset)' ),
array( 'far fa-angry' => 'Angry Face (disapprove,emoticon,face,mad,upset)' ),
array( 'fas fa-dizzy' => 'Dizzy Face (dazed,dead,disapprove,emoticon,face)' ),
array( 'far fa-dizzy' => 'Dizzy Face (dazed,dead,disapprove,emoticon,face)' ),
array( 'fas fa-flushed' => 'Flushed Face (embarrassed,emoticon,face)' ),
array( 'far fa-flushed' => 'Flushed Face (embarrassed,emoticon,face)' ),
array( 'fas fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'far fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'fas fa-frown-open' => 'Frowning Face With Open Mouth (disapprove,emoticon,face,rating,sad)' ),
array( 'far fa-frown-open' => 'Frowning Face With Open Mouth (disapprove,emoticon,face,rating,sad)' ),
array( 'fas fa-grimace' => 'Grimacing Face (cringe,emoticon,face,teeth)' ),
array( 'far fa-grimace' => 'Grimacing Face (cringe,emoticon,face,teeth)' ),
array( 'fas fa-grin' => 'Grinning Face (emoticon,face,laugh,smile)' ),
array( 'far fa-grin' => 'Grinning Face (emoticon,face,laugh,smile)' ),
array( 'fas fa-grin-alt' => 'Alternate Grinning Face (emoticon,face,laugh,smile)' ),
array( 'far fa-grin-alt' => 'Alternate Grinning Face (emoticon,face,laugh,smile)' ),
array( 'fas fa-grin-beam' => 'Grinning Face With Smiling Eyes (emoticon,face,laugh,smile)' ),
array( 'far fa-grin-beam' => 'Grinning Face With Smiling Eyes (emoticon,face,laugh,smile)' ),
array( 'fas fa-grin-beam-sweat' => 'Grinning Face With Sweat (embarass,emoticon,face,smile)' ),
array( 'far fa-grin-beam-sweat' => 'Grinning Face With Sweat (embarass,emoticon,face,smile)' ),
array( 'fas fa-grin-hearts' => 'Smiling Face With Heart-Eyes (emoticon,face,love,smile)' ),
array( 'far fa-grin-hearts' => 'Smiling Face With Heart-Eyes (emoticon,face,love,smile)' ),
array( 'fas fa-grin-squint' => 'Grinning Squinting Face (emoticon,face,laugh,smile)' ),
array( 'far fa-grin-squint' => 'Grinning Squinting Face (emoticon,face,laugh,smile)' ),
array( 'fas fa-grin-squint-tears' => 'Rolling on the Floor Laughing (emoticon,face,happy,smile)' ),
array( 'far fa-grin-squint-tears' => 'Rolling on the Floor Laughing (emoticon,face,happy,smile)' ),
array( 'fas fa-grin-stars' => 'Star-Struck (emoticon,face,star-struck)' ),
array( 'far fa-grin-stars' => 'Star-Struck (emoticon,face,star-struck)' ),
array( 'fas fa-grin-tears' => 'Face With Tears of Joy (LOL,emoticon,face)' ),
array( 'far fa-grin-tears' => 'Face With Tears of Joy (LOL,emoticon,face)' ),
array( 'fas fa-grin-tongue' => 'Face With Tongue (LOL,emoticon,face)' ),
array( 'far fa-grin-tongue' => 'Face With Tongue (LOL,emoticon,face)' ),
array( 'fas fa-grin-tongue-squint' => 'Squinting Face With Tongue (LOL,emoticon,face)' ),
array( 'far fa-grin-tongue-squint' => 'Squinting Face With Tongue (LOL,emoticon,face)' ),
array( 'fas fa-grin-tongue-wink' => 'Winking Face With Tongue (LOL,emoticon,face)' ),
array( 'far fa-grin-tongue-wink' => 'Winking Face With Tongue (LOL,emoticon,face)' ),
array( 'fas fa-grin-wink' => 'Grinning Winking Face (emoticon,face,flirt,laugh,smile)' ),
array( 'far fa-grin-wink' => 'Grinning Winking Face (emoticon,face,flirt,laugh,smile)' ),
array( 'fas fa-kiss' => 'Kissing Face (beso,emoticon,face,love,smooch)' ),
array( 'far fa-kiss' => 'Kissing Face (beso,emoticon,face,love,smooch)' ),
array( 'fas fa-kiss-beam' => 'Kissing Face With Smiling Eyes (beso,emoticon,face,love,smooch)' ),
array( 'far fa-kiss-beam' => 'Kissing Face With Smiling Eyes (beso,emoticon,face,love,smooch)' ),
array( 'fas fa-kiss-wink-heart' => 'Face Blowing a Kiss (beso,emoticon,face,love,smooch)' ),
array( 'far fa-kiss-wink-heart' => 'Face Blowing a Kiss (beso,emoticon,face,love,smooch)' ),
array( 'fas fa-laugh' => 'Grinning Face With Big Eyes (LOL,emoticon,face,laugh,smile)' ),
array( 'far fa-laugh' => 'Grinning Face With Big Eyes (LOL,emoticon,face,laugh,smile)' ),
array( 'fas fa-laugh-beam' => 'Laugh Face with Beaming Eyes (LOL,emoticon,face,happy,smile)' ),
array( 'far fa-laugh-beam' => 'Laugh Face with Beaming Eyes (LOL,emoticon,face,happy,smile)' ),
array( 'fas fa-laugh-squint' => 'Laughing Squinting Face (LOL,emoticon,face,happy,smile)' ),
array( 'far fa-laugh-squint' => 'Laughing Squinting Face (LOL,emoticon,face,happy,smile)' ),
array( 'fas fa-laugh-wink' => 'Laughing Winking Face (LOL,emoticon,face,happy,smile)' ),
array( 'far fa-laugh-wink' => 'Laughing Winking Face (LOL,emoticon,face,happy,smile)' ),
array( 'fas fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'far fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'fas fa-meh-blank' => 'Face Without Mouth (emoticon,face,neutral,rating)' ),
array( 'far fa-meh-blank' => 'Face Without Mouth (emoticon,face,neutral,rating)' ),
array( 'fas fa-meh-rolling-eyes' => 'Face With Rolling Eyes (emoticon,face,neutral,rating)' ),
array( 'far fa-meh-rolling-eyes' => 'Face With Rolling Eyes (emoticon,face,neutral,rating)' ),
array( 'fas fa-sad-cry' => 'Crying Face (emoticon,face,tear,tears)' ),
array( 'far fa-sad-cry' => 'Crying Face (emoticon,face,tear,tears)' ),
array( 'fas fa-sad-tear' => 'Loudly Crying Face (emoticon,face,tear,tears)' ),
array( 'far fa-sad-tear' => 'Loudly Crying Face (emoticon,face,tear,tears)' ),
array( 'fas fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'far fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'fas fa-smile-beam' => 'Beaming Face With Smiling Eyes (emoticon,face,happy,positive)' ),
array( 'far fa-smile-beam' => 'Beaming Face With Smiling Eyes (emoticon,face,happy,positive)' ),
array( 'fas fa-smile-wink' => 'Winking Face (emoticon,face,happy,hint,joke)' ),
array( 'far fa-smile-wink' => 'Winking Face (emoticon,face,happy,hint,joke)' ),
array( 'fas fa-surprise' => 'Hushed Face (emoticon,face,shocked)' ),
array( 'far fa-surprise' => 'Hushed Face (emoticon,face,shocked)' ),
array( 'fas fa-tired' => 'Tired Face (angry,emoticon,face,grumpy,upset)' ),
array( 'far fa-tired' => 'Tired Face (angry,emoticon,face,grumpy,upset)' ),
),
'Energy' => array(
array( 'fas fa-atom' => 'Atom (atheism,chemistry,ion,nuclear,science)' ),
array( 'fas fa-battery-empty' => 'Battery Empty (charge,dead,power,status)' ),
array( 'fas fa-battery-full' => 'Battery Full (charge,power,status)' ),
array( 'fas fa-battery-half' => 'Battery 1/2 Full (charge,power,status)' ),
array( 'fas fa-battery-quarter' => 'Battery 1/4 Full (charge,low,power,status)' ),
array( 'fas fa-battery-three-quarters' => 'Battery 3/4 Full (charge,power,status)' ),
array( 'fas fa-broadcast-tower' => 'Broadcast Tower (airwaves,antenna,radio,reception,waves)' ),
array( 'fas fa-burn' => 'Burn (caliente,energy,fire,flame,gas,heat,hot)' ),
array( 'fas fa-charging-station' => 'Charging Station (electric,ev,tesla,vehicle)' ),
array( 'fas fa-fire' => 'fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-gas-pump' => 'Gas Pump (car,fuel,gasoline,petrol)' ),
array( 'fas fa-industry' => 'Industry (building,factory,industrial,manufacturing,mill,warehouse)' ),
array( 'fas fa-leaf' => 'leaf (eco,flora,nature,plant,vegan)' ),
array( 'fas fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'far fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'fas fa-plug' => 'Plug (connect,electric,online,power)' ),
array( 'fas fa-poop' => 'Poop (crap,poop,shit,smile,turd)' ),
array( 'fas fa-power-off' => 'Power Off (cancel,computer,on,reboot,restart)' ),
array( 'fas fa-radiation' => 'Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-radiation-alt' => 'Alternate Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
array( 'fas fa-solar-panel' => 'Solar Panel (clean,eco-friendly,energy,green,sun)' ),
array( 'fas fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'far fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'fas fa-water' => 'Water (lake,liquid,ocean,sea,swim,wet)' ),
array( 'fas fa-wind' => 'Wind (air,blow,breeze,fall,seasonal,weather)' ),
),
'Files' => array(
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'far fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-file-archive' => 'Archive File (.zip,bundle,compress,compression,download,zip)' ),
array( 'far fa-file-archive' => 'Archive File (.zip,bundle,compress,compression,download,zip)' ),
array( 'fas fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'far fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'fas fa-file-code' => 'Code File (css,development,document,html)' ),
array( 'far fa-file-code' => 'Code File (css,development,document,html)' ),
array( 'fas fa-file-excel' => 'Excel File (csv,document,numbers,spreadsheets,table)' ),
array( 'far fa-file-excel' => 'Excel File (csv,document,numbers,spreadsheets,table)' ),
array( 'fas fa-file-image' => 'Image File (document,image,jpg,photo,png)' ),
array( 'far fa-file-image' => 'Image File (document,image,jpg,photo,png)' ),
array( 'fas fa-file-pdf' => 'PDF File (acrobat,document,preview,save)' ),
array( 'far fa-file-pdf' => 'PDF File (acrobat,document,preview,save)' ),
array( 'fas fa-file-powerpoint' => 'Powerpoint File (display,document,keynote,presentation)' ),
array( 'far fa-file-powerpoint' => 'Powerpoint File (display,document,keynote,presentation)' ),
array( 'fas fa-file-video' => 'Video File (document,m4v,movie,mp4,play)' ),
array( 'far fa-file-video' => 'Video File (document,m4v,movie,mp4,play)' ),
array( 'fas fa-file-word' => 'Word File (document,edit,page,text,writing)' ),
array( 'far fa-file-word' => 'Word File (document,edit,page,text,writing)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-photo-video' => 'Photo Video (av,film,image,library,media)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'far fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
),
'Finance' => array(
array( 'fas fa-balance-scale' => 'Balance Scale (balanced,justice,legal,measure,weight)' ),
array( 'fas fa-balance-scale-left' => 'Balance Scale (Left-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-balance-scale-right' => 'Balance Scale (Right-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-book' => 'book (diary,documentation,journal,library,read)' ),
array( 'fas fa-cash-register' => 'Cash Register (buy,cha-ching,change,checkout,commerce,leaerboard,machine,pay,payment,purchase,store)' ),
array( 'fas fa-chart-line' => 'Line Chart (activity,analytics,chart,dashboard,gain,graph,increase,line)' ),
array( 'fas fa-chart-pie' => 'Pie Chart (analytics,chart,diagram,graph,pie)' ),
array( 'fas fa-coins' => 'Coins (currency,dime,financial,gold,money,penny)' ),
array( 'fas fa-comment-dollar' => 'Comment Dollar (bubble,chat,commenting,conversation,feedback,message,money,note,notification,pay,sms,speech,spend,texting,transfer)' ),
array( 'fas fa-comments-dollar' => 'Comments Dollar (bubble,chat,commenting,conversation,feedback,message,money,note,notification,pay,sms,speech,spend,texting,transfer)' ),
array( 'fas fa-credit-card' => 'Credit Card (buy,checkout,credit-card-alt,debit,money,payment,purchase)' ),
array( 'far fa-credit-card' => 'Credit Card (buy,checkout,credit-card-alt,debit,money,payment,purchase)' ),
array( 'fas fa-donate' => 'Donate (contribute,generosity,gift,give)' ),
array( 'fas fa-file-invoice' => 'File Invoice (account,bill,charge,document,payment,receipt)' ),
array( 'fas fa-file-invoice-dollar' => 'File Invoice with US Dollar ($,account,bill,charge,document,dollar-sign,money,payment,receipt,usd)' ),
array( 'fas fa-hand-holding-usd' => 'Hand Holding US Dollar ($,carry,dollar sign,donation,giving,lift,money,price)' ),
array( 'fas fa-landmark' => 'Landmark (building,historic,memorable,monument,politics)' ),
array( 'fas fa-money-bill' => 'Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'far fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-wave' => 'Wavy Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-wave-alt' => 'Alternate Wavy Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-check' => 'Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-money-check-alt' => 'Alternate Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-percentage' => 'Percentage (discount,fraction,proportion,rate,ratio)' ),
array( 'fas fa-piggy-bank' => 'Piggy Bank (bank,save,savings)' ),
array( 'fas fa-receipt' => 'Receipt (check,invoice,money,pay,table)' ),
array( 'fas fa-stamp' => 'Stamp (art,certificate,imprint,rubber,seal)' ),
array( 'fas fa-wallet' => 'Wallet (billfold,cash,currency,money)' ),
),
'Fitness' => array(
array( 'fas fa-bicycle' => 'Bicycle (bike,gears,pedal,transportation,vehicle)' ),
array( 'fas fa-biking' => 'Biking (bicycle,bike,cycle,cycling,ride,wheel)' ),
array( 'fas fa-burn' => 'Burn (caliente,energy,fire,flame,gas,heat,hot)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heartbeat' => 'Heartbeat (ekg,electrocardiogram,health,lifeline,vital signs)' ),
array( 'fas fa-hiking' => 'Hiking (activity,backpack,fall,fitness,outdoors,person,seasonal,walking)' ),
array( 'fas fa-running' => 'Running (exercise,health,jog,person,run,sport,sprint)' ),
array( 'fas fa-shoe-prints' => 'Shoe Prints (feet,footprints,steps,walk)' ),
array( 'fas fa-skating' => 'Skating (activity,figure skating,fitness,ice,person,winter)' ),
array( 'fas fa-skiing' => 'Skiing (activity,downhill,fast,fitness,olympics,outdoors,person,seasonal,slalom)' ),
array( 'fas fa-skiing-nordic' => 'Skiing Nordic (activity,cross country,fitness,outdoors,person,seasonal)' ),
array( 'fas fa-snowboarding' => 'Snowboarding (activity,fitness,olympics,outdoors,person)' ),
array( 'fas fa-spa' => 'Spa (flora,massage,mindfulness,plant,wellness)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-walking' => 'Walking (exercise,health,pedometer,person,steps)' ),
),
'Food' => array(
array( 'fas fa-apple-alt' => 'Fruit Apple (fall,fruit,fuji,macintosh,orchard,seasonal,vegan)' ),
array( 'fas fa-bacon' => 'Bacon (blt,breakfast,ham,lard,meat,pancetta,pork,rasher)' ),
array( 'fas fa-bone' => 'Bone (calcium,dog,skeletal,skeleton,tibia)' ),
array( 'fas fa-bread-slice' => 'Bread Slice (bake,bakery,baking,dough,flour,gluten,grain,sandwich,sourdough,toast,wheat,yeast)' ),
array( 'fas fa-candy-cane' => 'Candy Cane (candy,christmas,holiday,mint,peppermint,striped,xmas)' ),
array( 'fas fa-carrot' => 'Carrot (bugs bunny,orange,vegan,vegetable)' ),
array( 'fas fa-cheese' => 'Cheese (cheddar,curd,gouda,melt,parmesan,sandwich,swiss,wedge)' ),
array( 'fas fa-cloud-meatball' => 'Cloud with (a chance of) Meatball (FLDSMDFR,food,spaghetti,storm)' ),
array( 'fas fa-cookie' => 'Cookie (baked good,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-drumstick-bite' => 'Drumstick with Bite Taken Out (bone,chicken,leg,meat,poultry,turkey)' ),
array( 'fas fa-egg' => 'Egg (breakfast,chicken,easter,shell,yolk)' ),
array( 'fas fa-fish' => 'Fish (fauna,gold,seafood,swimming)' ),
array( 'fas fa-hamburger' => 'Hamburger (bacon,beef,burger,burger king,cheeseburger,fast food,grill,ground beef,mcdonalds,sandwich)' ),
array( 'fas fa-hotdog' => 'Hot Dog (bun,chili,frankfurt,frankfurter,kosher,polish,sandwich,sausage,vienna,weiner)' ),
array( 'fas fa-ice-cream' => 'Ice Cream (chocolate,cone,dessert,frozen,scoop,sorbet,vanilla,yogurt)' ),
array( 'fas fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'far fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'fas fa-pepper-hot' => 'Hot Pepper (buffalo wings,capsicum,chili,chilli,habanero,jalapeno,mexican,spicy,tabasco,vegetable)' ),
array( 'fas fa-pizza-slice' => 'Pizza Slice (cheese,chicago,italian,mozzarella,new york,pepperoni,pie,slice,teenage mutant ninja turtles,tomato)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
array( 'fas fa-stroopwafel' => 'Stroopwafel (caramel,cookie,dessert,sweets,waffle)' ),
),
'Fruits & Vegetables' => array(
array( 'fas fa-apple-alt' => 'Fruit Apple (fall,fruit,fuji,macintosh,orchard,seasonal,vegan)' ),
array( 'fas fa-carrot' => 'Carrot (bugs bunny,orange,vegan,vegetable)' ),
array( 'fas fa-leaf' => 'leaf (eco,flora,nature,plant,vegan)' ),
array( 'fas fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'far fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'fas fa-pepper-hot' => 'Hot Pepper (buffalo wings,capsicum,chili,chilli,habanero,jalapeno,mexican,spicy,tabasco,vegetable)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
),
'Games' => array(
array( 'fas fa-chess' => 'Chess (board,castle,checkmate,game,king,rook,strategy,tournament)' ),
array( 'fas fa-chess-bishop' => 'Chess Bishop (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-board' => 'Chess Board (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-king' => 'Chess King (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-knight' => 'Chess Knight (board,checkmate,game,horse,strategy)' ),
array( 'fas fa-chess-pawn' => 'Chess Pawn (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-queen' => 'Chess Queen (board,checkmate,game,strategy)' ),
array( 'fas fa-chess-rook' => 'Chess Rook (board,castle,checkmate,game,strategy)' ),
array( 'fas fa-dice' => 'Dice (chance,gambling,game,roll)' ),
array( 'fas fa-dice-d20' => 'Dice D20 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dice-d6' => 'Dice D6 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dice-five' => 'Dice Five (chance,gambling,game,roll)' ),
array( 'fas fa-dice-four' => 'Dice Four (chance,gambling,game,roll)' ),
array( 'fas fa-dice-one' => 'Dice One (chance,gambling,game,roll)' ),
array( 'fas fa-dice-six' => 'Dice Six (chance,gambling,game,roll)' ),
array( 'fas fa-dice-three' => 'Dice Three (chance,gambling,game,roll)' ),
array( 'fas fa-dice-two' => 'Dice Two (chance,gambling,game,roll)' ),
array( 'fas fa-gamepad' => 'Gamepad (arcade,controller,d-pad,joystick,video,video game)' ),
array( 'fas fa-ghost' => 'Ghost (apparition,blinky,clyde,floating,halloween,holiday,inky,pinky,spirit)' ),
array( 'fas fa-headset' => 'Headset (audio,gamer,gaming,listen,live chat,microphone,shot caller,sound,support,telemarketer)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fab fa-playstation' => 'PlayStation' ),
array( 'fas fa-puzzle-piece' => 'Puzzle Piece (add-on,addon,game,section)' ),
array( 'fab fa-steam' => 'Steam' ),
array( 'fab fa-steam-square' => 'Steam Square' ),
array( 'fab fa-steam-symbol' => 'Steam Symbol' ),
array( 'fab fa-twitch' => 'Twitch' ),
array( 'fab fa-xbox' => 'Xbox' ),
),
'Genders' => array(
array( 'fas fa-genderless' => 'Genderless (androgynous,asexual,sexless)' ),
array( 'fas fa-mars' => 'Mars (male)' ),
array( 'fas fa-mars-double' => 'Mars Double' ),
array( 'fas fa-mars-stroke' => 'Mars Stroke' ),
array( 'fas fa-mars-stroke-h' => 'Mars Stroke Horizontal' ),
array( 'fas fa-mars-stroke-v' => 'Mars Stroke Vertical' ),
array( 'fas fa-mercury' => 'Mercury (transgender)' ),
array( 'fas fa-neuter' => 'Neuter' ),
array( 'fas fa-transgender' => 'Transgender (intersex)' ),
array( 'fas fa-transgender-alt' => 'Alternate Transgender (intersex)' ),
array( 'fas fa-venus' => 'Venus (female)' ),
array( 'fas fa-venus-double' => 'Venus Double (female)' ),
array( 'fas fa-venus-mars' => 'Venus Mars (Gender)' ),
),
'Halloween' => array(
array( 'fas fa-book-dead' => 'Book of the Dead (Dungeons & Dragons,crossbones,d&d,dark arts,death,dnd,documentation,evil,fantasy,halloween,holiday,necronomicon,read,skull,spell)' ),
array( 'fas fa-broom' => 'Broom (clean,firebolt,fly,halloween,nimbus 2000,quidditch,sweep,witch)' ),
array( 'fas fa-cat' => 'Cat (feline,halloween,holiday,kitten,kitty,meow,pet)' ),
array( 'fas fa-cloud-moon' => 'Cloud with Moon (crescent,evening,lunar,night,partly cloudy,sky)' ),
array( 'fas fa-crow' => 'Crow (bird,bullfrog,fauna,halloween,holiday,toad)' ),
array( 'fas fa-ghost' => 'Ghost (apparition,blinky,clyde,floating,halloween,holiday,inky,pinky,spirit)' ),
array( 'fas fa-hat-wizard' => 'Wizard\'s Hat (Dungeons & Dragons,accessory,buckle,clothing,d&d,dnd,fantasy,halloween,head,holiday,mage,magic,pointy,witch)' ),
array( 'fas fa-mask' => 'Mask (carnivale,costume,disguise,halloween,secret,super hero)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fas fa-spider' => 'Spider (arachnid,bug,charlotte,crawl,eight,halloween)' ),
array( 'fas fa-toilet-paper' => 'Toilet Paper (bathroom,halloween,holiday,lavatory,prank,restroom,roll)' ),
),
'Hands' => array(
array( 'fas fa-allergies' => 'Allergies (allergy,freckles,hand,hives,pox,skin,spots)' ),
array( 'fas fa-fist-raised' => 'Raised Fist (Dungeons & Dragons,d&d,dnd,fantasy,hand,ki,monk,resist,strength,unarmed combat)' ),
array( 'fas fa-hand-holding' => 'Hand Holding (carry,lift)' ),
array( 'fas fa-hand-holding-heart' => 'Hand Holding Heart (carry,charity,gift,lift,package)' ),
array( 'fas fa-hand-holding-usd' => 'Hand Holding US Dollar ($,carry,dollar sign,donation,giving,lift,money,price)' ),
array( 'fas fa-hand-lizard' => 'Lizard (Hand) (game,roshambo)' ),
array( 'far fa-hand-lizard' => 'Lizard (Hand) (game,roshambo)' ),
array( 'fas fa-hand-middle-finger' => 'Hand with Middle Finger Raised (flip the bird,gesture,hate,rude)' ),
array( 'fas fa-hand-paper' => 'Paper (Hand) (game,halt,roshambo,stop)' ),
array( 'far fa-hand-paper' => 'Paper (Hand) (game,halt,roshambo,stop)' ),
array( 'fas fa-hand-peace' => 'Peace (Hand) (rest,truce)' ),
array( 'far fa-hand-peace' => 'Peace (Hand) (rest,truce)' ),
array( 'fas fa-hand-point-down' => 'Hand Pointing Down (finger,hand-o-down,point)' ),
array( 'far fa-hand-point-down' => 'Hand Pointing Down (finger,hand-o-down,point)' ),
array( 'fas fa-hand-point-left' => 'Hand Pointing Left (back,finger,hand-o-left,left,point,previous)' ),
array( 'far fa-hand-point-left' => 'Hand Pointing Left (back,finger,hand-o-left,left,point,previous)' ),
array( 'fas fa-hand-point-right' => 'Hand Pointing Right (finger,forward,hand-o-right,next,point,right)' ),
array( 'far fa-hand-point-right' => 'Hand Pointing Right (finger,forward,hand-o-right,next,point,right)' ),
array( 'fas fa-hand-point-up' => 'Hand Pointing Up (finger,hand-o-up,point)' ),
array( 'far fa-hand-point-up' => 'Hand Pointing Up (finger,hand-o-up,point)' ),
array( 'fas fa-hand-pointer' => 'Pointer (Hand) (arrow,cursor,select)' ),
array( 'far fa-hand-pointer' => 'Pointer (Hand) (arrow,cursor,select)' ),
array( 'fas fa-hand-rock' => 'Rock (Hand) (fist,game,roshambo)' ),
array( 'far fa-hand-rock' => 'Rock (Hand) (fist,game,roshambo)' ),
array( 'fas fa-hand-scissors' => 'Scissors (Hand) (cut,game,roshambo)' ),
array( 'far fa-hand-scissors' => 'Scissors (Hand) (cut,game,roshambo)' ),
array( 'fas fa-hand-spock' => 'Spock (Hand) (live long,prosper,salute,star trek,vulcan)' ),
array( 'far fa-hand-spock' => 'Spock (Hand) (live long,prosper,salute,star trek,vulcan)' ),
array( 'fas fa-hands' => 'Hands (carry,hold,lift)' ),
array( 'fas fa-hands-helping' => 'Helping Hands (aid,assistance,handshake,partnership,volunteering)' ),
array( 'fas fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'far fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'fas fa-praying-hands' => 'Praying Hands (kneel,preach,religion,worship)' ),
array( 'fas fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'far fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'fas fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'far fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
),
'Health' => array(
array( 'fab fa-accessible-icon' => 'Accessible Icon (accessibility,handicap,person,wheelchair,wheelchair-alt)' ),
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-h-square' => 'H Square (directions,emergency,hospital,hotel,map)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heartbeat' => 'Heartbeat (ekg,electrocardiogram,health,lifeline,vital signs)' ),
array( 'fas fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'far fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'fas fa-medkit' => 'medkit (first aid,firstaid,health,help,support)' ),
array( 'fas fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'far fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'fas fa-prescription' => 'Prescription (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-stethoscope' => 'Stethoscope (diagnosis,doctor,general practitioner,hospital,infirmary,medicine,office,outpatient)' ),
array( 'fas fa-user-md' => 'Doctor (job,medical,nurse,occupation,physician,profile,surgeon)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
),
'Holiday' => array(
array( 'fas fa-candy-cane' => 'Candy Cane (candy,christmas,holiday,mint,peppermint,striped,xmas)' ),
array( 'fas fa-carrot' => 'Carrot (bugs bunny,orange,vegan,vegetable)' ),
array( 'fas fa-cookie-bite' => 'Cookie Bite (baked good,bitten,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-gifts' => 'Gifts (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-glass-cheers' => 'Glass Cheers (alcohol,bar,beverage,celebration,champagne,clink,drink,holiday,new year\'s eve,party,toast)' ),
array( 'fas fa-holly-berry' => 'Holly Berry (catwoman,christmas,decoration,flora,halle,holiday,ororo munroe,plant,storm,xmas)' ),
array( 'fas fa-mug-hot' => 'Mug Hot (caliente,cocoa,coffee,cup,drink,holiday,hot chocolate,steam,tea,warmth)' ),
array( 'fas fa-sleigh' => 'Sleigh (christmas,claus,fly,holiday,santa,sled,snow,xmas)' ),
array( 'fas fa-snowman' => 'Snowman (decoration,frost,frosty,holiday)' ),
),
'Hotel' => array(
array( 'fas fa-baby-carriage' => 'Baby Carriage (buggy,carrier,infant,push,stroller,transportation,walk,wheels)' ),
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-briefcase' => 'Briefcase (bag,business,luggage,office,work)' ),
array( 'fas fa-car' => 'Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-cocktail' => 'Cocktail (alcohol,beverage,drink,gin,glass,margarita,martini,vodka)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-concierge-bell' => 'Concierge Bell (attention,hotel,receptionist,service,support)' ),
array( 'fas fa-dice' => 'Dice (chance,gambling,game,roll)' ),
array( 'fas fa-dice-five' => 'Dice Five (chance,gambling,game,roll)' ),
array( 'fas fa-door-closed' => 'Door Closed (enter,exit,locked)' ),
array( 'fas fa-door-open' => 'Door Open (enter,exit,welcome)' ),
array( 'fas fa-dumbbell' => 'Dumbbell (exercise,gym,strength,weight,weight-lifting)' ),
array( 'fas fa-glass-martini' => 'Martini Glass (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-glass-martini-alt' => 'Alternate Glass Martini (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-hot-tub' => 'Hot Tub (bath,jacuzzi,massage,sauna,spa)' ),
array( 'fas fa-hotel' => 'Hotel (building,inn,lodging,motel,resort,travel)' ),
array( 'fas fa-infinity' => 'Infinity (eternity,forever,math)' ),
array( 'fas fa-key' => 'key (lock,password,private,secret,unlock)' ),
array( 'fas fa-luggage-cart' => 'Luggage Cart (bag,baggage,suitcase,travel)' ),
array( 'fas fa-shower' => 'Shower (bath,clean,faucet,water)' ),
array( 'fas fa-shuttle-van' => 'Shuttle Van (airport,machine,public-transportation,transportation,travel,vehicle)' ),
array( 'fas fa-smoking' => 'Smoking (cancer,cigarette,nicotine,smoking status,tobacco)' ),
array( 'fas fa-smoking-ban' => 'Smoking Ban (ban,cancel,no smoking,non-smoking)' ),
array( 'fas fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'far fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'fas fa-spa' => 'Spa (flora,massage,mindfulness,plant,wellness)' ),
array( 'fas fa-suitcase' => 'Suitcase (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-suitcase-rolling' => 'Suitcase Rolling (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-swimming-pool' => 'Swimming Pool (ladder,recreation,swim,water)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
array( 'fas fa-umbrella-beach' => 'Umbrella Beach (protection,recreation,sand,shade,summer,sun)' ),
array( 'fas fa-utensils' => 'Utensils (cutlery,dining,dinner,eat,food,fork,knife,restaurant)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
),
'Household' => array(
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-blender' => 'Blender (cocktail,milkshake,mixer,puree,smoothie)' ),
array( 'fas fa-chair' => 'Chair (furniture,seat,sit)' ),
array( 'fas fa-couch' => 'Couch (chair,cushion,furniture,relax,sofa)' ),
array( 'fas fa-door-closed' => 'Door Closed (enter,exit,locked)' ),
array( 'fas fa-door-open' => 'Door Open (enter,exit,welcome)' ),
array( 'fas fa-dungeon' => 'Dungeon (Dungeons & Dragons,building,d&d,dnd,door,entrance,fantasy,gate)' ),
array( 'fas fa-fan' => 'Fan (ac,air conditioning,blade,blower,cool,hot)' ),
array( 'fas fa-shower' => 'Shower (bath,clean,faucet,water)' ),
array( 'fas fa-toilet-paper' => 'Toilet Paper (bathroom,halloween,holiday,lavatory,prank,restroom,roll)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
),
'Images' => array(
array( 'fas fa-adjust' => 'adjust (contrast,dark,light,saturation)' ),
array( 'fas fa-bolt' => 'Lightning Bolt (electricity,lightning,weather,zap)' ),
array( 'fas fa-camera' => 'camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-camera-retro' => 'Retro Camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-chalkboard' => 'Chalkboard (blackboard,learning,school,teaching,whiteboard,writing)' ),
array( 'fas fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'far fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'fas fa-compress' => 'Compress (collapse,fullscreen,minimize,move,resize,shrink,smaller)' ),
array( 'fas fa-compress-arrows-alt' => 'Alternate Compress Arrows (collapse,fullscreen,minimize,move,resize,shrink,smaller)' ),
array( 'fas fa-expand' => 'Expand (arrow,bigger,enlarge,resize)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-dropper' => 'Eye Dropper (beaker,clone,color,copy,eyedropper,pipette)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-file-image' => 'Image File (document,image,jpg,photo,png)' ),
array( 'far fa-file-image' => 'Image File (document,image,jpg,photo,png)' ),
array( 'fas fa-film' => 'Film (cinema,movie,strip,video)' ),
array( 'fas fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'far fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'fas fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'far fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'far fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'fas fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'far fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'fas fa-photo-video' => 'Photo Video (av,film,image,library,media)' ),
array( 'fas fa-portrait' => 'Portrait (id,image,photo,picture,selfie)' ),
array( 'fas fa-sliders-h' => 'Horizontal Sliders (adjust,settings,sliders,toggle)' ),
array( 'fas fa-tint' => 'tint (color,drop,droplet,raindrop,waterdrop)' ),
),
'Interfaces' => array(
array( 'fas fa-award' => 'Award (honor,praise,prize,recognition,ribbon,trophy)' ),
array( 'fas fa-ban' => 'ban (abort,ban,block,cancel,delete,hide,prohibit,remove,stop,trash)' ),
array( 'fas fa-barcode' => 'barcode (info,laser,price,scan,upc)' ),
array( 'fas fa-bars' => 'Bars (checklist,drag,hamburger,list,menu,nav,navigation,ol,reorder,settings,todo,ul)' ),
array( 'fas fa-beer' => 'beer (alcohol,ale,bar,beverage,brewery,drink,lager,liquor,mug,stein)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-blog' => 'Blog (journal,log,online,personal,post,web 2.0,wordpress,writing)' ),
array( 'fas fa-bug' => 'Bug (beetle,error,insect,report)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-bullseye' => 'Bullseye (archery,goal,objective,target)' ),
array( 'fas fa-calculator' => 'Calculator (abacus,addition,arithmetic,counting,math,multiplication,subtraction)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'far fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'far fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'fas fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'far fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'fas fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'far fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'fas fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'far fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'fas fa-certificate' => 'certificate (badge,star,verified)' ),
array( 'fas fa-check' => 'Check (accept,agree,checkmark,confirm,correct,done,notice,notification,notify,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-check-circle' => 'Check Circle (accept,agree,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'far fa-check-circle' => 'Check Circle (accept,agree,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-check-double' => 'Double Check (accept,agree,checkmark,confirm,correct,done,notice,notification,notify,ok,select,success,tick,todo)' ),
array( 'fas fa-check-square' => 'Check Square (accept,agree,checkmark,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'far fa-check-square' => 'Check Square (accept,agree,checkmark,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'far fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'fas fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'far fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'fas fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'far fa-clone' => 'Clone (arrange,copy,duplicate,paste)' ),
array( 'fas fa-cloud' => 'Cloud (atmosphere,fog,overcast,save,upload,weather)' ),
array( 'fas fa-cloud-download-alt' => 'Alternate Cloud Download (download,export,save)' ),
array( 'fas fa-cloud-upload-alt' => 'Alternate Cloud Upload (cloud-upload,import,save,upload)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-cog' => 'cog (gear,mechanical,settings,sprocket,wheel)' ),
array( 'fas fa-cogs' => 'cogs (gears,mechanical,settings,sprocket,wheel)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-database' => 'Database (computer,development,directory,memory,storage)' ),
array( 'fas fa-dot-circle' => 'Dot Circle (bullseye,notification,target)' ),
array( 'far fa-dot-circle' => 'Dot Circle (bullseye,notification,target)' ),
array( 'fas fa-download' => 'Download (export,hard drive,save,transfer)' ),
array( 'fas fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'far fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'fas fa-ellipsis-h' => 'Horizontal Ellipsis (dots,drag,kebab,list,menu,nav,navigation,ol,reorder,settings,ul)' ),
array( 'fas fa-ellipsis-v' => 'Vertical Ellipsis (dots,drag,kebab,list,menu,nav,navigation,ol,reorder,settings,ul)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-exclamation' => 'exclamation (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-circle' => 'Exclamation Circle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-triangle' => 'Exclamation Triangle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-external-link-alt' => 'Alternate External Link (external-link,new,open,share)' ),
array( 'fas fa-external-link-square-alt' => 'Alternate External Link Square (external-link-square,new,open,share)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-file-download' => 'File Download (document,export,save)' ),
array( 'fas fa-file-export' => 'File Export (download,save)' ),
array( 'fas fa-file-import' => 'File Import (copy,document,send,upload)' ),
array( 'fas fa-file-upload' => 'File Upload (document,import,page,save)' ),
array( 'fas fa-filter' => 'Filter (funnel,options,separate,sort)' ),
array( 'fas fa-fingerprint' => 'Fingerprint (human,id,identification,lock,smudge,touch,unique,unlock)' ),
array( 'fas fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'far fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'fas fa-flag-checkered' => 'flag-checkered (notice,notification,notify,pole,racing,report,symbol)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'far fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'fas fa-glasses' => 'Glasses (hipster,nerd,reading,sight,spectacles,vision)' ),
array( 'fas fa-grip-horizontal' => 'Grip Horizontal (affordance,drag,drop,grab,handle)' ),
array( 'fas fa-grip-lines' => 'Grip Lines (affordance,drag,drop,grab,handle)' ),
array( 'fas fa-grip-lines-vertical' => 'Grip Lines Vertical (affordance,drag,drop,grab,handle)' ),
array( 'fas fa-grip-vertical' => 'Grip Vertical (affordance,drag,drop,grab,handle)' ),
array( 'fas fa-hashtag' => 'Hashtag (Twitter,instagram,pound,social media,tag)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-history' => 'History (Rewind,clock,reverse,time,time machine)' ),
array( 'fas fa-home' => 'home (abode,building,house,main)' ),
array( 'fas fa-i-cursor' => 'I Beam Cursor (editing,i-beam,type,writing)' ),
array( 'fas fa-info' => 'Info (details,help,information,more,support)' ),
array( 'fas fa-info-circle' => 'Info Circle (details,help,information,more,support)' ),
array( 'fas fa-language' => 'Language (dialect,idiom,localize,speech,translate,vernacular)' ),
array( 'fas fa-magic' => 'magic (autocomplete,automatic,mage,magic,spell,wand,witch,wizard)' ),
array( 'fas fa-marker' => 'Marker (design,edit,sharpie,update,write)' ),
array( 'fas fa-medal' => 'Medal (award,ribbon,star,trophy)' ),
array( 'fas fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'far fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-minus' => 'minus (collapse,delete,hide,minify,negative,remove,trash)' ),
array( 'fas fa-minus-circle' => 'Minus Circle (delete,hide,negative,remove,shape,trash)' ),
array( 'fas fa-minus-square' => 'Minus Square (collapse,delete,hide,minify,negative,remove,shape,trash)' ),
array( 'far fa-minus-square' => 'Minus Square (collapse,delete,hide,minify,negative,remove,shape,trash)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-fancy' => 'Pen Fancy (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-plus' => 'plus (add,create,expand,new,positive,shape)' ),
array( 'fas fa-plus-circle' => 'Plus Circle (add,create,expand,new,positive,shape)' ),
array( 'fas fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'far fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'fas fa-poo' => 'Poo (crap,poop,shit,smile,turd)' ),
array( 'fas fa-qrcode' => 'qrcode (barcode,info,information,scan)' ),
array( 'fas fa-question' => 'Question (help,information,support,unknown)' ),
array( 'fas fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'far fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'fas fa-quote-left' => 'quote-left (mention,note,phrase,text,type)' ),
array( 'fas fa-quote-right' => 'quote-right (mention,note,phrase,text,type)' ),
array( 'fas fa-redo' => 'Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-redo-alt' => 'Alternate Redo (forward,refresh,reload,repeat)' ),
array( 'fas fa-reply' => 'Reply (mail,message,respond)' ),
array( 'fas fa-reply-all' => 'reply-all (mail,message,respond)' ),
array( 'fas fa-rss' => 'rss (blog,feed,journal,news,writing)' ),
array( 'fas fa-rss-square' => 'RSS Square (blog,feed,journal,news,writing)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-screwdriver' => 'Screwdriver (admin,fix,mechanic,repair,settings,tool)' ),
array( 'fas fa-search' => 'Search (bigger,enlarge,find,magnify,preview,zoom)' ),
array( 'fas fa-search-minus' => 'Search Minus (minify,negative,smaller,zoom,zoom out)' ),
array( 'fas fa-search-plus' => 'Search Plus (bigger,enlarge,magnify,positive,zoom,zoom in)' ),
array( 'fas fa-share' => 'Share (forward,save,send,social)' ),
array( 'fas fa-share-alt' => 'Alternate Share (forward,save,send,social)' ),
array( 'fas fa-share-alt-square' => 'Alternate Share Square (forward,save,send,social)' ),
array( 'fas fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'far fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'fas fa-shield-alt' => 'Alternate Shield (achievement,award,block,defend,security,winner)' ),
array( 'fas fa-sign-in-alt' => 'Alternate Sign In (arrow,enter,join,log in,login,sign in,sign up,sign-in,signin,signup)' ),
array( 'fas fa-sign-out-alt' => 'Alternate Sign Out (arrow,exit,leave,log out,logout,sign-out)' ),
array( 'fas fa-signal' => 'signal (bars,graph,online,reception,status)' ),
array( 'fas fa-sitemap' => 'Sitemap (directory,hierarchy,ia,information architecture,organization)' ),
array( 'fas fa-sliders-h' => 'Horizontal Sliders (adjust,settings,sliders,toggle)' ),
array( 'fas fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'far fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'fas fa-sort' => 'Sort (filter,order)' ),
array( 'fas fa-sort-alpha-down' => 'Sort Alphabetical Down (alphabetical,arrange,filter,order,sort-alpha-asc)' ),
array( 'fas fa-sort-alpha-down-alt' => 'Alternate Sort Alphabetical Down (alphabetical,arrange,filter,order,sort-alpha-asc)' ),
array( 'fas fa-sort-alpha-up' => 'Sort Alphabetical Up (alphabetical,arrange,filter,order,sort-alpha-desc)' ),
array( 'fas fa-sort-alpha-up-alt' => 'Alternate Sort Alphabetical Up (alphabetical,arrange,filter,order,sort-alpha-desc)' ),
array( 'fas fa-sort-amount-down' => 'Sort Amount Down (arrange,filter,number,order,sort-amount-asc)' ),
array( 'fas fa-sort-amount-down-alt' => 'Alternate Sort Amount Down (arrange,filter,order,sort-amount-asc)' ),
array( 'fas fa-sort-amount-up' => 'Sort Amount Up (arrange,filter,order,sort-amount-desc)' ),
array( 'fas fa-sort-amount-up-alt' => 'Alternate Sort Amount Up (arrange,filter,order,sort-amount-desc)' ),
array( 'fas fa-sort-down' => 'Sort Down (Descending) (arrow,descending,filter,order,sort-desc)' ),
array( 'fas fa-sort-numeric-down' => 'Sort Numeric Down (arrange,filter,numbers,order,sort-numeric-asc)' ),
array( 'fas fa-sort-numeric-down-alt' => 'Alternate Sort Numeric Down (arrange,filter,numbers,order,sort-numeric-asc)' ),
array( 'fas fa-sort-numeric-up' => 'Sort Numeric Up (arrange,filter,numbers,order,sort-numeric-desc)' ),
array( 'fas fa-sort-numeric-up-alt' => 'Alternate Sort Numeric Up (arrange,filter,numbers,order,sort-numeric-desc)' ),
array( 'fas fa-sort-up' => 'Sort Up (Ascending) (arrow,ascending,filter,order,sort-asc)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fas fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'far fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'fas fa-sync' => 'Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-sync-alt' => 'Alternate Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'far fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'fas fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'far fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'fas fa-times' => 'Times (close,cross,error,exit,incorrect,notice,notification,notify,problem,wrong,x)' ),
array( 'fas fa-times-circle' => 'Times Circle (close,cross,exit,incorrect,notice,notification,notify,problem,wrong,x)' ),
array( 'far fa-times-circle' => 'Times Circle (close,cross,exit,incorrect,notice,notification,notify,problem,wrong,x)' ),
array( 'fas fa-toggle-off' => 'Toggle Off (switch)' ),
array( 'fas fa-toggle-on' => 'Toggle On (switch)' ),
array( 'fas fa-tools' => 'Tools (admin,fix,repair,screwdriver,settings,tools,wrench)' ),
array( 'fas fa-trash' => 'Trash (delete,garbage,hide,remove)' ),
array( 'fas fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'far fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'fas fa-trash-restore' => 'Trash Restore (back,control z,oops,undo)' ),
array( 'fas fa-trash-restore-alt' => 'Alternative Trash Restore (back,control z,oops,undo)' ),
array( 'fas fa-trophy' => 'trophy (achievement,award,cup,game,winner)' ),
array( 'fas fa-undo' => 'Undo (back,control z,exchange,oops,return,rotate,swap)' ),
array( 'fas fa-undo-alt' => 'Alternate Undo (back,control z,exchange,oops,return,swap)' ),
array( 'fas fa-upload' => 'Upload (hard drive,import,publish)' ),
array( 'fas fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-alt' => 'Alternate User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-volume-down' => 'Volume Down (audio,lower,music,quieter,sound,speaker)' ),
array( 'fas fa-volume-mute' => 'Volume Mute (audio,music,quiet,sound,speaker)' ),
array( 'fas fa-volume-off' => 'Volume Off (audio,ban,music,mute,quiet,silent,sound)' ),
array( 'fas fa-volume-up' => 'Volume Up (audio,higher,louder,music,sound,speaker)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
array( 'fas fa-wrench' => 'Wrench (construction,fix,mechanic,plumbing,settings,spanner,tool,update)' ),
),
'Logistics' => array(
array( 'fas fa-box' => 'Box (archive,container,package,storage)' ),
array( 'fas fa-boxes' => 'Boxes (archives,inventory,storage,warehouse)' ),
array( 'fas fa-clipboard-check' => 'Clipboard with Check (accept,agree,confirm,done,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-clipboard-list' => 'Clipboard List (checklist,completed,done,finished,intinerary,ol,schedule,tick,todo,ul)' ),
array( 'fas fa-dolly' => 'Dolly (carry,shipping,transport)' ),
array( 'fas fa-dolly-flatbed' => 'Dolly Flatbed (carry,inventory,shipping,transport)' ),
array( 'fas fa-hard-hat' => 'Hard Hat (construction,hardhat,helmet,safety)' ),
array( 'fas fa-pallet' => 'Pallet (archive,box,inventory,shipping,warehouse)' ),
array( 'fas fa-shipping-fast' => 'Shipping Fast (express,fedex,mail,overnight,package,ups)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-warehouse' => 'Warehouse (building,capacity,garage,inventory,storage)' ),
),
'Maps' => array(
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-anchor' => 'Anchor (berth,boat,dock,embed,link,maritime,moor,secure)' ),
array( 'fas fa-balance-scale' => 'Balance Scale (balanced,justice,legal,measure,weight)' ),
array( 'fas fa-balance-scale-left' => 'Balance Scale (Left-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-balance-scale-right' => 'Balance Scale (Right-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-beer' => 'beer (alcohol,ale,bar,beverage,brewery,drink,lager,liquor,mug,stein)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-bicycle' => 'Bicycle (bike,gears,pedal,transportation,vehicle)' ),
array( 'fas fa-binoculars' => 'Binoculars (glasses,magnify,scenic,spyglass,view)' ),
array( 'fas fa-birthday-cake' => 'Birthday Cake (anniversary,bakery,candles,celebration,dessert,frosting,holiday,party,pastry)' ),
array( 'fas fa-blind' => 'Blind (cane,disability,person,sight)' ),
array( 'fas fa-bomb' => 'Bomb (error,explode,fuse,grenade,warning)' ),
array( 'fas fa-book' => 'book (diary,documentation,journal,library,read)' ),
array( 'fas fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'far fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'fas fa-briefcase' => 'Briefcase (bag,business,luggage,office,work)' ),
array( 'fas fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'far fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'fas fa-car' => 'Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-crosshairs' => 'Crosshairs (aim,bullseye,gpd,picker,position)' ),
array( 'fas fa-directions' => 'Directions (map,navigation,sign,turn)' ),
array( 'fas fa-dollar-sign' => 'Dollar Sign ($,cost,dollar-sign,money,price,usd)' ),
array( 'fas fa-draw-polygon' => 'Draw Polygon (anchors,lines,object,render,shape)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-fighter-jet' => 'fighter-jet (airplane,fast,fly,goose,maverick,plane,quick,top gun,transportation,travel)' ),
array( 'fas fa-fire' => 'fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-extinguisher' => 'fire-extinguisher (burn,caliente,fire fighter,flame,heat,hot,rescue)' ),
array( 'fas fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'far fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'fas fa-flag-checkered' => 'flag-checkered (notice,notification,notify,pole,racing,report,symbol)' ),
array( 'fas fa-flask' => 'Flask (beaker,experimental,labs,science)' ),
array( 'fas fa-gamepad' => 'Gamepad (arcade,controller,d-pad,joystick,video,video game)' ),
array( 'fas fa-gavel' => 'Gavel (hammer,judge,law,lawyer,opinion)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-glass-martini' => 'Martini Glass (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-globe' => 'Globe (all,coordinates,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-graduation-cap' => 'Graduation Cap (ceremony,college,graduate,learning,school,student)' ),
array( 'fas fa-h-square' => 'H Square (directions,emergency,hospital,hotel,map)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heartbeat' => 'Heartbeat (ekg,electrocardiogram,health,lifeline,vital signs)' ),
array( 'fas fa-helicopter' => 'Helicopter (airwolf,apache,chopper,flight,fly,travel)' ),
array( 'fas fa-home' => 'home (abode,building,house,main)' ),
array( 'fas fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'far fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'fas fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'far fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'fas fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'far fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'fas fa-industry' => 'Industry (building,factory,industrial,manufacturing,mill,warehouse)' ),
array( 'fas fa-info' => 'Info (details,help,information,more,support)' ),
array( 'fas fa-info-circle' => 'Info Circle (details,help,information,more,support)' ),
array( 'fas fa-key' => 'key (lock,password,private,secret,unlock)' ),
array( 'fas fa-landmark' => 'Landmark (building,historic,memorable,monument,politics)' ),
array( 'fas fa-layer-group' => 'Layer Group (arrange,develop,layers,map,stack)' ),
array( 'fas fa-leaf' => 'leaf (eco,flora,nature,plant,vegan)' ),
array( 'fas fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'far fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'fas fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'far fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'fas fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'far fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'fas fa-location-arrow' => 'location-arrow (address,compass,coordinate,direction,gps,map,navigation,place)' ),
array( 'fas fa-low-vision' => 'Low Vision (blind,eye,sight)' ),
array( 'fas fa-magnet' => 'magnet (Attract,lodestone,tool)' ),
array( 'fas fa-male' => 'Male (human,man,person,profile,user)' ),
array( 'fas fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'far fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker' => 'map-marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker-alt' => 'Alternate Map Marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-pin' => 'Map Pin (address,agree,coordinates,destination,gps,localize,location,map,marker,navigation,pin,place,position,travel)' ),
array( 'fas fa-map-signs' => 'Map Signs (directions,directory,map,signage,wayfinding)' ),
array( 'fas fa-medkit' => 'medkit (first aid,firstaid,health,help,support)' ),
array( 'fas fa-money-bill' => 'Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'far fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-motorcycle' => 'Motorcycle (bike,machine,transportation,vehicle)' ),
array( 'fas fa-music' => 'Music (lyrics,melody,note,sing,sound)' ),
array( 'fas fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'far fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'fas fa-parking' => 'Parking (auto,car,garage,meter)' ),
array( 'fas fa-paw' => 'Paw (animal,cat,dog,pet,print)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-square' => 'Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-square-alt' => 'Alternate Phone Square (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-volume' => 'Phone Volume (call,earphone,number,sound,support,telephone,voice,volume-control-phone)' ),
array( 'fas fa-plane' => 'plane (airplane,destination,fly,location,mode,travel,trip)' ),
array( 'fas fa-plug' => 'Plug (connect,electric,online,power)' ),
array( 'fas fa-plus' => 'plus (add,create,expand,new,positive,shape)' ),
array( 'fas fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'far fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-recycle' => 'Recycle (Waste,compost,garbage,reuse,trash)' ),
array( 'fas fa-restroom' => 'Restroom (bathroom,john,loo,potty,washroom,waste,wc)' ),
array( 'fas fa-road' => 'road (highway,map,pavement,route,street,travel)' ),
array( 'fas fa-rocket' => 'rocket (aircraft,app,jet,launch,nasa,space)' ),
array( 'fas fa-route' => 'Route (directions,navigation,travel)' ),
array( 'fas fa-search' => 'Search (bigger,enlarge,find,magnify,preview,zoom)' ),
array( 'fas fa-search-minus' => 'Search Minus (minify,negative,smaller,zoom,zoom out)' ),
array( 'fas fa-search-plus' => 'Search Plus (bigger,enlarge,magnify,positive,zoom,zoom in)' ),
array( 'fas fa-ship' => 'Ship (boat,sea,water)' ),
array( 'fas fa-shoe-prints' => 'Shoe Prints (feet,footprints,steps,walk)' ),
array( 'fas fa-shopping-bag' => 'Shopping Bag (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-basket' => 'Shopping Basket (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shower' => 'Shower (bath,clean,faucet,water)' ),
array( 'fas fa-snowplow' => 'Snowplow (clean up,cold,road,storm,winter)' ),
array( 'fas fa-street-view' => 'Street View (directions,location,map,navigation)' ),
array( 'fas fa-subway' => 'Subway (machine,railway,train,transportation,vehicle)' ),
array( 'fas fa-suitcase' => 'Suitcase (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-tag' => 'tag (discount,label,price,shopping)' ),
array( 'fas fa-tags' => 'tags (discount,label,price,shopping)' ),
array( 'fas fa-taxi' => 'Taxi (cab,cabbie,car,car service,lyft,machine,transportation,travel,uber,vehicle)' ),
array( 'fas fa-thumbtack' => 'Thumbtack (coordinates,location,marker,pin,thumb-tack)' ),
array( 'fas fa-ticket-alt' => 'Alternate Ticket (movie,pass,support,ticket)' ),
array( 'fas fa-tint' => 'tint (color,drop,droplet,raindrop,waterdrop)' ),
array( 'fas fa-traffic-light' => 'Traffic Light (direction,road,signal,travel)' ),
array( 'fas fa-train' => 'Train (bullet,commute,locomotive,railway,subway)' ),
array( 'fas fa-tram' => 'Tram (crossing,machine,mountains,seasonal,transportation)' ),
array( 'fas fa-tree' => 'Tree (bark,fall,flora,forest,nature,plant,seasonal)' ),
array( 'fas fa-trophy' => 'trophy (achievement,award,cup,game,winner)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-tty' => 'TTY (communication,deaf,telephone,teletypewriter,text)' ),
array( 'fas fa-umbrella' => 'Umbrella (protection,rain,storm,wet)' ),
array( 'fas fa-university' => 'University (bank,building,college,higher education - students,institution)' ),
array( 'fas fa-utensil-spoon' => 'Utensil Spoon (cutlery,dining,scoop,silverware,spoon)' ),
array( 'fas fa-utensils' => 'Utensils (cutlery,dining,dinner,eat,food,fork,knife,restaurant)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
array( 'fas fa-wine-glass' => 'Wine Glass (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
array( 'fas fa-wrench' => 'Wrench (construction,fix,mechanic,plumbing,settings,spanner,tool,update)' ),
),
'Maritime' => array(
array( 'fas fa-anchor' => 'Anchor (berth,boat,dock,embed,link,maritime,moor,secure)' ),
array( 'fas fa-binoculars' => 'Binoculars (glasses,magnify,scenic,spyglass,view)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-dharmachakra' => 'Dharmachakra (buddhism,buddhist,wheel of dharma)' ),
array( 'fas fa-frog' => 'Frog (amphibian,bullfrog,fauna,hop,kermit,kiss,prince,ribbit,toad,wart)' ),
array( 'fas fa-ship' => 'Ship (boat,sea,water)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-water' => 'Water (lake,liquid,ocean,sea,swim,wet)' ),
array( 'fas fa-wind' => 'Wind (air,blow,breeze,fall,seasonal,weather)' ),
),
'Marketing' => array(
array( 'fas fa-ad' => 'Ad (advertisement,media,newspaper,promotion,publicity)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-bullseye' => 'Bullseye (archery,goal,objective,target)' ),
array( 'fas fa-comment-dollar' => 'Comment Dollar (bubble,chat,commenting,conversation,feedback,message,money,note,notification,pay,sms,speech,spend,texting,transfer)' ),
array( 'fas fa-comments-dollar' => 'Comments Dollar (bubble,chat,commenting,conversation,feedback,message,money,note,notification,pay,sms,speech,spend,texting,transfer)' ),
array( 'fas fa-envelope-open-text' => 'Envelope Open-text (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-funnel-dollar' => 'Funnel Dollar (filter,money,options,separate,sort)' ),
array( 'fas fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'far fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'fas fa-mail-bulk' => 'Mail Bulk (archive,envelope,letter,post office,postal,postcard,send,stamp,usps)' ),
array( 'fas fa-poll' => 'Poll (results,survey,trend,vote,voting)' ),
array( 'fas fa-poll-h' => 'Poll H (results,survey,trend,vote,voting)' ),
array( 'fas fa-search-dollar' => 'Search Dollar (bigger,enlarge,find,magnify,money,preview,zoom)' ),
array( 'fas fa-search-location' => 'Search Location (bigger,enlarge,find,magnify,preview,zoom)' ),
),
'Mathematics' => array(
array( 'fas fa-calculator' => 'Calculator (abacus,addition,arithmetic,counting,math,multiplication,subtraction)' ),
array( 'fas fa-divide' => 'Divide (arithmetic,calculus,division,math)' ),
array( 'fas fa-equals' => 'Equals (arithmetic,even,match,math)' ),
array( 'fas fa-greater-than' => 'Greater Than (arithmetic,compare,math)' ),
array( 'fas fa-greater-than-equal' => 'Greater Than Equal To (arithmetic,compare,math)' ),
array( 'fas fa-infinity' => 'Infinity (eternity,forever,math)' ),
array( 'fas fa-less-than' => 'Less Than (arithmetic,compare,math)' ),
array( 'fas fa-less-than-equal' => 'Less Than Equal To (arithmetic,compare,math)' ),
array( 'fas fa-minus' => 'minus (collapse,delete,hide,minify,negative,remove,trash)' ),
array( 'fas fa-not-equal' => 'Not Equal (arithmetic,compare,math)' ),
array( 'fas fa-percentage' => 'Percentage (discount,fraction,proportion,rate,ratio)' ),
array( 'fas fa-plus' => 'plus (add,create,expand,new,positive,shape)' ),
array( 'fas fa-square-root-alt' => 'Alternate Square Root (arithmetic,calculus,division,math)' ),
array( 'fas fa-subscript' => 'subscript (edit,font,format,text,type)' ),
array( 'fas fa-superscript' => 'superscript (edit,exponential,font,format,text,type)' ),
array( 'fas fa-times' => 'Times (close,cross,error,exit,incorrect,notice,notification,notify,problem,wrong,x)' ),
array( 'fas fa-wave-square' => 'Square Wave (frequency,pulse,signal)' ),
),
'Medical' => array(
array( 'fas fa-allergies' => 'Allergies (allergy,freckles,hand,hives,pox,skin,spots)' ),
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-band-aid' => 'Band-Aid (bandage,boo boo,first aid,ouch)' ),
array( 'fas fa-biohazard' => 'Biohazard (danger,dangerous,hazmat,medical,radioactive,toxic,waste,zombie)' ),
array( 'fas fa-bone' => 'Bone (calcium,dog,skeletal,skeleton,tibia)' ),
array( 'fas fa-bong' => 'Bong (aparatus,cannabis,marijuana,pipe,smoke,smoking)' ),
array( 'fas fa-book-medical' => 'Medical Book (diary,documentation,health,history,journal,library,read,record)' ),
array( 'fas fa-brain' => 'Brain (cerebellum,gray matter,intellect,medulla oblongata,mind,noodle,wit)' ),
array( 'fas fa-briefcase-medical' => 'Medical Briefcase (doctor,emt,first aid,health)' ),
array( 'fas fa-burn' => 'Burn (caliente,energy,fire,flame,gas,heat,hot)' ),
array( 'fas fa-cannabis' => 'Cannabis (bud,chronic,drugs,endica,endo,ganja,marijuana,mary jane,pot,reefer,sativa,spliff,weed,whacky-tabacky)' ),
array( 'fas fa-capsules' => 'Capsules (drugs,medicine,pills,prescription)' ),
array( 'fas fa-clinic-medical' => 'Medical Clinic (doctor,general practitioner,hospital,infirmary,medicine,office,outpatient)' ),
array( 'fas fa-comment-medical' => 'Alternate Medical Chat (advice,bubble,chat,commenting,conversation,diagnose,feedback,message,note,notification,prescription,sms,speech,texting)' ),
array( 'fas fa-crutch' => 'Crutch (cane,injury,mobility,wheelchair)' ),
array( 'fas fa-diagnoses' => 'Diagnoses (analyze,detect,diagnosis,examine,medicine)' ),
array( 'fas fa-dna' => 'DNA (double helix,genetic,helix,molecule,protein)' ),
array( 'fas fa-file-medical' => 'Medical File (document,health,history,prescription,record)' ),
array( 'fas fa-file-medical-alt' => 'Alternate Medical File (document,health,history,prescription,record)' ),
array( 'fas fa-file-prescription' => 'File Prescription (document,drugs,medical,medicine,rx)' ),
array( 'fas fa-first-aid' => 'First Aid (emergency,emt,health,medical,rescue)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heartbeat' => 'Heartbeat (ekg,electrocardiogram,health,lifeline,vital signs)' ),
array( 'fas fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'far fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'fas fa-hospital-alt' => 'Alternate Hospital (building,emergency room,medical center)' ),
array( 'fas fa-hospital-symbol' => 'Hospital Symbol (clinic,emergency,map)' ),
array( 'fas fa-id-card-alt' => 'Alternate Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-joint' => 'Joint (blunt,cannabis,doobie,drugs,marijuana,roach,smoke,smoking,spliff)' ),
array( 'fas fa-laptop-medical' => 'Laptop Medical (computer,device,ehr,electronic health records,history)' ),
array( 'fas fa-microscope' => 'Microscope (electron,lens,optics,science,shrink)' ),
array( 'fas fa-mortar-pestle' => 'Mortar Pestle (crush,culinary,grind,medical,mix,pharmacy,prescription,spices)' ),
array( 'fas fa-notes-medical' => 'Medical Notes (clipboard,doctor,ehr,health,history,records)' ),
array( 'fas fa-pager' => 'Pager (beeper,cellphone,communication)' ),
array( 'fas fa-pills' => 'Pills (drugs,medicine,prescription,tablets)' ),
array( 'fas fa-plus' => 'plus (add,create,expand,new,positive,shape)' ),
array( 'fas fa-poop' => 'Poop (crap,poop,shit,smile,turd)' ),
array( 'fas fa-prescription' => 'Prescription (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-prescription-bottle' => 'Prescription Bottle (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-prescription-bottle-alt' => 'Alternate Prescription Bottle (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-procedures' => 'Procedures (EKG,bed,electrocardiogram,health,hospital,life,patient,vital)' ),
array( 'fas fa-radiation' => 'Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-radiation-alt' => 'Alternate Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-smoking' => 'Smoking (cancer,cigarette,nicotine,smoking status,tobacco)' ),
array( 'fas fa-smoking-ban' => 'Smoking Ban (ban,cancel,no smoking,non-smoking)' ),
array( 'fas fa-star-of-life' => 'Star of Life (doctor,emt,first aid,health,medical)' ),
array( 'fas fa-stethoscope' => 'Stethoscope (diagnosis,doctor,general practitioner,hospital,infirmary,medicine,office,outpatient)' ),
array( 'fas fa-syringe' => 'Syringe (doctor,immunizations,medical,needle)' ),
array( 'fas fa-tablets' => 'Tablets (drugs,medicine,pills,prescription)' ),
array( 'fas fa-teeth' => 'Teeth (bite,dental,dentist,gums,mouth,smile,tooth)' ),
array( 'fas fa-teeth-open' => 'Teeth Open (dental,dentist,gums bite,mouth,smile,tooth)' ),
array( 'fas fa-thermometer' => 'Thermometer (mercury,status,temperature)' ),
array( 'fas fa-tooth' => 'Tooth (bicuspid,dental,dentist,molar,mouth,teeth)' ),
array( 'fas fa-user-md' => 'Doctor (job,medical,nurse,occupation,physician,profile,surgeon)' ),
array( 'fas fa-user-nurse' => 'Nurse (doctor,midwife,practitioner,surgeon)' ),
array( 'fas fa-vial' => 'Vial (experiment,lab,sample,science,test,test tube)' ),
array( 'fas fa-vials' => 'Vials (experiment,lab,sample,science,test,test tube)' ),
array( 'fas fa-weight' => 'Weight (health,measurement,scale,weight)' ),
array( 'fas fa-x-ray' => 'X-Ray (health,medical,radiological images,radiology,skeleton)' ),
),
'Moving' => array(
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-box-open' => 'Box Open (archive,container,package,storage,unpack)' ),
array( 'fas fa-couch' => 'Couch (chair,cushion,furniture,relax,sofa)' ),
array( 'fas fa-dolly' => 'Dolly (carry,shipping,transport)' ),
array( 'fas fa-people-carry' => 'People Carry (box,carry,fragile,help,movers,package)' ),
array( 'fas fa-route' => 'Route (directions,navigation,travel)' ),
array( 'fas fa-sign' => 'Sign (directions,real estate,signage,wayfinding)' ),
array( 'fas fa-suitcase' => 'Suitcase (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-tape' => 'Tape (design,package,sticky)' ),
array( 'fas fa-truck-loading' => 'Truck Loading (box,cargo,delivery,inventory,moving,rental,vehicle)' ),
array( 'fas fa-truck-moving' => 'Truck Moving (cargo,inventory,rental,vehicle)' ),
array( 'fas fa-wine-glass' => 'Wine Glass (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
),
'Music' => array(
array( 'fas fa-drum' => 'Drum (instrument,music,percussion,snare,sound)' ),
array( 'fas fa-drum-steelpan' => 'Drum Steelpan (calypso,instrument,music,percussion,reggae,snare,sound,steel,tropical)' ),
array( 'fas fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'far fa-file-audio' => 'Audio File (document,mp3,music,page,play,sound)' ),
array( 'fas fa-guitar' => 'Guitar (acoustic,instrument,music,rock,rock and roll,song,strings)' ),
array( 'fas fa-headphones' => 'headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-headphones-alt' => 'Alternate Headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt-slash' => 'Alternate Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-music' => 'Music (lyrics,melody,note,sing,sound)' ),
array( 'fab fa-napster' => 'Napster' ),
array( 'fas fa-play' => 'play (audio,music,playing,sound,start,video)' ),
array( 'fas fa-record-vinyl' => 'Record Vinyl (LP,album,analog,music,phonograph,sound)' ),
array( 'fas fa-sliders-h' => 'Horizontal Sliders (adjust,settings,sliders,toggle)' ),
array( 'fab fa-soundcloud' => 'SoundCloud' ),
array( 'fab fa-spotify' => 'Spotify' ),
array( 'fas fa-volume-down' => 'Volume Down (audio,lower,music,quieter,sound,speaker)' ),
array( 'fas fa-volume-mute' => 'Volume Mute (audio,music,quiet,sound,speaker)' ),
array( 'fas fa-volume-off' => 'Volume Off (audio,ban,music,mute,quiet,silent,sound)' ),
array( 'fas fa-volume-up' => 'Volume Up (audio,higher,louder,music,sound,speaker)' ),
),
'Objects' => array(
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-anchor' => 'Anchor (berth,boat,dock,embed,link,maritime,moor,secure)' ),
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-award' => 'Award (honor,praise,prize,recognition,ribbon,trophy)' ),
array( 'fas fa-baby-carriage' => 'Baby Carriage (buggy,carrier,infant,push,stroller,transportation,walk,wheels)' ),
array( 'fas fa-balance-scale' => 'Balance Scale (balanced,justice,legal,measure,weight)' ),
array( 'fas fa-balance-scale-left' => 'Balance Scale (Left-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-balance-scale-right' => 'Balance Scale (Right-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-bath' => 'Bath (clean,shower,tub,wash)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-beer' => 'beer (alcohol,ale,bar,beverage,brewery,drink,lager,liquor,mug,stein)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bicycle' => 'Bicycle (bike,gears,pedal,transportation,vehicle)' ),
array( 'fas fa-binoculars' => 'Binoculars (glasses,magnify,scenic,spyglass,view)' ),
array( 'fas fa-birthday-cake' => 'Birthday Cake (anniversary,bakery,candles,celebration,dessert,frosting,holiday,party,pastry)' ),
array( 'fas fa-blender' => 'Blender (cocktail,milkshake,mixer,puree,smoothie)' ),
array( 'fas fa-bomb' => 'Bomb (error,explode,fuse,grenade,warning)' ),
array( 'fas fa-book' => 'book (diary,documentation,journal,library,read)' ),
array( 'fas fa-book-dead' => 'Book of the Dead (Dungeons & Dragons,crossbones,d&d,dark arts,death,dnd,documentation,evil,fantasy,halloween,holiday,necronomicon,read,skull,spell)' ),
array( 'fas fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'far fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'fas fa-briefcase' => 'Briefcase (bag,business,luggage,office,work)' ),
array( 'fas fa-broadcast-tower' => 'Broadcast Tower (airwaves,antenna,radio,reception,waves)' ),
array( 'fas fa-bug' => 'Bug (beetle,error,insect,report)' ),
array( 'fas fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'far fa-building' => 'Building (apartment,business,city,company,office,work)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-bullseye' => 'Bullseye (archery,goal,objective,target)' ),
array( 'fas fa-bus' => 'Bus (public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-calculator' => 'Calculator (abacus,addition,arithmetic,counting,math,multiplication,subtraction)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'far fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'fas fa-camera' => 'camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-camera-retro' => 'Retro Camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-candy-cane' => 'Candy Cane (candy,christmas,holiday,mint,peppermint,striped,xmas)' ),
array( 'fas fa-car' => 'Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-carrot' => 'Carrot (bugs bunny,orange,vegan,vegetable)' ),
array( 'fas fa-church' => 'Church (building,cathedral,chapel,community,religion)' ),
array( 'fas fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'far fa-clipboard' => 'Clipboard (copy,notes,paste,record)' ),
array( 'fas fa-cloud' => 'Cloud (atmosphere,fog,overcast,save,upload,weather)' ),
array( 'fas fa-coffee' => 'Coffee (beverage,breakfast,cafe,drink,fall,morning,mug,seasonal,tea)' ),
array( 'fas fa-cog' => 'cog (gear,mechanical,settings,sprocket,wheel)' ),
array( 'fas fa-cogs' => 'cogs (gears,mechanical,settings,sprocket,wheel)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-cookie' => 'Cookie (baked good,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-cookie-bite' => 'Cookie Bite (baked good,bitten,chips,chocolate,eat,snack,sweet,treat)' ),
array( 'fas fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'far fa-copy' => 'Copy (clone,duplicate,file,files-o,paper,paste)' ),
array( 'fas fa-cube' => 'Cube (3d,block,dice,package,square,tesseract)' ),
array( 'fas fa-cubes' => 'Cubes (3d,block,dice,package,pyramid,square,stack,tesseract)' ),
array( 'fas fa-cut' => 'Cut (clip,scissors,snip)' ),
array( 'fas fa-dice' => 'Dice (chance,gambling,game,roll)' ),
array( 'fas fa-dice-d20' => 'Dice D20 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dice-d6' => 'Dice D6 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dice-five' => 'Dice Five (chance,gambling,game,roll)' ),
array( 'fas fa-dice-four' => 'Dice Four (chance,gambling,game,roll)' ),
array( 'fas fa-dice-one' => 'Dice One (chance,gambling,game,roll)' ),
array( 'fas fa-dice-six' => 'Dice Six (chance,gambling,game,roll)' ),
array( 'fas fa-dice-three' => 'Dice Three (chance,gambling,game,roll)' ),
array( 'fas fa-dice-two' => 'Dice Two (chance,gambling,game,roll)' ),
array( 'fas fa-digital-tachograph' => 'Digital Tachograph (data,distance,speed,tachometer)' ),
array( 'fas fa-door-closed' => 'Door Closed (enter,exit,locked)' ),
array( 'fas fa-door-open' => 'Door Open (enter,exit,welcome)' ),
array( 'fas fa-drum' => 'Drum (instrument,music,percussion,snare,sound)' ),
array( 'fas fa-drum-steelpan' => 'Drum Steelpan (calypso,instrument,music,percussion,reggae,snare,sound,steel,tropical)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-dropper' => 'Eye Dropper (beaker,clone,color,copy,eyedropper,pipette)' ),
array( 'fas fa-fax' => 'Fax (business,communicate,copy,facsimile,send)' ),
array( 'fas fa-feather' => 'Feather (bird,light,plucked,quill,write)' ),
array( 'fas fa-feather-alt' => 'Alternate Feather (bird,light,plucked,quill,write)' ),
array( 'fas fa-fighter-jet' => 'fighter-jet (airplane,fast,fly,goose,maverick,plane,quick,top gun,transportation,travel)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-file-prescription' => 'File Prescription (document,drugs,medical,medicine,rx)' ),
array( 'fas fa-film' => 'Film (cinema,movie,strip,video)' ),
array( 'fas fa-fire' => 'fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-extinguisher' => 'fire-extinguisher (burn,caliente,fire fighter,flame,heat,hot,rescue)' ),
array( 'fas fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'far fa-flag' => 'flag (country,notice,notification,notify,pole,report,symbol)' ),
array( 'fas fa-flag-checkered' => 'flag-checkered (notice,notification,notify,pole,racing,report,symbol)' ),
array( 'fas fa-flask' => 'Flask (beaker,experimental,labs,science)' ),
array( 'fas fa-futbol' => 'Futbol (ball,football,mls,soccer)' ),
array( 'far fa-futbol' => 'Futbol (ball,football,mls,soccer)' ),
array( 'fas fa-gamepad' => 'Gamepad (arcade,controller,d-pad,joystick,video,video game)' ),
array( 'fas fa-gavel' => 'Gavel (hammer,judge,law,lawyer,opinion)' ),
array( 'fas fa-gem' => 'Gem (diamond,jewelry,sapphire,stone,treasure)' ),
array( 'far fa-gem' => 'Gem (diamond,jewelry,sapphire,stone,treasure)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-gifts' => 'Gifts (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-glass-cheers' => 'Glass Cheers (alcohol,bar,beverage,celebration,champagne,clink,drink,holiday,new year\'s eve,party,toast)' ),
array( 'fas fa-glass-martini' => 'Martini Glass (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-glass-whiskey' => 'Glass Whiskey (alcohol,bar,beverage,bourbon,drink,liquor,neat,rye,scotch,whisky)' ),
array( 'fas fa-glasses' => 'Glasses (hipster,nerd,reading,sight,spectacles,vision)' ),
array( 'fas fa-globe' => 'Globe (all,coordinates,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-graduation-cap' => 'Graduation Cap (ceremony,college,graduate,learning,school,student)' ),
array( 'fas fa-guitar' => 'Guitar (acoustic,instrument,music,rock,rock and roll,song,strings)' ),
array( 'fas fa-hat-wizard' => 'Wizard\'s Hat (Dungeons & Dragons,accessory,buckle,clothing,d&d,dnd,fantasy,halloween,head,holiday,mage,magic,pointy,witch)' ),
array( 'fas fa-hdd' => 'HDD (cpu,hard drive,harddrive,machine,save,storage)' ),
array( 'far fa-hdd' => 'HDD (cpu,hard drive,harddrive,machine,save,storage)' ),
array( 'fas fa-headphones' => 'headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-headphones-alt' => 'Alternate Headphones (audio,listen,music,sound,speaker)' ),
array( 'fas fa-headset' => 'Headset (audio,gamer,gaming,listen,live chat,microphone,shot caller,sound,support,telemarketer)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heart-broken' => 'Heart Broken (breakup,crushed,dislike,dumped,grief,love,lovesick,relationship,sad)' ),
array( 'fas fa-helicopter' => 'Helicopter (airwolf,apache,chopper,flight,fly,travel)' ),
array( 'fas fa-highlighter' => 'Highlighter (edit,marker,sharpie,update,write)' ),
array( 'fas fa-holly-berry' => 'Holly Berry (catwoman,christmas,decoration,flora,halle,holiday,ororo munroe,plant,storm,xmas)' ),
array( 'fas fa-home' => 'home (abode,building,house,main)' ),
array( 'fas fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'far fa-hospital' => 'hospital (building,emergency room,medical center)' ),
array( 'fas fa-hourglass' => 'Hourglass (hour,minute,sand,stopwatch,time)' ),
array( 'far fa-hourglass' => 'Hourglass (hour,minute,sand,stopwatch,time)' ),
array( 'fas fa-igloo' => 'Igloo (dome,dwelling,eskimo,home,house,ice,snow)' ),
array( 'fas fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'far fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'fas fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'far fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'fas fa-industry' => 'Industry (building,factory,industrial,manufacturing,mill,warehouse)' ),
array( 'fas fa-key' => 'key (lock,password,private,secret,unlock)' ),
array( 'fas fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'far fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'fas fa-laptop' => 'Laptop (computer,cpu,dell,demo,device,mac,macbook,machine,pc)' ),
array( 'fas fa-leaf' => 'leaf (eco,flora,nature,plant,vegan)' ),
array( 'fas fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'far fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'fas fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'far fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'fas fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'far fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'fas fa-lock' => 'lock (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-lock-open' => 'Lock Open (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-magic' => 'magic (autocomplete,automatic,mage,magic,spell,wand,witch,wizard)' ),
array( 'fas fa-magnet' => 'magnet (Attract,lodestone,tool)' ),
array( 'fas fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'far fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker' => 'map-marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker-alt' => 'Alternate Map Marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-pin' => 'Map Pin (address,agree,coordinates,destination,gps,localize,location,map,marker,navigation,pin,place,position,travel)' ),
array( 'fas fa-map-signs' => 'Map Signs (directions,directory,map,signage,wayfinding)' ),
array( 'fas fa-marker' => 'Marker (design,edit,sharpie,update,write)' ),
array( 'fas fa-medal' => 'Medal (award,ribbon,star,trophy)' ),
array( 'fas fa-medkit' => 'medkit (first aid,firstaid,health,help,support)' ),
array( 'fas fa-memory' => 'Memory (DIMM,RAM,hardware,storage,technology)' ),
array( 'fas fa-microchip' => 'Microchip (cpu,hardware,processor,technology)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-mitten' => 'Mitten (clothing,cold,glove,hands,knitted,seasonal,warmth)' ),
array( 'fas fa-mobile' => 'Mobile Phone (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-mobile-alt' => 'Alternate Mobile (apple,call,cell phone,cellphone,device,iphone,number,screen,telephone)' ),
array( 'fas fa-money-bill' => 'Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'far fa-money-bill-alt' => 'Alternate Money Bill (buy,cash,checkout,money,payment,price,purchase)' ),
array( 'fas fa-money-check' => 'Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-money-check-alt' => 'Alternate Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'far fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'fas fa-motorcycle' => 'Motorcycle (bike,machine,transportation,vehicle)' ),
array( 'fas fa-mug-hot' => 'Mug Hot (caliente,cocoa,coffee,cup,drink,holiday,hot chocolate,steam,tea,warmth)' ),
array( 'fas fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'far fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'fas fa-paint-brush' => 'Paint Brush (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'far fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'fas fa-paperclip' => 'Paperclip (attach,attachment,connect,link)' ),
array( 'fas fa-paste' => 'Paste (clipboard,copy,document,paper)' ),
array( 'fas fa-paw' => 'Paw (animal,cat,dog,pet,print)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-fancy' => 'Pen Fancy (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pen-nib' => 'Pen Nib (design,edit,fountain pen,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-plane' => 'plane (airplane,destination,fly,location,mode,travel,trip)' ),
array( 'fas fa-plug' => 'Plug (connect,electric,online,power)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-puzzle-piece' => 'Puzzle Piece (add-on,addon,game,section)' ),
array( 'fas fa-ring' => 'Ring (Dungeons & Dragons,Gollum,band,binding,d&d,dnd,engagement,fantasy,gold,jewelry,marriage,precious)' ),
array( 'fas fa-road' => 'road (highway,map,pavement,route,street,travel)' ),
array( 'fas fa-rocket' => 'rocket (aircraft,app,jet,launch,nasa,space)' ),
array( 'fas fa-ruler-combined' => 'Ruler Combined (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-horizontal' => 'Ruler Horizontal (design,draft,length,measure,planning)' ),
array( 'fas fa-ruler-vertical' => 'Ruler Vertical (design,draft,length,measure,planning)' ),
array( 'fas fa-satellite' => 'Satellite (communications,hardware,orbit,space)' ),
array( 'fas fa-satellite-dish' => 'Satellite Dish (SETI,communications,hardware,receiver,saucer,signal)' ),
array( 'fas fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'far fa-save' => 'Save (disk,download,floppy,floppy-o)' ),
array( 'fas fa-school' => 'School (building,education,learn,student,teacher)' ),
array( 'fas fa-screwdriver' => 'Screwdriver (admin,fix,mechanic,repair,settings,tool)' ),
array( 'fas fa-scroll' => 'Scroll (Dungeons & Dragons,announcement,d&d,dnd,fantasy,paper,script)' ),
array( 'fas fa-sd-card' => 'Sd Card (image,memory,photo,save)' ),
array( 'fas fa-search' => 'Search (bigger,enlarge,find,magnify,preview,zoom)' ),
array( 'fas fa-shield-alt' => 'Alternate Shield (achievement,award,block,defend,security,winner)' ),
array( 'fas fa-shopping-bag' => 'Shopping Bag (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-basket' => 'Shopping Basket (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shower' => 'Shower (bath,clean,faucet,water)' ),
array( 'fas fa-sim-card' => 'SIM Card (hard drive,hardware,portable,storage,technology,tiny)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fas fa-sleigh' => 'Sleigh (christmas,claus,fly,holiday,santa,sled,snow,xmas)' ),
array( 'fas fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'far fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'fas fa-snowplow' => 'Snowplow (clean up,cold,road,storm,winter)' ),
array( 'fas fa-space-shuttle' => 'Space Shuttle (astronaut,machine,nasa,rocket,transportation)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fas fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'far fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'fas fa-stopwatch' => 'Stopwatch (clock,reminder,time)' ),
array( 'fas fa-stroopwafel' => 'Stroopwafel (caramel,cookie,dessert,sweets,waffle)' ),
array( 'fas fa-subway' => 'Subway (machine,railway,train,transportation,vehicle)' ),
array( 'fas fa-suitcase' => 'Suitcase (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'far fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'fas fa-tablet' => 'tablet (apple,device,ipad,kindle,screen)' ),
array( 'fas fa-tablet-alt' => 'Alternate Tablet (apple,device,ipad,kindle,screen)' ),
array( 'fas fa-tachometer-alt' => 'Alternate Tachometer (dashboard,fast,odometer,speed,speedometer)' ),
array( 'fas fa-tag' => 'tag (discount,label,price,shopping)' ),
array( 'fas fa-tags' => 'tags (discount,label,price,shopping)' ),
array( 'fas fa-taxi' => 'Taxi (cab,cabbie,car,car service,lyft,machine,transportation,travel,uber,vehicle)' ),
array( 'fas fa-thumbtack' => 'Thumbtack (coordinates,location,marker,pin,thumb-tack)' ),
array( 'fas fa-ticket-alt' => 'Alternate Ticket (movie,pass,support,ticket)' ),
array( 'fas fa-toilet' => 'Toilet (bathroom,flush,john,loo,pee,plumbing,poop,porcelain,potty,restroom,throne,washroom,waste,wc)' ),
array( 'fas fa-toolbox' => 'Toolbox (admin,container,fix,repair,settings,tools)' ),
array( 'fas fa-tools' => 'Tools (admin,fix,repair,screwdriver,settings,tools,wrench)' ),
array( 'fas fa-train' => 'Train (bullet,commute,locomotive,railway,subway)' ),
array( 'fas fa-tram' => 'Tram (crossing,machine,mountains,seasonal,transportation)' ),
array( 'fas fa-trash' => 'Trash (delete,garbage,hide,remove)' ),
array( 'fas fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'far fa-trash-alt' => 'Alternate Trash (delete,garbage,hide,remove,trash-o)' ),
array( 'fas fa-tree' => 'Tree (bark,fall,flora,forest,nature,plant,seasonal)' ),
array( 'fas fa-trophy' => 'trophy (achievement,award,cup,game,winner)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
array( 'fas fa-umbrella' => 'Umbrella (protection,rain,storm,wet)' ),
array( 'fas fa-university' => 'University (bank,building,college,higher education - students,institution)' ),
array( 'fas fa-unlock' => 'unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-unlock-alt' => 'Alternate Unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-utensil-spoon' => 'Utensil Spoon (cutlery,dining,scoop,silverware,spoon)' ),
array( 'fas fa-utensils' => 'Utensils (cutlery,dining,dinner,eat,food,fork,knife,restaurant)' ),
array( 'fas fa-wallet' => 'Wallet (billfold,cash,currency,money)' ),
array( 'fas fa-weight' => 'Weight (health,measurement,scale,weight)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
array( 'fas fa-wine-glass' => 'Wine Glass (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
array( 'fas fa-wrench' => 'Wrench (construction,fix,mechanic,plumbing,settings,spanner,tool,update)' ),
),
'Payments & Shopping' => array(
array( 'fab fa-alipay' => 'Alipay' ),
array( 'fab fa-amazon-pay' => 'Amazon Pay' ),
array( 'fab fa-apple-pay' => 'Apple Pay' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fab fa-bitcoin' => 'Bitcoin' ),
array( 'fas fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'far fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'fab fa-btc' => 'BTC' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-camera' => 'camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-camera-retro' => 'Retro Camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-cart-arrow-down' => 'Shopping Cart Arrow Down (download,save,shopping)' ),
array( 'fas fa-cart-plus' => 'Add to Shopping Cart (add,create,new,positive,shopping)' ),
array( 'fab fa-cc-amazon-pay' => 'Amazon Pay Credit Card' ),
array( 'fab fa-cc-amex' => 'American Express Credit Card (amex)' ),
array( 'fab fa-cc-apple-pay' => 'Apple Pay Credit Card' ),
array( 'fab fa-cc-diners-club' => 'Diner\'s Club Credit Card' ),
array( 'fab fa-cc-discover' => 'Discover Credit Card' ),
array( 'fab fa-cc-jcb' => 'JCB Credit Card' ),
array( 'fab fa-cc-mastercard' => 'MasterCard Credit Card' ),
array( 'fab fa-cc-paypal' => 'Paypal Credit Card' ),
array( 'fab fa-cc-stripe' => 'Stripe Credit Card' ),
array( 'fab fa-cc-visa' => 'Visa Credit Card' ),
array( 'fas fa-certificate' => 'certificate (badge,star,verified)' ),
array( 'fas fa-credit-card' => 'Credit Card (buy,checkout,credit-card-alt,debit,money,payment,purchase)' ),
array( 'far fa-credit-card' => 'Credit Card (buy,checkout,credit-card-alt,debit,money,payment,purchase)' ),
array( 'fab fa-ethereum' => 'Ethereum' ),
array( 'fas fa-gem' => 'Gem (diamond,jewelry,sapphire,stone,treasure)' ),
array( 'far fa-gem' => 'Gem (diamond,jewelry,sapphire,stone,treasure)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fab fa-google-wallet' => 'Google Wallet' ),
array( 'fas fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'far fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-key' => 'key (lock,password,private,secret,unlock)' ),
array( 'fas fa-money-check' => 'Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fas fa-money-check-alt' => 'Alternate Money Check (bank check,buy,checkout,cheque,money,payment,price,purchase)' ),
array( 'fab fa-paypal' => 'Paypal' ),
array( 'fas fa-receipt' => 'Receipt (check,invoice,money,pay,table)' ),
array( 'fas fa-shopping-bag' => 'Shopping Bag (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-basket' => 'Shopping Basket (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fab fa-stripe' => 'Stripe' ),
array( 'fab fa-stripe-s' => 'Stripe S' ),
array( 'fas fa-tag' => 'tag (discount,label,price,shopping)' ),
array( 'fas fa-tags' => 'tags (discount,label,price,shopping)' ),
array( 'fas fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'far fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'fas fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'far fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'fas fa-trophy' => 'trophy (achievement,award,cup,game,winner)' ),
),
'Pharmacy' => array(
array( 'fas fa-band-aid' => 'Band-Aid (bandage,boo boo,first aid,ouch)' ),
array( 'fas fa-book-medical' => 'Medical Book (diary,documentation,health,history,journal,library,read,record)' ),
array( 'fas fa-cannabis' => 'Cannabis (bud,chronic,drugs,endica,endo,ganja,marijuana,mary jane,pot,reefer,sativa,spliff,weed,whacky-tabacky)' ),
array( 'fas fa-capsules' => 'Capsules (drugs,medicine,pills,prescription)' ),
array( 'fas fa-clinic-medical' => 'Medical Clinic (doctor,general practitioner,hospital,infirmary,medicine,office,outpatient)' ),
array( 'fas fa-eye-dropper' => 'Eye Dropper (beaker,clone,color,copy,eyedropper,pipette)' ),
array( 'fas fa-file-medical' => 'Medical File (document,health,history,prescription,record)' ),
array( 'fas fa-file-prescription' => 'File Prescription (document,drugs,medical,medicine,rx)' ),
array( 'fas fa-first-aid' => 'First Aid (emergency,emt,health,medical,rescue)' ),
array( 'fas fa-flask' => 'Flask (beaker,experimental,labs,science)' ),
array( 'fas fa-history' => 'History (Rewind,clock,reverse,time,time machine)' ),
array( 'fas fa-joint' => 'Joint (blunt,cannabis,doobie,drugs,marijuana,roach,smoke,smoking,spliff)' ),
array( 'fas fa-laptop-medical' => 'Laptop Medical (computer,device,ehr,electronic health records,history)' ),
array( 'fas fa-mortar-pestle' => 'Mortar Pestle (crush,culinary,grind,medical,mix,pharmacy,prescription,spices)' ),
array( 'fas fa-notes-medical' => 'Medical Notes (clipboard,doctor,ehr,health,history,records)' ),
array( 'fas fa-pills' => 'Pills (drugs,medicine,prescription,tablets)' ),
array( 'fas fa-prescription' => 'Prescription (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-prescription-bottle' => 'Prescription Bottle (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-prescription-bottle-alt' => 'Alternate Prescription Bottle (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-receipt' => 'Receipt (check,invoice,money,pay,table)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fas fa-syringe' => 'Syringe (doctor,immunizations,medical,needle)' ),
array( 'fas fa-tablets' => 'Tablets (drugs,medicine,pills,prescription)' ),
array( 'fas fa-thermometer' => 'Thermometer (mercury,status,temperature)' ),
array( 'fas fa-vial' => 'Vial (experiment,lab,sample,science,test,test tube)' ),
array( 'fas fa-vials' => 'Vials (experiment,lab,sample,science,test,test tube)' ),
),
'Political' => array(
array( 'fas fa-award' => 'Award (honor,praise,prize,recognition,ribbon,trophy)' ),
array( 'fas fa-balance-scale' => 'Balance Scale (balanced,justice,legal,measure,weight)' ),
array( 'fas fa-balance-scale-left' => 'Balance Scale (Left-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-balance-scale-right' => 'Balance Scale (Right-Weighted) (justice,legal,measure,unbalanced,weight)' ),
array( 'fas fa-bullhorn' => 'bullhorn (announcement,broadcast,louder,megaphone,share)' ),
array( 'fas fa-check-double' => 'Double Check (accept,agree,checkmark,confirm,correct,done,notice,notification,notify,ok,select,success,tick,todo)' ),
array( 'fas fa-democrat' => 'Democrat (american,democratic party,donkey,election,left,left-wing,liberal,politics,usa)' ),
array( 'fas fa-donate' => 'Donate (contribute,generosity,gift,give)' ),
array( 'fas fa-dove' => 'Dove (bird,fauna,flying,peace,war)' ),
array( 'fas fa-fist-raised' => 'Raised Fist (Dungeons & Dragons,d&d,dnd,fantasy,hand,ki,monk,resist,strength,unarmed combat)' ),
array( 'fas fa-flag-usa' => 'United States of America Flag (betsy ross,country,old glory,stars,stripes,symbol)' ),
array( 'fas fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'far fa-handshake' => 'Handshake (agreement,greeting,meeting,partnership)' ),
array( 'fas fa-person-booth' => 'Person Entering Booth (changing,changing room,election,human,person,vote,voting)' ),
array( 'fas fa-piggy-bank' => 'Piggy Bank (bank,save,savings)' ),
array( 'fas fa-republican' => 'Republican (american,conservative,election,elephant,politics,republican party,right,right-wing,usa)' ),
array( 'fas fa-vote-yea' => 'Vote Yea (accept,cast,election,politics,positive,yes)' ),
),
'Religion' => array(
array( 'fas fa-ankh' => 'Ankh (amulet,copper,coptic christianity,copts,crux ansata,egypt,venus)' ),
array( 'fas fa-atom' => 'Atom (atheism,chemistry,ion,nuclear,science)' ),
array( 'fas fa-bible' => 'Bible (book,catholicism,christianity,god,holy)' ),
array( 'fas fa-church' => 'Church (building,cathedral,chapel,community,religion)' ),
array( 'fas fa-cross' => 'Cross (catholicism,christianity,church,jesus)' ),
array( 'fas fa-dharmachakra' => 'Dharmachakra (buddhism,buddhist,wheel of dharma)' ),
array( 'fas fa-dove' => 'Dove (bird,fauna,flying,peace,war)' ),
array( 'fas fa-gopuram' => 'Gopuram (building,entrance,hinduism,temple,tower)' ),
array( 'fas fa-hamsa' => 'Hamsa (amulet,christianity,islam,jewish,judaism,muslim,protection)' ),
array( 'fas fa-hanukiah' => 'Hanukiah (candle,hanukkah,jewish,judaism,light)' ),
array( 'fas fa-haykal' => 'Haykal (bahai,bahá\'í,star)' ),
array( 'fas fa-jedi' => 'Jedi (crest,force,sith,skywalker,star wars,yoda)' ),
array( 'fas fa-journal-whills' => 'Journal of the Whills (book,force,jedi,sith,star wars,yoda)' ),
array( 'fas fa-kaaba' => 'Kaaba (building,cube,islam,muslim)' ),
array( 'fas fa-khanda' => 'Khanda (chakkar,sikh,sikhism,sword)' ),
array( 'fas fa-menorah' => 'Menorah (candle,hanukkah,jewish,judaism,light)' ),
array( 'fas fa-mosque' => 'Mosque (building,islam,landmark,muslim)' ),
array( 'fas fa-om' => 'Om (buddhism,hinduism,jainism,mantra)' ),
array( 'fas fa-pastafarianism' => 'Pastafarianism (agnosticism,atheism,flying spaghetti monster,fsm)' ),
array( 'fas fa-peace' => 'Peace (serenity,tranquility,truce,war)' ),
array( 'fas fa-place-of-worship' => 'Place of Worship (building,church,holy,mosque,synagogue)' ),
array( 'fas fa-pray' => 'Pray (kneel,preach,religion,worship)' ),
array( 'fas fa-praying-hands' => 'Praying Hands (kneel,preach,religion,worship)' ),
array( 'fas fa-quran' => 'Quran (book,islam,muslim,religion)' ),
array( 'fas fa-star-and-crescent' => 'Star and Crescent (islam,muslim,religion)' ),
array( 'fas fa-star-of-david' => 'Star of David (jewish,judaism,religion)' ),
array( 'fas fa-synagogue' => 'Synagogue (building,jewish,judaism,religion,star of david,temple)' ),
array( 'fas fa-torah' => 'Torah (book,jewish,judaism,religion,scroll)' ),
array( 'fas fa-torii-gate' => 'Torii Gate (building,shintoism)' ),
array( 'fas fa-vihara' => 'Vihara (buddhism,buddhist,building,monastery)' ),
array( 'fas fa-yin-yang' => 'Yin Yang (daoism,opposites,taoism)' ),
),
'Science' => array(
array( 'fas fa-atom' => 'Atom (atheism,chemistry,ion,nuclear,science)' ),
array( 'fas fa-biohazard' => 'Biohazard (danger,dangerous,hazmat,medical,radioactive,toxic,waste,zombie)' ),
array( 'fas fa-brain' => 'Brain (cerebellum,gray matter,intellect,medulla oblongata,mind,noodle,wit)' ),
array( 'fas fa-burn' => 'Burn (caliente,energy,fire,flame,gas,heat,hot)' ),
array( 'fas fa-capsules' => 'Capsules (drugs,medicine,pills,prescription)' ),
array( 'fas fa-clipboard-check' => 'Clipboard with Check (accept,agree,confirm,done,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-dna' => 'DNA (double helix,genetic,helix,molecule,protein)' ),
array( 'fas fa-eye-dropper' => 'Eye Dropper (beaker,clone,color,copy,eyedropper,pipette)' ),
array( 'fas fa-filter' => 'Filter (funnel,options,separate,sort)' ),
array( 'fas fa-fire' => 'fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-fire-alt' => 'Alternate Fire (burn,caliente,flame,heat,hot,popular)' ),
array( 'fas fa-flask' => 'Flask (beaker,experimental,labs,science)' ),
array( 'fas fa-frog' => 'Frog (amphibian,bullfrog,fauna,hop,kermit,kiss,prince,ribbit,toad,wart)' ),
array( 'fas fa-magnet' => 'magnet (Attract,lodestone,tool)' ),
array( 'fas fa-microscope' => 'Microscope (electron,lens,optics,science,shrink)' ),
array( 'fas fa-mortar-pestle' => 'Mortar Pestle (crush,culinary,grind,medical,mix,pharmacy,prescription,spices)' ),
array( 'fas fa-pills' => 'Pills (drugs,medicine,prescription,tablets)' ),
array( 'fas fa-prescription-bottle' => 'Prescription Bottle (drugs,medical,medicine,pharmacy,rx)' ),
array( 'fas fa-radiation' => 'Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-radiation-alt' => 'Alternate Radiation (danger,dangerous,deadly,hazard,nuclear,radioactive,warning)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fas fa-syringe' => 'Syringe (doctor,immunizations,medical,needle)' ),
array( 'fas fa-tablets' => 'Tablets (drugs,medicine,pills,prescription)' ),
array( 'fas fa-temperature-high' => 'High Temperature (cook,mercury,summer,thermometer,warm)' ),
array( 'fas fa-temperature-low' => 'Low Temperature (cold,cool,mercury,thermometer,winter)' ),
array( 'fas fa-vial' => 'Vial (experiment,lab,sample,science,test,test tube)' ),
array( 'fas fa-vials' => 'Vials (experiment,lab,sample,science,test,test tube)' ),
),
'Science Fiction' => array(
array( 'fab fa-galactic-republic' => 'Galactic Republic (politics,star wars)' ),
array( 'fab fa-galactic-senate' => 'Galactic Senate (star wars)' ),
array( 'fas fa-globe' => 'Globe (all,coordinates,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-jedi' => 'Jedi (crest,force,sith,skywalker,star wars,yoda)' ),
array( 'fab fa-jedi-order' => 'Jedi Order (star wars)' ),
array( 'fas fa-journal-whills' => 'Journal of the Whills (book,force,jedi,sith,star wars,yoda)' ),
array( 'fas fa-meteor' => 'Meteor (armageddon,asteroid,comet,shooting star,space)' ),
array( 'fas fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'far fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'fab fa-old-republic' => 'Old Republic (politics,star wars)' ),
array( 'fas fa-robot' => 'Robot (android,automate,computer,cyborg)' ),
array( 'fas fa-rocket' => 'rocket (aircraft,app,jet,launch,nasa,space)' ),
array( 'fas fa-satellite' => 'Satellite (communications,hardware,orbit,space)' ),
array( 'fas fa-satellite-dish' => 'Satellite Dish (SETI,communications,hardware,receiver,saucer,signal)' ),
array( 'fas fa-space-shuttle' => 'Space Shuttle (astronaut,machine,nasa,rocket,transportation)' ),
array( 'fas fa-user-astronaut' => 'User Astronaut (avatar,clothing,cosmonaut,nasa,space,suit)' ),
),
'Security' => array(
array( 'fas fa-ban' => 'ban (abort,ban,block,cancel,delete,hide,prohibit,remove,stop,trash)' ),
array( 'fas fa-bug' => 'Bug (beetle,error,insect,report)' ),
array( 'fas fa-door-closed' => 'Door Closed (enter,exit,locked)' ),
array( 'fas fa-door-open' => 'Door Open (enter,exit,welcome)' ),
array( 'fas fa-dungeon' => 'Dungeon (Dungeons & Dragons,building,d&d,dnd,door,entrance,fantasy,gate)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-file-contract' => 'File Contract (agreement,binding,document,legal,signature)' ),
array( 'fas fa-file-signature' => 'File Signature (John Hancock,contract,document,name)' ),
array( 'fas fa-fingerprint' => 'Fingerprint (human,id,identification,lock,smudge,touch,unique,unlock)' ),
array( 'fas fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'far fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'fas fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'far fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-id-card-alt' => 'Alternate Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-key' => 'key (lock,password,private,secret,unlock)' ),
array( 'fas fa-lock' => 'lock (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-lock-open' => 'Lock Open (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-mask' => 'Mask (carnivale,costume,disguise,halloween,secret,super hero)' ),
array( 'fas fa-passport' => 'Passport (document,id,identification,issued,travel)' ),
array( 'fas fa-shield-alt' => 'Alternate Shield (achievement,award,block,defend,security,winner)' ),
array( 'fas fa-unlock' => 'unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-unlock-alt' => 'Alternate Unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-user-lock' => 'User Lock (admin,lock,person,private,unlock)' ),
array( 'fas fa-user-secret' => 'User Secret (clothing,coat,hat,incognito,person,privacy,spy,whisper)' ),
array( 'fas fa-user-shield' => 'User Shield (admin,person,private,protect,safe)' ),
),
'Shapes' => array(
array( 'fas fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'far fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-certificate' => 'certificate (badge,star,verified)' ),
array( 'fas fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'far fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'fas fa-cloud' => 'Cloud (atmosphere,fog,overcast,save,upload,weather)' ),
array( 'fas fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-heart-broken' => 'Heart Broken (breakup,crushed,dislike,dumped,grief,love,lovesick,relationship,sad)' ),
array( 'fas fa-map-marker' => 'map-marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-play' => 'play (audio,music,playing,sound,start,video)' ),
array( 'fas fa-shapes' => 'Shapes (blocks,build,circle,square,triangle)' ),
array( 'fas fa-square' => 'Square (block,box,shape)' ),
array( 'far fa-square' => 'Square (block,box,shape)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
),
'Shopping' => array(
array( 'fas fa-barcode' => 'barcode (info,laser,price,scan,upc)' ),
array( 'fas fa-cart-arrow-down' => 'Shopping Cart Arrow Down (download,save,shopping)' ),
array( 'fas fa-cart-plus' => 'Add to Shopping Cart (add,create,new,positive,shopping)' ),
array( 'fas fa-cash-register' => 'Cash Register (buy,cha-ching,change,checkout,commerce,leaerboard,machine,pay,payment,purchase,store)' ),
array( 'fas fa-gift' => 'gift (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-gifts' => 'Gifts (christmas,generosity,giving,holiday,party,present,wrapped,xmas)' ),
array( 'fas fa-person-booth' => 'Person Entering Booth (changing,changing room,election,human,person,vote,voting)' ),
array( 'fas fa-receipt' => 'Receipt (check,invoice,money,pay,table)' ),
array( 'fas fa-shipping-fast' => 'Shipping Fast (express,fedex,mail,overnight,package,ups)' ),
array( 'fas fa-shopping-bag' => 'Shopping Bag (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-basket' => 'Shopping Basket (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-store' => 'Store (building,buy,purchase,shopping)' ),
array( 'fas fa-store-alt' => 'Alternate Store (building,buy,purchase,shopping)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-tshirt' => 'T-Shirt (clothing,fashion,garment,shirt)' ),
),
'Social' => array(
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-birthday-cake' => 'Birthday Cake (anniversary,bakery,candles,celebration,dessert,frosting,holiday,party,pastry)' ),
array( 'fas fa-camera' => 'camera (image,lens,photo,picture,record,shutter,video)' ),
array( 'fas fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-hashtag' => 'Hashtag (Twitter,instagram,pound,social media,tag)' ),
array( 'fas fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'far fa-heart' => 'Heart (favorite,like,love,relationship,valentine)' ),
array( 'fas fa-icons' => 'Icons (bolt,emoji,heart,image,music,photo,symbols)' ),
array( 'fas fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'far fa-image' => 'Image (album,landscape,photo,picture)' ),
array( 'fas fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'far fa-images' => 'Images (album,landscape,photo,picture)' ),
array( 'fas fa-map-marker' => 'map-marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker-alt' => 'Alternate Map Marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-photo-video' => 'Photo Video (av,film,image,library,media)' ),
array( 'fas fa-poll' => 'Poll (results,survey,trend,vote,voting)' ),
array( 'fas fa-poll-h' => 'Poll H (results,survey,trend,vote,voting)' ),
array( 'fas fa-retweet' => 'Retweet (refresh,reload,share,swap)' ),
array( 'fas fa-share' => 'Share (forward,save,send,social)' ),
array( 'fas fa-share-alt' => 'Alternate Share (forward,save,send,social)' ),
array( 'fas fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'far fa-share-square' => 'Share Square (forward,save,send,social)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fas fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'far fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'fas fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'far fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'fas fa-thumbtack' => 'Thumbtack (coordinates,location,marker,pin,thumb-tack)' ),
array( 'fas fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-friends' => 'User Friends (group,people,person,team,users)' ),
array( 'fas fa-user-plus' => 'User Plus (add,avatar,positive,sign up,signup,team)' ),
array( 'fas fa-users' => 'Users (friends,group,people,persons,profiles,team)' ),
array( 'fas fa-video' => 'Video (camera,film,movie,record,video-camera)' ),
),
'Spinners' => array(
array( 'fas fa-asterisk' => 'asterisk (annotation,details,reference,star)' ),
array( 'fas fa-atom' => 'Atom (atheism,chemistry,ion,nuclear,science)' ),
array( 'fas fa-certificate' => 'certificate (badge,star,verified)' ),
array( 'fas fa-circle-notch' => 'Circle Notched (circle-o-notch,diameter,dot,ellipse,round,spinner)' ),
array( 'fas fa-cog' => 'cog (gear,mechanical,settings,sprocket,wheel)' ),
array( 'fas fa-compact-disc' => 'Compact Disc (album,bluray,cd,disc,dvd,media,movie,music,record,video,vinyl)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-crosshairs' => 'Crosshairs (aim,bullseye,gpd,picker,position)' ),
array( 'fas fa-dharmachakra' => 'Dharmachakra (buddhism,buddhist,wheel of dharma)' ),
array( 'fas fa-fan' => 'Fan (ac,air conditioning,blade,blower,cool,hot)' ),
array( 'fas fa-haykal' => 'Haykal (bahai,bahá\'í,star)' ),
array( 'fas fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'far fa-life-ring' => 'Life Ring (coast guard,help,overboard,save,support)' ),
array( 'fas fa-palette' => 'Palette (acrylic,art,brush,color,fill,paint,pigment,watercolor)' ),
array( 'fas fa-ring' => 'Ring (Dungeons & Dragons,Gollum,band,binding,d&d,dnd,engagement,fantasy,gold,jewelry,marriage,precious)' ),
array( 'fas fa-slash' => 'Slash (cancel,close,mute,off,stop,x)' ),
array( 'fas fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'far fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'fas fa-spinner' => 'Spinner (circle,loading,progress)' ),
array( 'fas fa-stroopwafel' => 'Stroopwafel (caramel,cookie,dessert,sweets,waffle)' ),
array( 'fas fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'far fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'fas fa-sync' => 'Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-sync-alt' => 'Alternate Sync (exchange,refresh,reload,rotate,swap)' ),
array( 'fas fa-yin-yang' => 'Yin Yang (daoism,opposites,taoism)' ),
),
'Sports' => array(
array( 'fas fa-baseball-ball' => 'Baseball Ball (foul,hardball,league,leather,mlb,softball,sport)' ),
array( 'fas fa-basketball-ball' => 'Basketball Ball (dribble,dunk,hoop,nba)' ),
array( 'fas fa-biking' => 'Biking (bicycle,bike,cycle,cycling,ride,wheel)' ),
array( 'fas fa-bowling-ball' => 'Bowling Ball (alley,candlepin,gutter,lane,strike,tenpin)' ),
array( 'fas fa-dumbbell' => 'Dumbbell (exercise,gym,strength,weight,weight-lifting)' ),
array( 'fas fa-football-ball' => 'Football Ball (ball,fall,nfl,pigskin,seasonal)' ),
array( 'fas fa-futbol' => 'Futbol (ball,football,mls,soccer)' ),
array( 'far fa-futbol' => 'Futbol (ball,football,mls,soccer)' ),
array( 'fas fa-golf-ball' => 'Golf Ball (caddy,eagle,putt,tee)' ),
array( 'fas fa-hockey-puck' => 'Hockey Puck (ice,nhl,sport)' ),
array( 'fas fa-quidditch' => 'Quidditch (ball,bludger,broom,golden snitch,harry potter,hogwarts,quaffle,sport,wizard)' ),
array( 'fas fa-running' => 'Running (exercise,health,jog,person,run,sport,sprint)' ),
array( 'fas fa-skating' => 'Skating (activity,figure skating,fitness,ice,person,winter)' ),
array( 'fas fa-skiing' => 'Skiing (activity,downhill,fast,fitness,olympics,outdoors,person,seasonal,slalom)' ),
array( 'fas fa-skiing-nordic' => 'Skiing Nordic (activity,cross country,fitness,outdoors,person,seasonal)' ),
array( 'fas fa-snowboarding' => 'Snowboarding (activity,fitness,olympics,outdoors,person)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-table-tennis' => 'Table Tennis (ball,paddle,ping pong)' ),
array( 'fas fa-volleyball-ball' => 'Volleyball Ball (beach,olympics,sport)' ),
),
'Spring' => array(
array( 'fas fa-allergies' => 'Allergies (allergy,freckles,hand,hives,pox,skin,spots)' ),
array( 'fas fa-broom' => 'Broom (clean,firebolt,fly,halloween,nimbus 2000,quidditch,sweep,witch)' ),
array( 'fas fa-cloud-sun' => 'Cloud with Sun (clear,day,daytime,fall,outdoors,overcast,partly cloudy)' ),
array( 'fas fa-cloud-sun-rain' => 'Cloud with Sun and Rain (day,overcast,precipitation,storm,summer,sunshower)' ),
array( 'fas fa-frog' => 'Frog (amphibian,bullfrog,fauna,hop,kermit,kiss,prince,ribbit,toad,wart)' ),
array( 'fas fa-rainbow' => 'Rainbow (gold,leprechaun,prism,rain,sky)' ),
array( 'fas fa-seedling' => 'Seedling (flora,grow,plant,vegan)' ),
array( 'fas fa-umbrella' => 'Umbrella (protection,rain,storm,wet)' ),
),
'Status' => array(
array( 'fas fa-ban' => 'ban (abort,ban,block,cancel,delete,hide,prohibit,remove,stop,trash)' ),
array( 'fas fa-battery-empty' => 'Battery Empty (charge,dead,power,status)' ),
array( 'fas fa-battery-full' => 'Battery Full (charge,power,status)' ),
array( 'fas fa-battery-half' => 'Battery 1/2 Full (charge,power,status)' ),
array( 'fas fa-battery-quarter' => 'Battery 1/4 Full (charge,low,power,status)' ),
array( 'fas fa-battery-three-quarters' => 'Battery 3/4 Full (charge,power,status)' ),
array( 'fas fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'far fa-bell' => 'bell (alarm,alert,chime,notification,reminder)' ),
array( 'fas fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'far fa-bell-slash' => 'Bell Slash (alert,cancel,disabled,notification,off,reminder)' ),
array( 'fas fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'far fa-calendar' => 'Calendar (calendar-o,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'far fa-calendar-alt' => 'Alternate Calendar (calendar,date,event,schedule,time,when)' ),
array( 'fas fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'far fa-calendar-check' => 'Calendar Check (accept,agree,appointment,confirm,correct,date,done,event,ok,schedule,select,success,tick,time,todo,when)' ),
array( 'fas fa-calendar-day' => 'Calendar with Day Focus (date,detail,event,focus,schedule,single day,time,today,when)' ),
array( 'fas fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'far fa-calendar-minus' => 'Calendar Minus (calendar,date,delete,event,negative,remove,schedule,time,when)' ),
array( 'fas fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'far fa-calendar-plus' => 'Calendar Plus (add,calendar,create,date,event,new,positive,schedule,time,when)' ),
array( 'fas fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'far fa-calendar-times' => 'Calendar Times (archive,calendar,date,delete,event,remove,schedule,time,when,x)' ),
array( 'fas fa-calendar-week' => 'Calendar with Week Focus (date,detail,event,focus,schedule,single week,time,today,when)' ),
array( 'fas fa-cart-arrow-down' => 'Shopping Cart Arrow Down (download,save,shopping)' ),
array( 'fas fa-cart-plus' => 'Add to Shopping Cart (add,create,new,positive,shopping)' ),
array( 'fas fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment' => 'comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'far fa-comment-alt' => 'Alternate Comment (bubble,chat,commenting,conversation,feedback,message,note,notification,sms,speech,texting)' ),
array( 'fas fa-comment-slash' => 'Comment Slash (bubble,cancel,chat,commenting,conversation,feedback,message,mute,note,notification,quiet,sms,speech,texting)' ),
array( 'fas fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'far fa-compass' => 'Compass (directions,directory,location,menu,navigation,safari,travel)' ),
array( 'fas fa-door-closed' => 'Door Closed (enter,exit,locked)' ),
array( 'fas fa-door-open' => 'Door Open (enter,exit,welcome)' ),
array( 'fas fa-exclamation' => 'exclamation (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-circle' => 'Exclamation Circle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-exclamation-triangle' => 'Exclamation Triangle (alert,danger,error,important,notice,notification,notify,problem,warning)' ),
array( 'fas fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'far fa-eye' => 'Eye (look,optic,see,seen,show,sight,views,visible)' ),
array( 'fas fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'far fa-eye-slash' => 'Eye Slash (blind,hide,show,toggle,unseen,views,visible,visiblity)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-gas-pump' => 'Gas Pump (car,fuel,gasoline,petrol)' ),
array( 'fas fa-info' => 'Info (details,help,information,more,support)' ),
array( 'fas fa-info-circle' => 'Info Circle (details,help,information,more,support)' ),
array( 'fas fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'far fa-lightbulb' => 'Lightbulb (energy,idea,inspiration,light)' ),
array( 'fas fa-lock' => 'lock (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-lock-open' => 'Lock Open (admin,lock,open,password,private,protect,security)' ),
array( 'fas fa-map-marker' => 'map-marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marker-alt' => 'Alternate Map Marker (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt' => 'Alternate Microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-alt-slash' => 'Alternate Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-minus' => 'minus (collapse,delete,hide,minify,negative,remove,trash)' ),
array( 'fas fa-minus-circle' => 'Minus Circle (delete,hide,negative,remove,shape,trash)' ),
array( 'fas fa-minus-square' => 'Minus Square (collapse,delete,hide,minify,negative,remove,shape,trash)' ),
array( 'far fa-minus-square' => 'Minus Square (collapse,delete,hide,minify,negative,remove,shape,trash)' ),
array( 'fas fa-parking' => 'Parking (auto,car,garage,meter)' ),
array( 'fas fa-phone' => 'Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-alt' => 'Alternate Phone (call,earphone,number,support,telephone,voice)' ),
array( 'fas fa-phone-slash' => 'Phone Slash (call,cancel,earphone,mute,number,support,telephone,voice)' ),
array( 'fas fa-plus' => 'plus (add,create,expand,new,positive,shape)' ),
array( 'fas fa-plus-circle' => 'Plus Circle (add,create,expand,new,positive,shape)' ),
array( 'fas fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'far fa-plus-square' => 'Plus Square (add,create,expand,new,positive,shape)' ),
array( 'fas fa-print' => 'print (business,copy,document,office,paper)' ),
array( 'fas fa-question' => 'Question (help,information,support,unknown)' ),
array( 'fas fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'far fa-question-circle' => 'Question Circle (help,information,support,unknown)' ),
array( 'fas fa-shield-alt' => 'Alternate Shield (achievement,award,block,defend,security,winner)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-sign-in-alt' => 'Alternate Sign In (arrow,enter,join,log in,login,sign in,sign up,sign-in,signin,signup)' ),
array( 'fas fa-sign-out-alt' => 'Alternate Sign Out (arrow,exit,leave,log out,logout,sign-out)' ),
array( 'fas fa-signal' => 'signal (bars,graph,online,reception,status)' ),
array( 'fas fa-smoking-ban' => 'Smoking Ban (ban,cancel,no smoking,non-smoking)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fas fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'far fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'fas fa-star-half-alt' => 'Alternate Star Half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'fas fa-stream' => 'Stream (flow,list,timeline)' ),
array( 'fas fa-thermometer-empty' => 'Thermometer Empty (cold,mercury,status,temperature)' ),
array( 'fas fa-thermometer-full' => 'Thermometer Full (fever,hot,mercury,status,temperature)' ),
array( 'fas fa-thermometer-half' => 'Thermometer 1/2 Full (mercury,status,temperature)' ),
array( 'fas fa-thermometer-quarter' => 'Thermometer 1/4 Full (mercury,status,temperature)' ),
array( 'fas fa-thermometer-three-quarters' => 'Thermometer 3/4 Full (mercury,status,temperature)' ),
array( 'fas fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'far fa-thumbs-down' => 'thumbs-down (disagree,disapprove,dislike,hand,social,thumbs-o-down)' ),
array( 'fas fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'far fa-thumbs-up' => 'thumbs-up (agree,approve,favorite,hand,like,ok,okay,social,success,thumbs-o-up,yes,you got it dude)' ),
array( 'fas fa-tint' => 'tint (color,drop,droplet,raindrop,waterdrop)' ),
array( 'fas fa-tint-slash' => 'Tint Slash (color,drop,droplet,raindrop,waterdrop)' ),
array( 'fas fa-toggle-off' => 'Toggle Off (switch)' ),
array( 'fas fa-toggle-on' => 'Toggle On (switch)' ),
array( 'fas fa-unlock' => 'unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-unlock-alt' => 'Alternate Unlock (admin,lock,password,private,protect)' ),
array( 'fas fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-alt' => 'Alternate User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-alt-slash' => 'Alternate User Slash (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-slash' => 'User Slash (ban,delete,remove)' ),
array( 'fas fa-video' => 'Video (camera,film,movie,record,video-camera)' ),
array( 'fas fa-video-slash' => 'Video Slash (add,create,film,new,positive,record,video)' ),
array( 'fas fa-volume-down' => 'Volume Down (audio,lower,music,quieter,sound,speaker)' ),
array( 'fas fa-volume-mute' => 'Volume Mute (audio,music,quiet,sound,speaker)' ),
array( 'fas fa-volume-off' => 'Volume Off (audio,ban,music,mute,quiet,silent,sound)' ),
array( 'fas fa-volume-up' => 'Volume Up (audio,higher,louder,music,sound,speaker)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
),
'Summer' => array(
array( 'fas fa-anchor' => 'Anchor (berth,boat,dock,embed,link,maritime,moor,secure)' ),
array( 'fas fa-biking' => 'Biking (bicycle,bike,cycle,cycling,ride,wheel)' ),
array( 'fas fa-fish' => 'Fish (fauna,gold,seafood,swimming)' ),
array( 'fas fa-hotdog' => 'Hot Dog (bun,chili,frankfurt,frankfurter,kosher,polish,sandwich,sausage,vienna,weiner)' ),
array( 'fas fa-ice-cream' => 'Ice Cream (chocolate,cone,dessert,frozen,scoop,sorbet,vanilla,yogurt)' ),
array( 'fas fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'far fa-lemon' => 'Lemon (citrus,lemonade,lime,tart)' ),
array( 'fas fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'far fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-swimming-pool' => 'Swimming Pool (ladder,recreation,swim,water)' ),
array( 'fas fa-umbrella-beach' => 'Umbrella Beach (protection,recreation,sand,shade,summer,sun)' ),
array( 'fas fa-volleyball-ball' => 'Volleyball Ball (beach,olympics,sport)' ),
array( 'fas fa-water' => 'Water (lake,liquid,ocean,sea,swim,wet)' ),
),
'Tabletop Gaming' => array(
array( 'fab fa-acquisitions-incorporated' => 'Acquisitions Incorporated (Dungeons & Dragons,d&d,dnd,fantasy,game,gaming,tabletop)' ),
array( 'fas fa-book-dead' => 'Book of the Dead (Dungeons & Dragons,crossbones,d&d,dark arts,death,dnd,documentation,evil,fantasy,halloween,holiday,necronomicon,read,skull,spell)' ),
array( 'fab fa-critical-role' => 'Critical Role (Dungeons & Dragons,d&d,dnd,fantasy,game,gaming,tabletop)' ),
array( 'fab fa-d-and-d' => 'Dungeons & Dragons' ),
array( 'fab fa-d-and-d-beyond' => 'D&D Beyond (Dungeons & Dragons,d&d,dnd,fantasy,gaming,tabletop)' ),
array( 'fas fa-dice-d20' => 'Dice D20 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dice-d6' => 'Dice D6 (Dungeons & Dragons,chance,d&d,dnd,fantasy,gambling,game,roll)' ),
array( 'fas fa-dragon' => 'Dragon (Dungeons & Dragons,d&d,dnd,fantasy,fire,lizard,serpent)' ),
array( 'fas fa-dungeon' => 'Dungeon (Dungeons & Dragons,building,d&d,dnd,door,entrance,fantasy,gate)' ),
array( 'fab fa-fantasy-flight-games' => 'Fantasy Flight-games (Dungeons & Dragons,d&d,dnd,fantasy,game,gaming,tabletop)' ),
array( 'fas fa-fist-raised' => 'Raised Fist (Dungeons & Dragons,d&d,dnd,fantasy,hand,ki,monk,resist,strength,unarmed combat)' ),
array( 'fas fa-hat-wizard' => 'Wizard\'s Hat (Dungeons & Dragons,accessory,buckle,clothing,d&d,dnd,fantasy,halloween,head,holiday,mage,magic,pointy,witch)' ),
array( 'fab fa-penny-arcade' => 'Penny Arcade (Dungeons & Dragons,d&d,dnd,fantasy,game,gaming,pax,tabletop)' ),
array( 'fas fa-ring' => 'Ring (Dungeons & Dragons,Gollum,band,binding,d&d,dnd,engagement,fantasy,gold,jewelry,marriage,precious)' ),
array( 'fas fa-scroll' => 'Scroll (Dungeons & Dragons,announcement,d&d,dnd,fantasy,paper,script)' ),
array( 'fas fa-skull-crossbones' => 'Skull & Crossbones (Dungeons & Dragons,alert,bones,d&d,danger,dead,deadly,death,dnd,fantasy,halloween,holiday,jolly-roger,pirate,poison,skeleton,warning)' ),
array( 'fab fa-wizards-of-the-coast' => 'Wizards of the Coast (Dungeons & Dragons,d&d,dnd,fantasy,game,gaming,tabletop)' ),
),
'Toggle' => array(
array( 'fas fa-bullseye' => 'Bullseye (archery,goal,objective,target)' ),
array( 'fas fa-check-circle' => 'Check Circle (accept,agree,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'far fa-check-circle' => 'Check Circle (accept,agree,confirm,correct,done,ok,select,success,tick,todo,yes)' ),
array( 'fas fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'far fa-circle' => 'Circle (circle-thin,diameter,dot,ellipse,notification,round)' ),
array( 'fas fa-dot-circle' => 'Dot Circle (bullseye,notification,target)' ),
array( 'far fa-dot-circle' => 'Dot Circle (bullseye,notification,target)' ),
array( 'fas fa-microphone' => 'microphone (audio,podcast,record,sing,sound,voice)' ),
array( 'fas fa-microphone-slash' => 'Microphone Slash (audio,disable,mute,podcast,record,sing,sound,voice)' ),
array( 'fas fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'far fa-star' => 'Star (achievement,award,favorite,important,night,rating,score)' ),
array( 'fas fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'far fa-star-half' => 'star-half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'fas fa-star-half-alt' => 'Alternate Star Half (achievement,award,rating,score,star-half-empty,star-half-full)' ),
array( 'fas fa-toggle-off' => 'Toggle Off (switch)' ),
array( 'fas fa-toggle-on' => 'Toggle On (switch)' ),
array( 'fas fa-wifi' => 'WiFi (connection,hotspot,internet,network,wireless)' ),
),
'Travel' => array(
array( 'fas fa-archway' => 'Archway (arc,monument,road,street,tunnel)' ),
array( 'fas fa-atlas' => 'Atlas (book,directions,geography,globe,map,travel,wayfinding)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-bus' => 'Bus (public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-bus-alt' => 'Bus Alt (mta,public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-cocktail' => 'Cocktail (alcohol,beverage,drink,gin,glass,margarita,martini,vodka)' ),
array( 'fas fa-concierge-bell' => 'Concierge Bell (attention,hotel,receptionist,service,support)' ),
array( 'fas fa-dumbbell' => 'Dumbbell (exercise,gym,strength,weight,weight-lifting)' ),
array( 'fas fa-glass-martini' => 'Martini Glass (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-glass-martini-alt' => 'Alternate Glass Martini (alcohol,bar,beverage,drink,liquor)' ),
array( 'fas fa-globe-africa' => 'Globe with Africa shown (all,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-globe-americas' => 'Globe with Americas shown (all,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-globe-asia' => 'Globe with Asia shown (all,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-globe-europe' => 'Globe with Europe shown (all,country,earth,global,gps,language,localize,location,map,online,place,planet,translate,travel,world)' ),
array( 'fas fa-hot-tub' => 'Hot Tub (bath,jacuzzi,massage,sauna,spa)' ),
array( 'fas fa-hotel' => 'Hotel (building,inn,lodging,motel,resort,travel)' ),
array( 'fas fa-luggage-cart' => 'Luggage Cart (bag,baggage,suitcase,travel)' ),
array( 'fas fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'far fa-map' => 'Map (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marked' => 'Map Marked (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-map-marked-alt' => 'Alternate Map Marked (address,coordinates,destination,gps,localize,location,map,navigation,paper,pin,place,point of interest,position,route,travel)' ),
array( 'fas fa-monument' => 'Monument (building,historic,landmark,memorable)' ),
array( 'fas fa-passport' => 'Passport (document,id,identification,issued,travel)' ),
array( 'fas fa-plane' => 'plane (airplane,destination,fly,location,mode,travel,trip)' ),
array( 'fas fa-plane-arrival' => 'Plane Arrival (airplane,arriving,destination,fly,land,landing,location,mode,travel,trip)' ),
array( 'fas fa-plane-departure' => 'Plane Departure (airplane,departing,destination,fly,location,mode,take off,taking off,travel,trip)' ),
array( 'fas fa-shuttle-van' => 'Shuttle Van (airport,machine,public-transportation,transportation,travel,vehicle)' ),
array( 'fas fa-spa' => 'Spa (flora,massage,mindfulness,plant,wellness)' ),
array( 'fas fa-suitcase' => 'Suitcase (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-suitcase-rolling' => 'Suitcase Rolling (baggage,luggage,move,suitcase,travel,trip)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-swimming-pool' => 'Swimming Pool (ladder,recreation,swim,water)' ),
array( 'fas fa-taxi' => 'Taxi (cab,cabbie,car,car service,lyft,machine,transportation,travel,uber,vehicle)' ),
array( 'fas fa-tram' => 'Tram (crossing,machine,mountains,seasonal,transportation)' ),
array( 'fas fa-tv' => 'Television (computer,display,monitor,television)' ),
array( 'fas fa-umbrella-beach' => 'Umbrella Beach (protection,recreation,sand,shade,summer,sun)' ),
array( 'fas fa-wine-glass' => 'Wine Glass (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
array( 'fas fa-wine-glass-alt' => 'Alternate Wine Glas (alcohol,beverage,cabernet,drink,grapes,merlot,sauvignon)' ),
),
'Users & People' => array(
array( 'fab fa-accessible-icon' => 'Accessible Icon (accessibility,handicap,person,wheelchair,wheelchair-alt)' ),
array( 'fas fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'far fa-address-book' => 'Address Book (contact,directory,index,little black book,rolodex)' ),
array( 'fas fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'far fa-address-card' => 'Address Card (about,contact,id,identification,postcard,profile)' ),
array( 'fas fa-baby' => 'Baby (child,diaper,doll,human,infant,kid,offspring,person,sprout)' ),
array( 'fas fa-bed' => 'Bed (lodging,rest,sleep,travel)' ),
array( 'fas fa-biking' => 'Biking (bicycle,bike,cycle,cycling,ride,wheel)' ),
array( 'fas fa-blind' => 'Blind (cane,disability,person,sight)' ),
array( 'fas fa-chalkboard-teacher' => 'Chalkboard Teacher (blackboard,instructor,learning,professor,school,whiteboard,writing)' ),
array( 'fas fa-child' => 'Child (boy,girl,kid,toddler,young)' ),
array( 'fas fa-female' => 'Female (human,person,profile,user,woman)' ),
array( 'fas fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'far fa-frown' => 'Frowning Face (disapprove,emoticon,face,rating,sad)' ),
array( 'fas fa-hiking' => 'Hiking (activity,backpack,fall,fitness,outdoors,person,seasonal,walking)' ),
array( 'fas fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'far fa-id-badge' => 'Identification Badge (address,contact,identification,license,profile)' ),
array( 'fas fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'far fa-id-card' => 'Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-id-card-alt' => 'Alternate Identification Card (contact,demographics,document,identification,issued,profile)' ),
array( 'fas fa-male' => 'Male (human,man,person,profile,user)' ),
array( 'fas fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'far fa-meh' => 'Neutral Face (emoticon,face,neutral,rating)' ),
array( 'fas fa-people-carry' => 'People Carry (box,carry,fragile,help,movers,package)' ),
array( 'fas fa-person-booth' => 'Person Entering Booth (changing,changing room,election,human,person,vote,voting)' ),
array( 'fas fa-poo' => 'Poo (crap,poop,shit,smile,turd)' ),
array( 'fas fa-portrait' => 'Portrait (id,image,photo,picture,selfie)' ),
array( 'fas fa-power-off' => 'Power Off (cancel,computer,on,reboot,restart)' ),
array( 'fas fa-pray' => 'Pray (kneel,preach,religion,worship)' ),
array( 'fas fa-restroom' => 'Restroom (bathroom,john,loo,potty,washroom,waste,wc)' ),
array( 'fas fa-running' => 'Running (exercise,health,jog,person,run,sport,sprint)' ),
array( 'fas fa-skating' => 'Skating (activity,figure skating,fitness,ice,person,winter)' ),
array( 'fas fa-skiing' => 'Skiing (activity,downhill,fast,fitness,olympics,outdoors,person,seasonal,slalom)' ),
array( 'fas fa-skiing-nordic' => 'Skiing Nordic (activity,cross country,fitness,outdoors,person,seasonal)' ),
array( 'fas fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'far fa-smile' => 'Smiling Face (approve,emoticon,face,happy,rating,satisfied)' ),
array( 'fas fa-snowboarding' => 'Snowboarding (activity,fitness,olympics,outdoors,person)' ),
array( 'fas fa-street-view' => 'Street View (directions,location,map,navigation)' ),
array( 'fas fa-swimmer' => 'Swimmer (athlete,head,man,olympics,person,pool,water)' ),
array( 'fas fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user' => 'User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-alt' => 'Alternate User (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-alt-slash' => 'Alternate User Slash (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-astronaut' => 'User Astronaut (avatar,clothing,cosmonaut,nasa,space,suit)' ),
array( 'fas fa-user-check' => 'User Check (accept,check,person,verified)' ),
array( 'fas fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'far fa-user-circle' => 'User Circle (account,avatar,head,human,man,person,profile)' ),
array( 'fas fa-user-clock' => 'User Clock (alert,person,remind,time)' ),
array( 'fas fa-user-cog' => 'User Cog (admin,cog,person,settings)' ),
array( 'fas fa-user-edit' => 'User Edit (edit,pen,pencil,person,update,write)' ),
array( 'fas fa-user-friends' => 'User Friends (group,people,person,team,users)' ),
array( 'fas fa-user-graduate' => 'User Graduate (cap,clothing,commencement,gown,graduation,person,student)' ),
array( 'fas fa-user-injured' => 'User Injured (cast,injury,ouch,patient,person,sling)' ),
array( 'fas fa-user-lock' => 'User Lock (admin,lock,person,private,unlock)' ),
array( 'fas fa-user-md' => 'Doctor (job,medical,nurse,occupation,physician,profile,surgeon)' ),
array( 'fas fa-user-minus' => 'User Minus (delete,negative,remove)' ),
array( 'fas fa-user-ninja' => 'User Ninja (assassin,avatar,dangerous,deadly,sneaky)' ),
array( 'fas fa-user-nurse' => 'Nurse (doctor,midwife,practitioner,surgeon)' ),
array( 'fas fa-user-plus' => 'User Plus (add,avatar,positive,sign up,signup,team)' ),
array( 'fas fa-user-secret' => 'User Secret (clothing,coat,hat,incognito,person,privacy,spy,whisper)' ),
array( 'fas fa-user-shield' => 'User Shield (admin,person,private,protect,safe)' ),
array( 'fas fa-user-slash' => 'User Slash (ban,delete,remove)' ),
array( 'fas fa-user-tag' => 'User Tag (avatar,discount,label,person,role,special)' ),
array( 'fas fa-user-tie' => 'User Tie (avatar,business,clothing,formal,professional,suit)' ),
array( 'fas fa-user-times' => 'Remove User (archive,delete,remove,x)' ),
array( 'fas fa-users' => 'Users (friends,group,people,persons,profiles,team)' ),
array( 'fas fa-users-cog' => 'Users Cog (admin,cog,group,person,settings,team)' ),
array( 'fas fa-walking' => 'Walking (exercise,health,pedometer,person,steps)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
),
'Vehicles' => array(
array( 'fab fa-accessible-icon' => 'Accessible Icon (accessibility,handicap,person,wheelchair,wheelchair-alt)' ),
array( 'fas fa-ambulance' => 'ambulance (emergency,emt,er,help,hospital,support,vehicle)' ),
array( 'fas fa-baby-carriage' => 'Baby Carriage (buggy,carrier,infant,push,stroller,transportation,walk,wheels)' ),
array( 'fas fa-bicycle' => 'Bicycle (bike,gears,pedal,transportation,vehicle)' ),
array( 'fas fa-bus' => 'Bus (public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-bus-alt' => 'Bus Alt (mta,public transportation,transportation,travel,vehicle)' ),
array( 'fas fa-car' => 'Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-car-alt' => 'Alternate Car (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-car-crash' => 'Car Crash (accident,auto,automobile,insurance,sedan,transportation,vehicle,wreck)' ),
array( 'fas fa-car-side' => 'Car Side (auto,automobile,sedan,transportation,travel,vehicle)' ),
array( 'fas fa-fighter-jet' => 'fighter-jet (airplane,fast,fly,goose,maverick,plane,quick,top gun,transportation,travel)' ),
array( 'fas fa-helicopter' => 'Helicopter (airwolf,apache,chopper,flight,fly,travel)' ),
array( 'fas fa-horse' => 'Horse (equus,fauna,mammmal,mare,neigh,pony)' ),
array( 'fas fa-motorcycle' => 'Motorcycle (bike,machine,transportation,vehicle)' ),
array( 'fas fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'far fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'fas fa-plane' => 'plane (airplane,destination,fly,location,mode,travel,trip)' ),
array( 'fas fa-rocket' => 'rocket (aircraft,app,jet,launch,nasa,space)' ),
array( 'fas fa-ship' => 'Ship (boat,sea,water)' ),
array( 'fas fa-shopping-cart' => 'shopping-cart (buy,checkout,grocery,payment,purchase)' ),
array( 'fas fa-shuttle-van' => 'Shuttle Van (airport,machine,public-transportation,transportation,travel,vehicle)' ),
array( 'fas fa-sleigh' => 'Sleigh (christmas,claus,fly,holiday,santa,sled,snow,xmas)' ),
array( 'fas fa-snowplow' => 'Snowplow (clean up,cold,road,storm,winter)' ),
array( 'fas fa-space-shuttle' => 'Space Shuttle (astronaut,machine,nasa,rocket,transportation)' ),
array( 'fas fa-subway' => 'Subway (machine,railway,train,transportation,vehicle)' ),
array( 'fas fa-taxi' => 'Taxi (cab,cabbie,car,car service,lyft,machine,transportation,travel,uber,vehicle)' ),
array( 'fas fa-tractor' => 'Tractor (agriculture,farm,vehicle)' ),
array( 'fas fa-train' => 'Train (bullet,commute,locomotive,railway,subway)' ),
array( 'fas fa-tram' => 'Tram (crossing,machine,mountains,seasonal,transportation)' ),
array( 'fas fa-truck' => 'truck (cargo,delivery,shipping,vehicle)' ),
array( 'fas fa-truck-monster' => 'Truck Monster (offroad,vehicle,wheel)' ),
array( 'fas fa-truck-pickup' => 'Truck Side (cargo,vehicle)' ),
array( 'fas fa-wheelchair' => 'Wheelchair (accessible,handicap,person)' ),
),
'Weather' => array(
array( 'fas fa-bolt' => 'Lightning Bolt (electricity,lightning,weather,zap)' ),
array( 'fas fa-cloud' => 'Cloud (atmosphere,fog,overcast,save,upload,weather)' ),
array( 'fas fa-cloud-meatball' => 'Cloud with (a chance of) Meatball (FLDSMDFR,food,spaghetti,storm)' ),
array( 'fas fa-cloud-moon' => 'Cloud with Moon (crescent,evening,lunar,night,partly cloudy,sky)' ),
array( 'fas fa-cloud-moon-rain' => 'Cloud with Moon and Rain (crescent,evening,lunar,night,partly cloudy,precipitation,rain,sky,storm)' ),
array( 'fas fa-cloud-rain' => 'Cloud with Rain (precipitation,rain,sky,storm)' ),
array( 'fas fa-cloud-showers-heavy' => 'Cloud with Heavy Showers (precipitation,rain,sky,storm)' ),
array( 'fas fa-cloud-sun' => 'Cloud with Sun (clear,day,daytime,fall,outdoors,overcast,partly cloudy)' ),
array( 'fas fa-cloud-sun-rain' => 'Cloud with Sun and Rain (day,overcast,precipitation,storm,summer,sunshower)' ),
array( 'fas fa-meteor' => 'Meteor (armageddon,asteroid,comet,shooting star,space)' ),
array( 'fas fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'far fa-moon' => 'Moon (contrast,crescent,dark,lunar,night)' ),
array( 'fas fa-poo-storm' => 'Poo Storm (bolt,cloud,euphemism,lightning,mess,poop,shit,turd)' ),
array( 'fas fa-rainbow' => 'Rainbow (gold,leprechaun,prism,rain,sky)' ),
array( 'fas fa-smog' => 'Smog (dragon,fog,haze,pollution,smoke,weather)' ),
array( 'fas fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'far fa-snowflake' => 'Snowflake (precipitation,rain,winter)' ),
array( 'fas fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'far fa-sun' => 'Sun (brighten,contrast,day,lighter,sol,solar,star,weather)' ),
array( 'fas fa-temperature-high' => 'High Temperature (cook,mercury,summer,thermometer,warm)' ),
array( 'fas fa-temperature-low' => 'Low Temperature (cold,cool,mercury,thermometer,winter)' ),
array( 'fas fa-umbrella' => 'Umbrella (protection,rain,storm,wet)' ),
array( 'fas fa-water' => 'Water (lake,liquid,ocean,sea,swim,wet)' ),
array( 'fas fa-wind' => 'Wind (air,blow,breeze,fall,seasonal,weather)' ),
),
'Winter' => array(
array( 'fas fa-glass-whiskey' => 'Glass Whiskey (alcohol,bar,beverage,bourbon,drink,liquor,neat,rye,scotch,whisky)' ),
array( 'fas fa-icicles' => 'Icicles (cold,frozen,hanging,ice,seasonal,sharp)' ),
array( 'fas fa-igloo' => 'Igloo (dome,dwelling,eskimo,home,house,ice,snow)' ),
array( 'fas fa-mitten' => 'Mitten (clothing,cold,glove,hands,knitted,seasonal,warmth)' ),
array( 'fas fa-skating' => 'Skating (activity,figure skating,fitness,ice,person,winter)' ),
array( 'fas fa-skiing' => 'Skiing (activity,downhill,fast,fitness,olympics,outdoors,person,seasonal,slalom)' ),
array( 'fas fa-skiing-nordic' => 'Skiing Nordic (activity,cross country,fitness,outdoors,person,seasonal)' ),
array( 'fas fa-snowboarding' => 'Snowboarding (activity,fitness,olympics,outdoors,person)' ),
array( 'fas fa-snowplow' => 'Snowplow (clean up,cold,road,storm,winter)' ),
array( 'fas fa-tram' => 'Tram (crossing,machine,mountains,seasonal,transportation)' ),
),
'Writing' => array(
array( 'fas fa-archive' => 'Archive (box,package,save,storage)' ),
array( 'fas fa-blog' => 'Blog (journal,log,online,personal,post,web 2.0,wordpress,writing)' ),
array( 'fas fa-book' => 'book (diary,documentation,journal,library,read)' ),
array( 'fas fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'far fa-bookmark' => 'bookmark (favorite,marker,read,remember,save)' ),
array( 'fas fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'far fa-edit' => 'Edit (edit,pen,pencil,update,write)' ),
array( 'fas fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope' => 'Envelope (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'far fa-envelope-open' => 'Envelope Open (e-mail,email,letter,mail,message,notification,support)' ),
array( 'fas fa-eraser' => 'eraser (art,delete,remove,rubber)' ),
array( 'fas fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'far fa-file' => 'File (document,new,page,pdf,resume)' ),
array( 'fas fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'far fa-file-alt' => 'Alternate File (document,file-text,invoice,new,page,pdf)' ),
array( 'fas fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'far fa-folder' => 'Folder (archive,directory,document,file)' ),
array( 'fas fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'far fa-folder-open' => 'Folder Open (archive,directory,document,empty,file,new)' ),
array( 'fas fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'far fa-keyboard' => 'Keyboard (accessory,edit,input,text,type,write)' ),
array( 'fas fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'far fa-newspaper' => 'Newspaper (article,editorial,headline,journal,journalism,news,press)' ),
array( 'fas fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'far fa-paper-plane' => 'Paper Plane (air,float,fold,mail,paper,send)' ),
array( 'fas fa-paperclip' => 'Paperclip (attach,attachment,connect,link)' ),
array( 'fas fa-paragraph' => 'paragraph (edit,format,text,writing)' ),
array( 'fas fa-pen' => 'Pen (design,edit,update,write)' ),
array( 'fas fa-pen-alt' => 'Alternate Pen (design,edit,update,write)' ),
array( 'fas fa-pen-square' => 'Pen Square (edit,pencil-square,update,write)' ),
array( 'fas fa-pencil-alt' => 'Alternate Pencil (design,edit,pencil,update,write)' ),
array( 'fas fa-quote-left' => 'quote-left (mention,note,phrase,text,type)' ),
array( 'fas fa-quote-right' => 'quote-right (mention,note,phrase,text,type)' ),
array( 'fas fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'far fa-sticky-note' => 'Sticky Note (message,note,paper,reminder,sticker)' ),
array( 'fas fa-thumbtack' => 'Thumbtack (coordinates,location,marker,pin,thumb-tack)' ),
),
'Other' => array(
array( 'fas fa-backspace' => 'Backspace (command,delete,erase,keyboard,undo)' ),
array( 'fas fa-blender-phone' => 'Blender Phone (appliance,cocktail,communication,fantasy,milkshake,mixer,puree,silly,smoothie)' ),
array( 'fas fa-crown' => 'Crown (award,favorite,king,queen,royal,tiara)' ),
array( 'fas fa-dumpster-fire' => 'Dumpster Fire (alley,bin,commercial,danger,dangerous,euphemism,flame,heat,hot,trash,waste)' ),
array( 'fas fa-file-csv' => 'File CSV (document,excel,numbers,spreadsheets,table)' ),
array( 'fas fa-network-wired' => 'Wired Network (computer,connect,ethernet,internet,intranet)' ),
array( 'fas fa-signature' => 'Signature (John Hancock,cursive,name,writing)' ),
array( 'fas fa-skull' => 'Skull (bones,skeleton,x-ray,yorick)' ),
array( 'fas fa-vr-cardboard' => 'Cardboard VR (3d,augment,google,reality,virtual)' ),
array( 'fas fa-weight-hanging' => 'Hanging Weight (anvil,heavy,measurement)' ),
),
);
return array_merge( $icons, $fontawesome_icons );
}
add_filter( 'vc_iconpicker-type-openiconic', 'vc_iconpicker_type_openiconic' );
/**
* Openicons icons from fontello.com
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_openiconic( $icons ) {
$openiconic_icons = array(
array( 'vc-oi vc-oi-dial' => 'Dial' ),
array( 'vc-oi vc-oi-pilcrow' => 'Pilcrow' ),
array( 'vc-oi vc-oi-at' => 'At' ),
array( 'vc-oi vc-oi-hash' => 'Hash' ),
array( 'vc-oi vc-oi-key-inv' => 'Key-inv' ),
array( 'vc-oi vc-oi-key' => 'Key' ),
array( 'vc-oi vc-oi-chart-pie-alt' => 'Chart-pie-alt' ),
array( 'vc-oi vc-oi-chart-pie' => 'Chart-pie' ),
array( 'vc-oi vc-oi-chart-bar' => 'Chart-bar' ),
array( 'vc-oi vc-oi-umbrella' => 'Umbrella' ),
array( 'vc-oi vc-oi-moon-inv' => 'Moon-inv' ),
array( 'vc-oi vc-oi-mobile' => 'Mobile' ),
array( 'vc-oi vc-oi-cd' => 'Cd' ),
array( 'vc-oi vc-oi-split' => 'Split' ),
array( 'vc-oi vc-oi-exchange' => 'Exchange' ),
array( 'vc-oi vc-oi-block' => 'Block' ),
array( 'vc-oi vc-oi-resize-full' => 'Resize-full' ),
array( 'vc-oi vc-oi-article-alt' => 'Article-alt' ),
array( 'vc-oi vc-oi-article' => 'Article' ),
array( 'vc-oi vc-oi-pencil-alt' => 'Pencil-alt' ),
array( 'vc-oi vc-oi-undo' => 'Undo' ),
array( 'vc-oi vc-oi-attach' => 'Attach' ),
array( 'vc-oi vc-oi-link' => 'Link' ),
array( 'vc-oi vc-oi-search' => 'Search' ),
array( 'vc-oi vc-oi-mail' => 'Mail' ),
array( 'vc-oi vc-oi-heart' => 'Heart' ),
array( 'vc-oi vc-oi-comment' => 'Comment' ),
array( 'vc-oi vc-oi-resize-full-alt' => 'Resize-full-alt' ),
array( 'vc-oi vc-oi-lock' => 'Lock' ),
array( 'vc-oi vc-oi-book-open' => 'Book-open' ),
array( 'vc-oi vc-oi-arrow-curved' => 'Arrow-curved' ),
array( 'vc-oi vc-oi-equalizer' => 'Equalizer' ),
array( 'vc-oi vc-oi-heart-empty' => 'Heart-empty' ),
array( 'vc-oi vc-oi-lock-empty' => 'Lock-empty' ),
array( 'vc-oi vc-oi-comment-inv' => 'Comment-inv' ),
array( 'vc-oi vc-oi-folder' => 'Folder' ),
array( 'vc-oi vc-oi-resize-small' => 'Resize-small' ),
array( 'vc-oi vc-oi-play' => 'Play' ),
array( 'vc-oi vc-oi-cursor' => 'Cursor' ),
array( 'vc-oi vc-oi-aperture' => 'Aperture' ),
array( 'vc-oi vc-oi-play-circle2' => 'Play-circle2' ),
array( 'vc-oi vc-oi-resize-small-alt' => 'Resize-small-alt' ),
array( 'vc-oi vc-oi-folder-empty' => 'Folder-empty' ),
array( 'vc-oi vc-oi-comment-alt' => 'Comment-alt' ),
array( 'vc-oi vc-oi-lock-open' => 'Lock-open' ),
array( 'vc-oi vc-oi-star' => 'Star' ),
array( 'vc-oi vc-oi-user' => 'User' ),
array( 'vc-oi vc-oi-lock-open-empty' => 'Lock-open-empty' ),
array( 'vc-oi vc-oi-box' => 'Box' ),
array( 'vc-oi vc-oi-resize-vertical' => 'Resize-vertical' ),
array( 'vc-oi vc-oi-stop' => 'Stop' ),
array( 'vc-oi vc-oi-aperture-alt' => 'Aperture-alt' ),
array( 'vc-oi vc-oi-book' => 'Book' ),
array( 'vc-oi vc-oi-steering-wheel' => 'Steering-wheel' ),
array( 'vc-oi vc-oi-pause' => 'Pause' ),
array( 'vc-oi vc-oi-to-start' => 'To-start' ),
array( 'vc-oi vc-oi-move' => 'Move' ),
array( 'vc-oi vc-oi-resize-horizontal' => 'Resize-horizontal' ),
array( 'vc-oi vc-oi-rss-alt' => 'Rss-alt' ),
array( 'vc-oi vc-oi-comment-alt2' => 'Comment-alt2' ),
array( 'vc-oi vc-oi-rss' => 'Rss' ),
array( 'vc-oi vc-oi-comment-inv-alt' => 'Comment-inv-alt' ),
array( 'vc-oi vc-oi-comment-inv-alt2' => 'Comment-inv-alt2' ),
array( 'vc-oi vc-oi-eye' => 'Eye' ),
array( 'vc-oi vc-oi-pin' => 'Pin' ),
array( 'vc-oi vc-oi-video' => 'Video' ),
array( 'vc-oi vc-oi-picture' => 'Picture' ),
array( 'vc-oi vc-oi-camera' => 'Camera' ),
array( 'vc-oi vc-oi-tag' => 'Tag' ),
array( 'vc-oi vc-oi-chat' => 'Chat' ),
array( 'vc-oi vc-oi-cog' => 'Cog' ),
array( 'vc-oi vc-oi-popup' => 'Popup' ),
array( 'vc-oi vc-oi-to-end' => 'To-end' ),
array( 'vc-oi vc-oi-book-alt' => 'Book-alt' ),
array( 'vc-oi vc-oi-brush' => 'Brush' ),
array( 'vc-oi vc-oi-eject' => 'Eject' ),
array( 'vc-oi vc-oi-down' => 'Down' ),
array( 'vc-oi vc-oi-wrench' => 'Wrench' ),
array( 'vc-oi vc-oi-chat-inv' => 'Chat-inv' ),
array( 'vc-oi vc-oi-tag-empty' => 'Tag-empty' ),
array( 'vc-oi vc-oi-ok' => 'Ok' ),
array( 'vc-oi vc-oi-ok-circle' => 'Ok-circle' ),
array( 'vc-oi vc-oi-download' => 'Download' ),
array( 'vc-oi vc-oi-location' => 'Location' ),
array( 'vc-oi vc-oi-share' => 'Share' ),
array( 'vc-oi vc-oi-left' => 'Left' ),
array( 'vc-oi vc-oi-target' => 'Target' ),
array( 'vc-oi vc-oi-brush-alt' => 'Brush-alt' ),
array( 'vc-oi vc-oi-cancel' => 'Cancel' ),
array( 'vc-oi vc-oi-upload' => 'Upload' ),
array( 'vc-oi vc-oi-location-inv' => 'Location-inv' ),
array( 'vc-oi vc-oi-calendar' => 'Calendar' ),
array( 'vc-oi vc-oi-right' => 'Right' ),
array( 'vc-oi vc-oi-signal' => 'Signal' ),
array( 'vc-oi vc-oi-eyedropper' => 'Eyedropper' ),
array( 'vc-oi vc-oi-layers' => 'Layers' ),
array( 'vc-oi vc-oi-award' => 'Award' ),
array( 'vc-oi vc-oi-up' => 'Up' ),
array( 'vc-oi vc-oi-calendar-inv' => 'Calendar-inv' ),
array( 'vc-oi vc-oi-location-alt' => 'Location-alt' ),
array( 'vc-oi vc-oi-download-cloud' => 'Download-cloud' ),
array( 'vc-oi vc-oi-cancel-circle' => 'Cancel-circle' ),
array( 'vc-oi vc-oi-plus' => 'Plus' ),
array( 'vc-oi vc-oi-upload-cloud' => 'Upload-cloud' ),
array( 'vc-oi vc-oi-compass' => 'Compass' ),
array( 'vc-oi vc-oi-calendar-alt' => 'Calendar-alt' ),
array( 'vc-oi vc-oi-down-circle' => 'Down-circle' ),
array( 'vc-oi vc-oi-award-empty' => 'Award-empty' ),
array( 'vc-oi vc-oi-layers-alt' => 'Layers-alt' ),
array( 'vc-oi vc-oi-sun' => 'Sun' ),
array( 'vc-oi vc-oi-list' => 'List' ),
array( 'vc-oi vc-oi-left-circle' => 'Left-circle' ),
array( 'vc-oi vc-oi-mic' => 'Mic' ),
array( 'vc-oi vc-oi-trash' => 'Trash' ),
array( 'vc-oi vc-oi-quote-left' => 'Quote-left' ),
array( 'vc-oi vc-oi-plus-circle' => 'Plus-circle' ),
array( 'vc-oi vc-oi-minus' => 'Minus' ),
array( 'vc-oi vc-oi-quote-right' => 'Quote-right' ),
array( 'vc-oi vc-oi-trash-empty' => 'Trash-empty' ),
array( 'vc-oi vc-oi-volume-off' => 'Volume-off' ),
array( 'vc-oi vc-oi-right-circle' => 'Right-circle' ),
array( 'vc-oi vc-oi-list-nested' => 'List-nested' ),
array( 'vc-oi vc-oi-sun-inv' => 'Sun-inv' ),
array( 'vc-oi vc-oi-bat-empty' => 'Bat-empty' ),
array( 'vc-oi vc-oi-up-circle' => 'Up-circle' ),
array( 'vc-oi vc-oi-volume-up' => 'Volume-up' ),
array( 'vc-oi vc-oi-doc' => 'Doc' ),
array( 'vc-oi vc-oi-quote-left-alt' => 'Quote-left-alt' ),
array( 'vc-oi vc-oi-minus-circle' => 'Minus-circle' ),
array( 'vc-oi vc-oi-cloud' => 'Cloud' ),
array( 'vc-oi vc-oi-rain' => 'Rain' ),
array( 'vc-oi vc-oi-bat-half' => 'Bat-half' ),
array( 'vc-oi vc-oi-cw' => 'Cw' ),
array( 'vc-oi vc-oi-headphones' => 'Headphones' ),
array( 'vc-oi vc-oi-doc-inv' => 'Doc-inv' ),
array( 'vc-oi vc-oi-quote-right-alt' => 'Quote-right-alt' ),
array( 'vc-oi vc-oi-help' => 'Help' ),
array( 'vc-oi vc-oi-info' => 'Info' ),
array( 'vc-oi vc-oi-pencil' => 'Pencil' ),
array( 'vc-oi vc-oi-doc-alt' => 'Doc-alt' ),
array( 'vc-oi vc-oi-clock' => 'Clock' ),
array( 'vc-oi vc-oi-loop' => 'Loop' ),
array( 'vc-oi vc-oi-bat-full' => 'Bat-full' ),
array( 'vc-oi vc-oi-flash' => 'Flash' ),
array( 'vc-oi vc-oi-moon' => 'Moon' ),
array( 'vc-oi vc-oi-bat-charge' => 'Bat-charge' ),
array( 'vc-oi vc-oi-loop-alt' => 'Loop-alt' ),
array( 'vc-oi vc-oi-lamp' => 'Lamp' ),
array( 'vc-oi vc-oi-doc-inv-alt' => 'Doc-inv-alt' ),
array( 'vc-oi vc-oi-pencil-neg' => 'Pencil-neg' ),
array( 'vc-oi vc-oi-home' => 'Home' ),
);
return array_merge( $icons, $openiconic_icons );
}
add_filter( 'vc_iconpicker-type-typicons', 'vc_iconpicker_type_typicons' );
/**
* Typicons icons from github.com/stephenhutchings/typicons.font
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_typicons( $icons ) {
$typicons_icons = array(
array( 'typcn typcn-adjust-brightness' => 'Adjust Brightness' ),
array( 'typcn typcn-adjust-contrast' => 'Adjust Contrast' ),
array( 'typcn typcn-anchor-outline' => 'Anchor Outline' ),
array( 'typcn typcn-anchor' => 'Anchor' ),
array( 'typcn typcn-archive' => 'Archive' ),
array( 'typcn typcn-arrow-back-outline' => 'Arrow Back Outline' ),
array( 'typcn typcn-arrow-back' => 'Arrow Back' ),
array( 'typcn typcn-arrow-down-outline' => 'Arrow Down Outline' ),
array( 'typcn typcn-arrow-down-thick' => 'Arrow Down Thick' ),
array( 'typcn typcn-arrow-down' => 'Arrow Down' ),
array( 'typcn typcn-arrow-forward-outline' => 'Arrow Forward Outline' ),
array( 'typcn typcn-arrow-forward' => 'Arrow Forward' ),
array( 'typcn typcn-arrow-left-outline' => 'Arrow Left Outline' ),
array( 'typcn typcn-arrow-left-thick' => 'Arrow Left Thick' ),
array( 'typcn typcn-arrow-left' => 'Arrow Left' ),
array( 'typcn typcn-arrow-loop-outline' => 'Arrow Loop Outline' ),
array( 'typcn typcn-arrow-loop' => 'Arrow Loop' ),
array( 'typcn typcn-arrow-maximise-outline' => 'Arrow Maximise Outline' ),
array( 'typcn typcn-arrow-maximise' => 'Arrow Maximise' ),
array( 'typcn typcn-arrow-minimise-outline' => 'Arrow Minimise Outline' ),
array( 'typcn typcn-arrow-minimise' => 'Arrow Minimise' ),
array( 'typcn typcn-arrow-move-outline' => 'Arrow Move Outline' ),
array( 'typcn typcn-arrow-move' => 'Arrow Move' ),
array( 'typcn typcn-arrow-repeat-outline' => 'Arrow Repeat Outline' ),
array( 'typcn typcn-arrow-repeat' => 'Arrow Repeat' ),
array( 'typcn typcn-arrow-right-outline' => 'Arrow Right Outline' ),
array( 'typcn typcn-arrow-right-thick' => 'Arrow Right Thick' ),
array( 'typcn typcn-arrow-right' => 'Arrow Right' ),
array( 'typcn typcn-arrow-shuffle' => 'Arrow Shuffle' ),
array( 'typcn typcn-arrow-sorted-down' => 'Arrow Sorted Down' ),
array( 'typcn typcn-arrow-sorted-up' => 'Arrow Sorted Up' ),
array( 'typcn typcn-arrow-sync-outline' => 'Arrow Sync Outline' ),
array( 'typcn typcn-arrow-sync' => 'Arrow Sync' ),
array( 'typcn typcn-arrow-unsorted' => 'Arrow Unsorted' ),
array( 'typcn typcn-arrow-up-outline' => 'Arrow Up Outline' ),
array( 'typcn typcn-arrow-up-thick' => 'Arrow Up Thick' ),
array( 'typcn typcn-arrow-up' => 'Arrow Up' ),
array( 'typcn typcn-at' => 'At' ),
array( 'typcn typcn-attachment-outline' => 'Attachment Outline' ),
array( 'typcn typcn-attachment' => 'Attachment' ),
array( 'typcn typcn-backspace-outline' => 'Backspace Outline' ),
array( 'typcn typcn-backspace' => 'Backspace' ),
array( 'typcn typcn-battery-charge' => 'Battery Charge' ),
array( 'typcn typcn-battery-full' => 'Battery Full' ),
array( 'typcn typcn-battery-high' => 'Battery High' ),
array( 'typcn typcn-battery-low' => 'Battery Low' ),
array( 'typcn typcn-battery-mid' => 'Battery Mid' ),
array( 'typcn typcn-beaker' => 'Beaker' ),
array( 'typcn typcn-beer' => 'Beer' ),
array( 'typcn typcn-bell' => 'Bell' ),
array( 'typcn typcn-book' => 'Book' ),
array( 'typcn typcn-bookmark' => 'Bookmark' ),
array( 'typcn typcn-briefcase' => 'Briefcase' ),
array( 'typcn typcn-brush' => 'Brush' ),
array( 'typcn typcn-business-card' => 'Business Card' ),
array( 'typcn typcn-calculator' => 'Calculator' ),
array( 'typcn typcn-calendar-outline' => 'Calendar Outline' ),
array( 'typcn typcn-calendar' => 'Calendar' ),
array( 'typcn typcn-camera-outline' => 'Camera Outline' ),
array( 'typcn typcn-camera' => 'Camera' ),
array( 'typcn typcn-cancel-outline' => 'Cancel Outline' ),
array( 'typcn typcn-cancel' => 'Cancel' ),
array( 'typcn typcn-chart-area-outline' => 'Chart Area Outline' ),
array( 'typcn typcn-chart-area' => 'Chart Area' ),
array( 'typcn typcn-chart-bar-outline' => 'Chart Bar Outline' ),
array( 'typcn typcn-chart-bar' => 'Chart Bar' ),
array( 'typcn typcn-chart-line-outline' => 'Chart Line Outline' ),
array( 'typcn typcn-chart-line' => 'Chart Line' ),
array( 'typcn typcn-chart-pie-outline' => 'Chart Pie Outline' ),
array( 'typcn typcn-chart-pie' => 'Chart Pie' ),
array( 'typcn typcn-chevron-left-outline' => 'Chevron Left Outline' ),
array( 'typcn typcn-chevron-left' => 'Chevron Left' ),
array( 'typcn typcn-chevron-right-outline' => 'Chevron Right Outline' ),
array( 'typcn typcn-chevron-right' => 'Chevron Right' ),
array( 'typcn typcn-clipboard' => 'Clipboard' ),
array( 'typcn typcn-cloud-storage' => 'Cloud Storage' ),
array( 'typcn typcn-cloud-storage-outline' => 'Cloud Storage Outline' ),
array( 'typcn typcn-code-outline' => 'Code Outline' ),
array( 'typcn typcn-code' => 'Code' ),
array( 'typcn typcn-coffee' => 'Coffee' ),
array( 'typcn typcn-cog-outline' => 'Cog Outline' ),
array( 'typcn typcn-cog' => 'Cog' ),
array( 'typcn typcn-compass' => 'Compass' ),
array( 'typcn typcn-contacts' => 'Contacts' ),
array( 'typcn typcn-credit-card' => 'Credit Card' ),
array( 'typcn typcn-css3' => 'Css3' ),
array( 'typcn typcn-database' => 'Database' ),
array( 'typcn typcn-delete-outline' => 'Delete Outline' ),
array( 'typcn typcn-delete' => 'Delete' ),
array( 'typcn typcn-device-desktop' => 'Device Desktop' ),
array( 'typcn typcn-device-laptop' => 'Device Laptop' ),
array( 'typcn typcn-device-phone' => 'Device Phone' ),
array( 'typcn typcn-device-tablet' => 'Device Tablet' ),
array( 'typcn typcn-directions' => 'Directions' ),
array( 'typcn typcn-divide-outline' => 'Divide Outline' ),
array( 'typcn typcn-divide' => 'Divide' ),
array( 'typcn typcn-document-add' => 'Document Add' ),
array( 'typcn typcn-document-delete' => 'Document Delete' ),
array( 'typcn typcn-document-text' => 'Document Text' ),
array( 'typcn typcn-document' => 'Document' ),
array( 'typcn typcn-download-outline' => 'Download Outline' ),
array( 'typcn typcn-download' => 'Download' ),
array( 'typcn typcn-dropbox' => 'Dropbox' ),
array( 'typcn typcn-edit' => 'Edit' ),
array( 'typcn typcn-eject-outline' => 'Eject Outline' ),
array( 'typcn typcn-eject' => 'Eject' ),
array( 'typcn typcn-equals-outline' => 'Equals Outline' ),
array( 'typcn typcn-equals' => 'Equals' ),
array( 'typcn typcn-export-outline' => 'Export Outline' ),
array( 'typcn typcn-export' => 'Export' ),
array( 'typcn typcn-eye-outline' => 'Eye Outline' ),
array( 'typcn typcn-eye' => 'Eye' ),
array( 'typcn typcn-feather' => 'Feather' ),
array( 'typcn typcn-film' => 'Film' ),
array( 'typcn typcn-filter' => 'Filter' ),
array( 'typcn typcn-flag-outline' => 'Flag Outline' ),
array( 'typcn typcn-flag' => 'Flag' ),
array( 'typcn typcn-flash-outline' => 'Flash Outline' ),
array( 'typcn typcn-flash' => 'Flash' ),
array( 'typcn typcn-flow-children' => 'Flow Children' ),
array( 'typcn typcn-flow-merge' => 'Flow Merge' ),
array( 'typcn typcn-flow-parallel' => 'Flow Parallel' ),
array( 'typcn typcn-flow-switch' => 'Flow Switch' ),
array( 'typcn typcn-folder-add' => 'Folder Add' ),
array( 'typcn typcn-folder-delete' => 'Folder Delete' ),
array( 'typcn typcn-folder-open' => 'Folder Open' ),
array( 'typcn typcn-folder' => 'Folder' ),
array( 'typcn typcn-gift' => 'Gift' ),
array( 'typcn typcn-globe-outline' => 'Globe Outline' ),
array( 'typcn typcn-globe' => 'Globe' ),
array( 'typcn typcn-group-outline' => 'Group Outline' ),
array( 'typcn typcn-group' => 'Group' ),
array( 'typcn typcn-headphones' => 'Headphones' ),
array( 'typcn typcn-heart-full-outline' => 'Heart Full Outline' ),
array( 'typcn typcn-heart-half-outline' => 'Heart Half Outline' ),
array( 'typcn typcn-heart-outline' => 'Heart Outline' ),
array( 'typcn typcn-heart' => 'Heart' ),
array( 'typcn typcn-home-outline' => 'Home Outline' ),
array( 'typcn typcn-home' => 'Home' ),
array( 'typcn typcn-html5' => 'Html5' ),
array( 'typcn typcn-image-outline' => 'Image Outline' ),
array( 'typcn typcn-image' => 'Image' ),
array( 'typcn typcn-infinity-outline' => 'Infinity Outline' ),
array( 'typcn typcn-infinity' => 'Infinity' ),
array( 'typcn typcn-info-large-outline' => 'Info Large Outline' ),
array( 'typcn typcn-info-large' => 'Info Large' ),
array( 'typcn typcn-info-outline' => 'Info Outline' ),
array( 'typcn typcn-info' => 'Info' ),
array( 'typcn typcn-input-checked-outline' => 'Input Checked Outline' ),
array( 'typcn typcn-input-checked' => 'Input Checked' ),
array( 'typcn typcn-key-outline' => 'Key Outline' ),
array( 'typcn typcn-key' => 'Key' ),
array( 'typcn typcn-keyboard' => 'Keyboard' ),
array( 'typcn typcn-leaf' => 'Leaf' ),
array( 'typcn typcn-lightbulb' => 'Lightbulb' ),
array( 'typcn typcn-link-outline' => 'Link Outline' ),
array( 'typcn typcn-link' => 'Link' ),
array( 'typcn typcn-location-arrow-outline' => 'Location Arrow Outline' ),
array( 'typcn typcn-location-arrow' => 'Location Arrow' ),
array( 'typcn typcn-location-outline' => 'Location Outline' ),
array( 'typcn typcn-location' => 'Location' ),
array( 'typcn typcn-lock-closed-outline' => 'Lock Closed Outline' ),
array( 'typcn typcn-lock-closed' => 'Lock Closed' ),
array( 'typcn typcn-lock-open-outline' => 'Lock Open Outline' ),
array( 'typcn typcn-lock-open' => 'Lock Open' ),
array( 'typcn typcn-mail' => 'Mail' ),
array( 'typcn typcn-map' => 'Map' ),
array( 'typcn typcn-media-eject-outline' => 'Media Eject Outline' ),
array( 'typcn typcn-media-eject' => 'Media Eject' ),
array( 'typcn typcn-media-fast-forward-outline' => 'Media Fast Forward Outline' ),
array( 'typcn typcn-media-fast-forward' => 'Media Fast Forward' ),
array( 'typcn typcn-media-pause-outline' => 'Media Pause Outline' ),
array( 'typcn typcn-media-pause' => 'Media Pause' ),
array( 'typcn typcn-media-play-outline' => 'Media Play Outline' ),
array( 'typcn typcn-media-play-reverse-outline' => 'Media Play Reverse Outline' ),
array( 'typcn typcn-media-play-reverse' => 'Media Play Reverse' ),
array( 'typcn typcn-media-play' => 'Media Play' ),
array( 'typcn typcn-media-record-outline' => 'Media Record Outline' ),
array( 'typcn typcn-media-record' => 'Media Record' ),
array( 'typcn typcn-media-rewind-outline' => 'Media Rewind Outline' ),
array( 'typcn typcn-media-rewind' => 'Media Rewind' ),
array( 'typcn typcn-media-stop-outline' => 'Media Stop Outline' ),
array( 'typcn typcn-media-stop' => 'Media Stop' ),
array( 'typcn typcn-message-typing' => 'Message Typing' ),
array( 'typcn typcn-message' => 'Message' ),
array( 'typcn typcn-messages' => 'Messages' ),
array( 'typcn typcn-microphone-outline' => 'Microphone Outline' ),
array( 'typcn typcn-microphone' => 'Microphone' ),
array( 'typcn typcn-minus-outline' => 'Minus Outline' ),
array( 'typcn typcn-minus' => 'Minus' ),
array( 'typcn typcn-mortar-board' => 'Mortar Board' ),
array( 'typcn typcn-news' => 'News' ),
array( 'typcn typcn-notes-outline' => 'Notes Outline' ),
array( 'typcn typcn-notes' => 'Notes' ),
array( 'typcn typcn-pen' => 'Pen' ),
array( 'typcn typcn-pencil' => 'Pencil' ),
array( 'typcn typcn-phone-outline' => 'Phone Outline' ),
array( 'typcn typcn-phone' => 'Phone' ),
array( 'typcn typcn-pi-outline' => 'Pi Outline' ),
array( 'typcn typcn-pi' => 'Pi' ),
array( 'typcn typcn-pin-outline' => 'Pin Outline' ),
array( 'typcn typcn-pin' => 'Pin' ),
array( 'typcn typcn-pipette' => 'Pipette' ),
array( 'typcn typcn-plane-outline' => 'Plane Outline' ),
array( 'typcn typcn-plane' => 'Plane' ),
array( 'typcn typcn-plug' => 'Plug' ),
array( 'typcn typcn-plus-outline' => 'Plus Outline' ),
array( 'typcn typcn-plus' => 'Plus' ),
array( 'typcn typcn-point-of-interest-outline' => 'Point Of Interest Outline' ),
array( 'typcn typcn-point-of-interest' => 'Point Of Interest' ),
array( 'typcn typcn-power-outline' => 'Power Outline' ),
array( 'typcn typcn-power' => 'Power' ),
array( 'typcn typcn-printer' => 'Printer' ),
array( 'typcn typcn-puzzle-outline' => 'Puzzle Outline' ),
array( 'typcn typcn-puzzle' => 'Puzzle' ),
array( 'typcn typcn-radar-outline' => 'Radar Outline' ),
array( 'typcn typcn-radar' => 'Radar' ),
array( 'typcn typcn-refresh-outline' => 'Refresh Outline' ),
array( 'typcn typcn-refresh' => 'Refresh' ),
array( 'typcn typcn-rss-outline' => 'Rss Outline' ),
array( 'typcn typcn-rss' => 'Rss' ),
array( 'typcn typcn-scissors-outline' => 'Scissors Outline' ),
array( 'typcn typcn-scissors' => 'Scissors' ),
array( 'typcn typcn-shopping-bag' => 'Shopping Bag' ),
array( 'typcn typcn-shopping-cart' => 'Shopping Cart' ),
array( 'typcn typcn-social-at-circular' => 'Social At Circular' ),
array( 'typcn typcn-social-dribbble-circular' => 'Social Dribbble Circular' ),
array( 'typcn typcn-social-dribbble' => 'Social Dribbble' ),
array( 'typcn typcn-social-facebook-circular' => 'Social Facebook Circular' ),
array( 'typcn typcn-social-facebook' => 'Social Facebook' ),
array( 'typcn typcn-social-flickr-circular' => 'Social Flickr Circular' ),
array( 'typcn typcn-social-flickr' => 'Social Flickr' ),
array( 'typcn typcn-social-github-circular' => 'Social Github Circular' ),
array( 'typcn typcn-social-github' => 'Social Github' ),
array( 'typcn typcn-social-google-plus-circular' => 'Social Google Plus Circular' ),
array( 'typcn typcn-social-google-plus' => 'Social Google Plus' ),
array( 'typcn typcn-social-instagram-circular' => 'Social Instagram Circular' ),
array( 'typcn typcn-social-instagram' => 'Social Instagram' ),
array( 'typcn typcn-social-last-fm-circular' => 'Social Last Fm Circular' ),
array( 'typcn typcn-social-last-fm' => 'Social Last Fm' ),
array( 'typcn typcn-social-linkedin-circular' => 'Social Linkedin Circular' ),
array( 'typcn typcn-social-linkedin' => 'Social Linkedin' ),
array( 'typcn typcn-social-pinterest-circular' => 'Social Pinterest Circular' ),
array( 'typcn typcn-social-pinterest' => 'Social Pinterest' ),
array( 'typcn typcn-social-skype-outline' => 'Social Skype Outline' ),
array( 'typcn typcn-social-skype' => 'Social Skype' ),
array( 'typcn typcn-social-tumbler-circular' => 'Social Tumbler Circular' ),
array( 'typcn typcn-social-tumbler' => 'Social Tumbler' ),
array( 'typcn typcn-social-twitter-circular' => 'Social Twitter Circular' ),
array( 'typcn typcn-social-twitter' => 'Social Twitter' ),
array( 'typcn typcn-social-vimeo-circular' => 'Social Vimeo Circular' ),
array( 'typcn typcn-social-vimeo' => 'Social Vimeo' ),
array( 'typcn typcn-social-youtube-circular' => 'Social Youtube Circular' ),
array( 'typcn typcn-social-youtube' => 'Social Youtube' ),
array( 'typcn typcn-sort-alphabetically-outline' => 'Sort Alphabetically Outline' ),
array( 'typcn typcn-sort-alphabetically' => 'Sort Alphabetically' ),
array( 'typcn typcn-sort-numerically-outline' => 'Sort Numerically Outline' ),
array( 'typcn typcn-sort-numerically' => 'Sort Numerically' ),
array( 'typcn typcn-spanner-outline' => 'Spanner Outline' ),
array( 'typcn typcn-spanner' => 'Spanner' ),
array( 'typcn typcn-spiral' => 'Spiral' ),
array( 'typcn typcn-star-full-outline' => 'Star Full Outline' ),
array( 'typcn typcn-star-half-outline' => 'Star Half Outline' ),
array( 'typcn typcn-star-half' => 'Star Half' ),
array( 'typcn typcn-star-outline' => 'Star Outline' ),
array( 'typcn typcn-star' => 'Star' ),
array( 'typcn typcn-starburst-outline' => 'Starburst Outline' ),
array( 'typcn typcn-starburst' => 'Starburst' ),
array( 'typcn typcn-stopwatch' => 'Stopwatch' ),
array( 'typcn typcn-support' => 'Support' ),
array( 'typcn typcn-tabs-outline' => 'Tabs Outline' ),
array( 'typcn typcn-tag' => 'Tag' ),
array( 'typcn typcn-tags' => 'Tags' ),
array( 'typcn typcn-th-large-outline' => 'Th Large Outline' ),
array( 'typcn typcn-th-large' => 'Th Large' ),
array( 'typcn typcn-th-list-outline' => 'Th List Outline' ),
array( 'typcn typcn-th-list' => 'Th List' ),
array( 'typcn typcn-th-menu-outline' => 'Th Menu Outline' ),
array( 'typcn typcn-th-menu' => 'Th Menu' ),
array( 'typcn typcn-th-small-outline' => 'Th Small Outline' ),
array( 'typcn typcn-th-small' => 'Th Small' ),
array( 'typcn typcn-thermometer' => 'Thermometer' ),
array( 'typcn typcn-thumbs-down' => 'Thumbs Down' ),
array( 'typcn typcn-thumbs-ok' => 'Thumbs Ok' ),
array( 'typcn typcn-thumbs-up' => 'Thumbs Up' ),
array( 'typcn typcn-tick-outline' => 'Tick Outline' ),
array( 'typcn typcn-tick' => 'Tick' ),
array( 'typcn typcn-ticket' => 'Ticket' ),
array( 'typcn typcn-time' => 'Time' ),
array( 'typcn typcn-times-outline' => 'Times Outline' ),
array( 'typcn typcn-times' => 'Times' ),
array( 'typcn typcn-trash' => 'Trash' ),
array( 'typcn typcn-tree' => 'Tree' ),
array( 'typcn typcn-upload-outline' => 'Upload Outline' ),
array( 'typcn typcn-upload' => 'Upload' ),
array( 'typcn typcn-user-add-outline' => 'User Add Outline' ),
array( 'typcn typcn-user-add' => 'User Add' ),
array( 'typcn typcn-user-delete-outline' => 'User Delete Outline' ),
array( 'typcn typcn-user-delete' => 'User Delete' ),
array( 'typcn typcn-user-outline' => 'User Outline' ),
array( 'typcn typcn-user' => 'User' ),
array( 'typcn typcn-vendor-android' => 'Vendor Android' ),
array( 'typcn typcn-vendor-apple' => 'Vendor Apple' ),
array( 'typcn typcn-vendor-microsoft' => 'Vendor Microsoft' ),
array( 'typcn typcn-video-outline' => 'Video Outline' ),
array( 'typcn typcn-video' => 'Video' ),
array( 'typcn typcn-volume-down' => 'Volume Down' ),
array( 'typcn typcn-volume-mute' => 'Volume Mute' ),
array( 'typcn typcn-volume-up' => 'Volume Up' ),
array( 'typcn typcn-volume' => 'Volume' ),
array( 'typcn typcn-warning-outline' => 'Warning Outline' ),
array( 'typcn typcn-warning' => 'Warning' ),
array( 'typcn typcn-watch' => 'Watch' ),
array( 'typcn typcn-waves-outline' => 'Waves Outline' ),
array( 'typcn typcn-waves' => 'Waves' ),
array( 'typcn typcn-weather-cloudy' => 'Weather Cloudy' ),
array( 'typcn typcn-weather-downpour' => 'Weather Downpour' ),
array( 'typcn typcn-weather-night' => 'Weather Night' ),
array( 'typcn typcn-weather-partly-sunny' => 'Weather Partly Sunny' ),
array( 'typcn typcn-weather-shower' => 'Weather Shower' ),
array( 'typcn typcn-weather-snow' => 'Weather Snow' ),
array( 'typcn typcn-weather-stormy' => 'Weather Stormy' ),
array( 'typcn typcn-weather-sunny' => 'Weather Sunny' ),
array( 'typcn typcn-weather-windy-cloudy' => 'Weather Windy Cloudy' ),
array( 'typcn typcn-weather-windy' => 'Weather Windy' ),
array( 'typcn typcn-wi-fi-outline' => 'Wi Fi Outline' ),
array( 'typcn typcn-wi-fi' => 'Wi Fi' ),
array( 'typcn typcn-wine' => 'Wine' ),
array( 'typcn typcn-world-outline' => 'World Outline' ),
array( 'typcn typcn-world' => 'World' ),
array( 'typcn typcn-zoom-in-outline' => 'Zoom In Outline' ),
array( 'typcn typcn-zoom-in' => 'Zoom In' ),
array( 'typcn typcn-zoom-out-outline' => 'Zoom Out Outline' ),
array( 'typcn typcn-zoom-out' => 'Zoom Out' ),
array( 'typcn typcn-zoom-outline' => 'Zoom Outline' ),
array( 'typcn typcn-zoom' => 'Zoom' ),
);
return array_merge( $icons, $typicons_icons );
}
add_filter( 'vc_iconpicker-type-entypo', 'vc_iconpicker_type_entypo' );
/**
* Entypo icons from github.com/danielbruce/entypo
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_entypo( $icons ) {
$entypo_icons = array(
array( 'entypo-icon entypo-icon-note' => 'Note' ),
array( 'entypo-icon entypo-icon-note-beamed' => 'Note Beamed' ),
array( 'entypo-icon entypo-icon-music' => 'Music' ),
array( 'entypo-icon entypo-icon-search' => 'Search' ),
array( 'entypo-icon entypo-icon-flashlight' => 'Flashlight' ),
array( 'entypo-icon entypo-icon-mail' => 'Mail' ),
array( 'entypo-icon entypo-icon-heart' => 'Heart' ),
array( 'entypo-icon entypo-icon-heart-empty' => 'Heart Empty' ),
array( 'entypo-icon entypo-icon-star' => 'Star' ),
array( 'entypo-icon entypo-icon-star-empty' => 'Star Empty' ),
array( 'entypo-icon entypo-icon-user' => 'User' ),
array( 'entypo-icon entypo-icon-users' => 'Users' ),
array( 'entypo-icon entypo-icon-user-add' => 'User Add' ),
array( 'entypo-icon entypo-icon-video' => 'Video' ),
array( 'entypo-icon entypo-icon-picture' => 'Picture' ),
array( 'entypo-icon entypo-icon-camera' => 'Camera' ),
array( 'entypo-icon entypo-icon-layout' => 'Layout' ),
array( 'entypo-icon entypo-icon-menu' => 'Menu' ),
array( 'entypo-icon entypo-icon-check' => 'Check' ),
array( 'entypo-icon entypo-icon-cancel' => 'Cancel' ),
array( 'entypo-icon entypo-icon-cancel-circled' => 'Cancel Circled' ),
array( 'entypo-icon entypo-icon-cancel-squared' => 'Cancel Squared' ),
array( 'entypo-icon entypo-icon-plus' => 'Plus' ),
array( 'entypo-icon entypo-icon-plus-circled' => 'Plus Circled' ),
array( 'entypo-icon entypo-icon-plus-squared' => 'Plus Squared' ),
array( 'entypo-icon entypo-icon-minus' => 'Minus' ),
array( 'entypo-icon entypo-icon-minus-circled' => 'Minus Circled' ),
array( 'entypo-icon entypo-icon-minus-squared' => 'Minus Squared' ),
array( 'entypo-icon entypo-icon-help' => 'Help' ),
array( 'entypo-icon entypo-icon-help-circled' => 'Help Circled' ),
array( 'entypo-icon entypo-icon-info' => 'Info' ),
array( 'entypo-icon entypo-icon-info-circled' => 'Info Circled' ),
array( 'entypo-icon entypo-icon-back' => 'Back' ),
array( 'entypo-icon entypo-icon-home' => 'Home' ),
array( 'entypo-icon entypo-icon-link' => 'Link' ),
array( 'entypo-icon entypo-icon-attach' => 'Attach' ),
array( 'entypo-icon entypo-icon-lock' => 'Lock' ),
array( 'entypo-icon entypo-icon-lock-open' => 'Lock Open' ),
array( 'entypo-icon entypo-icon-eye' => 'Eye' ),
array( 'entypo-icon entypo-icon-tag' => 'Tag' ),
array( 'entypo-icon entypo-icon-bookmark' => 'Bookmark' ),
array( 'entypo-icon entypo-icon-bookmarks' => 'Bookmarks' ),
array( 'entypo-icon entypo-icon-flag' => 'Flag' ),
array( 'entypo-icon entypo-icon-thumbs-up' => 'Thumbs Up' ),
array( 'entypo-icon entypo-icon-thumbs-down' => 'Thumbs Down' ),
array( 'entypo-icon entypo-icon-download' => 'Download' ),
array( 'entypo-icon entypo-icon-upload' => 'Upload' ),
array( 'entypo-icon entypo-icon-upload-cloud' => 'Upload Cloud' ),
array( 'entypo-icon entypo-icon-reply' => 'Reply' ),
array( 'entypo-icon entypo-icon-reply-all' => 'Reply All' ),
array( 'entypo-icon entypo-icon-forward' => 'Forward' ),
array( 'entypo-icon entypo-icon-quote' => 'Quote' ),
array( 'entypo-icon entypo-icon-code' => 'Code' ),
array( 'entypo-icon entypo-icon-export' => 'Export' ),
array( 'entypo-icon entypo-icon-pencil' => 'Pencil' ),
array( 'entypo-icon entypo-icon-feather' => 'Feather' ),
array( 'entypo-icon entypo-icon-print' => 'Print' ),
array( 'entypo-icon entypo-icon-retweet' => 'Retweet' ),
array( 'entypo-icon entypo-icon-keyboard' => 'Keyboard' ),
array( 'entypo-icon entypo-icon-comment' => 'Comment' ),
array( 'entypo-icon entypo-icon-chat' => 'Chat' ),
array( 'entypo-icon entypo-icon-bell' => 'Bell' ),
array( 'entypo-icon entypo-icon-attention' => 'Attention' ),
array( 'entypo-icon entypo-icon-alert' => 'Alert' ),
array( 'entypo-icon entypo-icon-vcard' => 'Vcard' ),
array( 'entypo-icon entypo-icon-address' => 'Address' ),
array( 'entypo-icon entypo-icon-location' => 'Location' ),
array( 'entypo-icon entypo-icon-map' => 'Map' ),
array( 'entypo-icon entypo-icon-direction' => 'Direction' ),
array( 'entypo-icon entypo-icon-compass' => 'Compass' ),
array( 'entypo-icon entypo-icon-cup' => 'Cup' ),
array( 'entypo-icon entypo-icon-trash' => 'Trash' ),
array( 'entypo-icon entypo-icon-doc' => 'Doc' ),
array( 'entypo-icon entypo-icon-docs' => 'Docs' ),
array( 'entypo-icon entypo-icon-doc-landscape' => 'Doc Landscape' ),
array( 'entypo-icon entypo-icon-doc-text' => 'Doc Text' ),
array( 'entypo-icon entypo-icon-doc-text-inv' => 'Doc Text Inv' ),
array( 'entypo-icon entypo-icon-newspaper' => 'Newspaper' ),
array( 'entypo-icon entypo-icon-book-open' => 'Book Open' ),
array( 'entypo-icon entypo-icon-book' => 'Book' ),
array( 'entypo-icon entypo-icon-folder' => 'Folder' ),
array( 'entypo-icon entypo-icon-archive' => 'Archive' ),
array( 'entypo-icon entypo-icon-box' => 'Box' ),
array( 'entypo-icon entypo-icon-rss' => 'Rss' ),
array( 'entypo-icon entypo-icon-phone' => 'Phone' ),
array( 'entypo-icon entypo-icon-cog' => 'Cog' ),
array( 'entypo-icon entypo-icon-tools' => 'Tools' ),
array( 'entypo-icon entypo-icon-share' => 'Share' ),
array( 'entypo-icon entypo-icon-shareable' => 'Shareable' ),
array( 'entypo-icon entypo-icon-basket' => 'Basket' ),
array( 'entypo-icon entypo-icon-bag' => 'Bag' ),
array( 'entypo-icon entypo-icon-calendar' => 'Calendar' ),
array( 'entypo-icon entypo-icon-login' => 'Login' ),
array( 'entypo-icon entypo-icon-logout' => 'Logout' ),
array( 'entypo-icon entypo-icon-mic' => 'Mic' ),
array( 'entypo-icon entypo-icon-mute' => 'Mute' ),
array( 'entypo-icon entypo-icon-sound' => 'Sound' ),
array( 'entypo-icon entypo-icon-volume' => 'Volume' ),
array( 'entypo-icon entypo-icon-clock' => 'Clock' ),
array( 'entypo-icon entypo-icon-hourglass' => 'Hourglass' ),
array( 'entypo-icon entypo-icon-lamp' => 'Lamp' ),
array( 'entypo-icon entypo-icon-light-down' => 'Light Down' ),
array( 'entypo-icon entypo-icon-light-up' => 'Light Up' ),
array( 'entypo-icon entypo-icon-adjust' => 'Adjust' ),
array( 'entypo-icon entypo-icon-block' => 'Block' ),
array( 'entypo-icon entypo-icon-resize-full' => 'Resize Full' ),
array( 'entypo-icon entypo-icon-resize-small' => 'Resize Small' ),
array( 'entypo-icon entypo-icon-popup' => 'Popup' ),
array( 'entypo-icon entypo-icon-publish' => 'Publish' ),
array( 'entypo-icon entypo-icon-window' => 'Window' ),
array( 'entypo-icon entypo-icon-arrow-combo' => 'Arrow Combo' ),
array( 'entypo-icon entypo-icon-down-circled' => 'Down Circled' ),
array( 'entypo-icon entypo-icon-left-circled' => 'Left Circled' ),
array( 'entypo-icon entypo-icon-right-circled' => 'Right Circled' ),
array( 'entypo-icon entypo-icon-up-circled' => 'Up Circled' ),
array( 'entypo-icon entypo-icon-down-open' => 'Down Open' ),
array( 'entypo-icon entypo-icon-left-open' => 'Left Open' ),
array( 'entypo-icon entypo-icon-right-open' => 'Right Open' ),
array( 'entypo-icon entypo-icon-up-open' => 'Up Open' ),
array( 'entypo-icon entypo-icon-down-open-mini' => 'Down Open Mini' ),
array( 'entypo-icon entypo-icon-left-open-mini' => 'Left Open Mini' ),
array( 'entypo-icon entypo-icon-right-open-mini' => 'Right Open Mini' ),
array( 'entypo-icon entypo-icon-up-open-mini' => 'Up Open Mini' ),
array( 'entypo-icon entypo-icon-down-open-big' => 'Down Open Big' ),
array( 'entypo-icon entypo-icon-left-open-big' => 'Left Open Big' ),
array( 'entypo-icon entypo-icon-right-open-big' => 'Right Open Big' ),
array( 'entypo-icon entypo-icon-up-open-big' => 'Up Open Big' ),
array( 'entypo-icon entypo-icon-down' => 'Down' ),
array( 'entypo-icon entypo-icon-left' => 'Left' ),
array( 'entypo-icon entypo-icon-right' => 'Right' ),
array( 'entypo-icon entypo-icon-up' => 'Up' ),
array( 'entypo-icon entypo-icon-down-dir' => 'Down Dir' ),
array( 'entypo-icon entypo-icon-left-dir' => 'Left Dir' ),
array( 'entypo-icon entypo-icon-right-dir' => 'Right Dir' ),
array( 'entypo-icon entypo-icon-up-dir' => 'Up Dir' ),
array( 'entypo-icon entypo-icon-down-bold' => 'Down Bold' ),
array( 'entypo-icon entypo-icon-left-bold' => 'Left Bold' ),
array( 'entypo-icon entypo-icon-right-bold' => 'Right Bold' ),
array( 'entypo-icon entypo-icon-up-bold' => 'Up Bold' ),
array( 'entypo-icon entypo-icon-down-thin' => 'Down Thin' ),
array( 'entypo-icon entypo-icon-left-thin' => 'Left Thin' ),
array( 'entypo-icon entypo-icon-right-thin' => 'Right Thin' ),
array( 'entypo-icon entypo-icon-up-thin' => 'Up Thin' ),
array( 'entypo-icon entypo-icon-ccw' => 'Ccw' ),
array( 'entypo-icon entypo-icon-cw' => 'Cw' ),
array( 'entypo-icon entypo-icon-arrows-ccw' => 'Arrows Ccw' ),
array( 'entypo-icon entypo-icon-level-down' => 'Level Down' ),
array( 'entypo-icon entypo-icon-level-up' => 'Level Up' ),
array( 'entypo-icon entypo-icon-shuffle' => 'Shuffle' ),
array( 'entypo-icon entypo-icon-loop' => 'Loop' ),
array( 'entypo-icon entypo-icon-switch' => 'Switch' ),
array( 'entypo-icon entypo-icon-play' => 'Play' ),
array( 'entypo-icon entypo-icon-stop' => 'Stop' ),
array( 'entypo-icon entypo-icon-pause' => 'Pause' ),
array( 'entypo-icon entypo-icon-record' => 'Record' ),
array( 'entypo-icon entypo-icon-to-end' => 'To End' ),
array( 'entypo-icon entypo-icon-to-start' => 'To Start' ),
array( 'entypo-icon entypo-icon-fast-forward' => 'Fast Forward' ),
array( 'entypo-icon entypo-icon-fast-backward' => 'Fast Backward' ),
array( 'entypo-icon entypo-icon-progress-0' => 'Progress 0' ),
array( 'entypo-icon entypo-icon-progress-1' => 'Progress 1' ),
array( 'entypo-icon entypo-icon-progress-2' => 'Progress 2' ),
array( 'entypo-icon entypo-icon-progress-3' => 'Progress 3' ),
array( 'entypo-icon entypo-icon-target' => 'Target' ),
array( 'entypo-icon entypo-icon-palette' => 'Palette' ),
array( 'entypo-icon entypo-icon-list' => 'List' ),
array( 'entypo-icon entypo-icon-list-add' => 'List Add' ),
array( 'entypo-icon entypo-icon-signal' => 'Signal' ),
array( 'entypo-icon entypo-icon-trophy' => 'Trophy' ),
array( 'entypo-icon entypo-icon-battery' => 'Battery' ),
array( 'entypo-icon entypo-icon-back-in-time' => 'Back In Time' ),
array( 'entypo-icon entypo-icon-monitor' => 'Monitor' ),
array( 'entypo-icon entypo-icon-mobile' => 'Mobile' ),
array( 'entypo-icon entypo-icon-network' => 'Network' ),
array( 'entypo-icon entypo-icon-cd' => 'Cd' ),
array( 'entypo-icon entypo-icon-inbox' => 'Inbox' ),
array( 'entypo-icon entypo-icon-install' => 'Install' ),
array( 'entypo-icon entypo-icon-globe' => 'Globe' ),
array( 'entypo-icon entypo-icon-cloud' => 'Cloud' ),
array( 'entypo-icon entypo-icon-cloud-thunder' => 'Cloud Thunder' ),
array( 'entypo-icon entypo-icon-flash' => 'Flash' ),
array( 'entypo-icon entypo-icon-moon' => 'Moon' ),
array( 'entypo-icon entypo-icon-flight' => 'Flight' ),
array( 'entypo-icon entypo-icon-paper-plane' => 'Paper Plane' ),
array( 'entypo-icon entypo-icon-leaf' => 'Leaf' ),
array( 'entypo-icon entypo-icon-lifebuoy' => 'Lifebuoy' ),
array( 'entypo-icon entypo-icon-mouse' => 'Mouse' ),
array( 'entypo-icon entypo-icon-briefcase' => 'Briefcase' ),
array( 'entypo-icon entypo-icon-suitcase' => 'Suitcase' ),
array( 'entypo-icon entypo-icon-dot' => 'Dot' ),
array( 'entypo-icon entypo-icon-dot-2' => 'Dot 2' ),
array( 'entypo-icon entypo-icon-dot-3' => 'Dot 3' ),
array( 'entypo-icon entypo-icon-brush' => 'Brush' ),
array( 'entypo-icon entypo-icon-magnet' => 'Magnet' ),
array( 'entypo-icon entypo-icon-infinity' => 'Infinity' ),
array( 'entypo-icon entypo-icon-erase' => 'Erase' ),
array( 'entypo-icon entypo-icon-chart-pie' => 'Chart Pie' ),
array( 'entypo-icon entypo-icon-chart-line' => 'Chart Line' ),
array( 'entypo-icon entypo-icon-chart-bar' => 'Chart Bar' ),
array( 'entypo-icon entypo-icon-chart-area' => 'Chart Area' ),
array( 'entypo-icon entypo-icon-tape' => 'Tape' ),
array( 'entypo-icon entypo-icon-graduation-cap' => 'Graduation Cap' ),
array( 'entypo-icon entypo-icon-language' => 'Language' ),
array( 'entypo-icon entypo-icon-ticket' => 'Ticket' ),
array( 'entypo-icon entypo-icon-water' => 'Water' ),
array( 'entypo-icon entypo-icon-droplet' => 'Droplet' ),
array( 'entypo-icon entypo-icon-air' => 'Air' ),
array( 'entypo-icon entypo-icon-credit-card' => 'Credit Card' ),
array( 'entypo-icon entypo-icon-floppy' => 'Floppy' ),
array( 'entypo-icon entypo-icon-clipboard' => 'Clipboard' ),
array( 'entypo-icon entypo-icon-megaphone' => 'Megaphone' ),
array( 'entypo-icon entypo-icon-database' => 'Database' ),
array( 'entypo-icon entypo-icon-drive' => 'Drive' ),
array( 'entypo-icon entypo-icon-bucket' => 'Bucket' ),
array( 'entypo-icon entypo-icon-thermometer' => 'Thermometer' ),
array( 'entypo-icon entypo-icon-key' => 'Key' ),
array( 'entypo-icon entypo-icon-flow-cascade' => 'Flow Cascade' ),
array( 'entypo-icon entypo-icon-flow-branch' => 'Flow Branch' ),
array( 'entypo-icon entypo-icon-flow-tree' => 'Flow Tree' ),
array( 'entypo-icon entypo-icon-flow-line' => 'Flow Line' ),
array( 'entypo-icon entypo-icon-flow-parallel' => 'Flow Parallel' ),
array( 'entypo-icon entypo-icon-rocket' => 'Rocket' ),
array( 'entypo-icon entypo-icon-gauge' => 'Gauge' ),
array( 'entypo-icon entypo-icon-traffic-cone' => 'Traffic Cone' ),
array( 'entypo-icon entypo-icon-cc' => 'Cc' ),
array( 'entypo-icon entypo-icon-cc-by' => 'Cc By' ),
array( 'entypo-icon entypo-icon-cc-nc' => 'Cc Nc' ),
array( 'entypo-icon entypo-icon-cc-nc-eu' => 'Cc Nc Eu' ),
array( 'entypo-icon entypo-icon-cc-nc-jp' => 'Cc Nc Jp' ),
array( 'entypo-icon entypo-icon-cc-sa' => 'Cc Sa' ),
array( 'entypo-icon entypo-icon-cc-nd' => 'Cc Nd' ),
array( 'entypo-icon entypo-icon-cc-pd' => 'Cc Pd' ),
array( 'entypo-icon entypo-icon-cc-zero' => 'Cc Zero' ),
array( 'entypo-icon entypo-icon-cc-share' => 'Cc Share' ),
array( 'entypo-icon entypo-icon-cc-remix' => 'Cc Remix' ),
array( 'entypo-icon entypo-icon-github' => 'Github' ),
array( 'entypo-icon entypo-icon-github-circled' => 'Github Circled' ),
array( 'entypo-icon entypo-icon-flickr' => 'Flickr' ),
array( 'entypo-icon entypo-icon-flickr-circled' => 'Flickr Circled' ),
array( 'entypo-icon entypo-icon-vimeo' => 'Vimeo' ),
array( 'entypo-icon entypo-icon-vimeo-circled' => 'Vimeo Circled' ),
array( 'entypo-icon entypo-icon-twitter' => 'Twitter' ),
array( 'entypo-icon entypo-icon-twitter-circled' => 'Twitter Circled' ),
array( 'entypo-icon entypo-icon-facebook' => 'Facebook' ),
array( 'entypo-icon entypo-icon-facebook-circled' => 'Facebook Circled' ),
array( 'entypo-icon entypo-icon-facebook-squared' => 'Facebook Squared' ),
array( 'entypo-icon entypo-icon-gplus' => 'Gplus' ),
array( 'entypo-icon entypo-icon-gplus-circled' => 'Gplus Circled' ),
array( 'entypo-icon entypo-icon-pinterest' => 'Pinterest' ),
array( 'entypo-icon entypo-icon-pinterest-circled' => 'Pinterest Circled' ),
array( 'entypo-icon entypo-icon-tumblr' => 'Tumblr' ),
array( 'entypo-icon entypo-icon-tumblr-circled' => 'Tumblr Circled' ),
array( 'entypo-icon entypo-icon-linkedin' => 'Linkedin' ),
array( 'entypo-icon entypo-icon-linkedin-circled' => 'Linkedin Circled' ),
array( 'entypo-icon entypo-icon-dribbble' => 'Dribbble' ),
array( 'entypo-icon entypo-icon-dribbble-circled' => 'Dribbble Circled' ),
array( 'entypo-icon entypo-icon-stumbleupon' => 'Stumbleupon' ),
array( 'entypo-icon entypo-icon-stumbleupon-circled' => 'Stumbleupon Circled' ),
array( 'entypo-icon entypo-icon-lastfm' => 'Lastfm' ),
array( 'entypo-icon entypo-icon-lastfm-circled' => 'Lastfm Circled' ),
array( 'entypo-icon entypo-icon-rdio' => 'Rdio' ),
array( 'entypo-icon entypo-icon-rdio-circled' => 'Rdio Circled' ),
array( 'entypo-icon entypo-icon-spotify' => 'Spotify' ),
array( 'entypo-icon entypo-icon-spotify-circled' => 'Spotify Circled' ),
array( 'entypo-icon entypo-icon-qq' => 'Qq' ),
array( 'entypo-icon entypo-icon-instagrem' => 'Instagrem' ),
array( 'entypo-icon entypo-icon-dropbox' => 'Dropbox' ),
array( 'entypo-icon entypo-icon-evernote' => 'Evernote' ),
array( 'entypo-icon entypo-icon-flattr' => 'Flattr' ),
array( 'entypo-icon entypo-icon-skype' => 'Skype' ),
array( 'entypo-icon entypo-icon-skype-circled' => 'Skype Circled' ),
array( 'entypo-icon entypo-icon-renren' => 'Renren' ),
array( 'entypo-icon entypo-icon-sina-weibo' => 'Sina Weibo' ),
array( 'entypo-icon entypo-icon-paypal' => 'Paypal' ),
array( 'entypo-icon entypo-icon-picasa' => 'Picasa' ),
array( 'entypo-icon entypo-icon-soundcloud' => 'Soundcloud' ),
array( 'entypo-icon entypo-icon-mixi' => 'Mixi' ),
array( 'entypo-icon entypo-icon-behance' => 'Behance' ),
array( 'entypo-icon entypo-icon-google-circles' => 'Google Circles' ),
array( 'entypo-icon entypo-icon-vkontakte' => 'Vkontakte' ),
array( 'entypo-icon entypo-icon-smashing' => 'Smashing' ),
array( 'entypo-icon entypo-icon-sweden' => 'Sweden' ),
array( 'entypo-icon entypo-icon-db-shape' => 'Db Shape' ),
array( 'entypo-icon entypo-icon-logo-db' => 'Logo Db' ),
);
return array_merge( $icons, $entypo_icons );
}
add_filter( 'vc_iconpicker-type-linecons', 'vc_iconpicker_type_linecons' );
/**
* Linecons icons from fontello.com
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_linecons( $icons ) {
$linecons_icons = array(
array( 'vc_li vc_li-heart' => 'Heart' ),
array( 'vc_li vc_li-cloud' => 'Cloud' ),
array( 'vc_li vc_li-star' => 'Star' ),
array( 'vc_li vc_li-tv' => 'Tv' ),
array( 'vc_li vc_li-sound' => 'Sound' ),
array( 'vc_li vc_li-video' => 'Video' ),
array( 'vc_li vc_li-trash' => 'Trash' ),
array( 'vc_li vc_li-user' => 'User' ),
array( 'vc_li vc_li-key' => 'Key' ),
array( 'vc_li vc_li-search' => 'Search' ),
array( 'vc_li vc_li-settings' => 'Settings' ),
array( 'vc_li vc_li-camera' => 'Camera' ),
array( 'vc_li vc_li-tag' => 'Tag' ),
array( 'vc_li vc_li-lock' => 'Lock' ),
array( 'vc_li vc_li-bulb' => 'Bulb' ),
array( 'vc_li vc_li-pen' => 'Pen' ),
array( 'vc_li vc_li-diamond' => 'Diamond' ),
array( 'vc_li vc_li-display' => 'Display' ),
array( 'vc_li vc_li-location' => 'Location' ),
array( 'vc_li vc_li-eye' => 'Eye' ),
array( 'vc_li vc_li-bubble' => 'Bubble' ),
array( 'vc_li vc_li-stack' => 'Stack' ),
array( 'vc_li vc_li-cup' => 'Cup' ),
array( 'vc_li vc_li-phone' => 'Phone' ),
array( 'vc_li vc_li-news' => 'News' ),
array( 'vc_li vc_li-mail' => 'Mail' ),
array( 'vc_li vc_li-like' => 'Like' ),
array( 'vc_li vc_li-photo' => 'Photo' ),
array( 'vc_li vc_li-note' => 'Note' ),
array( 'vc_li vc_li-clock' => 'Clock' ),
array( 'vc_li vc_li-paperplane' => 'Paperplane' ),
array( 'vc_li vc_li-params' => 'Params' ),
array( 'vc_li vc_li-banknote' => 'Banknote' ),
array( 'vc_li vc_li-data' => 'Data' ),
array( 'vc_li vc_li-music' => 'Music' ),
array( 'vc_li vc_li-megaphone' => 'Megaphone' ),
array( 'vc_li vc_li-study' => 'Study' ),
array( 'vc_li vc_li-lab' => 'Lab' ),
array( 'vc_li vc_li-food' => 'Food' ),
array( 'vc_li vc_li-t-shirt' => 'T Shirt' ),
array( 'vc_li vc_li-fire' => 'Fire' ),
array( 'vc_li vc_li-clip' => 'Clip' ),
array( 'vc_li vc_li-shop' => 'Shop' ),
array( 'vc_li vc_li-calendar' => 'Calendar' ),
array( 'vc_li vc_li-vallet' => 'Vallet' ),
array( 'vc_li vc_li-vynil' => 'Vynil' ),
array( 'vc_li vc_li-truck' => 'Truck' ),
array( 'vc_li vc_li-world' => 'World' ),
);
return array_merge( $icons, $linecons_icons );
}
add_filter( 'vc_iconpicker-type-monosocial', 'vc_iconpicker_type_monosocial' );
/**
* monosocial icons from drinchev.github.io/monosocialiconsfont
*
* @param $icons - taken from filter - vc_map param field settings['source']
* provided icons (default empty array). If array categorized it will
* auto-enable category dropdown
*
* @return array - of icons for iconpicker, can be categorized, or not.
* @since 4.4
*/
function vc_iconpicker_type_monosocial( $icons ) {
$monosocial = array(
array( 'vc-mono vc-mono-fivehundredpx' => 'Five Hundred px' ),
array( 'vc-mono vc-mono-aboutme' => 'About me' ),
array( 'vc-mono vc-mono-addme' => 'Add me' ),
array( 'vc-mono vc-mono-amazon' => 'Amazon' ),
array( 'vc-mono vc-mono-aol' => 'Aol' ),
array( 'vc-mono vc-mono-appstorealt' => 'App-store-alt' ),
array( 'vc-mono vc-mono-appstore' => 'Appstore' ),
array( 'vc-mono vc-mono-apple' => 'Apple' ),
array( 'vc-mono vc-mono-bebo' => 'Bebo' ),
array( 'vc-mono vc-mono-behance' => 'Behance' ),
array( 'vc-mono vc-mono-bing' => 'Bing' ),
array( 'vc-mono vc-mono-blip' => 'Blip' ),
array( 'vc-mono vc-mono-blogger' => 'Blogger' ),
array( 'vc-mono vc-mono-coroflot' => 'Coroflot' ),
array( 'vc-mono vc-mono-daytum' => 'Daytum' ),
array( 'vc-mono vc-mono-delicious' => 'Delicious' ),
array( 'vc-mono vc-mono-designbump' => 'Design bump' ),
array( 'vc-mono vc-mono-designfloat' => 'Design float' ),
array( 'vc-mono vc-mono-deviantart' => 'Deviant-art' ),
array( 'vc-mono vc-mono-diggalt' => 'Digg-alt' ),
array( 'vc-mono vc-mono-digg' => 'Digg' ),
array( 'vc-mono vc-mono-dribble' => 'Dribble' ),
array( 'vc-mono vc-mono-drupal' => 'Drupal' ),
array( 'vc-mono vc-mono-ebay' => 'Ebay' ),
array( 'vc-mono vc-mono-email' => 'Email' ),
array( 'vc-mono vc-mono-emberapp' => 'Ember app' ),
array( 'vc-mono vc-mono-etsy' => 'Etsy' ),
array( 'vc-mono vc-mono-facebook' => 'Facebook' ),
array( 'vc-mono vc-mono-feedburner' => 'Feed burner' ),
array( 'vc-mono vc-mono-flickr' => 'Flickr' ),
array( 'vc-mono vc-mono-foodspotting' => 'Food spotting' ),
array( 'vc-mono vc-mono-forrst' => 'Forrst' ),
array( 'vc-mono vc-mono-foursquare' => 'Fours quare' ),
array( 'vc-mono vc-mono-friendsfeed' => 'Friends feed' ),
array( 'vc-mono vc-mono-friendstar' => 'Friend star' ),
array( 'vc-mono vc-mono-gdgt' => 'Gdgt' ),
array( 'vc-mono vc-mono-github' => 'Github' ),
array( 'vc-mono vc-mono-githubalt' => 'Github-alt' ),
array( 'vc-mono vc-mono-googlebuzz' => 'Google buzz' ),
array( 'vc-mono vc-mono-googleplus' => 'Google plus' ),
array( 'vc-mono vc-mono-googletalk' => 'Google talk' ),
array( 'vc-mono vc-mono-gowallapin' => 'Gowallapin' ),
array( 'vc-mono vc-mono-gowalla' => 'Gowalla' ),
array( 'vc-mono vc-mono-grooveshark' => 'Groove shark' ),
array( 'vc-mono vc-mono-heart' => 'Heart' ),
array( 'vc-mono vc-mono-hyves' => 'Hyves' ),
array( 'vc-mono vc-mono-icondock' => 'Icondock' ),
array( 'vc-mono vc-mono-icq' => 'Icq' ),
array( 'vc-mono vc-mono-identica' => 'Identica' ),
array( 'vc-mono vc-mono-imessage' => 'I message' ),
array( 'vc-mono vc-mono-itunes' => 'I-tunes' ),
array( 'vc-mono vc-mono-lastfm' => 'Lastfm' ),
array( 'vc-mono vc-mono-linkedin' => 'Linkedin' ),
array( 'vc-mono vc-mono-meetup' => 'Meetup' ),
array( 'vc-mono vc-mono-metacafe' => 'Metacafe' ),
array( 'vc-mono vc-mono-mixx' => 'Mixx' ),
array( 'vc-mono vc-mono-mobileme' => 'Mobile me' ),
array( 'vc-mono vc-mono-mrwong' => 'Mrwong' ),
array( 'vc-mono vc-mono-msn' => 'Msn' ),
array( 'vc-mono vc-mono-myspace' => 'Myspace' ),
array( 'vc-mono vc-mono-newsvine' => 'Newsvine' ),
array( 'vc-mono vc-mono-paypal' => 'Paypal' ),
array( 'vc-mono vc-mono-photobucket' => 'Photo bucket' ),
array( 'vc-mono vc-mono-picasa' => 'Picasa' ),
array( 'vc-mono vc-mono-pinterest' => 'Pinterest' ),
array( 'vc-mono vc-mono-podcast' => 'Podcast' ),
array( 'vc-mono vc-mono-posterous' => 'Posterous' ),
array( 'vc-mono vc-mono-qik' => 'Qik' ),
array( 'vc-mono vc-mono-quora' => 'Quora' ),
array( 'vc-mono vc-mono-reddit' => 'Reddit' ),
array( 'vc-mono vc-mono-retweet' => 'Retweet' ),
array( 'vc-mono vc-mono-rss' => 'Rss' ),
array( 'vc-mono vc-mono-scribd' => 'Scribd' ),
array( 'vc-mono vc-mono-sharethis' => 'Sharethis' ),
array( 'vc-mono vc-mono-skype' => 'Skype' ),
array( 'vc-mono vc-mono-slashdot' => 'Slashdot' ),
array( 'vc-mono vc-mono-slideshare' => 'Slideshare' ),
array( 'vc-mono vc-mono-smugmug' => 'Smugmug' ),
array( 'vc-mono vc-mono-soundcloud' => 'Soundcloud' ),
array( 'vc-mono vc-mono-spotify' => 'Spotify' ),
array( 'vc-mono vc-mono-squidoo' => 'Squidoo' ),
array( 'vc-mono vc-mono-stackoverflow' => 'Stackoverflow' ),
array( 'vc-mono vc-mono-star' => 'Star' ),
array( 'vc-mono vc-mono-stumbleupon' => 'Stumble upon' ),
array( 'vc-mono vc-mono-technorati' => 'Technorati' ),
array( 'vc-mono vc-mono-tumblr' => 'Tumblr' ),
array( 'vc-mono vc-mono-twitterbird' => 'Twitterbird' ),
array( 'vc-mono vc-mono-twitter' => 'Twitter' ),
array( 'vc-mono vc-mono-viddler' => 'Viddler' ),
array( 'vc-mono vc-mono-vimeo' => 'Vimeo' ),
array( 'vc-mono vc-mono-virb' => 'Virb' ),
array( 'vc-mono vc-mono-www' => 'Www' ),
array( 'vc-mono vc-mono-wikipedia' => 'Wikipedia' ),
array( 'vc-mono vc-mono-windows' => 'Windows' ),
array( 'vc-mono vc-mono-wordpress' => 'WordPress' ),
array( 'vc-mono vc-mono-xing' => 'Xing' ),
array( 'vc-mono vc-mono-yahoobuzz' => 'Yahoo buzz' ),
array( 'vc-mono vc-mono-yahoo' => 'Yahoo' ),
array( 'vc-mono vc-mono-yelp' => 'Yelp' ),
array( 'vc-mono vc-mono-youtube' => 'Youtube' ),
array( 'vc-mono vc-mono-instagram' => 'Instagram' ),
);
return array_merge( $icons, $monosocial );
}
add_filter( 'vc_iconpicker-type-material', 'vc_iconpicker_type_material' );
/**
* Material icon set from Google
* @param $icons
*
* @return array
* @since 5.0
*
*/
function vc_iconpicker_type_material( $icons ) {
$material = array(
array( 'vc-material vc-material-3d_rotation' => '3d rotation' ),
array( 'vc-material vc-material-ac_unit' => 'ac unit' ),
array( 'vc-material vc-material-alarm' => 'alarm' ),
array( 'vc-material vc-material-access_alarms' => 'access alarms' ),
array( 'vc-material vc-material-schedule' => 'schedule' ),
array( 'vc-material vc-material-accessibility' => 'accessibility' ),
array( 'vc-material vc-material-accessible' => 'accessible' ),
array( 'vc-material vc-material-account_balance' => 'account balance' ),
array( 'vc-material vc-material-account_balance_wallet' => 'account balance wallet' ),
array( 'vc-material vc-material-account_box' => 'account box' ),
array( 'vc-material vc-material-account_circle' => 'account circle' ),
array( 'vc-material vc-material-adb' => 'adb' ),
array( 'vc-material vc-material-add' => 'add' ),
array( 'vc-material vc-material-add_a_photo' => 'add a photo' ),
array( 'vc-material vc-material-alarm_add' => 'alarm add' ),
array( 'vc-material vc-material-add_alert' => 'add alert' ),
array( 'vc-material vc-material-add_box' => 'add box' ),
array( 'vc-material vc-material-add_circle' => 'add circle' ),
array( 'vc-material vc-material-control_point' => 'control point' ),
array( 'vc-material vc-material-add_location' => 'add location' ),
array( 'vc-material vc-material-add_shopping_cart' => 'add shopping cart' ),
array( 'vc-material vc-material-queue' => 'queue' ),
array( 'vc-material vc-material-add_to_queue' => 'add to queue' ),
array( 'vc-material vc-material-adjust' => 'adjust' ),
array( 'vc-material vc-material-airline_seat_flat' => 'airline seat flat' ),
array( 'vc-material vc-material-airline_seat_flat_angled' => 'airline seat flat angled' ),
array( 'vc-material vc-material-airline_seat_individual_suite' => 'airline seat individual suite' ),
array( 'vc-material vc-material-airline_seat_legroom_extra' => 'airline seat legroom extra' ),
array( 'vc-material vc-material-airline_seat_legroom_normal' => 'airline seat legroom normal' ),
array( 'vc-material vc-material-airline_seat_legroom_reduced' => 'airline seat legroom reduced' ),
array( 'vc-material vc-material-airline_seat_recline_extra' => 'airline seat recline extra' ),
array( 'vc-material vc-material-airline_seat_recline_normal' => 'airline seat recline normal' ),
array( 'vc-material vc-material-flight' => 'flight' ),
array( 'vc-material vc-material-airplanemode_inactive' => 'airplanemode inactive' ),
array( 'vc-material vc-material-airplay' => 'airplay' ),
array( 'vc-material vc-material-airport_shuttle' => 'airport shuttle' ),
array( 'vc-material vc-material-alarm_off' => 'alarm off' ),
array( 'vc-material vc-material-alarm_on' => 'alarm on' ),
array( 'vc-material vc-material-album' => 'album' ),
array( 'vc-material vc-material-all_inclusive' => 'all inclusive' ),
array( 'vc-material vc-material-all_out' => 'all out' ),
array( 'vc-material vc-material-android' => 'android' ),
array( 'vc-material vc-material-announcement' => 'announcement' ),
array( 'vc-material vc-material-apps' => 'apps' ),
array( 'vc-material vc-material-archive' => 'archive' ),
array( 'vc-material vc-material-arrow_back' => 'arrow back' ),
array( 'vc-material vc-material-arrow_downward' => 'arrow downward' ),
array( 'vc-material vc-material-arrow_drop_down' => 'arrow drop down' ),
array( 'vc-material vc-material-arrow_drop_down_circle' => 'arrow drop down circle' ),
array( 'vc-material vc-material-arrow_drop_up' => 'arrow drop up' ),
array( 'vc-material vc-material-arrow_forward' => 'arrow forward' ),
array( 'vc-material vc-material-arrow_upward' => 'arrow upward' ),
array( 'vc-material vc-material-art_track' => 'art track' ),
array( 'vc-material vc-material-aspect_ratio' => 'aspect ratio' ),
array( 'vc-material vc-material-poll' => 'poll' ),
array( 'vc-material vc-material-assignment' => 'assignment' ),
array( 'vc-material vc-material-assignment_ind' => 'assignment ind' ),
array( 'vc-material vc-material-assignment_late' => 'assignment late' ),
array( 'vc-material vc-material-assignment_return' => 'assignment return' ),
array( 'vc-material vc-material-assignment_returned' => 'assignment returned' ),
array( 'vc-material vc-material-assignment_turned_in' => 'assignment turned in' ),
array( 'vc-material vc-material-assistant' => 'assistant' ),
array( 'vc-material vc-material-flag' => 'flag' ),
array( 'vc-material vc-material-attach_file' => 'attach file' ),
array( 'vc-material vc-material-attach_money' => 'attach money' ),
array( 'vc-material vc-material-attachment' => 'attachment' ),
array( 'vc-material vc-material-audiotrack' => 'audiotrack' ),
array( 'vc-material vc-material-autorenew' => 'autorenew' ),
array( 'vc-material vc-material-av_timer' => 'av timer' ),
array( 'vc-material vc-material-backspace' => 'backspace' ),
array( 'vc-material vc-material-cloud_upload' => 'cloud upload' ),
array( 'vc-material vc-material-battery_alert' => 'battery alert' ),
array( 'vc-material vc-material-battery_charging_full' => 'battery charging full' ),
array( 'vc-material vc-material-battery_std' => 'battery std' ),
array( 'vc-material vc-material-battery_unknown' => 'battery unknown' ),
array( 'vc-material vc-material-beach_access' => 'beach access' ),
array( 'vc-material vc-material-beenhere' => 'beenhere' ),
array( 'vc-material vc-material-block' => 'block' ),
array( 'vc-material vc-material-bluetooth' => 'bluetooth' ),
array( 'vc-material vc-material-bluetooth_searching' => 'bluetooth searching' ),
array( 'vc-material vc-material-bluetooth_connected' => 'bluetooth connected' ),
array( 'vc-material vc-material-bluetooth_disabled' => 'bluetooth disabled' ),
array( 'vc-material vc-material-blur_circular' => 'blur circular' ),
array( 'vc-material vc-material-blur_linear' => 'blur linear' ),
array( 'vc-material vc-material-blur_off' => 'blur off' ),
array( 'vc-material vc-material-blur_on' => 'blur on' ),
array( 'vc-material vc-material-class' => 'class' ),
array( 'vc-material vc-material-turned_in' => 'turned in' ),
array( 'vc-material vc-material-turned_in_not' => 'turned in not' ),
array( 'vc-material vc-material-border_all' => 'border all' ),
array( 'vc-material vc-material-border_bottom' => 'border bottom' ),
array( 'vc-material vc-material-border_clear' => 'border clear' ),
array( 'vc-material vc-material-border_color' => 'border color' ),
array( 'vc-material vc-material-border_horizontal' => 'border horizontal' ),
array( 'vc-material vc-material-border_inner' => 'border inner' ),
array( 'vc-material vc-material-border_left' => 'border left' ),
array( 'vc-material vc-material-border_outer' => 'border outer' ),
array( 'vc-material vc-material-border_right' => 'border right' ),
array( 'vc-material vc-material-border_style' => 'border style' ),
array( 'vc-material vc-material-border_top' => 'border top' ),
array( 'vc-material vc-material-border_vertical' => 'border vertical' ),
array( 'vc-material vc-material-branding_watermark' => 'branding watermark' ),
array( 'vc-material vc-material-brightness_1' => 'brightness 1' ),
array( 'vc-material vc-material-brightness_2' => 'brightness 2' ),
array( 'vc-material vc-material-brightness_3' => 'brightness 3' ),
array( 'vc-material vc-material-brightness_4' => 'brightness 4' ),
array( 'vc-material vc-material-brightness_low' => 'brightness low' ),
array( 'vc-material vc-material-brightness_medium' => 'brightness medium' ),
array( 'vc-material vc-material-brightness_high' => 'brightness high' ),
array( 'vc-material vc-material-brightness_auto' => 'brightness auto' ),
array( 'vc-material vc-material-broken_image' => 'broken image' ),
array( 'vc-material vc-material-brush' => 'brush' ),
array( 'vc-material vc-material-bubble_chart' => 'bubble chart' ),
array( 'vc-material vc-material-bug_report' => 'bug report' ),
array( 'vc-material vc-material-build' => 'build' ),
array( 'vc-material vc-material-burst_mode' => 'burst mode' ),
array( 'vc-material vc-material-domain' => 'domain' ),
array( 'vc-material vc-material-business_center' => 'business center' ),
array( 'vc-material vc-material-cached' => 'cached' ),
array( 'vc-material vc-material-cake' => 'cake' ),
array( 'vc-material vc-material-phone' => 'phone' ),
array( 'vc-material vc-material-call_end' => 'call end' ),
array( 'vc-material vc-material-call_made' => 'call made' ),
array( 'vc-material vc-material-merge_type' => 'merge type' ),
array( 'vc-material vc-material-call_missed' => 'call missed' ),
array( 'vc-material vc-material-call_missed_outgoing' => 'call missed outgoing' ),
array( 'vc-material vc-material-call_received' => 'call received' ),
array( 'vc-material vc-material-call_split' => 'call split' ),
array( 'vc-material vc-material-call_to_action' => 'call to action' ),
array( 'vc-material vc-material-camera' => 'camera' ),
array( 'vc-material vc-material-photo_camera' => 'photo camera' ),
array( 'vc-material vc-material-camera_enhance' => 'camera enhance' ),
array( 'vc-material vc-material-camera_front' => 'camera front' ),
array( 'vc-material vc-material-camera_rear' => 'camera rear' ),
array( 'vc-material vc-material-camera_roll' => 'camera roll' ),
array( 'vc-material vc-material-cancel' => 'cancel' ),
array( 'vc-material vc-material-redeem' => 'redeem' ),
array( 'vc-material vc-material-card_membership' => 'card membership' ),
array( 'vc-material vc-material-card_travel' => 'card travel' ),
array( 'vc-material vc-material-casino' => 'casino' ),
array( 'vc-material vc-material-cast' => 'cast' ),
array( 'vc-material vc-material-cast_connected' => 'cast connected' ),
array( 'vc-material vc-material-center_focus_strong' => 'center focus strong' ),
array( 'vc-material vc-material-center_focus_weak' => 'center focus weak' ),
array( 'vc-material vc-material-change_history' => 'change history' ),
array( 'vc-material vc-material-chat' => 'chat' ),
array( 'vc-material vc-material-chat_bubble' => 'chat bubble' ),
array( 'vc-material vc-material-chat_bubble_outline' => 'chat bubble outline' ),
array( 'vc-material vc-material-check' => 'check' ),
array( 'vc-material vc-material-check_box' => 'check box' ),
array( 'vc-material vc-material-check_box_outline_blank' => 'check box outline blank' ),
array( 'vc-material vc-material-check_circle' => 'check circle' ),
array( 'vc-material vc-material-navigate_before' => 'navigate before' ),
array( 'vc-material vc-material-navigate_next' => 'navigate next' ),
array( 'vc-material vc-material-child_care' => 'child care' ),
array( 'vc-material vc-material-child_friendly' => 'child friendly' ),
array( 'vc-material vc-material-chrome_reader_mode' => 'chrome reader mode' ),
array( 'vc-material vc-material-close' => 'close' ),
array( 'vc-material vc-material-clear_all' => 'clear all' ),
array( 'vc-material vc-material-closed_caption' => 'closed caption' ),
array( 'vc-material vc-material-wb_cloudy' => 'wb cloudy' ),
array( 'vc-material vc-material-cloud_circle' => 'cloud circle' ),
array( 'vc-material vc-material-cloud_done' => 'cloud done' ),
array( 'vc-material vc-material-cloud_download' => 'cloud download' ),
array( 'vc-material vc-material-cloud_off' => 'cloud off' ),
array( 'vc-material vc-material-cloud_queue' => 'cloud queue' ),
array( 'vc-material vc-material-code' => 'code' ),
array( 'vc-material vc-material-photo_library' => 'photo library' ),
array( 'vc-material vc-material-collections_bookmark' => 'collections bookmark' ),
array( 'vc-material vc-material-palette' => 'palette' ),
array( 'vc-material vc-material-colorize' => 'colorize' ),
array( 'vc-material vc-material-comment' => 'comment' ),
array( 'vc-material vc-material-compare' => 'compare' ),
array( 'vc-material vc-material-compare_arrows' => 'compare arrows' ),
array( 'vc-material vc-material-laptop' => 'laptop' ),
array( 'vc-material vc-material-confirmation_number' => 'confirmation number' ),
array( 'vc-material vc-material-contact_mail' => 'contact mail' ),
array( 'vc-material vc-material-contact_phone' => 'contact phone' ),
array( 'vc-material vc-material-contacts' => 'contacts' ),
array( 'vc-material vc-material-content_copy' => 'content copy' ),
array( 'vc-material vc-material-content_cut' => 'content cut' ),
array( 'vc-material vc-material-content_paste' => 'content paste' ),
array( 'vc-material vc-material-control_point_duplicate' => 'control point duplicate' ),
array( 'vc-material vc-material-copyright' => 'copyright' ),
array( 'vc-material vc-material-mode_edit' => 'mode edit' ),
array( 'vc-material vc-material-create_new_folder' => 'create new folder' ),
array( 'vc-material vc-material-payment' => 'payment' ),
array( 'vc-material vc-material-crop' => 'crop' ),
array( 'vc-material vc-material-crop_16_9' => 'crop 16 9' ),
array( 'vc-material vc-material-crop_3_2' => 'crop 3 2' ),
array( 'vc-material vc-material-crop_landscape' => 'crop landscape' ),
array( 'vc-material vc-material-crop_7_5' => 'crop 7 5' ),
array( 'vc-material vc-material-crop_din' => 'crop din' ),
array( 'vc-material vc-material-crop_free' => 'crop free' ),
array( 'vc-material vc-material-crop_original' => 'crop original' ),
array( 'vc-material vc-material-crop_portrait' => 'crop portrait' ),
array( 'vc-material vc-material-crop_rotate' => 'crop rotate' ),
array( 'vc-material vc-material-crop_square' => 'crop square' ),
array( 'vc-material vc-material-dashboard' => 'dashboard' ),
array( 'vc-material vc-material-data_usage' => 'data usage' ),
array( 'vc-material vc-material-date_range' => 'date range' ),
array( 'vc-material vc-material-dehaze' => 'dehaze' ),
array( 'vc-material vc-material-delete' => 'delete' ),
array( 'vc-material vc-material-delete_forever' => 'delete forever' ),
array( 'vc-material vc-material-delete_sweep' => 'delete sweep' ),
array( 'vc-material vc-material-description' => 'description' ),
array( 'vc-material vc-material-desktop_mac' => 'desktop mac' ),
array( 'vc-material vc-material-desktop_windows' => 'desktop windows' ),
array( 'vc-material vc-material-details' => 'details' ),
array( 'vc-material vc-material-developer_board' => 'developer board' ),
array( 'vc-material vc-material-developer_mode' => 'developer mode' ),
array( 'vc-material vc-material-device_hub' => 'device hub' ),
array( 'vc-material vc-material-phonelink' => 'phonelink' ),
array( 'vc-material vc-material-devices_other' => 'devices other' ),
array( 'vc-material vc-material-dialer_sip' => 'dialer sip' ),
array( 'vc-material vc-material-dialpad' => 'dialpad' ),
array( 'vc-material vc-material-directions' => 'directions' ),
array( 'vc-material vc-material-directions_bike' => 'directions bike' ),
array( 'vc-material vc-material-directions_boat' => 'directions boat' ),
array( 'vc-material vc-material-directions_bus' => 'directions bus' ),
array( 'vc-material vc-material-directions_car' => 'directions car' ),
array( 'vc-material vc-material-directions_railway' => 'directions railway' ),
array( 'vc-material vc-material-directions_run' => 'directions run' ),
array( 'vc-material vc-material-directions_transit' => 'directions transit' ),
array( 'vc-material vc-material-directions_walk' => 'directions walk' ),
array( 'vc-material vc-material-disc_full' => 'disc full' ),
array( 'vc-material vc-material-dns' => 'dns' ),
array( 'vc-material vc-material-not_interested' => 'not interested' ),
array( 'vc-material vc-material-do_not_disturb_alt' => 'do not disturb alt' ),
array( 'vc-material vc-material-do_not_disturb_off' => 'do not disturb off' ),
array( 'vc-material vc-material-remove_circle' => 'remove circle' ),
array( 'vc-material vc-material-dock' => 'dock' ),
array( 'vc-material vc-material-done' => 'done' ),
array( 'vc-material vc-material-done_all' => 'done all' ),
array( 'vc-material vc-material-donut_large' => 'donut large' ),
array( 'vc-material vc-material-donut_small' => 'donut small' ),
array( 'vc-material vc-material-drafts' => 'drafts' ),
array( 'vc-material vc-material-drag_handle' => 'drag handle' ),
array( 'vc-material vc-material-time_to_leave' => 'time to leave' ),
array( 'vc-material vc-material-dvr' => 'dvr' ),
array( 'vc-material vc-material-edit_location' => 'edit location' ),
array( 'vc-material vc-material-eject' => 'eject' ),
array( 'vc-material vc-material-markunread' => 'markunread' ),
array( 'vc-material vc-material-enhanced_encryption' => 'enhanced encryption' ),
array( 'vc-material vc-material-equalizer' => 'equalizer' ),
array( 'vc-material vc-material-error' => 'error' ),
array( 'vc-material vc-material-error_outline' => 'error outline' ),
array( 'vc-material vc-material-euro_symbol' => 'euro symbol' ),
array( 'vc-material vc-material-ev_station' => 'ev station' ),
array( 'vc-material vc-material-insert_invitation' => 'insert invitation' ),
array( 'vc-material vc-material-event_available' => 'event available' ),
array( 'vc-material vc-material-event_busy' => 'event busy' ),
array( 'vc-material vc-material-event_note' => 'event note' ),
array( 'vc-material vc-material-event_seat' => 'event seat' ),
array( 'vc-material vc-material-exit_to_app' => 'exit to app' ),
array( 'vc-material vc-material-expand_less' => 'expand less' ),
array( 'vc-material vc-material-expand_more' => 'expand more' ),
array( 'vc-material vc-material-explicit' => 'explicit' ),
array( 'vc-material vc-material-explore' => 'explore' ),
array( 'vc-material vc-material-exposure' => 'exposure' ),
array( 'vc-material vc-material-exposure_neg_1' => 'exposure neg 1' ),
array( 'vc-material vc-material-exposure_neg_2' => 'exposure neg 2' ),
array( 'vc-material vc-material-exposure_plus_1' => 'exposure plus 1' ),
array( 'vc-material vc-material-exposure_plus_2' => 'exposure plus 2' ),
array( 'vc-material vc-material-exposure_zero' => 'exposure zero' ),
array( 'vc-material vc-material-extension' => 'extension' ),
array( 'vc-material vc-material-face' => 'face' ),
array( 'vc-material vc-material-fast_forward' => 'fast forward' ),
array( 'vc-material vc-material-fast_rewind' => 'fast rewind' ),
array( 'vc-material vc-material-favorite' => 'favorite' ),
array( 'vc-material vc-material-favorite_border' => 'favorite border' ),
array( 'vc-material vc-material-featured_play_list' => 'featured play list' ),
array( 'vc-material vc-material-featured_video' => 'featured video' ),
array( 'vc-material vc-material-sms_failed' => 'sms failed' ),
array( 'vc-material vc-material-fiber_dvr' => 'fiber dvr' ),
array( 'vc-material vc-material-fiber_manual_record' => 'fiber manual record' ),
array( 'vc-material vc-material-fiber_new' => 'fiber new' ),
array( 'vc-material vc-material-fiber_pin' => 'fiber pin' ),
array( 'vc-material vc-material-fiber_smart_record' => 'fiber smart record' ),
array( 'vc-material vc-material-get_app' => 'get app' ),
array( 'vc-material vc-material-file_upload' => 'file upload' ),
array( 'vc-material vc-material-filter' => 'filter' ),
array( 'vc-material vc-material-filter_1' => 'filter 1' ),
array( 'vc-material vc-material-filter_2' => 'filter 2' ),
array( 'vc-material vc-material-filter_3' => 'filter 3' ),
array( 'vc-material vc-material-filter_4' => 'filter 4' ),
array( 'vc-material vc-material-filter_5' => 'filter 5' ),
array( 'vc-material vc-material-filter_6' => 'filter 6' ),
array( 'vc-material vc-material-filter_7' => 'filter 7' ),
array( 'vc-material vc-material-filter_8' => 'filter 8' ),
array( 'vc-material vc-material-filter_9' => 'filter 9' ),
array( 'vc-material vc-material-filter_9_plus' => 'filter 9 plus' ),
array( 'vc-material vc-material-filter_b_and_w' => 'filter b and w' ),
array( 'vc-material vc-material-filter_center_focus' => 'filter center focus' ),
array( 'vc-material vc-material-filter_drama' => 'filter drama' ),
array( 'vc-material vc-material-filter_frames' => 'filter frames' ),
array( 'vc-material vc-material-terrain' => 'terrain' ),
array( 'vc-material vc-material-filter_list' => 'filter list' ),
array( 'vc-material vc-material-filter_none' => 'filter none' ),
array( 'vc-material vc-material-filter_tilt_shift' => 'filter tilt shift' ),
array( 'vc-material vc-material-filter_vintage' => 'filter vintage' ),
array( 'vc-material vc-material-find_in_page' => 'find in page' ),
array( 'vc-material vc-material-find_replace' => 'find replace' ),
array( 'vc-material vc-material-fingerprint' => 'fingerprint' ),
array( 'vc-material vc-material-first_page' => 'first page' ),
array( 'vc-material vc-material-fitness_center' => 'fitness center' ),
array( 'vc-material vc-material-flare' => 'flare' ),
array( 'vc-material vc-material-flash_auto' => 'flash auto' ),
array( 'vc-material vc-material-flash_off' => 'flash off' ),
array( 'vc-material vc-material-flash_on' => 'flash on' ),
array( 'vc-material vc-material-flight_land' => 'flight land' ),
array( 'vc-material vc-material-flight_takeoff' => 'flight takeoff' ),
array( 'vc-material vc-material-flip' => 'flip' ),
array( 'vc-material vc-material-flip_to_back' => 'flip to back' ),
array( 'vc-material vc-material-flip_to_front' => 'flip to front' ),
array( 'vc-material vc-material-folder' => 'folder' ),
array( 'vc-material vc-material-folder_open' => 'folder open' ),
array( 'vc-material vc-material-folder_shared' => 'folder shared' ),
array( 'vc-material vc-material-folder_special' => 'folder special' ),
array( 'vc-material vc-material-font_download' => 'font download' ),
array( 'vc-material vc-material-format_align_center' => 'format align center' ),
array( 'vc-material vc-material-format_align_justify' => 'format align justify' ),
array( 'vc-material vc-material-format_align_left' => 'format align left' ),
array( 'vc-material vc-material-format_align_right' => 'format align right' ),
array( 'vc-material vc-material-format_bold' => 'format bold' ),
array( 'vc-material vc-material-format_clear' => 'format clear' ),
array( 'vc-material vc-material-format_color_fill' => 'format color fill' ),
array( 'vc-material vc-material-format_color_reset' => 'format color reset' ),
array( 'vc-material vc-material-format_color_text' => 'format color text' ),
array( 'vc-material vc-material-format_indent_decrease' => 'format indent decrease' ),
array( 'vc-material vc-material-format_indent_increase' => 'format indent increase' ),
array( 'vc-material vc-material-format_italic' => 'format italic' ),
array( 'vc-material vc-material-format_line_spacing' => 'format line spacing' ),
array( 'vc-material vc-material-format_list_bulleted' => 'format list bulleted' ),
array( 'vc-material vc-material-format_list_numbered' => 'format list numbered' ),
array( 'vc-material vc-material-format_paint' => 'format paint' ),
array( 'vc-material vc-material-format_quote' => 'format quote' ),
array( 'vc-material vc-material-format_shapes' => 'format shapes' ),
array( 'vc-material vc-material-format_size' => 'format size' ),
array( 'vc-material vc-material-format_strikethrough' => 'format strikethrough' ),
array( 'vc-material vc-material-format_textdirection_l_to_r' => 'format textdirection l to r' ),
array( 'vc-material vc-material-format_textdirection_r_to_l' => 'format textdirection r to l' ),
array( 'vc-material vc-material-format_underlined' => 'format underlined' ),
array( 'vc-material vc-material-question_answer' => 'question answer' ),
array( 'vc-material vc-material-forward' => 'forward' ),
array( 'vc-material vc-material-forward_10' => 'forward 10' ),
array( 'vc-material vc-material-forward_30' => 'forward 30' ),
array( 'vc-material vc-material-forward_5' => 'forward 5' ),
array( 'vc-material vc-material-free_breakfast' => 'free breakfast' ),
array( 'vc-material vc-material-fullscreen' => 'fullscreen' ),
array( 'vc-material vc-material-fullscreen_exit' => 'fullscreen exit' ),
array( 'vc-material vc-material-functions' => 'functions' ),
array( 'vc-material vc-material-g_translate' => 'g translate' ),
array( 'vc-material vc-material-games' => 'games' ),
array( 'vc-material vc-material-gavel' => 'gavel' ),
array( 'vc-material vc-material-gesture' => 'gesture' ),
array( 'vc-material vc-material-gif' => 'gif' ),
array( 'vc-material vc-material-goat' => 'goat' ),
array( 'vc-material vc-material-golf_course' => 'golf course' ),
array( 'vc-material vc-material-my_location' => 'my location' ),
array( 'vc-material vc-material-location_searching' => 'location searching' ),
array( 'vc-material vc-material-location_disabled' => 'location disabled' ),
array( 'vc-material vc-material-star' => 'star' ),
array( 'vc-material vc-material-gradient' => 'gradient' ),
array( 'vc-material vc-material-grain' => 'grain' ),
array( 'vc-material vc-material-graphic_eq' => 'graphic eq' ),
array( 'vc-material vc-material-grid_off' => 'grid off' ),
array( 'vc-material vc-material-grid_on' => 'grid on' ),
array( 'vc-material vc-material-people' => 'people' ),
array( 'vc-material vc-material-group_add' => 'group add' ),
array( 'vc-material vc-material-group_work' => 'group work' ),
array( 'vc-material vc-material-hd' => 'hd' ),
array( 'vc-material vc-material-hdr_off' => 'hdr off' ),
array( 'vc-material vc-material-hdr_on' => 'hdr on' ),
array( 'vc-material vc-material-hdr_strong' => 'hdr strong' ),
array( 'vc-material vc-material-hdr_weak' => 'hdr weak' ),
array( 'vc-material vc-material-headset' => 'headset' ),
array( 'vc-material vc-material-headset_mic' => 'headset mic' ),
array( 'vc-material vc-material-healing' => 'healing' ),
array( 'vc-material vc-material-hearing' => 'hearing' ),
array( 'vc-material vc-material-help' => 'help' ),
array( 'vc-material vc-material-help_outline' => 'help outline' ),
array( 'vc-material vc-material-high_quality' => 'high quality' ),
array( 'vc-material vc-material-highlight' => 'highlight' ),
array( 'vc-material vc-material-highlight_off' => 'highlight off' ),
array( 'vc-material vc-material-restore' => 'restore' ),
array( 'vc-material vc-material-home' => 'home' ),
array( 'vc-material vc-material-hot_tub' => 'hot tub' ),
array( 'vc-material vc-material-local_hotel' => 'local hotel' ),
array( 'vc-material vc-material-hourglass_empty' => 'hourglass empty' ),
array( 'vc-material vc-material-hourglass_full' => 'hourglass full' ),
array( 'vc-material vc-material-http' => 'http' ),
array( 'vc-material vc-material-lock' => 'lock' ),
array( 'vc-material vc-material-photo' => 'photo' ),
array( 'vc-material vc-material-image_aspect_ratio' => 'image aspect ratio' ),
array( 'vc-material vc-material-import_contacts' => 'import contacts' ),
array( 'vc-material vc-material-import_export' => 'import export' ),
array( 'vc-material vc-material-important_devices' => 'important devices' ),
array( 'vc-material vc-material-inbox' => 'inbox' ),
array( 'vc-material vc-material-indeterminate_check_box' => 'indeterminate check box' ),
array( 'vc-material vc-material-info' => 'info' ),
array( 'vc-material vc-material-info_outline' => 'info outline' ),
array( 'vc-material vc-material-input' => 'input' ),
array( 'vc-material vc-material-insert_comment' => 'insert comment' ),
array( 'vc-material vc-material-insert_drive_file' => 'insert drive file' ),
array( 'vc-material vc-material-tag_faces' => 'tag faces' ),
array( 'vc-material vc-material-link' => 'link' ),
array( 'vc-material vc-material-invert_colors' => 'invert colors' ),
array( 'vc-material vc-material-invert_colors_off' => 'invert colors off' ),
array( 'vc-material vc-material-iso' => 'iso' ),
array( 'vc-material vc-material-keyboard' => 'keyboard' ),
array( 'vc-material vc-material-keyboard_arrow_down' => 'keyboard arrow down' ),
array( 'vc-material vc-material-keyboard_arrow_left' => 'keyboard arrow left' ),
array( 'vc-material vc-material-keyboard_arrow_right' => 'keyboard arrow right' ),
array( 'vc-material vc-material-keyboard_arrow_up' => 'keyboard arrow up' ),
array( 'vc-material vc-material-keyboard_backspace' => 'keyboard backspace' ),
array( 'vc-material vc-material-keyboard_capslock' => 'keyboard capslock' ),
array( 'vc-material vc-material-keyboard_hide' => 'keyboard hide' ),
array( 'vc-material vc-material-keyboard_return' => 'keyboard return' ),
array( 'vc-material vc-material-keyboard_tab' => 'keyboard tab' ),
array( 'vc-material vc-material-keyboard_voice' => 'keyboard voice' ),
array( 'vc-material vc-material-kitchen' => 'kitchen' ),
array( 'vc-material vc-material-label' => 'label' ),
array( 'vc-material vc-material-label_outline' => 'label outline' ),
array( 'vc-material vc-material-language' => 'language' ),
array( 'vc-material vc-material-laptop_chromebook' => 'laptop chromebook' ),
array( 'vc-material vc-material-laptop_mac' => 'laptop mac' ),
array( 'vc-material vc-material-laptop_windows' => 'laptop windows' ),
array( 'vc-material vc-material-last_page' => 'last page' ),
array( 'vc-material vc-material-open_in_new' => 'open in new' ),
array( 'vc-material vc-material-layers' => 'layers' ),
array( 'vc-material vc-material-layers_clear' => 'layers clear' ),
array( 'vc-material vc-material-leak_add' => 'leak add' ),
array( 'vc-material vc-material-leak_remove' => 'leak remove' ),
array( 'vc-material vc-material-lens' => 'lens' ),
array( 'vc-material vc-material-library_books' => 'library books' ),
array( 'vc-material vc-material-library_music' => 'library music' ),
array( 'vc-material vc-material-lightbulb_outline' => 'lightbulb outline' ),
array( 'vc-material vc-material-line_style' => 'line style' ),
array( 'vc-material vc-material-line_weight' => 'line weight' ),
array( 'vc-material vc-material-linear_scale' => 'linear scale' ),
array( 'vc-material vc-material-linked_camera' => 'linked camera' ),
array( 'vc-material vc-material-list' => 'list' ),
array( 'vc-material vc-material-live_help' => 'live help' ),
array( 'vc-material vc-material-live_tv' => 'live tv' ),
array( 'vc-material vc-material-local_play' => 'local play' ),
array( 'vc-material vc-material-local_airport' => 'local airport' ),
array( 'vc-material vc-material-local_atm' => 'local atm' ),
array( 'vc-material vc-material-local_bar' => 'local bar' ),
array( 'vc-material vc-material-local_cafe' => 'local cafe' ),
array( 'vc-material vc-material-local_car_wash' => 'local car wash' ),
array( 'vc-material vc-material-local_convenience_store' => 'local convenience store' ),
array( 'vc-material vc-material-restaurant_menu' => 'restaurant menu' ),
array( 'vc-material vc-material-local_drink' => 'local drink' ),
array( 'vc-material vc-material-local_florist' => 'local florist' ),
array( 'vc-material vc-material-local_gas_station' => 'local gas station' ),
array( 'vc-material vc-material-shopping_cart' => 'shopping cart' ),
array( 'vc-material vc-material-local_hospital' => 'local hospital' ),
array( 'vc-material vc-material-local_laundry_service' => 'local laundry service' ),
array( 'vc-material vc-material-local_library' => 'local library' ),
array( 'vc-material vc-material-local_mall' => 'local mall' ),
array( 'vc-material vc-material-theaters' => 'theaters' ),
array( 'vc-material vc-material-local_offer' => 'local offer' ),
array( 'vc-material vc-material-local_parking' => 'local parking' ),
array( 'vc-material vc-material-local_pharmacy' => 'local pharmacy' ),
array( 'vc-material vc-material-local_pizza' => 'local pizza' ),
array( 'vc-material vc-material-print' => 'print' ),
array( 'vc-material vc-material-local_shipping' => 'local shipping' ),
array( 'vc-material vc-material-local_taxi' => 'local taxi' ),
array( 'vc-material vc-material-location_city' => 'location city' ),
array( 'vc-material vc-material-location_off' => 'location off' ),
array( 'vc-material vc-material-room' => 'room' ),
array( 'vc-material vc-material-lock_open' => 'lock open' ),
array( 'vc-material vc-material-lock_outline' => 'lock outline' ),
array( 'vc-material vc-material-looks' => 'looks' ),
array( 'vc-material vc-material-looks_3' => 'looks 3' ),
array( 'vc-material vc-material-looks_4' => 'looks 4' ),
array( 'vc-material vc-material-looks_5' => 'looks 5' ),
array( 'vc-material vc-material-looks_6' => 'looks 6' ),
array( 'vc-material vc-material-looks_one' => 'looks one' ),
array( 'vc-material vc-material-looks_two' => 'looks two' ),
array( 'vc-material vc-material-sync' => 'sync' ),
array( 'vc-material vc-material-loupe' => 'loupe' ),
array( 'vc-material vc-material-low_priority' => 'low priority' ),
array( 'vc-material vc-material-loyalty' => 'loyalty' ),
array( 'vc-material vc-material-mail_outline' => 'mail outline' ),
array( 'vc-material vc-material-map' => 'map' ),
array( 'vc-material vc-material-markunread_mailbox' => 'markunread mailbox' ),
array( 'vc-material vc-material-memory' => 'memory' ),
array( 'vc-material vc-material-menu' => 'menu' ),
array( 'vc-material vc-material-message' => 'message' ),
array( 'vc-material vc-material-mic' => 'mic' ),
array( 'vc-material vc-material-mic_none' => 'mic none' ),
array( 'vc-material vc-material-mic_off' => 'mic off' ),
array( 'vc-material vc-material-mms' => 'mms' ),
array( 'vc-material vc-material-mode_comment' => 'mode comment' ),
array( 'vc-material vc-material-monetization_on' => 'monetization on' ),
array( 'vc-material vc-material-money_off' => 'money off' ),
array( 'vc-material vc-material-monochrome_photos' => 'monochrome photos' ),
array( 'vc-material vc-material-mood_bad' => 'mood bad' ),
array( 'vc-material vc-material-more' => 'more' ),
array( 'vc-material vc-material-more_horiz' => 'more horiz' ),
array( 'vc-material vc-material-more_vert' => 'more vert' ),
array( 'vc-material vc-material-motorcycle' => 'motorcycle' ),
array( 'vc-material vc-material-mouse' => 'mouse' ),
array( 'vc-material vc-material-move_to_inbox' => 'move to inbox' ),
array( 'vc-material vc-material-movie_creation' => 'movie creation' ),
array( 'vc-material vc-material-movie_filter' => 'movie filter' ),
array( 'vc-material vc-material-multiline_chart' => 'multiline chart' ),
array( 'vc-material vc-material-music_note' => 'music note' ),
array( 'vc-material vc-material-music_video' => 'music video' ),
array( 'vc-material vc-material-nature' => 'nature' ),
array( 'vc-material vc-material-nature_people' => 'nature people' ),
array( 'vc-material vc-material-navigation' => 'navigation' ),
array( 'vc-material vc-material-near_me' => 'near me' ),
array( 'vc-material vc-material-network_cell' => 'network cell' ),
array( 'vc-material vc-material-network_check' => 'network check' ),
array( 'vc-material vc-material-network_locked' => 'network locked' ),
array( 'vc-material vc-material-network_wifi' => 'network wifi' ),
array( 'vc-material vc-material-new_releases' => 'new releases' ),
array( 'vc-material vc-material-next_week' => 'next week' ),
array( 'vc-material vc-material-nfc' => 'nfc' ),
array( 'vc-material vc-material-no_encryption' => 'no encryption' ),
array( 'vc-material vc-material-signal_cellular_no_sim' => 'signal cellular no sim' ),
array( 'vc-material vc-material-note' => 'note' ),
array( 'vc-material vc-material-note_add' => 'note add' ),
array( 'vc-material vc-material-notifications' => 'notifications' ),
array( 'vc-material vc-material-notifications_active' => 'notifications active' ),
array( 'vc-material vc-material-notifications_none' => 'notifications none' ),
array( 'vc-material vc-material-notifications_off' => 'notifications off' ),
array( 'vc-material vc-material-notifications_paused' => 'notifications paused' ),
array( 'vc-material vc-material-offline_pin' => 'offline pin' ),
array( 'vc-material vc-material-ondemand_video' => 'ondemand video' ),
array( 'vc-material vc-material-opacity' => 'opacity' ),
array( 'vc-material vc-material-open_in_browser' => 'open in browser' ),
array( 'vc-material vc-material-open_with' => 'open with' ),
array( 'vc-material vc-material-pages' => 'pages' ),
array( 'vc-material vc-material-pageview' => 'pageview' ),
array( 'vc-material vc-material-pan_tool' => 'pan tool' ),
array( 'vc-material vc-material-panorama' => 'panorama' ),
array( 'vc-material vc-material-radio_button_unchecked' => 'radio button unchecked' ),
array( 'vc-material vc-material-panorama_horizontal' => 'panorama horizontal' ),
array( 'vc-material vc-material-panorama_vertical' => 'panorama vertical' ),
array( 'vc-material vc-material-panorama_wide_angle' => 'panorama wide angle' ),
array( 'vc-material vc-material-party_mode' => 'party mode' ),
array( 'vc-material vc-material-pause' => 'pause' ),
array( 'vc-material vc-material-pause_circle_filled' => 'pause circle filled' ),
array( 'vc-material vc-material-pause_circle_outline' => 'pause circle outline' ),
array( 'vc-material vc-material-people_outline' => 'people outline' ),
array( 'vc-material vc-material-perm_camera_mic' => 'perm camera mic' ),
array( 'vc-material vc-material-perm_contact_calendar' => 'perm contact calendar' ),
array( 'vc-material vc-material-perm_data_setting' => 'perm data setting' ),
array( 'vc-material vc-material-perm_device_information' => 'perm device information' ),
array( 'vc-material vc-material-person_outline' => 'person outline' ),
array( 'vc-material vc-material-perm_media' => 'perm media' ),
array( 'vc-material vc-material-perm_phone_msg' => 'perm phone msg' ),
array( 'vc-material vc-material-perm_scan_wifi' => 'perm scan wifi' ),
array( 'vc-material vc-material-person' => 'person' ),
array( 'vc-material vc-material-person_add' => 'person add' ),
array( 'vc-material vc-material-person_pin' => 'person pin' ),
array( 'vc-material vc-material-person_pin_circle' => 'person pin circle' ),
array( 'vc-material vc-material-personal_video' => 'personal video' ),
array( 'vc-material vc-material-pets' => 'pets' ),
array( 'vc-material vc-material-phone_android' => 'phone android' ),
array( 'vc-material vc-material-phone_bluetooth_speaker' => 'phone bluetooth speaker' ),
array( 'vc-material vc-material-phone_forwarded' => 'phone forwarded' ),
array( 'vc-material vc-material-phone_in_talk' => 'phone in talk' ),
array( 'vc-material vc-material-phone_iphone' => 'phone iphone' ),
array( 'vc-material vc-material-phone_locked' => 'phone locked' ),
array( 'vc-material vc-material-phone_missed' => 'phone missed' ),
array( 'vc-material vc-material-phone_paused' => 'phone paused' ),
array( 'vc-material vc-material-phonelink_erase' => 'phonelink erase' ),
array( 'vc-material vc-material-phonelink_lock' => 'phonelink lock' ),
array( 'vc-material vc-material-phonelink_off' => 'phonelink off' ),
array( 'vc-material vc-material-phonelink_ring' => 'phonelink ring' ),
array( 'vc-material vc-material-phonelink_setup' => 'phonelink setup' ),
array( 'vc-material vc-material-photo_album' => 'photo album' ),
array( 'vc-material vc-material-photo_filter' => 'photo filter' ),
array( 'vc-material vc-material-photo_size_select_actual' => 'photo size select actual' ),
array( 'vc-material vc-material-photo_size_select_large' => 'photo size select large' ),
array( 'vc-material vc-material-photo_size_select_small' => 'photo size select small' ),
array( 'vc-material vc-material-picture_as_pdf' => 'picture as pdf' ),
array( 'vc-material vc-material-picture_in_picture' => 'picture in picture' ),
array( 'vc-material vc-material-picture_in_picture_alt' => 'picture in picture alt' ),
array( 'vc-material vc-material-pie_chart' => 'pie chart' ),
array( 'vc-material vc-material-pie_chart_outlined' => 'pie chart outlined' ),
array( 'vc-material vc-material-pin_drop' => 'pin drop' ),
array( 'vc-material vc-material-play_arrow' => 'play arrow' ),
array( 'vc-material vc-material-play_circle_filled' => 'play circle filled' ),
array( 'vc-material vc-material-play_circle_outline' => 'play circle outline' ),
array( 'vc-material vc-material-play_for_work' => 'play for work' ),
array( 'vc-material vc-material-playlist_add' => 'playlist add' ),
array( 'vc-material vc-material-playlist_add_check' => 'playlist add check' ),
array( 'vc-material vc-material-playlist_play' => 'playlist play' ),
array( 'vc-material vc-material-plus_one' => 'plus one' ),
array( 'vc-material vc-material-polymer' => 'polymer' ),
array( 'vc-material vc-material-pool' => 'pool' ),
array( 'vc-material vc-material-portable_wifi_off' => 'portable wifi off' ),
array( 'vc-material vc-material-portrait' => 'portrait' ),
array( 'vc-material vc-material-power' => 'power' ),
array( 'vc-material vc-material-power_input' => 'power input' ),
array( 'vc-material vc-material-power_settings_new' => 'power settings new' ),
array( 'vc-material vc-material-pregnant_woman' => 'pregnant woman' ),
array( 'vc-material vc-material-present_to_all' => 'present to all' ),
array( 'vc-material vc-material-priority_high' => 'priority high' ),
array( 'vc-material vc-material-public' => 'public' ),
array( 'vc-material vc-material-publish' => 'publish' ),
array( 'vc-material vc-material-queue_music' => 'queue music' ),
array( 'vc-material vc-material-queue_play_next' => 'queue play next' ),
array( 'vc-material vc-material-radio' => 'radio' ),
array( 'vc-material vc-material-radio_button_checked' => 'radio button checked' ),
array( 'vc-material vc-material-rate_review' => 'rate review' ),
array( 'vc-material vc-material-receipt' => 'receipt' ),
array( 'vc-material vc-material-recent_actors' => 'recent actors' ),
array( 'vc-material vc-material-record_voice_over' => 'record voice over' ),
array( 'vc-material vc-material-redo' => 'redo' ),
array( 'vc-material vc-material-refresh' => 'refresh' ),
array( 'vc-material vc-material-remove' => 'remove' ),
array( 'vc-material vc-material-remove_circle_outline' => 'remove circle outline' ),
array( 'vc-material vc-material-remove_from_queue' => 'remove from queue' ),
array( 'vc-material vc-material-visibility' => 'visibility' ),
array( 'vc-material vc-material-remove_shopping_cart' => 'remove shopping cart' ),
array( 'vc-material vc-material-reorder' => 'reorder' ),
array( 'vc-material vc-material-repeat' => 'repeat' ),
array( 'vc-material vc-material-repeat_one' => 'repeat one' ),
array( 'vc-material vc-material-replay' => 'replay' ),
array( 'vc-material vc-material-replay_10' => 'replay 10' ),
array( 'vc-material vc-material-replay_30' => 'replay 30' ),
array( 'vc-material vc-material-replay_5' => 'replay 5' ),
array( 'vc-material vc-material-reply' => 'reply' ),
array( 'vc-material vc-material-reply_all' => 'reply all' ),
array( 'vc-material vc-material-report' => 'report' ),
array( 'vc-material vc-material-warning' => 'warning' ),
array( 'vc-material vc-material-restaurant' => 'restaurant' ),
array( 'vc-material vc-material-restore_page' => 'restore page' ),
array( 'vc-material vc-material-ring_volume' => 'ring volume' ),
array( 'vc-material vc-material-room_service' => 'room service' ),
array( 'vc-material vc-material-rotate_90_degrees_ccw' => 'rotate 90 degrees ccw' ),
array( 'vc-material vc-material-rotate_left' => 'rotate left' ),
array( 'vc-material vc-material-rotate_right' => 'rotate right' ),
array( 'vc-material vc-material-rounded_corner' => 'rounded corner' ),
array( 'vc-material vc-material-router' => 'router' ),
array( 'vc-material vc-material-rowing' => 'rowing' ),
array( 'vc-material vc-material-rss_feed' => 'rss feed' ),
array( 'vc-material vc-material-rv_hookup' => 'rv hookup' ),
array( 'vc-material vc-material-satellite' => 'satellite' ),
array( 'vc-material vc-material-save' => 'save' ),
array( 'vc-material vc-material-scanner' => 'scanner' ),
array( 'vc-material vc-material-school' => 'school' ),
array( 'vc-material vc-material-screen_lock_landscape' => 'screen lock landscape' ),
array( 'vc-material vc-material-screen_lock_portrait' => 'screen lock portrait' ),
array( 'vc-material vc-material-screen_lock_rotation' => 'screen lock rotation' ),
array( 'vc-material vc-material-screen_rotation' => 'screen rotation' ),
array( 'vc-material vc-material-screen_share' => 'screen share' ),
array( 'vc-material vc-material-sd_storage' => 'sd storage' ),
array( 'vc-material vc-material-search' => 'search' ),
array( 'vc-material vc-material-security' => 'security' ),
array( 'vc-material vc-material-select_all' => 'select all' ),
array( 'vc-material vc-material-send' => 'send' ),
array( 'vc-material vc-material-sentiment_dissatisfied' => 'sentiment dissatisfied' ),
array( 'vc-material vc-material-sentiment_neutral' => 'sentiment neutral' ),
array( 'vc-material vc-material-sentiment_satisfied' => 'sentiment satisfied' ),
array( 'vc-material vc-material-sentiment_very_dissatisfied' => 'sentiment very dissatisfied' ),
array( 'vc-material vc-material-sentiment_very_satisfied' => 'sentiment very satisfied' ),
array( 'vc-material vc-material-settings' => 'settings' ),
array( 'vc-material vc-material-settings_applications' => 'settings applications' ),
array( 'vc-material vc-material-settings_backup_restore' => 'settings backup restore' ),
array( 'vc-material vc-material-settings_bluetooth' => 'settings bluetooth' ),
array( 'vc-material vc-material-settings_brightness' => 'settings brightness' ),
array( 'vc-material vc-material-settings_cell' => 'settings cell' ),
array( 'vc-material vc-material-settings_ethernet' => 'settings ethernet' ),
array( 'vc-material vc-material-settings_input_antenna' => 'settings input antenna' ),
array( 'vc-material vc-material-settings_input_composite' => 'settings input composite' ),
array( 'vc-material vc-material-settings_input_hdmi' => 'settings input hdmi' ),
array( 'vc-material vc-material-settings_input_svideo' => 'settings input svideo' ),
array( 'vc-material vc-material-settings_overscan' => 'settings overscan' ),
array( 'vc-material vc-material-settings_phone' => 'settings phone' ),
array( 'vc-material vc-material-settings_power' => 'settings power' ),
array( 'vc-material vc-material-settings_remote' => 'settings remote' ),
array( 'vc-material vc-material-settings_system_daydream' => 'settings system daydream' ),
array( 'vc-material vc-material-settings_voice' => 'settings voice' ),
array( 'vc-material vc-material-share' => 'share' ),
array( 'vc-material vc-material-shop' => 'shop' ),
array( 'vc-material vc-material-shop_two' => 'shop two' ),
array( 'vc-material vc-material-shopping_basket' => 'shopping basket' ),
array( 'vc-material vc-material-short_text' => 'short text' ),
array( 'vc-material vc-material-show_chart' => 'show chart' ),
array( 'vc-material vc-material-shuffle' => 'shuffle' ),
array( 'vc-material vc-material-signal_cellular_4_bar' => 'signal cellular 4 bar' ),
array( 'vc-material vc-material-signal_cellular_connected_no_internet_4_bar' => 'signal_cellular_connected_no internet 4 bar' ),
array( 'vc-material vc-material-signal_cellular_null' => 'signal cellular null' ),
array( 'vc-material vc-material-signal_cellular_off' => 'signal cellular off' ),
array( 'vc-material vc-material-signal_wifi_4_bar' => 'signal wifi 4 bar' ),
array( 'vc-material vc-material-signal_wifi_4_bar_lock' => 'signal wifi 4 bar lock' ),
array( 'vc-material vc-material-signal_wifi_off' => 'signal wifi off' ),
array( 'vc-material vc-material-sim_card' => 'sim card' ),
array( 'vc-material vc-material-sim_card_alert' => 'sim card alert' ),
array( 'vc-material vc-material-skip_next' => 'skip next' ),
array( 'vc-material vc-material-skip_previous' => 'skip previous' ),
array( 'vc-material vc-material-slideshow' => 'slideshow' ),
array( 'vc-material vc-material-slow_motion_video' => 'slow motion video' ),
array( 'vc-material vc-material-stay_primary_portrait' => 'stay primary portrait' ),
array( 'vc-material vc-material-smoke_free' => 'smoke free' ),
array( 'vc-material vc-material-smoking_rooms' => 'smoking rooms' ),
array( 'vc-material vc-material-textsms' => 'textsms' ),
array( 'vc-material vc-material-snooze' => 'snooze' ),
array( 'vc-material vc-material-sort' => 'sort' ),
array( 'vc-material vc-material-sort_by_alpha' => 'sort by alpha' ),
array( 'vc-material vc-material-spa' => 'spa' ),
array( 'vc-material vc-material-space_bar' => 'space bar' ),
array( 'vc-material vc-material-speaker' => 'speaker' ),
array( 'vc-material vc-material-speaker_group' => 'speaker group' ),
array( 'vc-material vc-material-speaker_notes' => 'speaker notes' ),
array( 'vc-material vc-material-speaker_notes_off' => 'speaker notes off' ),
array( 'vc-material vc-material-speaker_phone' => 'speaker phone' ),
array( 'vc-material vc-material-spellcheck' => 'spellcheck' ),
array( 'vc-material vc-material-star_border' => 'star border' ),
array( 'vc-material vc-material-star_half' => 'star half' ),
array( 'vc-material vc-material-stars' => 'stars' ),
array( 'vc-material vc-material-stay_primary_landscape' => 'stay primary landscape' ),
array( 'vc-material vc-material-stop' => 'stop' ),
array( 'vc-material vc-material-stop_screen_share' => 'stop screen share' ),
array( 'vc-material vc-material-storage' => 'storage' ),
array( 'vc-material vc-material-store_mall_directory' => 'store mall directory' ),
array( 'vc-material vc-material-straighten' => 'straighten' ),
array( 'vc-material vc-material-streetview' => 'streetview' ),
array( 'vc-material vc-material-strikethrough_s' => 'strikethrough s' ),
array( 'vc-material vc-material-style' => 'style' ),
array( 'vc-material vc-material-subdirectory_arrow_left' => 'subdirectory arrow left' ),
array( 'vc-material vc-material-subdirectory_arrow_right' => 'subdirectory arrow right' ),
array( 'vc-material vc-material-subject' => 'subject' ),
array( 'vc-material vc-material-subscriptions' => 'subscriptions' ),
array( 'vc-material vc-material-subtitles' => 'subtitles' ),
array( 'vc-material vc-material-subway' => 'subway' ),
array( 'vc-material vc-material-supervisor_account' => 'supervisor account' ),
array( 'vc-material vc-material-surround_sound' => 'surround sound' ),
array( 'vc-material vc-material-swap_calls' => 'swap calls' ),
array( 'vc-material vc-material-swap_horiz' => 'swap horiz' ),
array( 'vc-material vc-material-swap_vert' => 'swap vert' ),
array( 'vc-material vc-material-swap_vertical_circle' => 'swap vertical circle' ),
array( 'vc-material vc-material-switch_camera' => 'switch camera' ),
array( 'vc-material vc-material-switch_video' => 'switch video' ),
array( 'vc-material vc-material-sync_disabled' => 'sync disabled' ),
array( 'vc-material vc-material-sync_problem' => 'sync problem' ),
array( 'vc-material vc-material-system_update' => 'system update' ),
array( 'vc-material vc-material-system_update_alt' => 'system update alt' ),
array( 'vc-material vc-material-tab' => 'tab' ),
array( 'vc-material vc-material-tab_unselected' => 'tab unselected' ),
array( 'vc-material vc-material-tablet' => 'tablet' ),
array( 'vc-material vc-material-tablet_android' => 'tablet android' ),
array( 'vc-material vc-material-tablet_mac' => 'tablet mac' ),
array( 'vc-material vc-material-tap_and_play' => 'tap and play' ),
array( 'vc-material vc-material-text_fields' => 'text fields' ),
array( 'vc-material vc-material-text_format' => 'text format' ),
array( 'vc-material vc-material-texture' => 'texture' ),
array( 'vc-material vc-material-thumb_down' => 'thumb down' ),
array( 'vc-material vc-material-thumb_up' => 'thumb up' ),
array( 'vc-material vc-material-thumbs_up_down' => 'thumbs up down' ),
array( 'vc-material vc-material-timelapse' => 'timelapse' ),
array( 'vc-material vc-material-timeline' => 'timeline' ),
array( 'vc-material vc-material-timer' => 'timer' ),
array( 'vc-material vc-material-timer_10' => 'timer 10' ),
array( 'vc-material vc-material-timer_3' => 'timer 3' ),
array( 'vc-material vc-material-timer_off' => 'timer off' ),
array( 'vc-material vc-material-title' => 'title' ),
array( 'vc-material vc-material-toc' => 'toc' ),
array( 'vc-material vc-material-today' => 'today' ),
array( 'vc-material vc-material-toll' => 'toll' ),
array( 'vc-material vc-material-tonality' => 'tonality' ),
array( 'vc-material vc-material-touch_app' => 'touch app' ),
array( 'vc-material vc-material-toys' => 'toys' ),
array( 'vc-material vc-material-track_changes' => 'track changes' ),
array( 'vc-material vc-material-traffic' => 'traffic' ),
array( 'vc-material vc-material-train' => 'train' ),
array( 'vc-material vc-material-tram' => 'tram' ),
array( 'vc-material vc-material-transfer_within_a_station' => 'transfer within a station' ),
array( 'vc-material vc-material-transform' => 'transform' ),
array( 'vc-material vc-material-translate' => 'translate' ),
array( 'vc-material vc-material-trending_down' => 'trending down' ),
array( 'vc-material vc-material-trending_flat' => 'trending flat' ),
array( 'vc-material vc-material-trending_up' => 'trending up' ),
array( 'vc-material vc-material-tune' => 'tune' ),
array( 'vc-material vc-material-tv' => 'tv' ),
array( 'vc-material vc-material-unarchive' => 'unarchive' ),
array( 'vc-material vc-material-undo' => 'undo' ),
array( 'vc-material vc-material-unfold_less' => 'unfold less' ),
array( 'vc-material vc-material-unfold_more' => 'unfold more' ),
array( 'vc-material vc-material-update' => 'update' ),
array( 'vc-material vc-material-usb' => 'usb' ),
array( 'vc-material vc-material-verified_user' => 'verified user' ),
array( 'vc-material vc-material-vertical_align_bottom' => 'vertical align bottom' ),
array( 'vc-material vc-material-vertical_align_center' => 'vertical align center' ),
array( 'vc-material vc-material-vertical_align_top' => 'vertical align top' ),
array( 'vc-material vc-material-vibration' => 'vibration' ),
array( 'vc-material vc-material-video_call' => 'video call' ),
array( 'vc-material vc-material-video_label' => 'video label' ),
array( 'vc-material vc-material-video_library' => 'video library' ),
array( 'vc-material vc-material-videocam' => 'videocam' ),
array( 'vc-material vc-material-videocam_off' => 'videocam off' ),
array( 'vc-material vc-material-videogame_asset' => 'videogame asset' ),
array( 'vc-material vc-material-view_agenda' => 'view agenda' ),
array( 'vc-material vc-material-view_array' => 'view array' ),
array( 'vc-material vc-material-view_carousel' => 'view carousel' ),
array( 'vc-material vc-material-view_column' => 'view column' ),
array( 'vc-material vc-material-view_comfy' => 'view comfy' ),
array( 'vc-material vc-material-view_compact' => 'view compact' ),
array( 'vc-material vc-material-view_day' => 'view day' ),
array( 'vc-material vc-material-view_headline' => 'view headline' ),
array( 'vc-material vc-material-view_list' => 'view list' ),
array( 'vc-material vc-material-view_module' => 'view module' ),
array( 'vc-material vc-material-view_quilt' => 'view quilt' ),
array( 'vc-material vc-material-view_stream' => 'view stream' ),
array( 'vc-material vc-material-view_week' => 'view week' ),
array( 'vc-material vc-material-vignette' => 'vignette' ),
array( 'vc-material vc-material-visibility_off' => 'visibility off' ),
array( 'vc-material vc-material-voice_chat' => 'voice chat' ),
array( 'vc-material vc-material-voicemail' => 'voicemail' ),
array( 'vc-material vc-material-volume_down' => 'volume down' ),
array( 'vc-material vc-material-volume_mute' => 'volume mute' ),
array( 'vc-material vc-material-volume_off' => 'volume off' ),
array( 'vc-material vc-material-volume_up' => 'volume up' ),
array( 'vc-material vc-material-vpn_key' => 'vpn key' ),
array( 'vc-material vc-material-vpn_lock' => 'vpn lock' ),
array( 'vc-material vc-material-wallpaper' => 'wallpaper' ),
array( 'vc-material vc-material-watch' => 'watch' ),
array( 'vc-material vc-material-watch_later' => 'watch later' ),
array( 'vc-material vc-material-wb_auto' => 'wb auto' ),
array( 'vc-material vc-material-wb_incandescent' => 'wb incandescent' ),
array( 'vc-material vc-material-wb_iridescent' => 'wb iridescent' ),
array( 'vc-material vc-material-wb_sunny' => 'wb sunny' ),
array( 'vc-material vc-material-wc' => 'wc' ),
array( 'vc-material vc-material-web' => 'web' ),
array( 'vc-material vc-material-web_asset' => 'web asset' ),
array( 'vc-material vc-material-weekend' => 'weekend' ),
array( 'vc-material vc-material-whatshot' => 'whatshot' ),
array( 'vc-material vc-material-widgets' => 'widgets' ),
array( 'vc-material vc-material-wifi' => 'wifi' ),
array( 'vc-material vc-material-wifi_lock' => 'wifi lock' ),
array( 'vc-material vc-material-wifi_tethering' => 'wifi tethering' ),
array( 'vc-material vc-material-work' => 'work' ),
array( 'vc-material vc-material-wrap_text' => 'wrap text' ),
array( 'vc-material vc-material-youtube_searched_for' => 'youtube searched for' ),
array( 'vc-material vc-material-zoom_in' => 'zoom in' ),
array( 'vc-material vc-material-zoom_out' => 'zoom out' ),
array( 'vc-material vc-material-zoom_out_map' => 'zoom out map' ),
);
return array_merge( $icons, $material );
}
params/vc_link/vc_link.php 0000644 00000002311 15121635560 0011613 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_vc_link_form_field( $settings, $value ) {
$link = vc_build_link( $value );
return sprintf( '<div class="vc_link"><input name="%s" class="wpb_vc_param_value %s_field" type="hidden" value="%s" data-json="%s" /><a href="#" class="button vc_link-build %s_button">%s</a> <span class="vc_link_label_title vc_link_label">%s:</span> <span class="title-label">%s</span> <span class="vc_link_label">%s:</span> <span class="url-label">%s %s</span></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), htmlentities( $value, ENT_QUOTES, 'utf-8' ), htmlentities( wp_json_encode( $link ), ENT_QUOTES, 'utf-8' ), esc_attr( $settings['param_name'] ), esc_html__( 'Select URL', 'js_composer' ), esc_html__( 'Title', 'js_composer' ), $link['title'], esc_html__( 'URL', 'js_composer' ), $link['url'], $link['target'] );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
function vc_build_link( $value ) {
return vc_parse_multi_attribute( $value, array(
'url' => '',
'title' => '',
'target' => '',
'rel' => '',
) );
}
params/sorted_list/sorted_list.php 0000644 00000002763 15121635560 0013442 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_sorted_list_form_field( $settings, $value ) {
return sprintf( '<div class="vc_sorted-list"><input name="%s" class="wpb_vc_param_value %s %s_field" type="hidden" value="%s" /><div class="vc_sorted-list-toolbar">%s</div><ul class="vc_sorted-list-container"></ul></div>', $settings['param_name'], $settings['param_name'], $settings['type'], $value, vc_sorted_list_parts_list( $settings['options'] ) );
}
/**
* @param $list
*
* @return string
* @since 4.2
*/
function vc_sorted_list_parts_list( $list ) {
$output = '';
foreach ( $list as $control ) {
$output .= sprintf( '<div class="vc_sorted-list-checkbox"><label><input type="checkbox" name="vc_sorted_list_element" value="%s" data-element="%s" data-subcontrol="%s"> <span>%s</span></label></div>', $control[0], $control[0], count( $control ) > 1 ? htmlspecialchars( wp_json_encode( array_slice( $control, 2 ) ) ) : '', htmlspecialchars( $control[1] ) );
}
return $output;
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
function vc_sorted_list_parse_value( $value ) {
$data = array();
$split = preg_split( '/\,/', $value );
foreach ( $split as $v ) {
$v_split = array_map( 'rawurldecode', preg_split( '/\|/', $v ) );
$count = count( $v_split );
if ( $count > 0 ) {
$data[] = array(
$v_split[0],
$count > 1 ? array_slice( $v_split, 1 ) : array(),
);
}
}
return $data;
}
params/column_offset/column_offset.php 0000644 00000011261 15121635560 0014253 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @property mixed data
*/
class Vc_Column_Offset {
/**
* @var array
*/
protected $settings = array();
/**
* @var string
*/
protected $value = '';
/**
* @var array
*/
protected $size_types = array(
'lg' => 'Large',
'md' => 'Medium',
'sm' => 'Small',
'xs' => 'Extra small',
);
/**
* @var array
*/
protected $column_width_list = array();
/**
* @param $settings
* @param $value
*/
public function __construct( $settings, $value ) {
$this->settings = $settings;
$this->value = $value;
$this->column_width_list = array(
esc_html__( '1 column - 1/12', 'js_composer' ) => '1',
esc_html__( '2 columns - 1/6', 'js_composer' ) => '2',
esc_html__( '3 columns - 1/4', 'js_composer' ) => '3',
esc_html__( '4 columns - 1/3', 'js_composer' ) => '4',
esc_html__( '5 columns - 5/12', 'js_composer' ) => '5',
esc_html__( '6 columns - 1/2', 'js_composer' ) => '6',
esc_html__( '7 columns - 7/12', 'js_composer' ) => '7',
esc_html__( '8 columns - 2/3', 'js_composer' ) => '8',
esc_html__( '9 columns - 3/4', 'js_composer' ) => '9',
esc_html__( '10 columns - 5/6', 'js_composer' ) => '10',
esc_html__( '11 columns - 11/12', 'js_composer' ) => '11',
esc_html__( '12 columns - 1/1', 'js_composer' ) => '12',
esc_html__( '20% - 1/5', 'js_composer' ) => '1/5',
esc_html__( '40% - 2/5', 'js_composer' ) => '2/5',
esc_html__( '60% - 3/5', 'js_composer' ) => '3/5',
esc_html__( '80% - 4/5', 'js_composer' ) => '4/5',
);
}
/**
* @return string
*/
public function render() {
ob_start();
vc_include_template( 'params/column_offset/template.tpl.php', array(
'settings' => $this->settings,
'value' => $this->value,
'data' => $this->valueData(),
'sizes' => $this->size_types,
'param' => $this,
) );
return ob_get_clean();
}
/**
* @return array|mixed
*/
public function valueData() {
if ( ! isset( $this->data ) ) {
$this->data = preg_split( '/\s+/', $this->value );
}
return $this->data;
}
/**
* @param $size
*
* @return string
*/
public function sizeControl( $size ) {
if ( 'sm' === $size ) {
return '<span class="vc_description">' . esc_html__( 'Default value from width attribute', 'js_composer' ) . '</span>';
}
$empty_label = 'xs' === $size ? '' : esc_html__( 'Inherit from smaller', 'js_composer' );
$output = sprintf( '<select name="vc_col_%s_size" class="vc_column_offset_field" data-type="size-%s"><option value="" style="color: #ccc;">%s</option>', $size, $size, $empty_label );
foreach ( $this->column_width_list as $label => $index ) {
$value = 'vc_col-' . $size . '-' . $index;
$output .= sprintf( '<option value="%s" %s>%s</option>', $value, in_array( $value, $this->data, true ) ? 'selected="true"' : '', $label );
}
$output .= '</select>';
return $output;
}
/**
* @param $size
*
* @return string
*/
public function offsetControl( $size ) {
$prefix = 'vc_col-' . $size . '-offset-';
$empty_label = 'xs' === $size ? esc_html__( 'No offset', 'js_composer' ) : esc_html__( 'Inherit from smaller', 'js_composer' );
$output = sprintf( '<select name="vc_%s_offset_size" class="vc_column_offset_field" data-type="offset-%s"><option value="" style="color: #ccc;">%s</option>', $size, $size, $empty_label );
if ( 'xs' !== $size ) {
$output .= sprintf( '<option value="%s0" style="color: #ccc;"%s>%s</option>', $prefix, in_array( $prefix . '0', $this->data, true ) ? ' selected="true"' : '', esc_html__( 'No offset', 'js_composer' ) );
}
foreach ( $this->column_width_list as $label => $index ) {
$value = $prefix . $index;
$output .= sprintf( '<option value="%s"%s>%s</option>', $value, in_array( $value, $this->data, true ) ? ' selected="true"' : '', $label );
}
$output .= '</select>';
return $output;
}
}
/**
* @param $settings
* @param $value
*
* @return string
*/
function vc_column_offset_form_field( $settings, $value ) {
$column_offset = new Vc_Column_Offset( $settings, $value );
return $column_offset->render();
}
/**
* @param $column_offset
* @param $width
*
* @return mixed|string
*/
function vc_column_offset_class_merge( $column_offset, $width ) {
// Remove offset settings if
if ( '1' === vc_settings()->get( 'not_responsive_css' ) ) {
$column_offset = preg_replace( '/vc_col\-(lg|md|xs)[^\s]*/', '', $column_offset );
}
if ( preg_match( '/vc_col\-sm\-\d+/', $column_offset ) ) {
return $column_offset;
}
return $width . ( empty( $column_offset ) ? '' : ' ' . $column_offset );
}
/**
*
*/
function vc_load_column_offset_param() {
vc_add_shortcode_param( 'column_offset', 'vc_column_offset_form_field' );
}
add_action( 'vc_load_default_params', 'vc_load_column_offset_param' );
params/textarea_html/textarea_html.php 0000644 00000003136 15121635560 0014251 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $vc_html_editor_already_is_use;
$vc_html_editor_already_is_use = false;
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_textarea_html_form_field( $settings, $value ) {
global $vc_html_editor_already_is_use;
$output = '';
if ( false !== $vc_html_editor_already_is_use ) {
$output .= '<textarea name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb-textarea ' . esc_attr( $settings['param_name'] ) . ' textarea">' . $value . '</textarea>';
$output .= '<div class="updated"><p>' . sprintf( esc_html__( 'Field type is changed from "textarea_html" to "textarea", because it is already used by %s field. Textarea_html field\'s type can be used only once per shortcode.', 'js_composer' ), $vc_html_editor_already_is_use ) . '</p></div>';
} elseif ( function_exists( 'wp_editor' ) ) {
$default_content = $value;
// WP 3.3+
ob_start();
wp_editor( '', 'wpb_tinymce_' . esc_attr( $settings['param_name'] ), array(
'editor_class' => 'wpb-textarea visual_composer_tinymce ' . esc_attr( $settings['param_name'] . ' ' . $settings['type'] ),
'media_buttons' => true,
'wpautop' => false,
) );
$output_value = ob_get_contents();
ob_end_clean();
$output .= $output_value . '<input type="hidden" name="' . esc_attr( $settings['param_name'] ) . '" class="vc_textarea_html_content wpb_vc_param_value ' . esc_attr( $settings['param_name'] ) . '" value="' . htmlspecialchars( $default_content ) . '"/>';
$vc_html_editor_already_is_use = $settings['param_name'];
}
return $output;
}
params/params_preset/params_preset.php 0000644 00000002243 15121635560 0014257 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Params preset shortcode attribute type generator.
*
* Allows to set list of attributes which will be
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_params_preset_form_field( $settings, $value ) {
$output = '';
$output .= '<select name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value vc_params-preset-select ' . esc_attr( $settings['param_name'] . ' ' . $settings['type'] ) . '">';
foreach ( $settings['options'] as $option ) {
$selected = '';
if ( isset( $option['value'] ) ) {
$option_value_string = (string) $option['value'];
$value_string = (string) $value;
if ( '' !== $value && $option_value_string === $value_string ) {
$selected = 'selected';
}
$output .= '<option class="vc_params-preset-' . esc_attr( $option['value'] ) . '" value="' . esc_attr( $option['value'] ) . '" ' . $selected . ' data-params="' . esc_attr( wp_json_encode( $option['params'] ) ) . '">' . esc_html( isset( $option['label'] ) ? $option['label'] : $option['value'] ) . '</option>';
}
}
$output .= '</select>';
return $output;
}
params/hidden/hidden.php 0000644 00000001716 15121635560 0011237 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Hidden field param.
*
* @param $settings
* @param $value
*
* @since 4.5
* @return string - html string.
*/
function vc_hidden_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<input name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value vc_hidden-field vc_param-name-' . esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ) . '" type="hidden" value="' . esc_attr( $value ) . '"/>';
}
/**
* Remove content before hidden field type input.
*
* @param $output
*
* @since 4.5
*
* @return string
*/
function vc_edit_form_fields_render_field_hidden_before() {
return '<div class="vc_column vc_edit-form-hidden-field-wrapper">';
}
/**
* Remove content after hidden field type input.
*
* @param $output
*
* @since 4.5
*
* @return string
*/
function vc_edit_form_fields_render_field_hidden_after() {
return '</div>';
}
params/default_params.php 0000644 00000024613 15121635560 0011541 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcode default attributes functions for rendering.
*
* @package WPBakeryPageBuilder
* @since 4.4
*/
/**
* Textfield shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_textfield_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $settings['param_name'] . ' ' . $settings['type'] . '" type="text" value="' . $value . '"/>';
}
/**
* Dropdown(select with options) shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_dropdown_form_field( $settings, $value ) {
$output = '';
$css_option = str_replace( '#', 'hash-', vc_get_dropdown_option( $settings, $value ) );
$output .= '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . ' ' . $css_option . '" data-option="' . $css_option . '">';
if ( is_array( $value ) ) {
$value = isset( $value['value'] ) ? $value['value'] : array_shift( $value );
}
if ( ! empty( $settings['value'] ) ) {
foreach ( $settings['value'] as $index => $data ) {
if ( is_numeric( $index ) && ( is_string( $data ) || is_numeric( $data ) ) ) {
$option_label = $data;
$option_value = $data;
} elseif ( is_numeric( $index ) && is_array( $data ) ) {
$option_label = isset( $data['label'] ) ? $data['label'] : array_pop( $data );
$option_value = isset( $data['value'] ) ? $data['value'] : array_pop( $data );
} else {
$option_value = $data;
$option_label = $index;
}
$selected = '';
$option_value_string = (string) $option_value;
$value_string = (string) $value;
if ( '' !== $value && $option_value_string === $value_string ) {
$selected = 'selected="selected"';
}
$option_class = str_replace( '#', 'hash-', $option_value );
$output .= '<option class="' . esc_attr( $option_class ) . '" value="' . esc_attr( $option_value ) . '" ' . $selected . '>' . htmlspecialchars( $option_label ) . '</option>';
}
}
$output .= '</select>';
return $output;
}
/**
* Checkbox shortcode attribute type generator.
*
* @param $settings
* @param string $value
*
* @return string - html string.
* @since 4.4
*/
function vc_checkbox_form_field( $settings, $value ) {
$output = '';
if ( is_array( $value ) ) {
$value = ''; // fix #1239
}
$current_value = strlen( $value ) > 0 ? explode( ',', $value ) : array();
$values = isset( $settings['value'] ) && is_array( $settings['value'] ) ? $settings['value'] : array( esc_html__( 'Yes', 'js_composer' ) => 'true' );
if ( ! empty( $values ) ) {
foreach ( $values as $label => $v ) {
// NOTE!! Don't use strict compare here for BC!
// @codingStandardsIgnoreLine
$checked = in_array( $v, $current_value ) ? 'checked' : '';
$output .= ' <label class="vc_checkbox-label"><input id="' . $settings['param_name'] . '-' . $v . '" value="' . $v . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '" type="checkbox" name="' . $settings['param_name'] . '" ' . $checked . '>' . $label . '</label>';
}
}
return $output;
}
add_filter( 'vc_map_get_param_defaults', 'vc_checkbox_param_defaults', 10, 2 );
/**
* @param $value
* @param $param
* @return mixed|string
*/
function vc_checkbox_param_defaults( $value, $param ) {
if ( 'checkbox' === $param['type'] ) {
$value = '';
if ( isset( $param['std'] ) ) {
$value = $param['std'];
}
}
return $value;
}
/**
* Checkbox shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_posttypes_form_field( $settings, $value ) {
$output = '';
$args = array(
'public' => true,
);
$post_types = get_post_types( $args );
foreach ( $post_types as $post_type ) {
$checked = '';
if ( 'attachment' !== $post_type ) {
if ( in_array( $post_type, explode( ',', $value ), true ) ) {
$checked = 'checked="checked"';
}
$output .= '<label class="vc_checkbox-label"><input id="' . $settings['param_name'] . '-' . $post_type . '" value="' . $post_type . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '" type="checkbox" name="' . $settings['param_name'] . '" ' . $checked . '> ' . $post_type . '</label>';
}
}
return $output;
}
/**
* Taxonomies shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_taxonomies_form_field( $settings, $value ) {
$output = '';
$post_types = get_post_types( array(
'public' => false,
'name' => 'attachment',
), 'names', 'NOT' );
foreach ( $post_types as $type ) {
$taxonomies = get_object_taxonomies( $type, '' );
foreach ( $taxonomies as $tax ) {
$checked = '';
if ( in_array( $tax->name, explode( ',', $value ), true ) ) {
$checked = 'checked';
}
$output .= ' <label class="vc_checkbox-label" data-post-type="' . $type . '"><input id="' . $settings['param_name'] . '-' . $tax->name . '" value="' . $tax->name . '" data-post-type="' . $type . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '" type="checkbox" name="' . $settings['param_name'] . '" ' . $checked . '> ' . $tax->label . '</label>';
}
}
return $output;
}
/**
* Exploded textarea shortcode attribute type generator.
*
* Data saved and coma-separated values are merged with line breaks and returned in a textarea.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_exploded_textarea_form_field( $settings, $value ) {
$value = str_replace( ',', "\n", $value );
return '<textarea name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $settings['param_name'] . ' ' . $settings['type'] . '">' . $value . '</textarea>';
}
/**
* Safe Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.8.2
*/
function vc_exploded_textarea_safe_form_field( $settings, $value ) {
$value = vc_value_from_safe( $value, true );
$value = str_replace( ',', "\n", $value );
return '<textarea name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $settings['param_name'] . ' ' . $settings['type'] . '">' . $value . '</textarea>';
}
/**
* Textarea raw html shortcode attribute type generator.
*
* This attribute type allows safely add custom html to your post/page.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_textarea_raw_html_form_field( $settings, $value ) {
// @codingStandardsIgnoreLine
return sprintf( '<textarea name="%s" class="wpb_vc_param_value wpb-textarea_raw_html %s %s" rows="16">%s</textarea>', $settings['param_name'], $settings['param_name'], $settings['type'], htmlentities( rawurldecode( base64_decode( $value ) ), ENT_COMPAT, 'UTF-8' ) );
}
/**
* Safe Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_textarea_safe_form_field( $settings, $value ) {
return '<textarea name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea_raw_html ' . $settings['param_name'] . ' ' . $settings['type'] . '">' . vc_value_from_safe( $value, true ) . '</textarea>';
}
/**
* Textarea shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_textarea_form_field( $settings, $value ) {
return '<textarea name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textarea ' . $settings['param_name'] . ' ' . $settings['type'] . '">' . $value . '</textarea>';
}
/**
* Attach images shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @param $tag
* @param bool $single
*
* @return string - html string.
* @since 4.4
*
*/
function vc_attach_images_form_field( $settings, $value, $tag, $single = false ) {
$output = '';
$param_value = wpb_removeNotExistingImgIDs( $value );
$output .= '<input type="hidden" class="wpb_vc_param_value gallery_widget_attached_images_ids ' . esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ) . '" name="' . esc_attr( $settings['param_name'] ) . '" value="' . $value . '"/>';
$output .= '<div class="gallery_widget_attached_images">';
$output .= '<ul class="gallery_widget_attached_images_list">';
$output .= ( '' !== $param_value ) ? vc_field_attached_images( explode( ',', $value ) ) : '';
$output .= '</ul>';
$output .= '</div>';
$output .= '<div class="gallery_widget_site_images">';
$output .= '</div>';
if ( true === $single ) {
$output .= '<a class="gallery_widget_add_images" href="javascript:;" use-single="true" title="' . esc_attr__( 'Add image', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add"></i>' . esc_html__( 'Add image', 'js_composer' ) . '</a>';
} else {
$output .= '<a class="gallery_widget_add_images" href="javascript:;" title="' . esc_attr__( 'Add images', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add"></i>' . esc_html__( 'Add images', 'js_composer' ) . '</a>';
}
return $output;
}
/**
* Attach image shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @param $tag
*
* @return string - html string.
* @since 4.4
*/
function vc_attach_image_form_field( $settings, $value, $tag ) {
return vc_attach_images_form_field( $settings, $value, $tag, true );
}
/**
* Widgetised sidebars shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @return string - html string.
* @since 4.4
*/
function vc_widgetised_sidebars_form_field( $settings, $value ) {
$output = '';
$sidebars = $GLOBALS['wp_registered_sidebars'];
$output .= '<select name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value dropdown wpb-input wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . '">';
foreach ( $sidebars as $sidebar ) {
$selected = '';
if ( $sidebar['id'] === $value ) {
$selected = 'selected';
}
$sidebar_name = $sidebar['name'];
$output .= '<option value="' . esc_attr( $sidebar['id'] ) . '" ' . $selected . '>' . $sidebar_name . '</option>';
}
$output .= '</select>';
return $output;
}
params/load.php 0000644 00000004414 15121635560 0007466 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcode attributes fields loader
*
* @package WPBakeryPageBuilder
*
*/
require_once vc_path_dir( 'PARAMS_DIR', '/default_params.php' );
/**
* Loads attributes hooks.
*/
require_once vc_path_dir( 'PARAMS_DIR', '/textarea_html/textarea_html.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/colorpicker/colorpicker.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/loop/loop.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/vc_link/vc_link.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/options/options.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/sorted_list/sorted_list.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/css_editor/css_editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/tab_id/tab_id.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/href/href.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/font_container/font_container.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/google_fonts/google_fonts.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/column_offset/column_offset.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/autocomplete/autocomplete.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/params_preset/params_preset.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/param_group/param_group.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/custom_markup/custom_markup.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/animation_style/animation_style.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/iconpicker/iconpicker.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/el_id/el_id.php' );
require_once vc_path_dir( 'PARAMS_DIR', '/gutenberg/gutenberg.php' );
global $vc_params_list;
$vc_params_list = array(
// Default
'textfield',
'dropdown',
'textarea_html',
'checkbox',
'posttypes',
'taxonomies',
'taxomonies',
'exploded_textarea',
'exploded_textarea_safe',
'textarea_raw_html',
'textarea_safe',
'textarea',
'attach_images',
'attach_image',
'widgetised_sidebars',
// Advanced
'colorpicker',
'loop',
'vc_link',
'options',
'sorted_list',
'css_editor',
'font_container',
'google_fonts',
'autocomplete',
'tab_id',
'href',
'params_preset',
'param_group',
'custom_markup',
'animation_style',
'iconpicker',
'el_id',
'gutenberg',
);
params/css_editor/css_editor.php 0000644 00000016707 15121635560 0013053 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( ! class_exists( 'WPBakeryVisualComposerCssEditor' ) ) {
/**
* Class WPBakeryVisualComposerCssEditor
*/
class WPBakeryVisualComposerCssEditor {
/**
* @var array
*/
protected $settings = array();
/**
* @var string
*/
protected $value = '';
/**
* @var array
*/
protected $positions = array(
'top',
'right',
'bottom',
'left',
);
public $params = array();
/**
* Setters/Getters {{
*
* @param null $settings
*
* @return array
*/
public function settings( $settings = null ) {
if ( is_array( $settings ) ) {
$this->settings = $settings;
}
return $this->settings;
}
/**
* @param $key
*
* @return string
*/
public function setting( $key ) {
return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : '';
}
/**
* @param null $value
*
* @return string
*/
public function value( $value = null ) {
if ( is_string( $value ) ) {
$this->value = $value;
}
return $this->value;
}
/**
* @param null $values
*
* @return array
*/
public function params( $values = null ) {
if ( is_array( $values ) ) {
$this->params = $values;
}
return $this->params;
}
// }}
/**
* vc_filter: vc_css_editor - hook to override output of this method
* @return mixed
*/
public function render() {
$output = '<div class="vc_css-editor vc_row vc_ui-flex-row" data-css-editor="true">';
$output .= $this->onionLayout();
$output .= sprintf( '<div class="vc_col-xs-5 vc_settings"><label>%s</label><div class="color-group"><input type="text" name="border_color" value="" class="vc_color-control"></div><label>%s</label><div class="vc_border-style"><select name="border_style" class="vc_border-style">%s</select></div><label>%s</label><div class="vc_border-radius"><select name="border_radius" class="vc_border-radius">%s</select></div><label>%s</label><div class="color-group"><input type="text" name="background_color" value="" class="vc_color-control"></div><div class="vc_background-image">%s<div class="vc_clearfix"></div></div><div class="vc_background-style"><select name="background_style" class="vc_background-style">%s</select></div><label>%s</label><label class="vc_checkbox"><input type="checkbox" name="simply" class="vc_simplify" value=""> %s</label></div>', esc_html__( 'Border color', 'js_composer' ), esc_html__( 'Border style', 'js_composer' ), $this->getBorderStyleOptions(), esc_html__( 'Border radius', 'js_composer' ), $this->getBorderRadiusOptions(), esc_html__( 'Background', 'js_composer' ), $this->getBackgroundImageControl(), $this->getBackgroundStyleOptions(), esc_html__( 'Box controls', 'js_composer' ), esc_html__( 'Simplify controls', 'js_composer' ) );
$output .= sprintf( '<input name="%s" class="wpb_vc_param_value %s %s_field" type="hidden" value="%s"/>', esc_attr( $this->setting( 'param_name' ) ), esc_attr( $this->setting( 'param_name' ) ), esc_attr( $this->setting( 'type' ) ), esc_attr( $this->value() ) );
$output .= '</div><div class="vc_clearfix"></div>';
$custom_tag = 'script';
$output .= '<' . $custom_tag . ' type="text/html" id="vc_css-editor-image-block"><li class="added"><div class="inner" style="width: 80px; height: 80px; overflow: hidden;text-align: center;"><img src="{{ img.url }}?id={{ img.id }}" data-image-id="{{ img.id }}" class="vc_ce-image<# if (!_.isUndefined(img.css_class)) {#> {{ img.css_class }}<# }#>"> </div><a href="#" class="vc_icon-remove"><i class="vc-composer-icon vc-c-icon-close"></i></a></li></' . $custom_tag . '>';
return apply_filters( 'vc_css_editor', $output );
}
/**
* @return string
*/
public function getBackgroundImageControl() {
$value = sprintf( '<ul class="vc_image"></ul><a href="#" class="vc_add-image"><i class="vc-composer-icon vc-c-icon-add"></i>%s</a>', esc_html__( 'Add image', 'js_composer' ) );
return apply_filters( 'vc_css_editor_background_image_control', $value );
}
/**
* @return string
*/
public function getBorderRadiusOptions() {
$radiuses = apply_filters( 'vc_css_editor_border_radius_options_data', array(
'' => esc_html__( 'None', 'js_composer' ),
'1px' => '1px',
'2px' => '2px',
'3px' => '3px',
'4px' => '4px',
'5px' => '5px',
'10px' => '10px',
'15px' => '15px',
'20px' => '20px',
'25px' => '25px',
'30px' => '30px',
'35px' => '35px',
) );
$output = '';
foreach ( $radiuses as $radius => $title ) {
$output .= '<option value="' . $radius . '">' . $title . '</option>';
}
return $output;
}
/**
* @return string
*/
public function getBorderStyleOptions() {
$output = '<option value="">' . esc_html__( 'Theme defaults', 'js_composer' ) . '</option>';
$styles = apply_filters( 'vc_css_editor_border_style_options_data', array(
esc_html__( 'solid', 'js_composer' ),
esc_html__( 'dotted', 'js_composer' ),
esc_html__( 'dashed', 'js_composer' ),
esc_html__( 'none', 'js_composer' ),
esc_html__( 'hidden', 'js_composer' ),
esc_html__( 'double', 'js_composer' ),
esc_html__( 'groove', 'js_composer' ),
esc_html__( 'ridge', 'js_composer' ),
esc_html__( 'inset', 'js_composer' ),
esc_html__( 'outset', 'js_composer' ),
esc_html__( 'initial', 'js_composer' ),
esc_html__( 'inherit', 'js_composer' ),
) );
foreach ( $styles as $style ) {
$output .= '<option value="' . $style . '">' . ucfirst( $style ) . '</option>';
}
return $output;
}
/**
* @return string
*/
public function getBackgroundStyleOptions() {
$output = '<option value="">' . esc_html__( 'Theme defaults', 'js_composer' ) . '</option>';
$styles = apply_filters( 'vc_css_editor_background_style_options_data', array(
esc_html__( 'Cover', 'js_composer' ) => 'cover',
esc_html__( 'Contain', 'js_composer' ) => 'contain',
esc_html__( 'No Repeat', 'js_composer' ) => 'no-repeat',
esc_html__( 'Repeat', 'js_composer' ) => 'repeat',
) );
foreach ( $styles as $name => $style ) {
$output .= '<option value="' . $style . '">' . $name . '</option>';
}
return $output;
}
/**
* @return string
*/
public function onionLayout() {
$output = sprintf( '<div class="vc_layout-onion vc_col-xs-7"><div class="vc_margin">%s<div class="vc_border">%s<div class="vc_padding">%s<div class="vc_content"><i></i></div></div></div></div></div>', $this->layerControls( 'margin' ), $this->layerControls( 'border', 'width' ), $this->layerControls( 'padding' ) );
return apply_filters( 'vc_css_editor_onion_layout', $output );
}
/**
* @param $name
* @param string $prefix
*
* @return string
*/
protected function layerControls( $name, $prefix = '' ) {
$output = '<label>' . esc_html( $name ) . '</label>';
foreach ( $this->positions as $pos ) {
$output .= sprintf( '<input type="text" name="%s_%s%s" data-name="%s%s-%s" class="vc_%s" placeholder="-" data-attribute="%s" value="">', esc_attr( $name ), esc_attr( $pos ), '' !== $prefix ? '_' . esc_attr( $prefix ) : '', esc_attr( $name ), '' !== $prefix ? '-' . esc_attr( $prefix ) : '', esc_attr( $pos ), esc_attr( $pos ), esc_attr( $name ) );
}
return apply_filters( 'vc_css_editor_layer_controls', $output );
}
}
}
/**
* @param $settings
* @param $value
*
* @return mixed
*/
function vc_css_editor_form_field( $settings, $value ) {
$css_editor = new WPBakeryVisualComposerCssEditor();
$css_editor->settings( $settings );
$css_editor->value( $value );
return $css_editor->render();
}
params/font_container/font_container.php 0000644 00000033251 15121635560 0014570 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Font_Container
* @since 4.3
* vc_map examples:
* array(
* 'type' => 'font_container',
* 'param_name' => 'font_container',
* 'value'=>'',
* 'settings'=>array(
* 'fields'=>array(
* 'tag'=>'h2',
* 'text_align',
* 'font_size',
* 'line_height',
* 'color',
*
* 'tag_description' => esc_html__('Select element tag.','js_composer'),
* 'text_align_description' => esc_html__('Select text alignment.','js_composer'),
* 'font_size_description' => esc_html__('Enter font size.','js_composer'),
* 'line_height_description' => esc_html__('Enter line height.','js_composer'),
* 'color_description' => esc_html__('Select color for your element.','js_composer'),
* ),
* ),
* ),
* Ordering of fields, font_family, tag, text_align and etc. will be Same as ordering in array!
* To provide default value to field use 'key' => 'value'
*/
class Vc_Font_Container {
/**
* @param $settings
* @param $value
*
* @return string
*/
public function render( $settings, $value ) {
$fields = array();
$values = array();
extract( $this->_vc_font_container_parse_attributes( $settings['settings']['fields'], $value ) );
$data = array();
$output = '';
if ( ! empty( $fields ) ) {
if ( isset( $fields['tag'] ) ) {
$data['tag'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Element tag', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-tag-container">
<select class="vc_font_container_form_field-tag-select">';
$tags = $this->_vc_font_container_get_allowed_tags();
foreach ( $tags as $tag ) {
$data['tag'] .= '<option value="' . $tag . '" class="' . $tag . '" ' . ( $values['tag'] === $tag ? 'selected' : '' ) . '>' . $tag . '</option>';
}
$data['tag'] .= '
</select>
</div>';
if ( isset( $fields['tag_description'] ) && strlen( $fields['tag_description'] ) > 0 ) {
$data['tag'] .= '
<span class="vc_description clear">' . $fields['tag_description'] . '</span>
';
}
$data['tag'] .= '</div>';
}
if ( isset( $fields['font_size'] ) ) {
$data['font_size'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Font size', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_size-container">
<input class="vc_font_container_form_field-font_size-input" type="text" value="' . $values['font_size'] . '" />
</div>';
if ( isset( $fields['font_size_description'] ) && strlen( $fields['font_size_description'] ) > 0 ) {
$data['font_size'] .= '
<span class="vc_description clear">' . $fields['font_size_description'] . '</span>
';
}
$data['font_size'] .= '</div>';
}
if ( isset( $fields['text_align'] ) ) {
$data['text_align'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Text align', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-text_align-container">
<select class="vc_font_container_form_field-text_align-select">
<option value="left" class="left" ' . ( 'left' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . esc_html__( 'left', 'js_composer' ) . '</option>
<option value="right" class="right" ' . ( 'right' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . esc_html__( 'right', 'js_composer' ) . '</option>
<option value="center" class="center" ' . ( 'center' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . esc_html__( 'center', 'js_composer' ) . '</option>
<option value="justify" class="justify" ' . ( 'justify' === $values['text_align'] ? 'selected="selected"' : '' ) . '>' . esc_html__( 'justify', 'js_composer' ) . '</option>
</select>
</div>';
if ( isset( $fields['text_align_description'] ) && strlen( $fields['text_align_description'] ) > 0 ) {
$data['text_align'] .= '
<span class="vc_description clear">' . $fields['text_align_description'] . '</span>
';
}
$data['text_align'] .= '</div>';
}
if ( isset( $fields['line_height'] ) ) {
$data['line_height'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Line height', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-line_height-container">
<input class="vc_font_container_form_field-line_height-input" type="text" value="' . $values['line_height'] . '" />
</div>';
if ( isset( $fields['line_height_description'] ) && strlen( $fields['line_height_description'] ) > 0 ) {
$data['line_height'] .= '
<span class="vc_description clear">' . $fields['line_height_description'] . '</span>
';
}
$data['line_height'] .= '</div>';
}
if ( isset( $fields['color'] ) ) {
$data['color'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Text color', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-color-container">
<div class="color-group">
<input type="text" value="' . $values['color'] . '" class="vc_font_container_form_field-color-input vc_color-control" />
</div>
</div>';
if ( isset( $fields['color_description'] ) && strlen( $fields['color_description'] ) > 0 ) {
$data['color'] .= '
<span class="vc_description clear">' . $fields['color_description'] . '</span>
';
}
$data['color'] .= '</div>';
}
if ( isset( $fields['font_family'] ) ) {
$data['font_family'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Font Family', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_family-container">
<select class="vc_font_container_form_field-font_family-select">';
$fonts = $this->_vc_font_container_get_web_safe_fonts();
foreach ( $fonts as $font_name => $font_data ) {
$data['font_family'] .= '<option value="' . $font_name . '" class="' . vc_build_safe_css_class( $font_name ) . '" ' . ( strtolower( $values['font_family'] ) === strtolower( $font_name ) ? 'selected' : '' ) . ' data[font_family]="' . rawurlencode( $font_data ) . '">' . $font_name . '</option>';
}
$data['font_family'] .= '
</select>
</div>';
if ( isset( $fields['font_family_description'] ) && strlen( $fields['font_family_description'] ) > 0 ) {
$data['font_family'] .= '
<span class="vc_description clear">' . $fields['font_family_description'] . '</span>
';
}
$data['font_family'] .= '</div>';
}
if ( isset( $fields['font_style'] ) ) {
$data['font_style'] = '
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label">' . esc_html__( 'Font style', 'js_composer' ) . '</div>
<div class="vc_font_container_form_field-font_style-container">
<label>
<input type="checkbox" class="vc_font_container_form_field-font_style-checkbox italic" value="italic" ' . ( '1' === $values['font_style_italic'] ? 'checked' : '' ) . '><span class="vc_font_container_form_field-font_style-label italic">' . esc_html__( 'italic', 'js_composer' ) . '</span>
</label>
<br />
<label>
<input type="checkbox" class="vc_font_container_form_field-font_style-checkbox bold" value="bold" ' . ( '1' === $values['font_style_bold'] ? 'checked' : '' ) . '><span class="vc_font_container_form_field-font_style-label bold">' . esc_html__( 'bold', 'js_composer' ) . '</span>
</label>
</div>';
if ( isset( $fields['font_style_description'] ) && strlen( $fields['font_style_description'] ) > 0 ) {
$data['font_style'] .= '
<span class="vc_description clear">' . $fields['font_style_description'] . '</span>
';
}
$data['font_style'] .= '</div>';
}
$data = apply_filters( 'vc_font_container_output_data', $data, $fields, $values, $settings );
// combine all in output, make sure you follow ordering
foreach ( $fields as $key => $field ) {
if ( isset( $data[ $key ] ) ) {
$output .= $data[ $key ];
}
}
}
$output .= '<input name="' . $settings['param_name'] . '" class="wpb_vc_param_value ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" type="hidden" value="' . $value . '" />';
return $output;
}
/**
* If field 'font_family' is used this is list of fonts available
* To modify this list, you should use add_filter('vc_font_container_get_fonts_filter','your_custom_function');
* vc_filter: vc_font_container_get_fonts_filter - to modify list of fonts
* @return array list of fonts
*/
public function _vc_font_container_get_web_safe_fonts() {
// this is "Web Safe FONTS" from w3c: http://www.w3schools.com/cssref/css_websafe_fonts.asp
$web_fonts = array(
'Georgia' => 'Georgia, serif',
'Palatino Linotype' => '"Palatino Linotype", "Book Antiqua", Palatino, serif',
'Book Antiqua' => '"Book Antiqua", Palatino, serif',
'Palatino' => 'Palatino, serif',
'Times New Roman' => '"Times New Roman", Times, serif',
'Arial' => 'Arial, Helvetica, sans-serif',
'Arial Black' => '"Arial Black", Gadget, sans-serif',
'Helvetica' => 'Helvetica, sans-serif',
'Comic Sans MS' => '"Comic Sans MS", cursive, sans-serif',
'Impact' => 'Impact, Charcoal, sans-serif',
'Charcoal' => 'Charcoal, sans-serif',
'Lucida Sans Unicode' => '"Lucida Sans Unicode", "Lucida Grande", sans-serif',
'Lucida Grande' => '"Lucida Grande", sans-serif',
'Tahoma' => 'Tahoma, Geneva, sans-serif',
'Geneva' => 'Geneva, sans-serif',
'Trebuchet MS' => '"Trebuchet MS", Helvetica, sans-serif',
'Verdana' => '"Trebuchet MS", Helvetica, sans-serif',
'Courier New' => '"Courier New", Courier, monospace',
'Lucida Console' => '"Lucida Console", Monaco, monospace',
'Monaco' => 'Monaco, monospace',
);
return apply_filters( 'vc_font_container_get_fonts_filter', $web_fonts );
}
/**
* If 'tag' field used this is list of allowed tags
* To modify this list, you should use add_filter('vc_font_container_get_allowed_tags','your_custom_function');
* vc_filter: vc_font_container_get_allowed_tags - to modify list of allowed tags by default
* @return array list of allowed tags
*/
public function _vc_font_container_get_allowed_tags() {
$allowed_tags = array(
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'p',
'div',
);
return apply_filters( 'vc_font_container_get_allowed_tags', $allowed_tags );
}
/**
* @param $attr
* @param $value
*
* @return array
*/
public function _vc_font_container_parse_attributes( $attr, $value ) {
$fields = array();
if ( isset( $attr ) ) {
foreach ( $attr as $key => $val ) {
if ( is_numeric( $key ) ) {
$fields[ $val ] = '';
} else {
$fields[ $key ] = $val;
}
}
}
$values = vc_parse_multi_attribute( $value, array(
'tag' => isset( $fields['tag'] ) ? $fields['tag'] : 'h2',
'font_size' => isset( $fields['font_size'] ) ? $fields['font_size'] : '',
'font_style_italic' => isset( $fields['font_style_italic'] ) ? $fields['font_style_italic'] : '',
'font_style_bold' => isset( $fields['font_style_bold'] ) ? $fields['font_style_bold'] : '',
'font_family' => isset( $fields['font_family'] ) ? $fields['font_family'] : '',
'color' => isset( $fields['color'] ) ? $fields['color'] : '',
'line_height' => isset( $fields['line_height'] ) ? $fields['line_height'] : '',
'text_align' => isset( $fields['text_align'] ) ? $fields['text_align'] : 'left',
'tag_description' => isset( $fields['tag_description'] ) ? $fields['tag_description'] : '',
'font_size_description' => isset( $fields['font_size_description'] ) ? $fields['font_size_description'] : '',
'font_style_description' => isset( $fields['font_style_description'] ) ? $fields['font_style_description'] : '',
'font_family_description' => isset( $fields['font_family_description'] ) ? $fields['font_family_description'] : '',
'color_description' => isset( $fields['color_description'] ) ? $fields['color_description'] : 'left',
'line_height_description' => isset( $fields['line_height_description'] ) ? $fields['line_height_description'] : '',
'text_align_description' => isset( $fields['text_align_description'] ) ? $fields['text_align_description'] : '',
) );
return array(
'fields' => $fields,
'values' => $values,
);
}
}
/**
* @param $settings
* @param $value
*
* @return mixed
*/
function vc_font_container_form_field( $settings, $value ) {
$font_container = new Vc_Font_Container();
return apply_filters( 'vc_font_container_render_filter', $font_container->render( $settings, $value ) );
}
params/google_fonts/google_fonts.php 0000644 00000237426 15121635560 0013734 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Google_Fonts
* @since 4.3
* vc_map examples:
* 'params' => array(
* array(
* 'type' => 'google_fonts',
* 'param_name' => 'google_fonts',
* 'value' => '',// Not recommended, this will override 'settings'. Example:
* 'font_family:'.rawurlencode('Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic').'|font_style:'.rawurlencode('900
* bold italic:900:italic'),
* 'settings' => array(
* 'fields'=>array(
* 'font_family'=>'Abril Fatface:regular',//
* 'Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic',
* Default font family and all available styles to fetch
* 'font_style'=>'400 regular:400:normal', // Default font style. Name:weight:style, example:
* "800 bold regular:800:normal"
* 'font_family_description' => esc_html__('Select font family.','js_composer'),
* 'font_style_description' => esc_html__('Select font styling.','js_composer')
* )
* ),
* 'description' => esc_html__( 'Description for this group', 'js_composer' ), // Description for field group
* ),
* )
*/
class Vc_Google_Fonts {
public $fonts_list = '[{"font_family":"Abril Fatface","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"ABeeZee","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Abel","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aclonica","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Acme","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Actor","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Adamina","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Advent Pro","font_styles":"100,200,300,regular,500,600,700","font_types":"100 light regular:100:normal,200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Aguafina Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Akronim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aladin","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aldrich","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alef","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Alegreya","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya SC","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya Sans","font_styles":"100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alegreya Sans SC","font_styles":"100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Alex Brush","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alfa Slab One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alice","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alike","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Alike Angular","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allan","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Allerta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allerta Stencil","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Allura","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Almendra","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Almendra Display","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Almendra SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Amarante","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Amaranth","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Amatic SC","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Amethysta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Anaheim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Andada","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Andika","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Angkor","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Annie Use Your Telescope","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Anonymous Pro","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Antic","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Antic Didone","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Antic Slab","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Anton","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Arapey","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Arbutus","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Arbutus Slab","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Architects Daughter","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Archivo Black","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Archivo Narrow","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Arimo","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Arizonia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Armata","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Artifika","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Arvo","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Asap","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Asset","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Astloch","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Asul","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Atomic Age","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Aubrey","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Audiowide","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Autour One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Average","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Average Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Averia Gruesa Libre","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Averia Libre","font_styles":"300,300italic,regular,italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Averia Sans Libre","font_styles":"300,300italic,regular,italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Averia Serif Libre","font_styles":"300,300italic,regular,italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Bad Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Balthazar","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bangers","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Basic","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Battambang","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Baumans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bayon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Belgrano","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Belleza","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"BenchNine","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Bentham","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Berkshire Swash","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bevan","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bigelow Rules","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bigshot One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bilbo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bilbo Swash Caps","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bitter","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Black Ops One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bokor","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bonbon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Boogaloo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bowlby One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bowlby One SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Brawler","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bree Serif","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bubblegum Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Bubbler One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Buda","font_styles":"300","font_types":"300 light regular:300:normal"},{"font_family":"Buenard","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Butcherman","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Butterfly Kids","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cabin","font_styles":"regular,italic,500,500italic,600,600italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Cabin Condensed","font_styles":"regular,500,600,700","font_types":"400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Cabin Sketch","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Caesar Dressing","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cagliostro","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Calligraffitti","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cambo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Candal","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cantarell","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Cantata One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cantora One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Capriola","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cardo","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Carme","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Carrois Gothic","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Carrois Gothic SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Carter One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Caudex","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Cedarville Cursive","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ceviche One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Changa One","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Chango","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Chau Philomene One","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Chela One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Chelsea Market","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Chenla","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cherry Cream Soda","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cherry Swash","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Chewy","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Chicle","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Chivo","font_styles":"regular,italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Cinzel","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Cinzel Decorative","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Clicker Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Coda","font_styles":"regular,800","font_types":"400 regular:400:normal,800 bold regular:800:normal"},{"font_family":"Coda Caption","font_styles":"800","font_types":"800 bold regular:800:normal"},{"font_family":"Codystar","font_styles":"300,regular","font_types":"300 light regular:300:normal,400 regular:400:normal"},{"font_family":"Combo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Comfortaa","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Coming Soon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Concert One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Condiment","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Content","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Contrail One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Convergence","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cookie","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Copse","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Corben","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Courgette","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cousine","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Coustard","font_styles":"regular,900","font_types":"400 regular:400:normal,900 bold regular:900:normal"},{"font_family":"Covered By Your Grace","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Crafty Girls","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Creepster","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Crete Round","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Crimson Text","font_styles":"regular,italic,600,600italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Croissant One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Crushed","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cuprum","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Cutive","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Cutive Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Damion","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Dancing Script","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Dangrek","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Dawning of a New Day","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Days One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Delius","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Delius Swash Caps","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Delius Unicase","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Della Respira","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Denk One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Devonshire","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Didact Gothic","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Diplomata","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Diplomata SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Domine","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Donegal One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Doppio One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Dorsa","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Dosis","font_styles":"200,300,regular,500,600,700,800","font_types":"200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal,800 bold regular:800:normal"},{"font_family":"Dr Sugiyama","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Droid Sans","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Droid Sans Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Droid Serif","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Duru Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Dynalight","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"EB Garamond","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Eagle Lake","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Eater","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Economica","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Electrolize","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Elsie","font_styles":"regular,900","font_types":"400 regular:400:normal,900 bold regular:900:normal"},{"font_family":"Elsie Swash Caps","font_styles":"regular,900","font_types":"400 regular:400:normal,900 bold regular:900:normal"},{"font_family":"Emblema One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Emilys Candy","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Engagement","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Englebert","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Enriqueta","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Erica One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Esteban","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Euphoria Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ewert","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Exo","font_styles":"100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,200 light regular:200:normal,200 light italic:200:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Exo 2","font_styles":"100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,200 light regular:200:normal,200 light italic:200:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Expletus Sans","font_styles":"regular,italic,500,500italic,600,600italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Fanwood Text","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Fascinate","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fascinate Inline","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Faster One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fasthand","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fauna One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Federant","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Federo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Felipa","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fenix","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Finger Paint","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fira Mono","font_styles":"400,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Fira Sans","font_styles":"300,300italic,400,400italic,500,500italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Fjalla One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fjord One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Flamenco","font_styles":"300,regular","font_types":"300 light regular:300:normal,400 regular:400:normal"},{"font_family":"Flavors","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fondamento","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Fontdiner Swanky","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Forum","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Francois One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Freckle Face","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fredericka the Great","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fredoka One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Freehand","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fresca","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Frijole","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fruktur","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Fugaz One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"GFS Didot","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"GFS Neohellenic","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Gabriela","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gafata","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Galdeano","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Galindo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gentium Basic","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Gentium Book Basic","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Geo","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Geostar","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Geostar Fill","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Germania One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gilda Display","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Give You Glory","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Glass Antiqua","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Glegoo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gloria Hallelujah","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Goblin One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gochi Hand","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gorditas","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Goudy Bookletter 1911","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Graduate","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Grand Hotel","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gravitas One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Great Vibes","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Griffy","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gruppo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Gudea","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Habibi","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Hammersmith One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Hanalei","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Hanalei Fill","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Handlee","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Hanuman","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Happy Monkey","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Headland One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Henny Penny","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Herr Von Muellerhoff","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Hind","font_styles":"300,regular,500,600,700","font_types":"300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Holtwood One SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Homemade Apple","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Homenaje","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"IM Fell DW Pica","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"IM Fell DW Pica SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"IM Fell Double Pica","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"IM Fell Double Pica SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"IM Fell English","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"IM Fell English SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"IM Fell French Canon","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"IM Fell French Canon SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"IM Fell Great Primer","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"IM Fell Great Primer SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Iceberg","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Iceland","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Imprima","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Inconsolata","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Inder","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Indie Flower","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Inika","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Irish Grover","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Istok Web","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Italiana","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Italianno","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jacques Francois","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jacques Francois Shadow","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jim Nightshade","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jockey One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jolly Lodger","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Josefin Sans","font_styles":"100,100italic,300,300italic,regular,italic,600,600italic,700,700italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Josefin Slab","font_styles":"100,100italic,300,300italic,regular,italic,600,600italic,700,700italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Joti One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Judson","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Julee","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Julius Sans One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Junge","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Jura","font_styles":"300,regular,500,600","font_types":"300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal"},{"font_family":"Just Another Hand","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Just Me Again Down Here","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kameron","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Kantumruy","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Karla","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Kaushan Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kavoon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kdam Thmor","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Keania One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kelly Slab","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kenia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Khmer","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kite One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Knewave","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kotta One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Koulen","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kranky","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Kreon","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Kristi","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Krona One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"La Belle Aurore","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lancelot","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lato","font_styles":"100,100italic,300,300italic,regular,italic,700,700italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"League Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Leckerli One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ledger","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lekton","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Lemon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Libre Baskerville","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Life Savers","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Lilita One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lily Script One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Limelight","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Linden Hill","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Lobster","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lobster Two","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Londrina Outline","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Londrina Shadow","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Londrina Sketch","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Londrina Solid","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lora","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Love Ya Like A Sister","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Loved by the King","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lovers Quarrel","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Luckiest Guy","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Lusitana","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Lustria","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Macondo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Macondo Swash Caps","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Magra","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Maiden Orange","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mako","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marcellus","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marcellus SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marck Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Margarine","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marko One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marmelad","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Marvel","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Mate","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Mate SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Maven Pro","font_styles":"regular,500,700,900","font_types":"400 regular:400:normal,500 bold regular:500:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"McLaren","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Meddon","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"MedievalSharp","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Medula One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Megrim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Meie Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Merienda","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Merienda One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Merriweather","font_styles":"300,300italic,regular,italic,700,700italic,900,900italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Merriweather Sans","font_styles":"300,300italic,regular,italic,700,700italic,800,800italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic"},{"font_family":"Metal","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Metal Mania","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Metamorphous","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Metrophobic","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Michroma","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Milonga","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Miltonian","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Miltonian Tattoo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Miniver","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Miss Fajardose","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Modern Antiqua","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Molengo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Molle","font_styles":"italic","font_types":"400 italic:400:italic"},{"font_family":"Monda","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Monofett","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Monoton","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Monsieur La Doulaise","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Montaga","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Montez","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Montserrat","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Montserrat Alternates","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Montserrat Subrayada","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Moul","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Moulpali","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mountains of Christmas","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Mouse Memoirs","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mr Bedfort","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mr Dafoe","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mr De Haviland","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mrs Saint Delafield","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Mrs Sheppards","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Muli","font_styles":"300,300italic,regular,italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic"},{"font_family":"Mystery Quest","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Neucha","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Neuton","font_styles":"200,300,regular,italic,700,800","font_types":"200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,800 bold regular:800:normal"},{"font_family":"New Rocker","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"News Cycle","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Niconne","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nixie One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nobile","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Nokora","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Norican","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nosifer","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nothing You Could Do","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Noticia Text","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Noto Sans","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Noto Serif","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Nova Cut","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Flat","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Oval","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Round","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Slim","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nova Square","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Numans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Nunito","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Odor Mean Chey","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Offside","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Old Standard TT","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Oldenburg","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Oleo Script","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Oleo Script Swash Caps","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Open Sans","font_styles":"300,300italic,regular,italic,600,600italic,700,700italic,800,800italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic,800 bold regular:800:normal,800 bold italic:800:italic"},{"font_family":"Open Sans Condensed","font_styles":"300,300italic,700","font_types":"300 light regular:300:normal,300 light italic:300:italic,700 bold regular:700:normal"},{"font_family":"Oranienbaum","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Orbitron","font_styles":"regular,500,700,900","font_types":"400 regular:400:normal,500 bold regular:500:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Oregano","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Orienta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Original Surfer","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Oswald","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Over the Rainbow","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Overlock","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Overlock SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ovo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Oxygen","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Oxygen Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"PT Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"PT Sans","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"PT Sans Caption","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"PT Sans Narrow","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"PT Serif","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"PT Serif Caption","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Pacifico","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Paprika","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Parisienne","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Passero One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Passion One","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Pathway Gothic One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Patrick Hand","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Patrick Hand SC","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Patua One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Paytone One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Peralta","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Permanent Marker","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Petit Formal Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Petrona","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Philosopher","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Piedra","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Pinyon Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Pirata One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Plaster","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Play","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Playball","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Playfair Display","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Playfair Display SC","font_styles":"regular,italic,700,700italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Podkova","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Poiret One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Poller One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Poly","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Pompiere","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Pontano Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Port Lligat Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Port Lligat Slab","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Prata","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Preahvihear","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Press Start 2P","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Princess Sofia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Prociono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Prosto One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Puritan","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Purple Purse","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Quando","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Quantico","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Quattrocento","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Quattrocento Sans","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Questrial","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Quicksand","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Quintessential","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Qwigley","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Racing Sans One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Radley","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Raleway","font_styles":"100,200,300,regular,500,600,700,800,900","font_types":"100 light regular:100:normal,200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal,800 bold regular:800:normal,900 bold regular:900:normal"},{"font_family":"Raleway Dots","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rambla","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Rammetto One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ranchers","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rancho","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rationale","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Redressed","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Reenie Beanie","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Revalia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ribeye","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ribeye Marrow","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Righteous","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Risque","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Roboto","font_styles":"100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic","font_types":"100 light regular:100:normal,100 light italic:100:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Roboto Condensed","font_styles":"300,300italic,regular,italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Roboto Slab","font_styles":"100,300,regular,700","font_types":"100 light regular:100:normal,300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Rochester","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rock Salt","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rokkitt","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Romanesco","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ropa Sans","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Rosario","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Rosarivo","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Rouge Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rubik Mono One","font_styles":"400","font_types":"400 regular:400:normal"},{"font_family":"Rubik One","font_styles":"400","font_types":"400 regular:400:normal"},{"font_family":"Ruda","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Rufina","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Ruge Boogie","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ruluko","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rum Raisin","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ruslan Display","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Russo One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ruthie","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Rye","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sacramento","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sail","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Salsa","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sanchez","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Sancreek","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sansita One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sarina","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Satisfy","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Scada","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Schoolbell","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Seaweed Script","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sevillana","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Seymour One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Shadows Into Light","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Shadows Into Light Two","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Shanti","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Share","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Share Tech","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Share Tech Mono","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Shojumaru","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Short Stack","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Siemreap","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sigmar One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Signika","font_styles":"300,regular,600,700","font_types":"300 light regular:300:normal,400 regular:400:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Signika Negative","font_styles":"300,regular,600,700","font_types":"300 light regular:300:normal,400 regular:400:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Simonetta","font_styles":"regular,italic,900,900italic","font_types":"400 regular:400:normal,400 italic:400:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Sintony","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Sirin Stencil","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Six Caps","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Skranji","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Slackey","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Smokum","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Smythe","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sniglet","font_styles":"regular,800","font_types":"400 regular:400:normal,800 bold regular:800:normal"},{"font_family":"Snippet","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Snowburst One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sofadi One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sofia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sonsie One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sorts Mill Goudy","font_styles":"regular,italic","font_types":"400 regular:400:normal,400 italic:400:italic"},{"font_family":"Source Code Pro","font_styles":"200,300,regular,500,600,700,900","font_types":"200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,500 bold regular:500:normal,600 bold regular:600:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Source Sans Pro","font_styles":"200,200italic,300,300italic,regular,italic,600,600italic,700,700italic,900,900italic","font_types":"200 light regular:200:normal,200 light italic:200:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal,900 bold italic:900:italic"},{"font_family":"Source Serif Pro","font_styles":"400,600,700","font_types":"400 regular:400:normal,600 bold regular:600:normal,700 bold regular:700:normal"},{"font_family":"Special Elite","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Spicy Rice","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Spinnaker","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Spirax","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Squada One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Stalemate","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Stalinist One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Stardos Stencil","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Stint Ultra Condensed","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Stint Ultra Expanded","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Stoke","font_styles":"300,regular","font_types":"300 light regular:300:normal,400 regular:400:normal"},{"font_family":"Strait","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sue Ellen Francisco","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Sunshiney","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Supermercado One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Suwannaphum","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Swanky and Moo Moo","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Syncopate","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Tangerine","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Taprom","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Tauri","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Telex","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Tenor Sans","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Text Me One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"The Girl Next Door","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Tienne","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Tinos","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Titan One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Titillium Web","font_styles":"200,200italic,300,300italic,regular,italic,600,600italic,700,700italic,900","font_types":"200 light regular:200:normal,200 light italic:200:italic,300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,600 bold regular:600:normal,600 bold italic:600:italic,700 bold regular:700:normal,700 bold italic:700:italic,900 bold regular:900:normal"},{"font_family":"Trade Winds","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Trocchi","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Trochut","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Trykker","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Tulpen One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ubuntu","font_styles":"300,300italic,regular,italic,500,500italic,700,700italic","font_types":"300 light regular:300:normal,300 light italic:300:italic,400 regular:400:normal,400 italic:400:italic,500 bold regular:500:normal,500 bold italic:500:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Ubuntu Condensed","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Ubuntu Mono","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Ultra","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Uncial Antiqua","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Underdog","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Unica One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"UnifrakturCook","font_styles":"700","font_types":"700 bold regular:700:normal"},{"font_family":"UnifrakturMaguntia","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Unkempt","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Unlock","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Unna","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"VT323","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Vampiro One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Varela","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Varela Round","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Vast Shadow","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Vibur","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Vidaloka","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Viga","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Voces","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Volkhov","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Vollkorn","font_styles":"regular,italic,700,700italic","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal,700 bold italic:700:italic"},{"font_family":"Voltaire","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Waiting for the Sunrise","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Wallpoet","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Walter Turncoat","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Warnes","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Wellfleet","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Wendy One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Wire One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Yanone Kaffeesatz","font_styles":"200,300,regular,700","font_types":"200 light regular:200:normal,300 light regular:300:normal,400 regular:400:normal,700 bold regular:700:normal"},{"font_family":"Yellowtail","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Yeseva One","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Yesteryear","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Zeyada","font_styles":"regular","font_types":"400 regular:400:normal"}]';
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.3
*/
public function render( $settings, $value ) {
/** @var array $fields - used in template.php */
$fields = array();
/** @var array $values - used in template.php */
$values = array();
$set = isset( $settings['settings'], $settings['settings']['fields'] ) ? $settings['settings']['fields'] : array();
extract( $this->_vc_google_fonts_parse_attributes( $set, $value ) );
ob_start();
include vc_path_dir( 'TEMPLATES_DIR', 'params/google_fonts/template.php' );
return ob_get_clean();
}
/**
*
* Load google fonts list for param
* To change this list use add_filters('vc_google_fonts_get_fonts_filter','your_custom_function'); and change array
* vc_filter: vc_google_fonts_get_fonts_filter
*
* @return array
* @since 4.3
*/
public function _vc_google_fonts_get_fonts() {
return apply_filters( 'vc_google_fonts_get_fonts_filter', json_decode( $this->fonts_list ) );
}
/**
* @param $attr
* @param $value
*
* @return array
* @since 4.3
*/
public function _vc_google_fonts_parse_attributes( $attr, $value ) {
$fields = array();
if ( is_array( $attr ) && ! empty( $attr ) ) {
foreach ( $attr as $key => $val ) {
if ( is_numeric( $key ) ) {
$fields[ $val ] = '';
} else {
$fields[ $key ] = $val;
}
}
}
$values = vc_parse_multi_attribute( $value, array(
'font_family' => isset( $fields['font_family'] ) ? $fields['font_family'] : '',
'font_style' => isset( $fields['font_style'] ) ? $fields['font_style'] : '',
'font_family_description' => isset( $fields['font_family_description'] ) ? $fields['font_family_description'] : '',
'font_style_description' => isset( $fields['font_style_description'] ) ? $fields['font_style_description'] : '',
) );
return array(
'fields' => $fields,
'values' => $values,
);
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $settings
* @param $value
*
* @return mixed rendered template for params in edit form
*
* @since 4.3
* vc_filter: vc_google_fonts_render_filter
*/
function vc_google_fonts_form_field( $settings, $value ) {
$google_fonts = new Vc_Google_Fonts();
return apply_filters( 'vc_google_fonts_render_filter', $google_fonts->render( $settings, $value ) );
}
params/colorpicker/colorpicker.php 0000644 00000000725 15121635560 0013400 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Param 'colorpicker' field
*
* @param $settings
* @param $value
*
* @return string
* @since 4.4
*/
function vc_colorpicker_form_field( $settings, $value ) {
return sprintf( '<div class="color-group"><input name="%s" class="wpb_vc_param_value wpb-textinput %s %s_field vc_color-control" type="text" value="%s"/></div>', $settings['param_name'], $settings['param_name'], $settings['type'], $value );
}
params/href/href.php 0000644 00000001034 15121635560 0010412 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.4
*/
function vc_href_form_field( $settings, $value ) {
if ( ! is_string( $value ) || strlen( $value ) === 0 ) {
$value = 'http://';
}
return sprintf( '<div class="vc_href-form-field"><input name="%s" class="wpb_vc_param_value wpb-textinput %s %s_field" type="text" value="%s"/></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] ), esc_attr( $settings['type'] ), $value );
}
params/el_id/el_id.php 0000644 00000001012 15121635560 0010666 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.5
*/
function vc_el_id_form_field( $settings, $value ) {
$value_output = sprintf( '<div class="vc-param-el_id"><input name="%s" class="wpb_vc_param_value wpb-textinput %s_field" type="text" value="%s" /></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), $value );
return apply_filters( 'vc_el_id_render_filter', $value_output );
}
params/animation_style/animation_style.php 0000644 00000036163 15121635560 0015153 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_ParamAnimation
*
* For working with animations
* array(
* 'type' => 'animation_style',
* 'heading' => esc_html__( 'Animation', 'js_composer' ),
* 'param_name' => 'animation',
* ),
* Preview in https://daneden.github.io/animate.css/
* @since 4.4
*/
class Vc_ParamAnimation {
/**
* @since 4.4
* @var array $settings parameter settings from vc_map
*/
protected $settings;
/**
* @since 4.4
* @var string $value parameter value
*/
protected $value;
/**
* Define available animation effects
* @return array
* @since 4.4
* vc_filter: vc_param_animation_style_list - to override animation styles
* array
*/
protected function animationStyles() {
$styles = array(
array(
'values' => array(
esc_html__( 'None', 'js_composer' ) => 'none',
),
),
array(
'label' => esc_html__( 'Attention Seekers', 'js_composer' ),
'values' => array(
// text to display => value
esc_html__( 'bounce', 'js_composer' ) => array(
'value' => 'bounce',
'type' => 'other',
),
esc_html__( 'flash', 'js_composer' ) => array(
'value' => 'flash',
'type' => 'other',
),
esc_html__( 'pulse', 'js_composer' ) => array(
'value' => 'pulse',
'type' => 'other',
),
esc_html__( 'rubberBand', 'js_composer' ) => array(
'value' => 'rubberBand',
'type' => 'other',
),
esc_html__( 'shake', 'js_composer' ) => array(
'value' => 'shake',
'type' => 'other',
),
esc_html__( 'swing', 'js_composer' ) => array(
'value' => 'swing',
'type' => 'other',
),
esc_html__( 'tada', 'js_composer' ) => array(
'value' => 'tada',
'type' => 'other',
),
esc_html__( 'wobble', 'js_composer' ) => array(
'value' => 'wobble',
'type' => 'other',
),
),
),
array(
'label' => esc_html__( 'Bouncing Entrances', 'js_composer' ),
'values' => array(
// text to display => value
esc_html__( 'bounceIn', 'js_composer' ) => array(
'value' => 'bounceIn',
'type' => 'in',
),
esc_html__( 'bounceInDown', 'js_composer' ) => array(
'value' => 'bounceInDown',
'type' => 'in',
),
esc_html__( 'bounceInLeft', 'js_composer' ) => array(
'value' => 'bounceInLeft',
'type' => 'in',
),
esc_html__( 'bounceInRight', 'js_composer' ) => array(
'value' => 'bounceInRight',
'type' => 'in',
),
esc_html__( 'bounceInUp', 'js_composer' ) => array(
'value' => 'bounceInUp',
'type' => 'in',
),
),
),
array(
'label' => esc_html__( 'Bouncing Exits', 'js_composer' ),
'values' => array(
// text to display => value
esc_html__( 'bounceOut', 'js_composer' ) => array(
'value' => 'bounceOut',
'type' => 'out',
),
esc_html__( 'bounceOutDown', 'js_composer' ) => array(
'value' => 'bounceOutDown',
'type' => 'out',
),
esc_html__( 'bounceOutLeft', 'js_composer' ) => array(
'value' => 'bounceOutLeft',
'type' => 'out',
),
esc_html__( 'bounceOutRight', 'js_composer' ) => array(
'value' => 'bounceOutRight',
'type' => 'out',
),
esc_html__( 'bounceOutUp', 'js_composer' ) => array(
'value' => 'bounceOutUp',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Fading Entrances', 'js_composer' ),
'values' => array(
// text to display => value
esc_html__( 'fadeIn', 'js_composer' ) => array(
'value' => 'fadeIn',
'type' => 'in',
),
esc_html__( 'fadeInDown', 'js_composer' ) => array(
'value' => 'fadeInDown',
'type' => 'in',
),
esc_html__( 'fadeInDownBig', 'js_composer' ) => array(
'value' => 'fadeInDownBig',
'type' => 'in',
),
esc_html__( 'fadeInLeft', 'js_composer' ) => array(
'value' => 'fadeInLeft',
'type' => 'in',
),
esc_html__( 'fadeInLeftBig', 'js_composer' ) => array(
'value' => 'fadeInLeftBig',
'type' => 'in',
),
esc_html__( 'fadeInRight', 'js_composer' ) => array(
'value' => 'fadeInRight',
'type' => 'in',
),
esc_html__( 'fadeInRightBig', 'js_composer' ) => array(
'value' => 'fadeInRightBig',
'type' => 'in',
),
esc_html__( 'fadeInUp', 'js_composer' ) => array(
'value' => 'fadeInUp',
'type' => 'in',
),
esc_html__( 'fadeInUpBig', 'js_composer' ) => array(
'value' => 'fadeInUpBig',
'type' => 'in',
),
),
),
array(
'label' => esc_html__( 'Fading Exits', 'js_composer' ),
'values' => array(
esc_html__( 'fadeOut', 'js_composer' ) => array(
'value' => 'fadeOut',
'type' => 'out',
),
esc_html__( 'fadeOutDown', 'js_composer' ) => array(
'value' => 'fadeOutDown',
'type' => 'out',
),
esc_html__( 'fadeOutDownBig', 'js_composer' ) => array(
'value' => 'fadeOutDownBig',
'type' => 'out',
),
esc_html__( 'fadeOutLeft', 'js_composer' ) => array(
'value' => 'fadeOutLeft',
'type' => 'out',
),
esc_html__( 'fadeOutLeftBig', 'js_composer' ) => array(
'value' => 'fadeOutLeftBig',
'type' => 'out',
),
esc_html__( 'fadeOutRight', 'js_composer' ) => array(
'value' => 'fadeOutRight',
'type' => 'out',
),
esc_html__( 'fadeOutRightBig', 'js_composer' ) => array(
'value' => 'fadeOutRightBig',
'type' => 'out',
),
esc_html__( 'fadeOutUp', 'js_composer' ) => array(
'value' => 'fadeOutUp',
'type' => 'out',
),
esc_html__( 'fadeOutUpBig', 'js_composer' ) => array(
'value' => 'fadeOutUpBig',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Flippers', 'js_composer' ),
'values' => array(
esc_html__( 'flip', 'js_composer' ) => array(
'value' => 'flip',
'type' => 'other',
),
esc_html__( 'flipInX', 'js_composer' ) => array(
'value' => 'flipInX',
'type' => 'in',
),
esc_html__( 'flipInY', 'js_composer' ) => array(
'value' => 'flipInY',
'type' => 'in',
),
esc_html__( 'flipOutX', 'js_composer' ) => array(
'value' => 'flipOutX',
'type' => 'out',
),
esc_html__( 'flipOutY', 'js_composer' ) => array(
'value' => 'flipOutY',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Lightspeed', 'js_composer' ),
'values' => array(
esc_html__( 'lightSpeedIn', 'js_composer' ) => array(
'value' => 'lightSpeedIn',
'type' => 'in',
),
esc_html__( 'lightSpeedOut', 'js_composer' ) => array(
'value' => 'lightSpeedOut',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Rotating Entrances', 'js_composer' ),
'values' => array(
esc_html__( 'rotateIn', 'js_composer' ) => array(
'value' => 'rotateIn',
'type' => 'in',
),
esc_html__( 'rotateInDownLeft', 'js_composer' ) => array(
'value' => 'rotateInDownLeft',
'type' => 'in',
),
esc_html__( 'rotateInDownRight', 'js_composer' ) => array(
'value' => 'rotateInDownRight',
'type' => 'in',
),
esc_html__( 'rotateInUpLeft', 'js_composer' ) => array(
'value' => 'rotateInUpLeft',
'type' => 'in',
),
esc_html__( 'rotateInUpRight', 'js_composer' ) => array(
'value' => 'rotateInUpRight',
'type' => 'in',
),
),
),
array(
'label' => esc_html__( 'Rotating Exits', 'js_composer' ),
'values' => array(
esc_html__( 'rotateOut', 'js_composer' ) => array(
'value' => 'rotateOut',
'type' => 'out',
),
esc_html__( 'rotateOutDownLeft', 'js_composer' ) => array(
'value' => 'rotateOutDownLeft',
'type' => 'out',
),
esc_html__( 'rotateOutDownRight', 'js_composer' ) => array(
'value' => 'rotateOutDownRight',
'type' => 'out',
),
esc_html__( 'rotateOutUpLeft', 'js_composer' ) => array(
'value' => 'rotateOutUpLeft',
'type' => 'out',
),
esc_html__( 'rotateOutUpRight', 'js_composer' ) => array(
'value' => 'rotateOutUpRight',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Specials', 'js_composer' ),
'values' => array(
esc_html__( 'hinge', 'js_composer' ) => array(
'value' => 'hinge',
'type' => 'out',
),
esc_html__( 'rollIn', 'js_composer' ) => array(
'value' => 'rollIn',
'type' => 'in',
),
esc_html__( 'rollOut', 'js_composer' ) => array(
'value' => 'rollOut',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Zoom Entrances', 'js_composer' ),
'values' => array(
esc_html__( 'zoomIn', 'js_composer' ) => array(
'value' => 'zoomIn',
'type' => 'in',
),
esc_html__( 'zoomInDown', 'js_composer' ) => array(
'value' => 'zoomInDown',
'type' => 'in',
),
esc_html__( 'zoomInLeft', 'js_composer' ) => array(
'value' => 'zoomInLeft',
'type' => 'in',
),
esc_html__( 'zoomInRight', 'js_composer' ) => array(
'value' => 'zoomInRight',
'type' => 'in',
),
esc_html__( 'zoomInUp', 'js_composer' ) => array(
'value' => 'zoomInUp',
'type' => 'in',
),
),
),
array(
'label' => esc_html__( 'Zoom Exits', 'js_composer' ),
'values' => array(
esc_html__( 'zoomOut', 'js_composer' ) => array(
'value' => 'zoomOut',
'type' => 'out',
),
esc_html__( 'zoomOutDown', 'js_composer' ) => array(
'value' => 'zoomOutDown',
'type' => 'out',
),
esc_html__( 'zoomOutLeft', 'js_composer' ) => array(
'value' => 'zoomOutLeft',
'type' => 'out',
),
esc_html__( 'zoomOutRight', 'js_composer' ) => array(
'value' => 'zoomOutRight',
'type' => 'out',
),
esc_html__( 'zoomOutUp', 'js_composer' ) => array(
'value' => 'zoomOutUp',
'type' => 'out',
),
),
),
array(
'label' => esc_html__( 'Slide Entrances', 'js_composer' ),
'values' => array(
esc_html__( 'slideInDown', 'js_composer' ) => array(
'value' => 'slideInDown',
'type' => 'in',
),
esc_html__( 'slideInLeft', 'js_composer' ) => array(
'value' => 'slideInLeft',
'type' => 'in',
),
esc_html__( 'slideInRight', 'js_composer' ) => array(
'value' => 'slideInRight',
'type' => 'in',
),
esc_html__( 'slideInUp', 'js_composer' ) => array(
'value' => 'slideInUp',
'type' => 'in',
),
),
),
array(
'label' => esc_html__( 'Slide Exits', 'js_composer' ),
'values' => array(
esc_html__( 'slideOutDown', 'js_composer' ) => array(
'value' => 'slideOutDown',
'type' => 'out',
),
esc_html__( 'slideOutLeft', 'js_composer' ) => array(
'value' => 'slideOutLeft',
'type' => 'out',
),
esc_html__( 'slideOutRight', 'js_composer' ) => array(
'value' => 'slideOutRight',
'type' => 'out',
),
esc_html__( 'slideOutUp', 'js_composer' ) => array(
'value' => 'slideOutUp',
'type' => 'out',
),
),
),
);
/**
* Used to override animation style list
* @since 4.4
*/
return apply_filters( 'vc_param_animation_style_list', $styles );
}
/**
* @param array $styles - array of styles to group
* @param string|array $type - what type to return
*
* @return array
* @since 4.4
*/
public function groupStyleByType( $styles, $type ) {
$grouped = array();
foreach ( $styles as $group ) {
$inner_group = array( 'values' => array() );
if ( isset( $group['label'] ) ) {
$inner_group['label'] = $group['label'];
}
foreach ( $group['values'] as $key => $value ) {
if ( ( is_array( $value ) && isset( $value['type'] ) && ( ( is_string( $type ) && $value['type'] === $type ) || is_array( $type ) && in_array( $value['type'], $type, true ) ) ) || ! is_array( $value ) || ! isset( $value['type'] ) ) {
$inner_group['values'][ $key ] = $value;
}
}
if ( ! empty( $inner_group['values'] ) ) {
$grouped[] = $inner_group;
}
}
return $grouped;
}
/**
* Set variables and register animate-css asset
* @param $settings
* @param $value
* @since 4.4
*
*/
public function __construct( $settings, $value ) {
$this->settings = $settings;
$this->value = $value;
wp_register_style( 'vc_animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION );
}
/**
* Render edit form output
* @return string
* @since 4.4
*/
public function render() {
$output = '<div class="vc_row">';
wp_enqueue_style( 'vc_animate-css' );
$styles = $this->animationStyles();
if ( isset( $this->settings['settings']['type'] ) ) {
$styles = $this->groupStyleByType( $styles, $this->settings['settings']['type'] );
}
if ( isset( $this->settings['settings']['custom'] ) && is_array( $this->settings['settings']['custom'] ) ) {
$styles = array_merge( $styles, $this->settings['settings']['custom'] );
}
if ( is_array( $styles ) && ! empty( $styles ) ) {
$left_side = '<div class="vc_col-sm-6">';
$build_style_select = '<select class="vc_param-animation-style">';
foreach ( $styles as $style ) {
$build_style_select .= '<optgroup ' . ( isset( $style['label'] ) ? 'label="' . esc_attr( $style['label'] ) . '"' : '' ) . '>';
if ( is_array( $style['values'] ) && ! empty( $style['values'] ) ) {
foreach ( $style['values'] as $key => $value ) {
$build_style_select .= '<option value="' . ( is_array( $value ) ? $value['value'] : $value ) . '">' . esc_html( $key ) . '</option>';
}
}
$build_style_select .= '</optgroup>';
}
$build_style_select .= '</select>';
$left_side .= $build_style_select;
$left_side .= '</div>';
$output .= $left_side;
$right_side = '<div class="vc_col-sm-6">';
$right_side .= '<div class="vc_param-animation-style-preview"><button class="vc_btn vc_btn-grey vc_btn-sm vc_param-animation-style-trigger">' . esc_html__( 'Animate it', 'js_composer' ) . '</button></div>';
$right_side .= '</div>';
$output .= $right_side;
}
$output .= '</div>'; // Close Row
$output .= sprintf( '<input name="%s" class="wpb_vc_param_value %s %s_field" type="hidden" value="%s" />', esc_attr( $this->settings['param_name'] ), esc_attr( $this->settings['param_name'] ), esc_attr( $this->settings['type'] ), $this->value );
return $output;
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered 'values'.
*
* @param array $settings - parameter settings in vc_map
* @param string $value - parameter value
* @param string $tag - shortcode tag
*
* vc_filter: vc_animation_style_render_filter - filter to override editor form
* field output
*
* @return mixed rendered template for params in edit form
*
* @since 4.4
*/
function vc_animation_style_form_field( $settings, $value, $tag ) {
$field = new Vc_ParamAnimation( $settings, $value );
/**
* Filter used to override full output of edit form field animation style
* @since 4.4
*/
return apply_filters( 'vc_animation_style_render_filter', $field->render(), $settings, $value, $tag );
}
params/vc_grid_item/templates.php 0000644 00000172345 15121635560 0013211 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return array(
'none' => array(
'name' => esc_html__( 'Basic grid: Default', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419240516480{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_ScaleInWithRotation' => array(
'name' => esc_html__( 'Basic grid: Scale in with rotation', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419240793832{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419240595465{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_FadeInWithSideContent' => array(
'name' => esc_html__( 'Basic grid: Fade with side content', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="right" css=".vc_custom_1420541757398{background-color: #f9f9f9 !important;}"][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="3-4" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419242201096{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419242120132{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:div|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_SlideBottomWithIcon' => array(
'name' => esc_html__( 'Basic grid: Slide bottom with icon', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419251931135{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-zoom" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="md" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419251874438{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:center" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:center" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="center"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'basicGrid_VerticalFlip' => array(
'name' => esc_html__( 'Basic grid: Vertical flip', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="flipFadeIn"][vc_gitem_zone_a height_mode="3-4" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419250758402{background-color: #353535 !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419250916067{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal" block_container="font_size:22|color:%23ffffff|line_height:1.2"][vc_separator color="white" align="align_center" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal" block_container="font_size:14|color:%23ffffff|line_height:1.3"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_NoAnimation' => array(
'name' => esc_html__( 'Basic grid: No animation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419253765784{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23e5e5e5" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h3|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_GoTopSlideout' => array(
'name' => esc_html__( 'Basic grid: Go top slideout', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="goTop20"][vc_gitem_zone_a height_mode="3-4" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419254486087{background-color: #f2f2f2 !important;}"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_TextFirst' => array(
'name' => esc_html__( 'Basic grid: Text first', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="flipHorizontalFadeIn"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="" css=".vc_custom_1419260513295{padding-right: 15px !important;padding-left: 15px !important;background-color: #2d2d2d !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_separator color="white" align="align_left" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23e2e2e2|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_SlideFromLeft' => array(
'name' => esc_html__( 'Basic grid: Slide from left', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="slideInRight"][vc_gitem_zone_a height_mode="4-3" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2" featured_image="" css=".vc_custom_1419258058654{padding-left: 15px !important;background-color: #282828 !important;}"][vc_gitem_post_date link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:12|color:%23efefef" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h3|text_align:left" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal" block_container="font_size:20|color:%23ffffff"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'basicGrid_SlideFromTop' => array(
'name' => esc_html__( 'Basic grid: Slide from top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="1-1" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="none" featured_image="" css=".vc_custom_1419260990461{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.2" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:700%20bold%20regular%3A700%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'READ MORE', 'js_composer' ) . '" style="outline" shape="square" color="white" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_Default' => array(
'name' => esc_html__( 'Masonry grid: Default', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419328663991{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_FadeIn' => array(
'name' => esc_html__( 'Masonry grid: Fade in', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419328603590{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419328565352{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_IconSlideOut' => array(
'name' => esc_html__( 'Masonry grid: Icon slide out', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419328999899{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="md" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419328781574{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_SlideFromLeft' => array(
'name' => esc_html__( 'Masonry grid: Slide from left', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideInRight"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419328927507{background-color: #f4f4f4 !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_separator color="black" align="align_left" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_GoTop' => array(
'name' => esc_html__( 'Masonry grid: Go top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="goTop20"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419329081651{background-color: #2b2b2b !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:20|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:14|color:%23efefef|line_height:1.2" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_OverlayWithRotation' => array(
'name' => esc_html__( 'Masonry grid: Overlay with rotation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419329305433{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23dbdbdb" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_BlurOut' => array(
'name' => esc_html__( 'Masonry grid: Blur out', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurOut"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419329691977{background-color: rgba(0,0,0,0.5) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:300%20light%20regular%3A300%3Anormal"][vc_separator color="grey" align="align_center" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_ScaleWithRotation' => array(
'name' => esc_html__( 'Masonry grid: Scale with rotation', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom" position=""][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419333125675{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419333453605{background-color: #f4f4f4 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryGrid_SlideoOutFromRight' => array(
'name' => esc_html__( 'Masonry grid: Slideo out from right', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideInLeft"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2" featured_image=""][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2" featured_image="" css=".vc_custom_1419333716781{margin-bottom: 25px !important;padding-top: 20px !important;padding-left: 20px !important;background-color: #282828 !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryGrid_WithSideContent' => array(
'name' => esc_html__( 'Masonry grid: With side content', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="right" css=".vc_custom_1419334531994{background-color: #f4f4f4 !important;}"][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="original" link="post_link" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="post_link" featured_image="" css=".vc_custom_1419334566318{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_date link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_btn link="post_link" title="' . esc_attr__( 'Read more', 'js_composer' ) . '" style="flat" shape="rounded" color="juicy-pink" size="md" align="left"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'mediaGrid_Default' => array(
'name' => esc_html__( 'Media grid: Default', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block][vc_gitem_zone_a height_mode="1-1" link="image_lightbox" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_SimpleOverlay' => array(
'name' => esc_html__( 'Media grid: Simple overlay', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="yes" css=".vc_custom_1419000810062{margin: -15px !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_FadeInWithIcon' => array(
'name' => esc_html__( 'Media grid: Fade in with icon', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="fadeIn"][vc_gitem_zone_a height_mode="4-3" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419001011185{background-color: rgba(40,40,40,0.5) !important;*background-color: rgb(40,40,40) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="entypo" icon_fontawesome="fa fa-adjust" icon_openiconic="vc-oi vc-oi-eye" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-plus" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="lg" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_BorderedScaleWithTitle' => array(
'name' => esc_html__( 'Media grid: Bordered scale with title', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="3-4" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419001608026{margin-top: 5px !important;margin-right: 5px !important;margin-bottom: 5px !important;margin-left: 5px !important;border-top-width: 5px !important;border-right-width: 5px !important;border-bottom-width: 5px !important;border-left-width: 5px !important;border-left-color: #ffffff !important;border-left-style: solid !important;border-right-color: #ffffff !important;border-right-style: solid !important;border-top-color: #ffffff !important;border-top-style: solid !important;border-bottom-color: #ffffff !important;border-bottom-style: solid !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419001517455{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Open%20Sans%3A300%2C300italic%2Cregular%2Citalic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_ScaleWithRotation' => array(
'name' => esc_html__( 'Media grid: Scale with rotation', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419001365234{background-color: rgba(0,0,0,0.3) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_SlideOutCaption' => array(
'name' => esc_html__( 'Media grid: Slide out caption', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419002217534{padding-right: 20px !important;padding-left: 20px !important;background-color: #4f4f4f !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:30|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:100%20light%20regular%3A100%3Anormal"][vc_separator color="white" align="align_center" border_width="2" el_width="50"][vc_gitem_post_excerpt link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:14|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_HorizontalFlipWithFade' => array(
'name' => esc_html__( 'Media grid: Horizontal flip with fade', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="flipHorizontalFadeIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419002089906{background-color: #4f4f4f !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419002184955{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_date link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:12|color:%23e0e0e0|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:30|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:100%20light%20regular%3A100%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_BlurWithContentBlock' => array(
'name' => esc_html__( 'Media grid: Blur with content block', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419002895369{background-color: rgba(255,255,255,0.15) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1419240502350{background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'mediaGrid_SlideInTitle' => array(
'name' => esc_html__( 'Media grid: Slide in title', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="4-3" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1419003984488{padding-right: 15px !important;padding-left: 15px !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:18|color:%23ffffff|line_height:1.3" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:500%20bold%20regular%3A500%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/2" featured_image=""][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'mediaGrid_ScaleInWithIcon' => array(
'name' => esc_html__( 'Media grid: Scale in with icon', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleIn"][vc_gitem_zone_a height_mode="1-1" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="lg" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_Default' => array(
'name' => esc_html__( 'Masonry media: Default', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_BorderedScale' => array(
'name' => esc_html__( 'Masonry media: Bordered scale', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleIn"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1418993682046{border: 10px solid #e8e8e8 !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_SolidBlurOut' => array(
'name' => esc_html__( 'Masonry media: Solid blur out', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurOut"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1418993823084{background-color: rgba(0,0,0,0.4) !important;*background-color: rgb(0,0,0) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="typicons" icon_fontawesome="fa fa-adjust" icon_openiconic="vc-oi vc-oi-resize-full-alt" icon_typicons="typcn typcn-zoom-outline" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="white" size="lg" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_ScaleWithRotationLight' => array(
'name' => esc_html__( 'Masonry media: Scale with rotation light', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1418994252440{background-color: rgba(255,255,255,0.2) !important;*background-color: rgb(255,255,255) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_SlideWithTitleAndCaption' => array(
'name' => esc_html__( 'Masonry media: Slide with title and caption', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="" position=""][vc_gitem_animated_block animation="slideBottom"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1" featured_image="" css=".vc_custom_1418995080777{padding-top: 15px !important;padding-right: 15px !important;padding-bottom: 15px !important;padding-left: 15px !important;background-color: rgba(45,45,45,0.8) !important;*background-color: rgb(45,45,45) !important;}"][vc_gitem_post_title link="none" font_container="tag:div|text_align:left" use_custom_fonts="yes" block_container="font_size:18|color:%23ffffff|line_height:1.2" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="yes" google_fonts="font_family:Roboto%3A100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C500%2C500italic%2C700%2C700italic%2C900%2C900italic|font_style:400%20regular%3A400%3Anormal" block_container="font_size:14|color:%23ffffff|line_height:1.3"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_ScaleWithContentBlock' => array(
'name' => esc_html__( 'Masonry media: Scale with content block', 'js_composer' ),
'template' => '[vc_gitem c_zone_position="bottom"][vc_gitem_animated_block animation="scaleRotateIn"][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="none" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][vc_gitem_zone_c css=".vc_custom_1418995850605{padding-top: 5px !important;padding-right: 15px !important;padding-bottom: 5px !important;padding-left: 15px !important;background-color: #f9f9f9 !important;}"][vc_gitem_row][vc_gitem_col width="1/1" featured_image=""][vc_gitem_post_title link="none" font_container="tag:h4|text_align:left" use_custom_fonts="" block_container="font_size:18|line_height:1.2" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][vc_gitem_post_excerpt link="none" font_container="tag:p|text_align:left" use_custom_fonts="" google_fonts="font_family:Abril%20Fatface%3Aregular|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_c][/vc_gitem]',
),
'masonryMedia_SimpleOverlay' => array(
'name' => esc_html__( 'Masonry media: Simple overlay', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="none"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419337784115{background-color: #262626 !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_gitem_post_title link="none" font_container="tag:div|text_align:center" use_custom_fonts="yes" block_container="font_size:24|color:%23ffffff|line_height:1.3" google_fonts="font_family:Montserrat%3Aregular%2C700|font_style:400%20regular%3A400%3Anormal"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_SlideTop' => array(
'name' => esc_html__( 'Masonry media: Slide top', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="slideTop"][vc_gitem_zone_a height_mode="original" link="none" featured_image="yes"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="image_lightbox" featured_image="" css=".vc_custom_1419337643064{background-color: rgba(10,10,10,0.5) !important;*background-color: rgb(10,10,10) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/1"][vc_icon type="fontawesome" icon_fontawesome="fa fa-search" icon_openiconic="vc-oi vc-oi-dial" icon_typicons="typcn typcn-adjust-brightness" icon_entypo="entypo-icon entypo-icon-note" icon_linecons="vc_li vc_li-heart" color="white" background_color="blue" size="md" align="center"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
'masonryMedia_SimpleBlurWithScale' => array(
'name' => esc_html__( 'Masonry media: Simple blur with scale', 'js_composer' ),
'template' => '[vc_gitem][vc_gitem_animated_block animation="blurScaleOut"][vc_gitem_zone_a height_mode="original" link="image_lightbox" featured_image="yes" css=".vc_custom_1419338012126{background-color: rgba(10,10,10,0.7) !important;*background-color: rgb(10,10,10) !important;}"][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_a][vc_gitem_zone_b link="none" featured_image=""][vc_gitem_row position="top"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="middle"][vc_gitem_col width="1/2"][/vc_gitem_col][vc_gitem_col width="1/2"][/vc_gitem_col][/vc_gitem_row][vc_gitem_row position="bottom"][vc_gitem_col width="1/1"][/vc_gitem_col][/vc_gitem_row][/vc_gitem_zone_b][/vc_gitem_animated_block][/vc_gitem]',
),
);
params/vc_grid_item/editor/class-vc-grid-item-preview.php 0000644 00000010274 15121635560 0017542 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Grid_Item_Preview
*/
class Vc_Grid_Item_Preview {
protected $shortcodes_string = '';
protected $post_id = false;
public function render() {
$this->post_id = (int) vc_request_param( 'post_id' );
$this->shortcodes_string = stripslashes( vc_request_param( 'shortcodes_string', true ) );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$grid_item->setIsEnd( false );
$grid_item->setGridAttributes( array( 'element_width' => 4 ) );
$grid_item->setTemplate( $this->shortcodes_string, $this->post_id );
$this->enqueue();
vc_include_template( 'params/vc_grid_item/preview.tpl.php', array(
'preview' => $this,
'grid_item' => $grid_item,
'shortcodes_string' => $this->shortcodes_string,
'post' => $this->mockingPost(),
'default_width_value' => apply_filters( 'vc_grid_item_preview_render_default_width_value', 4 ),
) );
}
/**
* @param $css
* @return string
*/
public function addCssBackgroundImage( $css ) {
if ( empty( $css ) ) {
$css = 'background-image: url(' . vc_asset_url( 'vc/vc_gitem_image.png' ) . ') !important';
}
return $css;
}
/**
* @param $url
* @return string
*/
public function addImageUrl( $url ) {
if ( empty( $url ) ) {
$url = vc_asset_url( 'vc/vc_gitem_image.png' );
}
return $url;
}
/**
* @param $img
* @return string
*/
public function addImage( $img ) {
if ( empty( $img ) ) {
$img = '<img src="' . esc_url( vc_asset_url( 'vc/vc_gitem_image.png' ) ) . '" alt="">';
}
return $img;
}
/**
*
* @param $link
*
* @param $atts
* @param $css_class
* @return string
* @since 4.5
*
*/
public function disableContentLink( $link, $atts, $css_class ) {
return 'a' . ( strlen( $css_class ) > 0 ? ' class="' . esc_attr( $css_class ) . '"' : '' );
}
/**
*
* @param $link
*
* @param $atts
* @param $post
* @param $css_class
* @return string
* @since 4.5
*
*/
public function disableRealContentLink( $link, $atts, $post, $css_class ) {
return 'a' . ( strlen( $css_class ) > 0 ? ' class="' . esc_attr( $css_class ) . '"' : '' );
}
/**
* Used for filter: vc_gitem_zone_image_block_link
* @param $link
*
* @return string
* @since 4.5
*
*/
public function disableGitemZoneLink( $link ) {
return '';
}
public function enqueue() {
visual_composer()->frontCss();
visual_composer()->frontJsRegister();
wp_enqueue_script( 'prettyphoto' );
wp_enqueue_style( 'prettyphoto' );
wp_enqueue_style( 'js_composer_front' );
wp_enqueue_script( 'wpb_composer_front_js' );
wp_enqueue_style( 'js_composer_custom_css' );
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Basic_Grid' );
$grid = new WPBakeryShortCode_Vc_Basic_Grid( array( 'base' => 'vc_basic_grid' ) );
$grid->shortcodeScripts();
$grid->enqueueScripts();
}
/**
* @return array|\WP_Post|null
*/
public function mockingPost() {
$post = get_post( $this->post_id );
setup_postdata( $post );
$post->post_title = esc_html__( 'Post title', 'js_composer' );
$post->post_content = esc_html__( 'The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.', 'js_composer' );
$post->post_excerpt = esc_html__( 'The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.', 'js_composer' );
add_filter( 'get_the_categories', array(
$this,
'getTheCategories',
), 10, 2 );
$GLOBALS['post'] = $post;
return $post;
}
/**
* @param $categories
* @param $post_id
* @return array
*/
public function getTheCategories( $categories, $post_id ) {
$ret = $categories;
if ( ! $post_id || ( $post_id && $post_id === $this->post_id ) ) {
$cat = get_categories( 'number=5' );
if ( empty( $ret ) && ! empty( $cat ) ) {
$ret += $cat;
}
}
return $ret;
}
/**
* @param $img
* @return array
*/
public function addPlaceholderImage( $img ) {
if ( null === $img || false === $img ) {
$img = array(
'thumbnail' => '<img class="vc_img-placeholder vc_single_image-img" src="' . esc_url( vc_asset_url( 'vc/vc_gitem_image.png' ) ) . '" />',
);
}
return $img;
}
}
params/vc_grid_item/editor/navbar/class-vc-navbar-grid-item.php 0000644 00000005275 15121635560 0020610 0 ustar 00 <?php
/**
* @noinspection PhpMissingParentCallCommonInspection
* @package WPBakery
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'navbar/class-vc-navbar.php' );
/**
* Renders navigation bar for Editors.
*/
class Vc_Navbar_Grid_Item extends Vc_Navbar {
protected $controls = array(
'templates',
'save_backend',
'preview_template',
'animation_list',
'preview_item_width',
'edit',
);
/**
* @return string
*/
public function getControlTemplates() {
return '<li><a href="javascript:;" class="vc_icon-btn vc_templates-button" id="vc_templates-editor-button" title="' . esc_attr__( 'Templates', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add_template"></i></a></li>';
}
/**
* @return string
*/
public function getControlPreviewTemplate() {
return '<li class="vc_pull-right">' . '<a href="#" class="vc_btn vc_btn-grey vc_btn-sm vc_navbar-btn" data-vc-navbar-control="preview">' . esc_html__( 'Preview', 'js_composer' ) . '</a>' . '</li>';
}
/**
* @return string
*/
public function getControlEdit() {
return '<li class="vc_pull-right">' . '<a data-vc-navbar-control="edit" class="vc_icon-btn vc_post-settings" title="' . esc_attr__( 'Grid element settings', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-cog"></i>' . '</a>' . '</li>';
}
/**
* @return string
*/
public function getControlSaveBackend() {
return '<li class="vc_pull-right vc_save-backend">' . '<a class="vc_btn vc_btn-sm vc_navbar-btn vc_btn-primary vc_control-save" id="wpb-save-post">' . esc_html__( 'Update', 'js_composer' ) . '</a>' . '</li>';
}
/**
* @return string
*/
public function getControlPreviewItemWidth() {
$output = '<li class="vc_pull-right vc_gitem-navbar-dropdown vc_gitem-navbar-preview-width" data-vc-grid-item="navbar_preview_width"><select data-vc-navbar-control="preview_width">';
for ( $i = 1; $i <= 12; $i ++ ) {
$output .= '<option value="' . esc_attr( $i ) . '">' . sprintf( esc_html__( '%s/12 width', 'js_composer' ), $i ) . '</option>';
}
$output .= '</select></li>';
return $output;
}
/**
* @return string
*/
public function getControlAnimationList() {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Gitem_Animated_Block' );
$output = '';
$animations = WPBakeryShortCode_Vc_Gitem_Animated_Block::animations();
if ( is_array( $animations ) ) {
$output .= '<li class="vc_pull-right vc_gitem-navbar-dropdown"><select data-vc-navbar-control="animation">';
foreach ( $animations as $value => $key ) {
$output .= '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
}
$output .= '</select></li>';
}
return $output;
}
}
params/vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.php 0000644 00000001670 15121635560 0022354 0 ustar 00 <?php
/**
* @noinspection PhpMissingParentCallCommonInspection
* @package WPBakery
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-add-element-box.php' );
/**
* Add element for VC editors with a list of mapped shortcodes for gri item constructor.
*
* @since 4.4
*/
class Vc_Add_Element_Box_Grid_Item extends Vc_Add_Element_Box {
/**
* Get shortcodes from param type vc_grid_item
* @return array|bool
* @throws \Exception
*/
public function shortcodes() {
return WpbMap_Grid_Item::getSortedGitemUserShortCodes();
}
/**
* Get categories list from mapping data.
* @return bool
* @throws \Exception
* @since 4.5
*/
public function getCategories() {
return WpbMap_Grid_Item::getGitemUserCategories();
}
/**
* @return mixed
* @throws \Exception
*/
public function getPartState() {
return vc_user_access()->part( 'grid_builder' )->getState();
}
}
params/vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php 0000644 00000014710 15121635560 0022670 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-templates-panel-editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
/**
* Class Vc_Templates_Editor_Grid_Item
*/
class Vc_Templates_Editor_Grid_Item extends Vc_Templates_Panel_Editor {
protected $default_templates = array(); // this prevents for loading default templates
public function __construct() {
add_filter( 'vc_templates_render_category', array(
$this,
'renderTemplateBlock',
), 10, 2 );
add_filter( 'vc_templates_render_template', array(
$this,
'renderTemplateWindowGrid',
), 10, 2 );
}
/**
* @param $category
* @return mixed
*/
public function renderTemplateBlock( $category ) {
if ( 'grid_templates' === $category['category'] || 'grid_templates_custom' === $category['category'] ) {
$category['output'] = '<div class="vc_col-md-12">';
if ( isset( $category['category_name'] ) ) {
$category['output'] .= '<h3>' . esc_html( $category['category_name'] ) . '</h3>';
}
if ( isset( $category['category_description'] ) ) {
$category['output'] .= '<p class="vc_description">' . esc_html( $category['category_description'] ) . '</p>';
}
$category['output'] .= '</div>';
$category['output'] .= '
<div class="vc_column vc_col-sm-12">
<div class="vc_ui-template-list vc_templates-list-my_templates vc_ui-list-bar" data-vc-action="collapseAll">';
if ( ! empty( $category['templates'] ) ) {
foreach ( $category['templates'] as $template ) {
$category['output'] .= $this->renderTemplateListItem( $template );
}
}
$category['output'] .= '
</div>
</div>';
}
return $category;
}
/** Output rendered template in modal dialog
* @param $template_name
* @param $template_data
*
* @return string
* @since 4.4
*
*/
public function renderTemplateWindowGrid( $template_name, $template_data ) {
if ( 'grid_templates' === $template_data['type'] || 'grid_templates_custom' === $template_data['type'] ) {
return $this->renderTemplateWindowGridTemplate( $template_name, $template_data );
}
return $template_name;
}
/**
* @param $template_name
* @param $template_data
*
* @return string
* @since 4.4
*
*/
protected function renderTemplateWindowGridTemplate( $template_name, $template_data ) {
ob_start();
$template_id = esc_attr( $template_data['unique_id'] );
$template_name = esc_html( $template_name );
$preview_template_title = esc_attr__( 'Preview template', 'js_composer' );
$add_template_title = esc_attr__( 'Preview template', 'js_composer' );
echo sprintf( '<button type="button" class="vc_ui-list-bar-item-trigger" title="%s"
data-template-handler=""
data-vc-ui-element="template-title">%s</button>
<div class="vc_ui-list-bar-item-actions">
<button type="button" class="vc_general vc_ui-control-button" title="%s"
data-template-handler=""
data-vc-ui-element="template-title">
<i class="vc-composer-icon vc-c-icon-add"></i>
</button>
<button type="button" class="vc_general vc_ui-control-button" title="%s"
data-vc-preview-handler data-vc-container=".vc_ui-list-bar" data-vc-target="[data-template_id=%s]">
<i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i>
</button>
</div>', esc_attr( $add_template_title ), esc_html( $template_name ), esc_attr( $add_template_title ), esc_attr( $preview_template_title ), esc_attr( $template_id ) );
return ob_get_clean();
}
/**
* @param bool $template_id
*/
public function load( $template_id = false ) {
if ( ! $template_id ) {
$template_id = vc_post_param( 'template_unique_id' );
}
if ( ! isset( $template_id ) || '' === $template_id ) {
echo 'Error: TPL-02';
die;
}
$predefined_template = Vc_Grid_Item::predefinedTemplate( $template_id );
if ( $predefined_template ) {
echo esc_html( trim( $predefined_template['template'] ) );
}
}
/**
* @param bool $template_id
* @return string
*/
public function loadCustomTemplate( $template_id = false ) {
if ( ! $template_id ) {
$template_id = vc_post_param( 'template_unique_id' );
}
if ( ! isset( $template_id ) || '' === $template_id ) {
echo 'Error: TPL-02';
die();
}
$post = get_post( $template_id );
if ( $post && Vc_Grid_Item_Editor::postType() === $post->post_type ) {
return $post->post_content;
}
return '';
}
/**
* @return array|mixed|void
*/
public function getAllTemplates() {
$data = array();
$grid_templates = $this->getGridTemplates();
// this has only 'name' and 'template' key and index 'key' is template id.
if ( ! empty( $grid_templates ) ) {
$arr_category = array(
'category' => 'grid_templates',
'category_name' => esc_html__( 'Grid Templates', 'js_composer' ),
'category_weight' => 10,
);
$category_templates = array();
foreach ( $grid_templates as $template_id => $template_data ) {
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_data['name'],
'type' => 'grid_templates',
// for rendering in backend/frontend with ajax
);
}
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
$custom_grid_templates = $this->getCustomTemplateList();
if ( ! empty( $custom_grid_templates ) ) {
$arr_category = array(
'category' => 'grid_templates_custom',
'category_name' => esc_html__( 'Custom Grid Templates', 'js_composer' ),
'category_weight' => 10,
);
$category_templates = array();
foreach ( $custom_grid_templates as $template_name => $template_id ) {
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_name,
'type' => 'grid_templates_custom',
// for rendering in backend/frontend with ajax);
);
}
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
// To get any other 3rd "Custom template" - do this by hook filter 'vc_get_all_templates'
return apply_filters( 'vc_grid_get_all_templates', $data );
}
/**
* @return array
*/
protected function getCustomTemplateList() {
$list = array();
$templates = get_posts( array(
'post_type' => Vc_Grid_Item_Editor::postType(),
'numberposts' => - 1,
) );
foreach ( $templates as $template ) {
$id = $template->ID;
$list[ $template->post_title ] = $id;
}
return $list;
}
/**
* @return bool|mixed
*/
public function getGridTemplates() {
$list = Vc_Grid_Item::predefinedTemplates();
return $list;
}
}
params/vc_grid_item/editor/class-vc-grid-item-editor.php 0000644 00000017541 15121635560 0017353 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Manger for new post type for single grid item design with constructor
*
* @package WPBakeryPageBuilder
* @since 4.4
*/
require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-backend-editor.php' );
/**
* Class Vc_Grid_Item_Editor
*/
class Vc_Grid_Item_Editor extends Vc_Backend_Editor {
protected static $post_type = 'vc_grid_item';
protected $templates_editor = false;
/**
* This method is called to add hooks.
*
* @since 4.8
* @access public
*/
public function addHooksSettings() {
add_action( 'add_meta_boxes', array(
$this,
'render',
) );
add_action( 'vc_templates_render_backend_template', array(
$this,
'loadTemplate',
), 10, 2 );
}
public function addScripts() {
$this->render( get_post_type() );
}
/**
* @param $post_type
* @throws \Exception
*/
public function render( $post_type ) {
if ( $this->isValidPostType( $post_type ) ) {
$this->registerBackendJavascript();
$this->registerBackendCss();
// B.C:
visual_composer()->registerAdminCss();
visual_composer()->registerAdminJavascript();
add_action( 'admin_print_scripts-post.php', array(
$this,
'printScriptsMessages',
), 300 );
add_action( 'admin_print_scripts-post-new.php', array(
$this,
'printScriptsMessages',
), 300 );
}
}
/**
* @return bool
* @throws \Exception
*/
public function editorEnabled() {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
public function replaceTemplatesPanelEditorJsAction() {
wp_dequeue_script( 'vc-template-preview-script' );
$this->templatesEditor()->addScriptsToTemplatePreview();
}
/**
* Create post type and new item in the admin menu.
* @return void
*/
public static function createPostType() {
register_post_type( self::$post_type, array(
'labels' => self::getPostTypesLabels(),
'public' => false,
'has_archive' => false,
'show_in_nav_menus' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
'show_ui' => true,
'show_in_menu' => false,
'query_var' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array(
'title',
'editor',
),
) );
}
/**
* @return array
*/
public static function getPostTypesLabels() {
return array(
'add_new_item' => esc_html__( 'Add Grid template', 'js_composer' ),
'name' => esc_html__( 'Grid Builder', 'js_composer' ),
'singular_name' => esc_html__( 'Grid template', 'js_composer' ),
'edit_item' => esc_html__( 'Edit Grid template', 'js_composer' ),
'view_item' => esc_html__( 'View Grid template', 'js_composer' ),
'search_items' => esc_html__( 'Search Grid templates', 'js_composer' ),
'not_found' => esc_html__( 'No Grid templates found', 'js_composer' ),
'not_found_in_trash' => esc_html__( 'No Grid templates found in Trash', 'js_composer' ),
);
}
/**
* Rewrites validation for correct post_type of th post.
*
* @param string $type
*
* @return bool
* @throws \Exception
*/
public function isValidPostType( $type = '' ) {
$type = ! empty( $type ) ? $type : get_post_type();
return $this->editorEnabled() && $this->postType() === $type;
}
/**
* Get post type for Vc grid element editor.
*
* @static
* @return string
*/
public static function postType() {
return self::$post_type;
}
/**
* Calls add_meta_box to create Editor block.
*
* @access public
*/
public function addMetaBox() {
add_meta_box( 'wpb_visual_composer', esc_html__( 'Grid Builder', 'js_composer' ), array(
$this,
'renderEditor',
), $this->postType(), 'normal', 'high' );
}
/**
* Change order of the controls for shortcodes admin block.
*
* @return array
*/
public function shortcodesControls() {
return array(
'delete',
'edit',
);
}
/**
* Output html for backend editor meta box.
*
* @param null|int $post
*
* @throws \Exception
*/
public function renderEditor( $post = null ) {
if ( ! vc_user_access()->part( 'grid_builder' )->can()->get() ) {
return;
}
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$this->post = $post;
vc_include_template( 'params/vc_grid_item/editor/vc_grid_item_editor.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
add_action( 'admin_footer', array(
$this,
'renderEditorFooter',
) );
do_action( 'vc_backend_editor_render' );
do_action( 'vc_vc_grid_item_editor_render' );
add_action( 'vc_user_access_check-shortcode_edit', array(
$this,
'accessCheckShortcodeEdit',
), 10, 2 );
add_action( 'vc_user_access_check-shortcode_all', array(
$this,
'accessCheckShortcodeAll',
), 10, 2 );
}
/**
* @param $null
* @param $shortcode
* @return bool
* @throws \Exception
*/
public function accessCheckShortcodeEdit( $null, $shortcode ) {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
/**
* @param $null
* @param $shortcode
* @return bool
* @throws \Exception
*/
public function accessCheckShortcodeAll( $null, $shortcode ) {
return vc_user_access()->part( 'grid_builder' )->can()->get();
}
/**
* Output required html and js content for VC editor.
*
* Here comes panels, modals and js objects with data for mapped shortcodes.
*/
public function renderEditorFooter() {
vc_include_template( 'params/vc_grid_item/editor/partials/vc_grid_item_editor_footer.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
do_action( 'vc_backend_editor_footer_render' );
}
public function registerBackendJavascript() {
parent::registerBackendJavascript();
wp_register_script( 'vc_grid_item_editor', vc_asset_url( 'js/dist/grid-builder.min.js' ), array( 'vc-backend-min-js' ), WPB_VC_VERSION, true );
wp_localize_script( 'vc_grid_item_editor', 'i18nLocaleGItem', array(
'preview' => esc_html__( 'Preview', 'js_composer' ),
'builder' => esc_html__( 'Builder', 'js_composer' ),
'add_template_message' => esc_html__( 'If you add this template, all your current changes will be removed. Are you sure you want to add template?', 'js_composer' ),
) );
}
public function enqueueJs() {
parent::enqueueJs();
wp_enqueue_script( 'vc_grid_item_editor' );
}
/**
* @return bool|\Vc_Templates_Editor_Grid_Item
*/
public function templatesEditor() {
if ( false === $this->templates_editor ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php' );
$this->templates_editor = new Vc_Templates_Editor_Grid_Item();
}
return $this->templates_editor;
}
/**
* @param $template_id
* @param $template_type
* @return false|string
*/
public function loadPredefinedTemplate( $template_id, $template_type ) {
ob_start();
$this->templatesEditor()->load( $template_id );
return ob_get_clean();
}
/**
* @param $template_id
* @param $template_type
* @return false|string
*/
public function loadTemplate( $template_id, $template_type ) {
if ( 'grid_templates' === $template_type ) {
return $this->loadPredefinedTemplate( $template_id, $template_type );
} elseif ( 'grid_templates_custom' === $template_type ) {
return $this->templatesEditor()->loadCustomTemplate( $template_id );
}
return $template_id;
}
/**
* @param $path
* @return string
*/
public function templatePreviewPath( $path ) {
return 'params/vc_grid_item/editor/vc_ui-template-preview.tpl.php';
}
public function renderTemplatePreview() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'grid_builder' )->can()->validateDie();
add_action( 'vc_templates_render_backend_template_preview', array(
$this,
'loadTemplate',
), 10, 2 );
add_filter( 'vc_render_template_preview_include_template', array(
$this,
'templatePreviewPath',
) );
visual_composer()->templatesPanelEditor()->renderTemplatePreview();
}
}
params/vc_grid_item/shortcodes.php 0000644 00000102020 15121635560 0013347 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Gitem_Animated_Block' );
global $vc_gitem_add_link_param;
$vc_gitem_add_link_param = apply_filters( 'vc_gitem_add_link_param', array(
'type' => 'dropdown',
'heading' => esc_html__( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => array(
esc_html__( 'None', 'js_composer' ) => 'none',
esc_html__( 'Post link', 'js_composer' ) => 'post_link',
esc_html__( 'Post author', 'js_composer' ) => 'post_author',
esc_html__( 'Large image', 'js_composer' ) => 'image',
esc_html__( 'Large image (prettyPhoto)', 'js_composer' ) => 'image_lightbox',
esc_html__( 'Custom', 'js_composer' ) => 'custom',
),
'description' => esc_html__( 'Select link option.', 'js_composer' ),
) );
$zone_params = array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Use featured image on background?', 'js_composer' ),
'param_name' => 'featured_image',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'value' => 'large',
'description' => esc_html__( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'js_composer' ),
'dependency' => array(
'element' => 'featured_image',
'not_empty' => true,
),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
);
$post_data_params = array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
);
$custom_fonts_params = array(
array(
'type' => 'font_container',
'param_name' => 'font_container',
'value' => '',
'settings' => array(
'fields' => array(
'tag' => 'div',
// default value h2
'text_align',
'tag_description' => esc_html__( 'Select element tag.', 'js_composer' ),
'text_align_description' => esc_html__( 'Select text alignment.', 'js_composer' ),
'font_size_description' => esc_html__( 'Enter font size.', 'js_composer' ),
'line_height_description' => esc_html__( 'Enter line height.', 'js_composer' ),
'color_description' => esc_html__( 'Select color for your element.', 'js_composer' ),
),
),
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Use custom fonts?', 'js_composer' ),
'param_name' => 'use_custom_fonts',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Enable Google fonts.', 'js_composer' ),
),
array(
'type' => 'font_container',
'param_name' => 'block_container',
'value' => '',
'settings' => array(
'fields' => array(
'font_size',
'line_height',
'color',
'tag_description' => esc_html__( 'Select element tag.', 'js_composer' ),
'text_align_description' => esc_html__( 'Select text alignment.', 'js_composer' ),
'font_size_description' => esc_html__( 'Enter font size.', 'js_composer' ),
'line_height_description' => esc_html__( 'Enter line height.', 'js_composer' ),
'color_description' => esc_html__( 'Select color for your element.', 'js_composer' ),
),
),
'group' => esc_html__( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_custom_fonts',
'value' => array( 'yes' ),
),
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Yes theme default font family?', 'js_composer' ),
'param_name' => 'use_theme_fonts',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Yes font family from the theme.', 'js_composer' ),
'group' => esc_html__( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_custom_fonts',
'value' => array( 'yes' ),
),
),
array(
'type' => 'google_fonts',
'param_name' => 'google_fonts',
'value' => '',
// Not recommended, this will override 'settings'. 'font_family:'.rawurlencode('Exo:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic').'|font_style:'.rawurlencode('900 bold italic:900:italic'),
'settings' => array(
'fields' => array(
// Default font style. Name:weight:style, example: "800 bold regular:800:normal"
'font_family_description' => esc_html__( 'Select font family.', 'js_composer' ),
'font_style_description' => esc_html__( 'Select font styling.', 'js_composer' ),
),
),
'group' => esc_html__( 'Custom fonts', 'js_composer' ),
'dependency' => array(
'element' => 'use_theme_fonts',
'value_not_equal_to' => 'yes',
),
),
);
$list = array(
'vc_gitem' => array(
'name' => esc_html__( 'Grid Item', 'js_composer' ),
'base' => 'vc_gitem',
'is_container' => true,
'icon' => 'icon-wpb-gitem',
'content_element' => false,
'show_settings_on_create' => false,
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Main grid item', 'js_composer' ),
'params' => array(
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_animated_block' => array(
'base' => 'vc_gitem_animated_block',
'name' => esc_html__( 'A/B block', 'js_composer' ),
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-block',
'category' => esc_html__( 'Content', 'js_composer' ),
'controls' => array(),
'as_parent' => array(
'only' => array(
'vc_gitem_zone_a',
'vc_gitem_zone_b',
),
),
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Animation', 'js_composer' ),
'param_name' => 'animation',
'value' => WPBakeryShortCode_Vc_Gitem_Animated_Block::animations(),
),
),
'js_view' => 'VcGitemAnimatedBlockView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone' => array(
'name' => esc_html__( 'Zone', 'js_composer' ),
'base' => 'vc_gitem_zone',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => esc_html__( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => $zone_params,
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_a' => array(
'name' => esc_html__( 'Normal', 'js_composer' ),
'base' => 'vc_gitem_zone_a',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => esc_html__( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => array_merge( array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Height mode', 'js_composer' ),
'param_name' => 'height_mode',
'value' => array(
'1:1' => '1-1',
esc_html__( 'Original', 'js_composer' ) => 'original',
'4:3' => '4-3',
'3:4' => '3-4',
'16:9' => '16-9',
'9:16' => '9-16',
esc_html__( 'Custom', 'js_composer' ) => 'custom',
),
'description' => esc_html__( 'Sizing proportions for height and width. Select "Original" to scale image without cropping.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Height', 'js_composer' ),
'param_name' => 'height',
'dependency' => array(
'element' => 'height_mode',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Enter custom height.', 'js_composer' ),
),
), $zone_params ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_b' => array(
'name' => esc_html__( 'Hover', 'js_composer' ),
'base' => 'vc_gitem_zone_b',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => esc_html__( 'Content', 'js_composer' ),
'controls' => array( 'edit' ),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneView',
'params' => $zone_params,
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_zone_c' => array(
'name' => esc_html__( 'Additional', 'js_composer' ),
'base' => 'vc_gitem_zone_c',
'content_element' => false,
'is_container' => true,
'show_settings_on_create' => false,
'icon' => 'icon-wpb-gitem-zone',
'category' => esc_html__( 'Content', 'js_composer' ),
'controls' => array(
'move',
'delete',
'edit',
),
'as_parent' => array( 'only' => 'vc_gitem_row' ),
'js_view' => 'VcGitemZoneCView',
'params' => array(
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_row' => array(
'name' => esc_html__( 'Row', 'js_composer' ),
'base' => 'vc_gitem_row',
'content_element' => false,
'is_container' => true,
'icon' => 'icon-wpb-row',
'weight' => 1000,
'show_settings_on_create' => false,
'controls' => array(
'layout',
'delete',
),
'allowed_container_element' => 'vc_gitem_col',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place content elements inside the row', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemRowView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_col' => array(
'name' => esc_html__( 'Column', 'js_composer' ),
'base' => 'vc_gitem_col',
'icon' => 'icon-wpb-row',
'weight' => 1000,
'is_container' => true,
'allowed_container_element' => false,
'content_element' => false,
'controls' => array( 'edit' ),
'description' => esc_html__( 'Place content elements inside the column', 'js_composer' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Width', 'js_composer' ),
'param_name' => 'width',
'value' => array(
esc_html__( '1 column - 1/12', 'js_composer' ) => '1/12',
esc_html__( '2 columns - 1/6', 'js_composer' ) => '1/6',
esc_html__( '3 columns - 1/4', 'js_composer' ) => '1/4',
esc_html__( '4 columns - 1/3', 'js_composer' ) => '1/3',
esc_html__( '5 columns - 5/12', 'js_composer' ) => '5/12',
esc_html__( '6 columns - 1/2', 'js_composer' ) => '1/2',
esc_html__( '7 columns - 7/12', 'js_composer' ) => '7/12',
esc_html__( '8 columns - 2/3', 'js_composer' ) => '2/3',
esc_html__( '9 columns - 3/4', 'js_composer' ) => '3/4',
esc_html__( '10 columns - 5/6', 'js_composer' ) => '5/6',
esc_html__( '11 columns - 11/12', 'js_composer' ) => '11/12',
esc_html__( '12 columns - 1/1', 'js_composer' ) => '1/1',
),
'description' => esc_html__( 'Select column width.', 'js_composer' ),
'std' => '1/1',
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Use featured image on background?', 'js_composer' ),
'param_name' => 'featured_image',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'value' => 'large',
'description' => esc_html__( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'js_composer' ),
'dependency' => array(
'element' => 'featured_image',
'not_empty' => true,
),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'js_view' => 'VcGitemColView',
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_title' => array(
'name' => esc_html__( 'Post Title', 'js_composer' ),
'base' => 'vc_gitem_post_title',
'icon' => 'vc_icon-vc-gitem-post-title',
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Title of current post', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_excerpt' => array(
'name' => esc_html__( 'Post Excerpt', 'js_composer' ),
'base' => 'vc_gitem_post_excerpt',
'icon' => 'vc_icon-vc-gitem-post-excerpt',
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Excerpt or manual excerpt', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_author' => array(
'name' => esc_html__( 'Post Author', 'js_composer' ),
'base' => 'vc_gitem_post_author',
'icon' => 'vc_icon-vc-gitem-post-author',
// @todo change icon ?
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Author of current post', 'js_composer' ),
'params' => array_merge( array(
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => '',
'description' => esc_html__( 'Add link to author?', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
), $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_categories' => array(
'name' => esc_html__( 'Post Categories', 'js_composer' ),
'base' => 'vc_gitem_post_categories',
'icon' => 'vc_icon-vc-gitem-post-categories',
// @todo change icon ?
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Categories of current post', 'js_composer' ),
'params' => array(
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Add link', 'js_composer' ),
'param_name' => 'link',
'value' => '',
'description' => esc_html__( 'Add link to category?', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Style', 'js_composer' ),
'param_name' => 'category_style',
'value' => array(
esc_html__( 'None', 'js_composer' ) => ' ',
esc_html__( 'Comma', 'js_composer' ) => ', ',
esc_html__( 'Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-round-all',
esc_html__( 'Less Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-rounded-all',
esc_html__( 'Border', 'js_composer' ) => 'bordered',
esc_html__( 'Rounded Border', 'js_composer' ) => 'bordered-rounded vc_grid-filter-filled-round-all',
esc_html__( 'Less Rounded Border', 'js_composer' ) => 'bordered-rounded-less vc_grid-filter-filled-rounded-all',
),
'description' => esc_html__( 'Select category display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Color', 'js_composer' ),
'param_name' => 'category_color',
'value' => vc_get_shared( 'colors' ),
'std' => 'grey',
'param_holder_class' => 'vc_colored-dropdown',
'dependency' => array(
'element' => 'category_style',
'value_not_equal_to' => array(
' ',
', ',
),
),
'description' => esc_html__( 'Select category color.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Category size', 'js_composer' ),
'param_name' => 'category_size',
'value' => vc_get_shared( 'sizes' ),
'std' => 'md',
'description' => esc_html__( 'Select category size.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_image' => array(
'name' => esc_html__( 'Post Image', 'js_composer' ),
'base' => 'vc_gitem_image',
'icon' => 'vc_icon-vc-gitem-image',
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Featured image', 'js_composer' ),
'params' => array(
$vc_gitem_add_link_param,
array(
'type' => 'vc_link',
'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Add custom link.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'description' => esc_html__( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)). Leave parameter empty to use "thumbnail" by default.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Image alignment', 'js_composer' ),
'param_name' => 'alignment',
'value' => array(
esc_html__( 'Left', 'js_composer' ) => '',
esc_html__( 'Right', 'js_composer' ) => 'right',
esc_html__( 'Center', 'js_composer' ) => 'center',
),
'description' => esc_html__( 'Select image alignment.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Image style', 'js_composer' ),
'param_name' => 'style',
'value' => vc_get_shared( 'single image styles' ),
'description' => esc_html__( 'Select image display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Border color', 'js_composer' ),
'param_name' => 'border_color',
'value' => vc_get_shared( 'colors' ),
'std' => 'grey',
'dependency' => array(
'element' => 'style',
'value' => array(
'vc_box_border',
'vc_box_border_circle',
'vc_box_outline',
'vc_box_outline_circle',
),
),
'description' => esc_html__( 'Border color.', 'js_composer' ),
'param_holder_class' => 'vc_colored-dropdown',
),
vc_map_add_css_animation(),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_date' => array(
'name' => esc_html__( 'Post Date', 'js_composer' ),
'base' => 'vc_gitem_post_date',
'icon' => 'vc_icon-vc-gitem-post-date',
'category' => esc_html__( 'Post', 'js_composer' ),
'description' => esc_html__( 'Post publish date', 'js_composer' ),
'params' => array_merge( $post_data_params, $custom_fonts_params, array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
'vc_gitem_post_meta' => array(
'name' => esc_html__( 'Custom Field', 'js_composer' ),
'base' => 'vc_gitem_post_meta',
'icon' => 'vc_icon-vc-gitem-post-meta',
'category' => array(
esc_html__( 'Elements', 'js_composer' ),
),
'description' => esc_html__( 'Custom fields data from meta values of the post.', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Field key name', 'js_composer' ),
'param_name' => 'key',
'description' => esc_html__( 'Enter custom field name to retrieve meta data value.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Label', 'js_composer' ),
'param_name' => 'label',
'description' => esc_html__( 'Enter label to display before key value.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Alignment', 'js_composer' ),
'param_name' => 'align',
'value' => array(
esc_html__( 'Left', 'js_composer' ) => 'left',
esc_html__( 'Right', 'js_composer' ) => 'right',
esc_html__( 'Center', 'js_composer' ) => 'center',
esc_html__( 'Justify', 'js_composer' ) => 'justify',
),
'description' => esc_html__( 'Select alignment.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
);
$shortcode_vc_column_text = WPBMap::getShortCode( 'vc_column_text' );
if ( is_array( $shortcode_vc_column_text ) && isset( $shortcode_vc_column_text['base'] ) ) {
$list['vc_column_text'] = $shortcode_vc_column_text;
$list['vc_column_text']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_column_text']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_column_text']['params'][ $k ] );
}
}
}
$shortcode_vc_separator = WPBMap::getShortCode( 'vc_separator' );
if ( is_array( $shortcode_vc_separator ) && isset( $shortcode_vc_separator['base'] ) ) {
$list['vc_separator'] = $shortcode_vc_separator;
$list['vc_separator']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_separator']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_separator']['params'][ $k ] );
}
}
}
$shortcode_vc_text_separator = WPBMap::getShortCode( 'vc_text_separator' );
if ( is_array( $shortcode_vc_text_separator ) && isset( $shortcode_vc_text_separator['base'] ) ) {
$list['vc_text_separator'] = $shortcode_vc_text_separator;
$list['vc_text_separator']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_text_separator']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_text_separator']['params'][ $k ] );
}
}
}
$shortcode_vc_icon = WPBMap::getShortCode( 'vc_icon' );
if ( is_array( $shortcode_vc_icon ) && isset( $shortcode_vc_icon['base'] ) ) {
$list['vc_icon'] = $shortcode_vc_icon;
$list['vc_icon']['post_type'] = Vc_Grid_Item_Editor::postType();
$list['vc_icon']['params'] = vc_map_integrate_shortcode( 'vc_icon', '', '', array(
'exclude' => array(
'link',
'el_id',
),
) );
}
$list['vc_single_image'] = array(
'name' => esc_html__( 'Single Image', 'js_composer' ),
'base' => 'vc_single_image',
'icon' => 'icon-wpb-single-image',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Simple image with CSS animation', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Widget title', 'js_composer' ),
'param_name' => 'title',
'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Image source', 'js_composer' ),
'param_name' => 'source',
'value' => array(
esc_html__( 'Media library', 'js_composer' ) => 'media_library',
esc_html__( 'External link', 'js_composer' ) => 'external_link',
),
'std' => 'media_library',
'description' => esc_html__( 'Select image source.', 'js_composer' ),
),
array(
'type' => 'attach_image',
'heading' => esc_html__( 'Image', 'js_composer' ),
'param_name' => 'image',
'value' => '',
'description' => esc_html__( 'Select image from media library.', 'js_composer' ),
'dependency' => array(
'element' => 'source',
'value' => 'media_library',
),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'External link', 'js_composer' ),
'param_name' => 'custom_src',
'description' => esc_html__( 'Select external link.', 'js_composer' ),
'dependency' => array(
'element' => 'source',
'value' => 'external_link',
),
),
vc_map_add_css_animation(),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Image size', 'js_composer' ),
'param_name' => 'img_size',
'description' => esc_html__( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)). Leave parameter empty to use "thumbnail" by default.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Image alignment', 'js_composer' ),
'param_name' => 'alignment',
'value' => array(
esc_html__( 'Left', 'js_composer' ) => '',
esc_html__( 'Right', 'js_composer' ) => 'right',
esc_html__( 'Center', 'js_composer' ) => 'center',
),
'description' => esc_html__( 'Select image alignment.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Image style', 'js_composer' ),
'param_name' => 'style',
'value' => vc_get_shared( 'single image styles' ),
'description' => esc_html__( 'Select image display style.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Border color', 'js_composer' ),
'param_name' => 'border_color',
'value' => vc_get_shared( 'colors' ),
'std' => 'grey',
'dependency' => array(
'element' => 'style',
'value' => array(
'vc_box_border',
'vc_box_border_circle',
'vc_box_outline',
'vc_box_outline_circle',
),
),
'description' => esc_html__( 'Border color.', 'js_composer' ),
'param_holder_class' => 'vc_colored-dropdown',
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
);
$shortcode_vc_button2 = WPBMap::getShortCode( 'vc_button2' );
if ( is_array( $shortcode_vc_button2 ) && isset( $shortcode_vc_button2['base'] ) ) {
$list['vc_button2'] = $shortcode_vc_button2;
$list['vc_button2']['post_type'] = Vc_Grid_Item_Editor::postType();
}
$shortcode_vc_btn = WPBMap::getShortCode( 'vc_btn' );
if ( is_array( $shortcode_vc_btn ) && isset( $shortcode_vc_btn['base'] ) ) {
$list['vc_btn'] = $shortcode_vc_btn;
$list['vc_btn']['post_type'] = Vc_Grid_Item_Editor::postType();
unset( $list['vc_btn']['params'][1] );
$remove = array( 'el_id' );
foreach ( $list['vc_btn']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_btn']['params'][ $k ] );
}
}
}
$shortcode_vc_custom_heading = WPBMap::getShortCode( 'vc_custom_heading' );
if ( is_array( $shortcode_vc_custom_heading ) && isset( $shortcode_vc_custom_heading['base'] ) ) {
$list['vc_custom_heading'] = $shortcode_vc_custom_heading;
$list['vc_custom_heading']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array(
'link',
'source',
'el_id',
);
foreach ( $list['vc_custom_heading']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_custom_heading']['params'][ $k ] );
}
// text depends on source. remove dependency so text is always saved
if ( 'text' === $v['param_name'] ) {
unset( $list['vc_custom_heading']['params'][ $k ]['dependency'] );
}
}
}
$shortcode_vc_empty_space = WPBMap::getShortCode( 'vc_empty_space' );
if ( is_array( $shortcode_vc_empty_space ) && isset( $shortcode_vc_empty_space['base'] ) ) {
$list['vc_empty_space'] = $shortcode_vc_empty_space;
$list['vc_empty_space']['post_type'] = Vc_Grid_Item_Editor::postType();
$remove = array( 'el_id' );
foreach ( $list['vc_empty_space']['params'] as $k => $v ) {
if ( in_array( $v['param_name'], $remove, true ) ) {
unset( $list['vc_empty_space']['params'][ $k ] );
}
}
}
foreach (
array(
'vc_icon',
'vc_button2',
'vc_btn',
'vc_custom_heading',
'vc_single_image',
) as $key
) {
if ( isset( $list[ $key ] ) ) {
if ( ! isset( $list[ $key ]['params'] ) ) {
$list[ $key ]['params'] = array();
}
if ( 'vc_button2' === $key ) {
// change settings for vc_link in dropdown. Add dependency.
$list[ $key ]['params'][0] = array(
'type' => 'vc_link',
'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Add custom link.', 'js_composer' ),
);
} else {
array_unshift( $list[ $key ]['params'], array(
'type' => 'vc_link',
'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
'param_name' => 'url',
'dependency' => array(
'element' => 'link',
'value' => array( 'custom' ),
),
'description' => esc_html__( 'Add custom link.', 'js_composer' ),
) );
}
// Add link dropdown
array_unshift( $list[ $key ]['params'], $vc_gitem_add_link_param );
}
}
foreach ( $list as $key => $value ) {
if ( isset( $list[ $key ]['params'] ) ) {
$list[ $key ]['params'] = array_values( $list[ $key ]['params'] );
}
}
return $list;
params/vc_grid_item/attributes.php 0000644 00000027031 15121635560 0013370 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Build css classes from terms of the post.
*
* @param $value
* @param $data
*
* @return string
* @since 4.4
*
*/
function vc_gitem_template_attribute_filter_terms_css_classes( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
if ( isset( $post->filter_terms ) && is_array( $post->filter_terms ) ) {
foreach ( $post->filter_terms as $t ) {
$output .= ' vc_grid-term-' . $t; // @todo fix #106154391786878 $t is array
}
}
return $output;
}
/**
* Get image for post
*
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_image( $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
if ( 'attachment' === $post->post_type ) {
return wp_get_attachment_image( $post->ID, 'large' );
}
$html = get_the_post_thumbnail( $post->ID );
return apply_filters( 'vc_gitem_template_attribute_post_image_html', $html );
}
/**
* @param $value
* @param $data
* @return mixed
*/
function vc_gitem_template_attribute_featured_image( $value, $data ) {
/**
* @var Wp_Post $post
* @var string $data
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return vc_include_template( 'params/vc_grid_item/attributes/featured_image.php', array(
'post' => $post,
'data' => $data,
) );
}
/**
* Create new btn
*
* @param $value
* @param $data
*
* @return mixed
* @since 4.5
*
*/
function vc_gitem_template_attribute_vc_btn( $value, $data ) {
/**
* @var Wp_Post $post
* @var string $data
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return vc_include_template( 'params/vc_grid_item/attributes/vc_btn.php', array(
'post' => $post,
'data' => $data,
) );
}
/**
* Get post image url
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$extraImageMeta = explode( ':', $data );
$size = 'large'; // default size
if ( isset( $extraImageMeta[1] ) ) {
$size = $extraImageMeta[1];
}
if ( 'attachment' === $post->post_type ) {
$src = vc_get_image_by_size( $post->ID, $size );
} else {
$attachment_id = get_post_thumbnail_id( $post->ID );
$src = vc_get_image_by_size( $attachment_id, $size );
}
if ( ! empty( $src ) ) {
$output = is_array( $src ) ? $src[0] : $src;
} else {
$output = vc_asset_url( 'vc/vc_gitem_image.png' );
}
return apply_filters( 'vc_gitem_template_attribute_post_image_url_value', $output );
}
/**
* Get post image url with href for a dom element
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url_href( $value, $data ) {
$link = vc_gitem_template_attribute_post_image_url( $value, $data );
return strlen( $link ) ? ' href="' . esc_url( $link ) . '"' : '';
}
/**
* Add image url as href with css classes for lightbox js plugin.
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_post_image_url_attr_lightbox( $value, $data ) {
$data_default = $data;
/**
* @var Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$href = vc_gitem_template_attribute_post_image_url_href( $value, array(
'post' => $post,
'data' => '',
) );
$rel = ' data-lightbox="' . esc_attr( 'lightbox[rel-' . md5( vc_request_param( 'shortcode_id' ) ) . ']' ) . '"';
return $href . $rel . ' class="' . esc_attr( $data ) . '" title="' . esc_attr( apply_filters( 'vc_gitem_template_attribute_post_title', $post->post_title, $data_default ) ) . '"';
}
/**
* @param $value
* @param $data
* @return string
* @depreacted 6.6.0
*/
function vc_gitem_template_attribute_post_image_url_attr_prettyphoto( $value, $data ) {
return vc_gitem_template_attribute_post_image_url_attr_lightbox( $value, $data );
}
/**
* Get post image alt
*
* @param $value
* @param $data
* @return string
*/
function vc_gitem_template_attribute_post_image_alt( $value, $data ) {
if ( empty( $data['post']->ID ) ) {
return '';
}
if ( 'attachment' === $data['post']->post_type ) {
$attachment_id = $data['post']->ID;
} else {
$attachment_id = get_post_thumbnail_id( $data['post']->ID );
}
if ( ! $attachment_id ) {
return '';
}
$alt = trim( wp_strip_all_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );
return apply_filters( 'vc_gitem_template_attribute_post_image_url_value', $alt );
}
/**
* Get post image url
*
* @param $value
* @param $data
* @return string
*/
function vc_gitem_template_attribute_post_image_background_image_css( $value, $data ) {
$output = '';
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$size = 'large'; // default size
if ( ! empty( $data ) ) {
$size = $data;
}
if ( 'attachment' === $post->post_type ) {
$src = vc_get_image_by_size( $post->ID, $size );
} else {
$attachment_id = get_post_thumbnail_id( $post->ID );
$src = vc_get_image_by_size( $attachment_id, $size );
}
if ( ! empty( $src ) ) {
$output = 'background-image: url(\'' . ( is_array( $src ) ? $src[0] : $src ) . '\') !important;';
} else {
$output = 'background-image: url(\'' . vc_asset_url( 'vc/vc_gitem_image.png' ) . '\') !important;';
}
return apply_filters( 'vc_gitem_template_attribute_post_image_background_image_css_value', $output );
}
/**
* Get post link
*
* @param $value
* @param $data
* @return bool|string
*/
function vc_gitem_template_attribute_post_link_url( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_permalink( $post->ID );
}
/**
* Get post date
*
* @param $value
* @param $data
* @return bool|int|string
*/
function vc_gitem_template_attribute_post_date( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_the_date( '', $post->ID );
}
/**
* Get post date time
*
* @param $value
* @param $data
* @return bool|int|string
*/
function vc_gitem_template_attribute_post_datetime( $value, $data ) {
/**
* @var null|Wp_Post $post ;
*/
extract( array_merge( array(
'post' => null,
), $data ) );
return get_the_time( 'F j, Y g:i', $post->ID );
}
/**
* Get custom fields.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_meta_value( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return strlen( $data ) > 0 ? get_post_meta( $post->ID, $data, true ) : $value;
}
/**
* Get post data. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_data( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return strlen( $data ) > 0 ? apply_filters( 'vc_gitem_template_attribute_' . $data, ( isset( $post->$data ) ? $post->$data : '' ), array(
'post' => $post,
'data' => '',
) ) : $value;
}
/**
* Get post excerpt. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_excerpt( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $value ) );
}
/**
* Get post excerpt. Used as wrapper for others post data attributes.
*
* @param $value
* @param $data
* @return mixed|string
*/
function vc_gitem_template_attribute_post_title( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return the_title( '', '', false );
}
/**
* @param $value
* @param $data
* @return string|null
*/
function vc_gitem_template_attribute_post_author( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return get_the_author();
}
/**
* @param $value
* @param $data
* @return string
*/
function vc_gitem_template_attribute_post_author_href( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
return get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) );
}
/**
* @param $value
* @param $data
* @return mixed
*/
function vc_gitem_template_attribute_post_categories( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$atts_extended = array();
parse_str( $data, $atts_extended );
return vc_include_template( 'params/vc_grid_item/attributes/post_categories.php', array(
'post' => $post,
'atts' => $atts_extended['atts'],
) );
}
/**
* Adding filters to parse grid template.
*/
add_filter( 'vc_gitem_template_attribute_filter_terms_css_classes', 'vc_gitem_template_attribute_filter_terms_css_classes', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image', 'vc_gitem_template_attribute_post_image', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url', 'vc_gitem_template_attribute_post_image_url', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url_href', 'vc_gitem_template_attribute_post_image_url_href', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_url_attr_prettyphoto', 'vc_gitem_template_attribute_post_image_url_attr_prettyphoto', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_alt', 'vc_gitem_template_attribute_post_image_alt', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_link_url', 'vc_gitem_template_attribute_post_link_url', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_date', 'vc_gitem_template_attribute_post_date', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_datetime', 'vc_gitem_template_attribute_post_datetime', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_meta_value', 'vc_gitem_template_attribute_post_meta_value', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_data', 'vc_gitem_template_attribute_post_data', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_image_background_image_css', 'vc_gitem_template_attribute_post_image_background_image_css', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_excerpt', 'vc_gitem_template_attribute_post_excerpt', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_title', 'vc_gitem_template_attribute_post_title', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_author', 'vc_gitem_template_attribute_post_author', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_author_href', 'vc_gitem_template_attribute_post_author_href', 10, 2 );
add_filter( 'vc_gitem_template_attribute_post_categories', 'vc_gitem_template_attribute_post_categories', 10, 2 );
add_filter( 'vc_gitem_template_attribute_featured_image', 'vc_gitem_template_attribute_featured_image', 10, 2 );
add_filter( 'vc_gitem_template_attribute_vc_btn', 'vc_gitem_template_attribute_vc_btn', 10, 2 );
params/vc_grid_item/class-wpb-map-grid-item.php 0000644 00000006606 15121635560 0015534 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WpbMap_Grid_Item
*/
class WpbMap_Grid_Item extends WPBMap {
protected static $gitem_user_sc = false;
protected static $gitem_user_categories = false;
protected static $gitem_user_sorted_sc = false;
/**
* Generates list of shortcodes only for Grid element.
*
* This method parses the list of mapped shortcodes and creates categories list for users.
* Also it checks is 'is_grid_item_element' attribute true.
*
* @static
*
* @param bool $force - force data generation even data already generated.
* @throws \Exception
*/
protected static function generateGitemUserData( $force = false ) {
if ( ! $force && false !== self::$gitem_user_sc && false !== self::$gitem_user_categories ) {
return;
}
self::$gitem_user_sc = self::$gitem_user_categories = self::$gitem_user_sorted_sc = array();
$deprecated = 'deprecated';
$add_deprecated = false;
if ( is_array( self::$sc ) && ! empty( self::$sc ) ) {
foreach ( self::$sc as $name => $values ) {
if ( isset( $values['post_type'] ) && Vc_Grid_Item_Editor::postType() === $values['post_type'] && vc_user_access_check_shortcode_all( $name ) ) {
if ( ! isset( $values['content_element'] ) || true === $values['content_element'] ) {
$categories = isset( $values['category'] ) ? $values['category'] : '_other_category_';
$values['_category_ids'] = array();
if ( isset( $values['deprecated'] ) && false !== $values['deprecated'] ) {
$add_deprecated = true;
$values['_category_ids'][] = $deprecated;
} else {
if ( is_array( $categories ) && ! empty( $categories ) ) {
foreach ( $categories as $c ) {
if ( false === array_search( $c, self::$gitem_user_categories, true ) ) {
self::$gitem_user_categories[] = $c;
}
$values['_category_ids'][] = md5( $c );
}
} else {
if ( false === array_search( $categories, self::$gitem_user_categories, true ) ) {
self::$gitem_user_categories[] = $categories;
}
$values['_category_ids'][] = md5( $categories );
}
}
}
self::$gitem_user_sc[ $name ] = $values;
self::$gitem_user_sorted_sc[] = $values;
}
}
}
if ( $add_deprecated ) {
self::$gitem_user_categories[] = $deprecated;
}
$sort = new Vc_Sort( self::$gitem_user_sorted_sc );
self::$gitem_user_sorted_sc = $sort->sortByKey();
}
/**
* Get sorted list of mapped shortcode settings grid element
*
* Sorting depends on the weight attribute and mapping order.
*
* @static
* @return bool
* @throws \Exception
*/
public static function getSortedGitemUserShortCodes() {
self::generateGitemUserData();
return self::$gitem_user_sorted_sc;
}
/**
* Get list of mapped shortcode settings for current user.
* @static
* @return bool - associated array of shortcodes settings with tag as the key.
* @throws \Exception
*/
public static function getGitemUserShortCodes() {
self::generateGitemUserData();
return self::$gitem_user_sc;
}
/**
* Get all categories for current user.
*
* Category is added to the list when at least one shortcode of this category is allowed for current user
* by Vc access rules.
*
* @static
* @return bool
* @throws \Exception
*/
public static function getGitemUserCategories() {
self::generateGitemUserData();
return self::$gitem_user_categories;
}
}
params/vc_grid_item/class-vc-grid-item.php 0000644 00000023326 15121635560 0014577 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Grid_Item to build grid item.
*/
class Vc_Grid_Item {
protected $template = '';
protected $html_template = false;
protected $post = false;
protected $grid_atts = array();
protected $is_end = false;
protected $shortcodes = false;
protected $found_variables = false;
protected static $predefined_templates = false;
protected $template_id = false;
/**
* Get shortcodes to build vc grid item templates.
*
* @return bool|mixed
*/
public function shortcodes() {
if ( false === $this->shortcodes ) {
$this->shortcodes = include vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/shortcodes.php' );
$this->shortcodes = apply_filters( 'vc_grid_item_shortcodes', $this->shortcodes );
}
add_filter( 'vc_shortcode_set_template_vc_icon', array(
$this,
'addVcIconShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_button2', array(
$this,
'addVcButton2ShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_single_image', array(
$this,
'addVcSingleImageShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_custom_heading', array(
$this,
'addVcCustomHeadingShortcodesTemplates',
) );
add_filter( 'vc_shortcode_set_template_vc_btn', array(
$this,
'addVcBtnShortcodesTemplates',
) );
return $this->shortcodes;
}
/**
* Used by filter vc_shortcode_set_template_vc_icon to set custom template for vc_icon shortcode.
*
* @param $template
*
* @return string
*/
public function addVcIconShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_icon.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_button2 to set custom template for vc_button2 shortcode.
*
* @param $template
*
* @return string
*/
public function addVcButton2ShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_button2.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_single_image to set custom template for vc_single_image shortcode.
*
* @param $template
*
* @return string
*/
public function addVcSingleImageShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_single_image.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_custom_heading to set custom template for vc_custom_heading
* shortcode.
*
* @param $template
*
* @return string
*/
public function addVcCustomHeadingShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_custom_heading.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Used by filter vc_shortcode_set_template_vc_button2 to set custom template for vc_button2 shortcode.
*
* @param $template
*
* @return string
*/
public function addVcBtnShortcodesTemplates( $template ) {
if ( Vc_Grid_Item_Editor::postType() === WPBMap::getScope() ) {
$file = vc_path_dir( 'TEMPLATES_DIR', 'params/vc_grid_item/shortcodes/vc_btn.php' );
if ( is_file( $file ) ) {
return $file;
}
}
return $template;
}
/**
* Map shortcodes for vc_grid_item param type.
* @throws \Exception
*/
public function mapShortcodes() {
// @kludge
// TODO: refactor with with new way of roles for shortcodes.
// NEW ROLES like post_type for shortcode and access policies.
$shortcodes = $this->shortcodes();
foreach ( $shortcodes as $shortcode_settings ) {
vc_map( $shortcode_settings );
}
}
/**
* Get list of predefined templates.
*
* @return bool|mixed
*/
public static function predefinedTemplates() {
if ( false === self::$predefined_templates ) {
self::$predefined_templates = apply_filters( 'vc_grid_item_predefined_templates', include vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/templates.php' ) );
}
return self::$predefined_templates;
}
/**
* @param $id - Predefined templates id
*
* @return array|bool
*/
public static function predefinedTemplate( $id ) {
$predefined_templates = self::predefinedTemplates();
if ( isset( $predefined_templates[ $id ]['template'] ) ) {
return $predefined_templates[ $id ];
}
return false;
}
/**
* Set template which should grid used when vc_grid_item param value is rendered.
*
* @param $id
*
* @return bool
* @throws \Exception
*/
public function setTemplateById( $id ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/templates.php' );
if ( 0 === strlen( $id ) ) {
return false;
}
if ( preg_match( '/^\d+$/', $id ) ) {
$post = get_post( (int) $id );
if ( $post ) {
$this->setTemplate( $post->post_content, $post->ID );
}
return true;
} else {
$predefined_template = $this->predefinedTemplate( $id );
if ( $predefined_template ) {
$this->setTemplate( $predefined_template['template'], $id );
return true;
}
}
return false;
}
/**
* Setter for template attribute.
*
* @param $template
* @param $template_id
* @throws \Exception
*/
public function setTemplate( $template, $template_id ) {
$this->template = $template;
$this->template_id = $template_id;
$this->parseTemplate( $template );
}
/**
* Getter for template attribute.
* @return string
*/
public function template() {
return $this->template;
}
/**
* Add custom css from shortcodes that were mapped for vc grid item.
* @return string
* @throws \Exception
*/
public function addShortcodesCustomCss() {
$output = $shortcodes_custom_css = '';
$id = $this->template_id;
if ( preg_match( '/^\d+$/', $id ) ) {
$shortcodes_custom_css = get_post_meta( $id, '_wpb_shortcodes_custom_css', true );
} else {
$predefined_template = $this->predefinedTemplate( $id );
if ( $predefined_template ) {
$shortcodes_custom_css = visual_composer()->parseShortcodesCustomCss( $predefined_template['template'] );
}
}
if ( ! empty( $shortcodes_custom_css ) ) {
$shortcodes_custom_css = wp_strip_all_tags( $shortcodes_custom_css );
$first_tag = 'style';
$output .= '<' . $first_tag . ' data-type="vc_shortcodes-custom-css">';
$output .= $shortcodes_custom_css;
$output .= '</' . $first_tag . '>';
}
return $output;
}
/**
* Generates html with template's variables for rendering new project.
*
* @param $template
* @throws \Exception
*/
public function parseTemplate( $template ) {
$this->mapShortcodes();
WPBMap::addAllMappedShortcodes();
$attr = ' width="' . $this->gridAttribute( 'element_width', 12 ) . '"' . ' is_end="' . ( 'true' === $this->isEnd() ? 'true' : '' ) . '"';
$template = preg_replace( '/(\[(\[?)vc_gitem\b)/', '$1' . $attr, $template );
$template = str_replace( array(
'<p>[vc_gitem',
'[/vc_gitem]</p>',
), array(
'[vc_gitem',
'[/vc_gitem]',
), $template );
$this->html_template .= do_shortcode( trim( $template ) );
}
/**
* Regexp for variables.
* @return string
*/
public function templateVariablesRegex() {
return '/\{\{' . '\{?' . '\s*' . '([^\}\:]+)(\:([^\}]+))?' . '\s*' . '\}\}' . '\}?/';
}
/**
* Get default variables.
*
* @return array|bool
*/
public function getTemplateVariables() {
if ( ! is_array( $this->found_variables ) ) {
preg_match_all( $this->templateVariablesRegex(), $this->html_template, $this->found_variables, PREG_SET_ORDER );
}
return $this->found_variables;
}
/**
* Render item by replacing template variables for exact post.
*
* @param WP_Post $post
*
* @return mixed
*/
public function renderItem( WP_Post $post ) {
$pattern = array();
$replacement = array();
$this->addAttributesFilters();
foreach ( $this->getTemplateVariables() as $var ) {
$pattern[] = '/' . preg_quote( $var[0], '/' ) . '/';
$replacement[] = preg_replace( '/\\$/', '\\\$', $this->attribute( $var[1], $post, isset( $var[3] ) ? trim( $var[3] ) : '' ) );
}
return preg_replace( $pattern, $replacement, do_shortcode( $this->html_template ) );
}
/**
* Adds filters to build templates variables values.
*/
public function addAttributesFilters() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/attributes.php' );
}
/**
* Getter for Grid shortcode attributes.
*
* @param $grid_atts
*/
public function setGridAttributes( $grid_atts ) {
$this->grid_atts = $grid_atts;
}
/**
* Setter for Grid shortcode attributes.
*
* @param $name
* @param string $default
*
* @return string
*/
public function gridAttribute( $name, $default = '' ) {
return isset( $this->grid_atts[ $name ] ) ? $this->grid_atts[ $name ] : $default;
}
/**
* Get attribute value for WP_post object.
*
* @param $name
* @param $post
* @param string $data
*
* @return mixed
*/
public function attribute( $name, $post, $data = '' ) {
$data = html_entity_decode( $data );
return apply_filters( 'vc_gitem_template_attribute_' . trim( $name ), ( isset( $post->$name ) ? $post->$name : '' ), array(
'post' => $post,
'data' => $data,
) );
}
/**
* Set that this is last items in the grid. Used for load more button and lazy loading.
*
* @param bool $is_end
*/
public function setIsEnd( $is_end = true ) {
$this->is_end = $is_end;
}
/**
* Checks is the end.
* @return bool
*/
public function isEnd() {
return $this->is_end;
}
}
params/param_group/param_group.php 0000644 00000015350 15121635560 0013400 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-edit-form-fields.php' );
/**
* Class Vc_ParamGroup_Edit_Form_Fields
* @since 4.4
*/
class Vc_ParamGroup_Edit_Form_Fields extends Vc_Edit_Form_Fields {
/** @noinspection PhpMissingParentConstructorInspection */
/**
* @param $settings
* @since 4.4
*
*/
public function __construct( $settings ) {
$this->setSettings( $settings );
}
/**
* Get shortcode attribute value wrapper for params group.
*
* This function checks if value isn't set then it uses std or value fields in param settings.
* @param $params_settings
* @param null $value
*
* @return mixed;
* @since 5.2.1
*
*/
public function getParamGroupAttributeValue( $params_settings, $value = null ) {
return $this->parseShortcodeAttributeValue( $params_settings, $value );
}
}
/**
* Class Vc_ParamGroup
* @since 4.4
*/
class Vc_ParamGroup {
/**
* @since 4.4
* @var
*/
protected $settings;
/**
* @since 4.4
* @var array|mixed
*/
protected $value;
/**
* @since 4.4
* @var
*/
protected $map;
/**
* @since 4.4
* @var
*/
protected $atts;
public $unparsed_value;
/**
* @param $settings
* @param $value
* @param $tag
*
* @since 4.4
*/
public function __construct( $settings, $value, $tag ) {
$this->settings = $settings;
$this->settings['base'] = $tag;
$this->value = vc_param_group_parse_atts( $value );
$this->unparsed_value = $value;
}
/**
* @param $param_name
* @param $arr
*
* @return array
* @since 4.4
*/
public function params_to_arr( $param_name, $arr ) {
$data = array();
foreach ( $arr as $param ) {
$data[ $param_name . '_' . $param['param_name'] ] = $param['type'];
}
return $data;
}
/**
* @return mixed|string
* @since 4.4
*/
public function render() {
$output = '';
$edit_form = new Vc_ParamGroup_Edit_Form_Fields( $this->settings );
$settings = $this->settings;
$output .= '<ul class="vc_param_group-list vc_settings" data-settings="' . htmlentities( wp_json_encode( $settings ), ENT_QUOTES, 'utf-8' ) . '">';
$template = vc_include_template( 'params/param_group/content.tpl.php' );
// Parsing values
if ( ! empty( $this->value ) ) {
foreach ( $this->value as $values ) {
$output .= $template;
$value_block = "<div class='vc_param_group-wrapper vc_clearfix'>";
$data = $values;
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( $data[ $param['param_name'] ] ) ? $data[ $param['param_name'] ] : ( isset( $param['value'] ) ? $param['value'] : null );
$param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name'];
$value = $edit_form->getParamGroupAttributeValue( $param, $param_value );
$value_block .= $edit_form->renderField( $param, $value );
}
$value_block .= '</div>';
$output = str_replace( '%content%', $value_block, $output );
}
} else {
$output .= $template;
}
// Empty fields wrapper and Add new fields wrapper
$content = "<div class='vc_param_group-wrapper vc_clearfix'>";
foreach ( $this->settings['params'] as $param ) {
$param['param_name'] = $this->settings['param_name'] . '_' . $param['param_name'];
$value = $edit_form->getParamGroupAttributeValue( $param );
$content .= $edit_form->renderField( $param, $value );
}
$content .= '</div>';
$output = str_replace( '%content%', $content, $output );
// And button on bottom
$output .= '<li class="wpb_column_container vc_container_for_children vc_param_group-add_content vc_empty-container"></li></ul>';
$add_template = vc_include_template( 'params/param_group/add.tpl.php' );
$add_template = str_replace( '%content%', $content, $add_template );
$custom_tag = 'script';
$output .= '<' . $custom_tag . ' type="text/html" class="vc_param_group-template">' . wp_json_encode( $add_template ) . '</' . $custom_tag . '>';
$output .= '<input name="' . $this->settings['param_name'] . '" class="wpb_vc_param_value ' . $this->settings['param_name'] . ' ' . $this->settings['type'] . '_field" type="hidden" value="' . $this->unparsed_value . '" />';
return $output;
}
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $param_settings
* @param $param_value
* @param $tag
*
* @return mixed rendered template for params in edit form
* @since 4.4
*
* vc_filter: vc_param_group_render_filter
*
*/
function vc_param_group_form_field( $param_settings, $param_value, $tag ) {
$param_group = new Vc_ParamGroup( $param_settings, $param_value, $tag );
return apply_filters( 'vc_param_group_render_filter', $param_group->render() );
}
add_action( 'wp_ajax_vc_param_group_clone', 'vc_param_group_clone' );
/**
* @since 4.4
*/
function vc_param_group_clone() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$param = vc_post_param( 'param' );
$value = vc_post_param( 'value' );
$tag = vc_post_param( 'shortcode' );
wp_send_json_success( vc_param_group_clone_by_data( $tag, json_decode( rawurldecode( $param ), true ), json_decode( rawurldecode( $value ), true ) ) );
}
/**
* @param $tag
* @param $params
* @param $data
*
* @return mixed|string
* @since 4.4
*/
function vc_param_group_clone_by_data( $tag, $params, $data ) {
$output = '';
$params['base'] = $tag;
$edit_form = new Vc_ParamGroup_Edit_Form_Fields( $params );
$edit_form->loadDefaultParams();
$template = vc_include_template( 'params/param_group/content.tpl.php' );
$output .= $template;
$value_block = "<div class='vc_param_group-wrapper vc_clearfix'>";
$data = $data[0];
if ( isset( $params['params'] ) && is_array( $params['params'] ) ) {
foreach ( $params['params'] as $param ) {
$param_data = isset( $data[ $param['param_name'] ] ) ? $data[ $param['param_name'] ] : ( isset( $param['value'] ) ? $param['value'] : '' );
$param['param_name'] = $params['param_name'] . '_' . $param['param_name'];
$value_block .= $edit_form->renderField( $param, $param_data );
}
}
$value_block .= '</div>';
$output = str_replace( '%content%', $value_block, $output );
return $output;
}
/**
* @param $atts_string
*
* @return array|mixed
* @since 4.4
*/
function vc_param_group_parse_atts( $atts_string ) {
$array = json_decode( urldecode( $atts_string ), true );
return $array;
}
add_filter( 'vc_map_get_param_defaults', 'vc_param_group_param_defaults', 10, 2 );
/**
* @param $value
* @param $param
* @return string
*/
function vc_param_group_param_defaults( $value, $param ) {
if ( 'param_group' === $param['type'] && isset( $param['params'] ) && empty( $value ) ) {
$defaults = vc_map_get_params_defaults( $param['params'] );
$value = rawurlencode( wp_json_encode( array( $defaults ) ) );
}
return $value;
}
params/custom_markup/custom_markup.php 0000644 00000001045 15121635560 0014326 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
* @since 4.4
*
* @param $settings
* @param $value
* @param $tag
*
* vc_filter: vc_custom_markup_render_filter - hook to override custom markup for field
*
* @return mixed rendered template for params in edit form
*
*/
function vc_custom_markup_form_field( $settings, $value, $tag ) {
return apply_filters( 'vc_custom_markup_render_filter', $value, $settings, $tag );
}
params/vc_grid_element/vc_grid_element.php 0000644 00000023072 15121635560 0015024 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Grid_Element
*/
class Vc_Grid_Element {
protected $template = '';
protected $html_template = false;
protected $post = false;
protected $attributes = array();
protected $grid_atts = array();
protected $is_end = false;
protected static $templates_added = false;
protected $shortcodes = array(
'vc_gitem_row',
'vc_gitem_col',
'vc_gitem_post_title',
'vc_gitem_icon',
);
/**
* @return array
*/
public function shortcodes() {
return $this->shortcodes;
}
/**
* @param $template
*/
public function setTemplate( $template ) {
$this->template = $template;
$this->parseTemplate( $template );
}
/**
* @return string
*/
public function template() {
return $this->template;
}
/**
* @param $template
*/
public function parseTemplate( $template ) {
$this->setShortcodes();
$this->html_template = do_shortcode( $template );
}
/**
* @param \WP_Post $post
* @return string
*/
public function renderItem( WP_Post $post ) {
$attributes = $this->attributes();
$pattern = array();
$replacement = array();
foreach ( $attributes as $attr ) {
$pattern[] = '/\{\{' . preg_quote( $attr, '' ) . '\}\}/';
$replacement[] = $this->attribute( $attr, $post );
}
$css_class_items = 'vc_grid-item ' . ( $this->isEnd() ? ' vc_grid-last-item ' : '' ) . ' vc_grid-thumb vc_theme-thumb-full-overlay vc_animation-slide-left vc_col-sm-' . $this->gridAttribute( 'element_width', 12 );
foreach ( $post->filter_terms as $t ) {
$css_class_items .= ' vc_grid-term-' . $t;
}
return '<div class="' . $css_class_items . '">' . "\n" . preg_replace( $pattern, $replacement, $this->html_template ) . "\n" . '</div>' . "\n";
}
/**
* @return string
*/
public function renderParam() {
$output = '<div class="vc_grid-element-constructor" data-vc-grid-element="builder"></div>' . '<a href="#" data-vc-control="add-row">' . esc_html__( 'Add row', 'js_composer' ) . '</a>';
if ( false === self::$templates_added ) {
foreach ( $this->shortcodes as $tag ) {
$method = vc_camel_case( $tag . '_template' );
if ( method_exists( $this, $method ) ) {
$content = $this->$method();
} else {
$content = $this->vcDefaultTemplate( $tag );
}
$custom_tag = 'script';
$output .= '<' . $custom_tag . ' type="text/template" data-vc-grid-element-template="' . esc_attr( $tag ) . '">' . $content . '</' . $custom_tag . '>';
$output .= '<' . $custom_tag . ' type="text/template" data-vc-grid-element-template="modal">' . '<div class="vc_grid-element-modal-title"><# title #></div>' . '<div class="vc_grid-element-modal-controls"><# controls #></div>' . '<div class="vc_grid-element-modal-body"><# body #></div>' . '</' . $custom_tag . '>';
}
self::$templates_added = true;
}
return $output;
}
/**
* @param $grid_atts
*/
public function setGridAttributes( $grid_atts ) {
$this->grid_atts = $grid_atts;
}
/**
* @param $name
* @param string $default
* @return mixed|string
*/
public function gridAttribute( $name, $default = '' ) {
return isset( $this->grid_atts[ $name ] ) ? $this->grid_atts[ $name ] : $default;
}
/**
* @param $name
*/
public function setAttribute( $name ) {
$this->attributes[] = $name;
}
/**
* @return array
*/
public function attributes() {
return $this->attributes;
}
/**
* @param $name
* @param $post
* @return string
*/
public function attribute( $name, $post ) {
if ( method_exists( $this, 'attribute' . ucfirst( $name ) ) ) {
$method_name = 'attribute' . ucfirst( $name );
return $this->$method_name( $post );
}
if ( isset( $post->$name ) ) {
return $post->$name;
}
return '';
}
/**
* @param bool $is_end
*/
public function setIsEnd( $is_end = true ) {
$this->is_end = $is_end;
}
/**
* @return bool
*/
public function isEnd() {
return $this->is_end;
}
/**
* Set elements templates.
*/
protected function setShortcodes() {
foreach ( $this->shortcodes as $tag ) {
add_shortcode( $tag, array(
$this,
vc_camel_case( $tag . '_shortcode' ),
) );
}
}
/**
* @param $atts
* @param string $content
* @return string
*/
public function vcGitemRowShortcode( $atts, $content = '' ) {
return '<div class="vc_row vc_gitem-row' . $this->gridAttribute( 'element_width' ) . '">' . "\n" . do_shortcode( $content ) . "\n" . '</div>';
}
/**
* @return string
*/
public function vcGitemRowTemplate() {
$output = '<div class="vc_gitem-wrapper">';
$output .= '<div class="vc_t-grid-controls vc_t-grid-controls-row" data-vc-element-shortcode="controls">';
// Move control
$output .= '<a class="vc_t-grid-control vc_t-grid-control-move" href="#" title="' . esc_html__( 'Drag row to reorder', 'js_composer' ) . '" data-vc-element-control="move"><i class="vc_t-grid-icon vc_t-grid-icon-move"></i></a>';
// Layout control
$output .= '<span class="vc_t-grid-control vc_t-grid-control-layouts" style="display: none;">' // vc_col-sm-12
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="12" title="' . '1/1' . '" data-vc-element-control="layouts">' . '<i class="vc_t-grid-icon vc_t-grid-icon-layout-12"></i></a>' // vc_col-sm-6 + vc_col-sm-6
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="6_6" title="' . '1/2 + 1/2' . '" data-vc-element-control="layouts">' . '<i class="vc_t-grid-icon vc_t-grid-icon-layout-6-6"></i></a>' // vc_col-sm-4 + vc_col-sm-4 + vc_col-sm-4
. '<a class="vc_t-grid-control vc_t-grid-control-layout" data-cells="4_4_4" title="' . '1/3 + 1/3 + 1/3' . '" data-vc-element-control="layouts">' . '<i class="vc_t-grid-icon vc_t-grid-icon-layout-4-4-4"></i></a>' . '</span>' . '<span class="vc_pull-right">' // Destroy control
. '<a class="vc_t-grid-control vc_t-grid-control-destroy" href="#" title="' . esc_attr__( 'Delete this row', 'js_composer' ) . '" data-vc-element-control="destroy">' . '<i class="vc_t-grid-icon vc_t-grid-icon-destroy"></i>' . '</a>' . '</span>';
$output .= '</div>';
$output .= '<div data-vc-element-shortcode="content" class="vc_row vc_gitem-content"></div>';
$output .= '</div>';
return $output;
}
/**
* @param $atts
* @param string $content
* @return string
*/
public function vcGitemColShortcode( $atts, $content = '' ) {
$width = '12';
$atts = shortcode_atts( array(
'width' => '12',
), $atts );
extract( $atts );
return '<div class="vc_col-sm-' . $width . ' vc_gitem-col">' . "\n" . do_shortcode( $content ) . "\n" . '</div>';
}
/**
* @return string
*/
public function vcGitemColTemplate() {
$output = '<div class="vc_gitem-wrapper">';
// Controls
// Control "Add"
$controls = '<a class="vc_t-grid-control vc_t-grid-control-add" href="#" title="' . esc_attr__( 'Prepend to this column', 'js_composer' ) . '" data-vc-element-control="add">' . '<i class="vc_t-grid-icon vc_t-grid-icon-add"></i>' . '</a>';
$output .= '<div class="vc_t-grid-controls vc_t-grid-controls-col" data-vc-element-shortcode="controls">' . $controls . '</div>';
// Content
$output .= '<div data-vc-element-shortcode="content" class="vc_gitem-content">' . '</div>';
$output .= '</div>';
return $output;
}
/**
* @param $atts
* @param string $content
* @return string
*/
public function vcGitemPostTitleShortcode( $atts, $content = '' ) {
$atts = shortcode_atts( array(), $atts );
extract( $atts );
$this->setAttribute( 'post_title' );
return '<h3 data-vc-element-shortcode="content" class="vc_ptitle">{{post_title}}</h3>';
}
/**
* @param $tag
* @return string
*/
public function vcDefaultTemplate( $tag ) {
$name = preg_replace( '/^vc_gitem_/', '', $tag );
$title = ucfirst( preg_replace( '/\_/', ' ', $name ) );
return '<div class="vc_gitem-wrapper">' . $this->elementControls( $title, preg_match( '/^post/', $name ) ? 'orange' : 'green' ) . '</div>';
}
/**
* @param $title
* @param null $theme
* @return string
*/
protected function elementControls( $title, $theme = null ) {
return '<div class="vc_t-grid-controls vc_t-grid-controls-element' . ( is_string( $theme ) ? ' vc_th-controls-element-' . $theme : '' ) . '" data-vc-element-shortcode="controls">' // Move control
. '<a class="vc_t-grid-control vc_t-grid-control-move" href="#" title="' . esc_attr__( 'Drag to reorder', 'js_composer' ) . '" data-vc-element-control="move">' . '<i class="vc_t-grid-icon vc_t-grid-icon-move"></i>' . '</a>' // Label
. '<span class="vc_t-grid-control vc_t-grid-control-name" data-vc-element-control="name">
' . $title . '</span>' // Edit control
. '<a class="vc_t-grid-control vc_t-grid-control-edit" data-vc-element-control="edit">' . '<i class="vc_t-grid-icon vc_t-grid-icon-edit"></i>' . '</a>' // Delete control
. '<a class="vc_t-grid-control vc_t-grid-control-destroy" data-vc-element-control="destroy">' . '<i class="vc_t-grid-icon vc_t-grid-icon-destroy"></i>' . '</a>' . '</div>';
}
// }}
}
/**
* @param $settings
* @param $value
* @return string
*/
function vc_vc_grid_element_form_field( $settings, $value ) {
$grid_element = new Vc_Grid_Element();
return '<div data-vc-grid-element="container" data-vc-grid-tags-list="' . esc_attr( wp_json_encode( $grid_element->shortcodes() ) ) . '">' . '<input data-vc-grid-element="value" type="hidden" name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-textinput ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" ' . ' value="' . esc_attr( $value ) . '">' . $grid_element->renderParam() . '</div>';
}
function vc_load_vc_grid_element_param() {
vc_add_shortcode_param( 'vc_grid_element', 'vc_vc_grid_element_form_field' );
}
add_action( 'vc_load_default_params', 'vc_load_vc_grid_element_param' );
params/vc_grid_element/vc_grid_id/vc_grid_id.php 0000644 00000000714 15121635560 0016056 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.4.3
*/
function vc_vc_grid_id_form_field( $settings, $value ) {
return sprintf( '<div class="vc_param-vc-grid-id"><input name="%s" class="wpb_vc_param_value wpb-textinput %s_field" type="hidden" value="%s" /></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), $value );
}
params/loop/loop.php 0000644 00000053611 15121635560 0010474 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_loop_form_field( $settings, $value ) {
$query_builder = new VcLoopSettings( $value );
$params = $query_builder->getContent();
$loop_info = '';
$parsed_value = array();
if ( is_array( $params ) ) {
foreach ( $params as $key => $param ) {
$param_value_render = vc_loop_get_value( $param );
if ( ! empty( $param_value_render ) ) {
$parsed_value[] = $key . ':' . ( is_array( $param['value'] ) ? implode( ',', $param['value'] ) : $param['value'] );
$loop_info .= ' <b>' . $query_builder->getLabel( $key ) . '</b>: ' . $param_value_render . ';';
}
}
}
if ( ! isset( $settings['settings'] ) ) {
$settings['settings'] = array();
}
return '<div class="vc_loop">' . '<input name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value ' . esc_attr( $settings['param_name'] . ' ' . $settings['type'] ) . '_field" type="hidden" value="' . esc_attr( join( '|', $parsed_value ) ) . '"/>' . '<a href="javascript:;" class="button vc_loop-build ' . esc_attr( $settings['param_name'] ) . '_button" data-settings="' . rawurlencode( wp_json_encode( $settings['settings'] ) ) . '">' . esc_html__( 'Build query', 'js_composer' ) . '</a>' . '<div class="vc_loop-info">' . $loop_info . '</div>' . '</div>';
}
/**
* @param $param
*
* @return string
* @since 4.2
*/
function vc_loop_get_value( $param ) {
$value = array();
$selected_values = (array) $param['value'];
if ( isset( $param['options'] ) && is_array( $param['options'] ) ) {
foreach ( $param['options'] as $option ) {
if ( is_array( $option ) && isset( $option['value'] ) ) {
if ( in_array( ( ( '-' === $option['action'] ? '-' : '' ) . $option['value'] ), $selected_values, true ) ) {
$value[] = $option['action'] . $option['name'];
}
} elseif ( is_array( $option ) && isset( $option[0] ) ) {
if ( in_array( $option[0], $selected_values, true ) ) {
$value[] = $option[1];
}
} elseif ( in_array( $option, $selected_values, true ) ) {
$value[] = $option;
}
}
} else {
$value[] = $param['value'];
}
return implode( ', ', $value );
}
/**
* Parses loop settings and creates WP_Query according to manual
* @since 4.2
* @link http://codex.wordpress.org/Class_Reference/WP_Query
*/
class VcLoopQueryBuilder {
/**
* @since 4.2
* @var array
*/
protected $args = array(
'post_status' => 'publish',
// show only published posts #1098
);
/**
* @param $data
* @since 4.2
*
*/
public function __construct( $data ) {
foreach ( $data as $key => $value ) {
$method = 'parse_' . $key;
if ( method_exists( $this, $method ) ) {
$this->$method( $value );
}
}
}
/**
* Pages count
* @param $value
* @since 4.2
*
*/
protected function parse_size( $value ) {
$this->args['posts_per_page'] = 'All' === $value ? - 1 : (int) $value;
}
/**
* Sorting field
* @param $value
* @since 4.2
*
*/
protected function parse_order_by( $value ) {
$this->args['orderby'] = $value;
}
/**
* Sorting order
* @param $value
* @since 4.2
*
*/
protected function parse_order( $value ) {
$this->args['order'] = $value;
}
/**
* By post types
* @param $value
* @since 4.2
*
*/
protected function parse_post_type( $value ) {
$this->args['post_type'] = $this->stringToArray( $value );
}
/**
* By author
* @param $value
* @since 4.2
*
*/
protected function parse_authors( $value ) {
$this->args['author'] = $value;
}
/**
* By categories
* @param $value
* @since 4.2
*
*/
protected function parse_categories( $value ) {
$values = explode( ',', $value );
$cat_in = array();
$cat_not_in = array();
foreach ( $values as $cat ) {
if ( (int) $cat > 0 ) {
$cat_in[] = $cat;
} else {
$cat_not_in[] = abs( $cat );
}
}
if ( ! empty( $cat_in ) ) {
$this->args['category__in'] = $cat_in;
}
if ( ! empty( $cat_not_in ) ) {
$this->args['category__not_in'] = $cat_not_in;
}
}
/**
* By taxonomies
* @param $value
* @since 4.2
*
*/
protected function parse_tax_query( $value ) {
$terms = $this->stringToArray( $value );
if ( empty( $this->args['tax_query'] ) ) {
$this->args['tax_query'] = array( 'relation' => 'AND' );
}
$negative_term_list = array();
foreach ( $terms as $term ) {
if ( (int) $term < 0 ) {
$negative_term_list[] = abs( $term );
}
}
$not_in = array();
$in = array();
$terms = get_terms( VcLoopSettings::getTaxonomies(), array( 'include' => array_map( 'abs', $terms ) ) );
foreach ( $terms as $t ) {
if ( in_array( (int) $t->term_id, $negative_term_list, true ) ) {
$not_in[ $t->taxonomy ][] = $t->term_id;
} else {
$in[ $t->taxonomy ][] = $t->term_id;
}
}
foreach ( $in as $taxonomy => $terms ) {
$this->args['tax_query'][] = array(
'field' => 'term_id',
'taxonomy' => $taxonomy,
'terms' => $terms,
'operator' => 'IN',
);
}
foreach ( $not_in as $taxonomy => $terms ) {
$this->args['tax_query'][] = array(
'field' => 'term_id',
'taxonomy' => $taxonomy,
'terms' => $terms,
'operator' => 'NOT IN',
);
}
}
/**
* By tags ids
* @param $value
* @since 4.2
*
*/
protected function parse_tags( $value ) {
$in = $not_in = array();
$tags_ids = $this->stringToArray( $value );
foreach ( $tags_ids as $tag ) {
$tag = (int) $tag;
if ( $tag < 0 ) {
$not_in[] = abs( $tag );
} else {
$in[] = $tag;
}
}
$this->args['tag__in'] = $in;
$this->args['tag__not_in'] = $not_in;
}
protected function parse_ignore_sticky_posts( $value ) {
if ( ! empty( $value ) ) {
$this->args['ignore_sticky_posts'] = true;
}
}
/**
* By posts ids
* @param $value
* @since 4.2
*
*/
protected function parse_by_id( $value ) {
$in = $not_in = array();
$ids = $this->stringToArray( $value );
foreach ( $ids as $id ) {
$id = (int) $id;
if ( $id < 0 ) {
$not_in[] = abs( $id );
} else {
$in[] = $id;
}
}
$this->args['post__in'] = $in;
$this->args['post__not_in'] = $not_in;
}
/**
* @param $id
* @since 4.2
*
*/
public function excludeId( $id ) {
if ( ! isset( $this->args['post__not_in'] ) ) {
$this->args['post__not_in'] = array();
}
if ( is_array( $id ) ) {
$this->args['post__not_in'] = array_merge( $this->args['post__not_in'], $id );
} else {
$this->args['post__not_in'][] = $id;
}
}
/**
* Converts string to array. Filters empty arrays values
* @param $value
*
* @return array
* @since 4.2
*
*/
protected function stringToArray( $value ) {
$valid_values = array();
$list = preg_split( '/\,[\s]*/', $value );
foreach ( $list as $v ) {
if ( strlen( $v ) > 0 ) {
$valid_values[] = $v;
}
}
return $valid_values;
}
/**
* @return array
*/
public function build() {
$args = apply_filters( 'wpb_loop_query_build_args', $this->args );
return array(
$args,
new WP_Query( $args ),
);
}
}
/**
* Class VcLoopSettings
* @since 4.2
*/
class VcLoopSettings {
// Available parts of loop for WP_Query object.
/**
* @since 4.2
* @var array
*/
protected $content = array();
/**
* @since 4.2
* @var array
*/
protected $parts;
/**
* @since 4.2
* @var array
*/
protected $query_parts = array(
'size',
'order_by',
'order',
'post_type',
'ignore_sticky_posts',
'authors',
'categories',
'tags',
'tax_query',
'by_id',
);
public $settings = array();
/**
* @param $value
* @param array $settings
* @since 4.2
*
*/
public function __construct( $value, $settings = array() ) {
$this->parts = array(
'size' => esc_html__( 'Post count', 'js_composer' ),
'order_by' => esc_html__( 'Order by', 'js_composer' ),
'order' => esc_html__( 'Sort order', 'js_composer' ),
'post_type' => esc_html__( 'Post types', 'js_composer' ),
'ignore_sticky_posts' => esc_html__( 'Ignore Sticky posts', 'js_composer' ),
'authors' => esc_html__( 'Author', 'js_composer' ),
'categories' => esc_html__( 'Categories', 'js_composer' ),
'tags' => esc_html__( 'Tags', 'js_composer' ),
'tax_query' => esc_html__( 'Taxonomies', 'js_composer' ),
'by_id' => esc_html__( 'Individual posts/pages', 'js_composer' ),
);
$this->settings = $settings;
// Parse loop string
$data = $this->parseData( $value );
foreach ( $this->query_parts as $part ) {
$value = isset( $data[ $part ] ) ? $data[ $part ] : '';
$locked = 'true' === $this->getSettings( $part, 'locked' );
// Predefined value check.
if ( ! is_null( $this->getSettings( $part, 'value' ) ) && $this->replaceLockedValue( $part ) && ( true === $locked || 0 === strlen( (string) $value ) ) ) {
$value = $this->settings[ $part ]['value'];
} elseif ( ! is_null( $this->getSettings( $part, 'value' ) ) && ! $this->replaceLockedValue( $part ) && ( true === $locked || 0 === strlen( (string) $value ) ) ) {
$value = implode( ',', array_unique( explode( ',', $value . ',' . $this->settings[ $part ]['value'] ) ) );
}
// Find custom method for parsing
if ( method_exists( $this, 'parse_' . $part ) ) {
$method = 'parse_' . $part;
$this->content[ $part ] = $this->$method( $value );
} else {
$this->content[ $part ] = $this->parseString( $value );
}
// Set locked if value is locked by settings
if ( $locked ) {
$this->content[ $part ]['locked'] = true;
}
if ( 'true' === $this->getSettings( $part, 'hidden' ) ) {
$this->content[ $part ]['hidden'] = true;
}
}
}
/**
* @param $part
*
* @return bool
* @since 4.2
*/
protected function replaceLockedValue( $part ) {
return in_array( $part, array(
'size',
'order_by',
'order',
), true );
}
/**
* @param $key
*
* @return mixed
* @since 4.2
*/
public function getLabel( $key ) {
return isset( $this->parts[ $key ] ) ? $this->parts[ $key ] : $key;
}
/**
* @param $part
* @param $name
*
* @return null
* @since 4.2
*/
public function getSettings( $part, $name ) {
$settings_exists = isset( $this->settings[ $part ] ) && is_array( $this->settings[ $part ] );
return $settings_exists && isset( $this->settings[ $part ][ $name ] ) ? $this->settings[ $part ][ $name ] : null;
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parseString( $value ) {
return array( 'value' => $value );
}
/**
* @param $value
* @param array $options
*
* @return array
* @since 4.2
*/
protected function parseDropDown( $value, $options = array() ) {
return array(
'value' => $value,
'options' => $options,
);
}
/**
* @param $value
* @param array $options
*
* @return array
* @since 4.2
*/
protected function parseMultiSelect( $value, $options = array() ) {
return array(
'value' => explode( ',', trim( $value, ',' ) ),
'options' => $options,
);
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_order_by( $value ) {
return $this->parseDropDown( $value, array(
array(
'date',
esc_html__( 'Date', 'js_composer' ),
),
'ID',
array(
'author',
esc_html__( 'Author', 'js_composer' ),
),
array(
'title',
esc_html__( 'Title', 'js_composer' ),
),
array(
'modified',
esc_html__( 'Modified', 'js_composer' ),
),
array(
'rand',
esc_html__( 'Random', 'js_composer' ),
),
array(
'comment_count',
esc_html__( 'Comment count', 'js_composer' ),
),
array(
'menu_order',
esc_html__( 'Menu order', 'js_composer' ),
),
) );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_order( $value ) {
return $this->parseDropDown( $value, array(
array(
'ASC',
esc_html__( 'Ascending', 'js_composer' ),
),
array(
'DESC',
esc_html__( 'Descending', 'js_composer' ),
),
) );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_post_type( $value ) {
$options = array();
$args = array(
'public' => true,
);
$post_types = get_post_types( $args );
foreach ( $post_types as $post_type ) {
if ( 'attachment' !== $post_type ) {
$options[] = $post_type;
}
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @return array
*/
public function parse_ignore_sticky_posts( $value ) {
return array(
'value' => [ $value ],
'options' => [
[
'1',
'Yes',
],
],
);
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_authors( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$users = get_users( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $users as $user ) {
$options[] = array(
'value' => (string) $user->ID,
'name' => $user->data->user_nicename,
'action' => in_array( (int) $user->ID, $not_in, true ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_categories( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_categories( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->cat_ID,
'name' => $obj->cat_name,
'action' => in_array( (int) $obj->cat_ID, $not_in, true ) ? '-' : '+',
);
}
if ( empty( $list ) ) {
$value = '';
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_tags( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_tags( array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->term_id,
'name' => $obj->name,
'action' => in_array( (int) $obj->term_id, $not_in, true ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_tax_query( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_terms( self::getTaxonomies(), array( 'include' => array_map( 'abs', $list ) ) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->term_id,
'name' => $obj->name,
'action' => in_array( (int) $obj->term_id, $not_in, true ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public function parse_by_id( $value ) {
$options = $not_in = array();
if ( empty( $value ) ) {
return $this->parseMultiSelect( $value, $options );
}
$list = explode( ',', $value );
foreach ( $list as $id ) {
if ( (int) $id < 0 ) {
$not_in[] = abs( $id );
}
}
$list = get_posts( array(
'post_type' => 'any',
'include' => array_map( 'abs', $list ),
) );
foreach ( $list as $obj ) {
$options[] = array(
'value' => (string) $obj->ID,
'name' => $obj->post_title,
'action' => in_array( (int) $obj->ID, $not_in, true ) ? '-' : '+',
);
}
return $this->parseMultiSelect( $value, $options );
}
/**
* @since 4.2
*/
public function render() {
echo wp_json_encode( $this->content );
}
/**
* @return array
* @since 4.2
*/
public function getContent() {
return $this->content;
}
/**
* get list of taxonomies which has no tags and categories items.
* @return array
* @since 4.2
* @static
*/
public static function getTaxonomies() {
$taxonomy_exclude = (array) apply_filters( 'get_categories_taxonomy', 'category' );
$taxonomy_exclude[] = 'post_tag';
$taxonomies = array();
foreach ( get_taxonomies() as $taxonomy ) {
if ( ! in_array( $taxonomy, $taxonomy_exclude, true ) ) {
$taxonomies[] = $taxonomy;
}
}
return $taxonomies;
}
/**
* @param $settings
*
* @return string
* @since 4.2
*/
public static function buildDefault( $settings ) {
if ( ! isset( $settings['settings'] ) || ! is_array( $settings['settings'] ) ) {
return '';
}
$value = '';
foreach ( $settings['settings'] as $key => $val ) {
if ( isset( $val['value'] ) ) {
$value .= ( empty( $value ) ? '' : '|' ) . $key . ':' . $val['value'];
}
}
return $value;
}
/**
* @param $query
* @param bool $exclude_id
*
* @return array
* @since 4.2
*/
public static function buildWpQuery( $query, $exclude_id = false ) {
$data = self::parseData( $query );
$query_builder = new VcLoopQueryBuilder( $data );
if ( $exclude_id ) {
$query_builder->excludeId( $exclude_id );
}
return $query_builder->build();
}
/**
* @param $value
*
* @return array
* @since 4.2
*/
public static function parseData( $value ) {
$data = array();
$values_pairs = preg_split( '/\|/', $value );
foreach ( $values_pairs as $pair ) {
if ( ! empty( $pair ) ) {
list( $key, $value ) = preg_split( '/\:/', $pair );
$data[ $key ] = $value;
}
}
return $data;
}
}
/**
* Suggestion list for wp_query field
* Class VcLoopSuggestions
* @since 4.2
*/
class VcLoopSuggestions {
/**
* @since 4.2
* @var array
*/
protected $content = array();
/**
* @since 4.2
* @var array
*/
protected $exclude = array();
/**
* @since 4.2
* @var
*/
protected $field;
/**
* @param $field
* @param $query
* @param $exclude
*
* @since 4.2
*/
public function __construct( $field, $query, $exclude ) {
$this->exclude = explode( ',', $exclude );
$method_name = 'get_' . preg_replace( '/_out$/', '', $field );
if ( method_exists( $this, $method_name ) ) {
$this->$method_name( $query );
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_authors( $query ) {
$args = ! empty( $query ) ? array(
'search' => '*' . $query . '*',
'search_columns' => array( 'user_nicename' ),
) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$users = get_users( $args );
foreach ( $users as $user ) {
$this->content[] = array(
'value' => (string) $user->ID,
'name' => (string) $user->data->user_nicename,
);
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_categories( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$categories = get_categories( $args );
foreach ( $categories as $cat ) {
$this->content[] = array(
'value' => (string) $cat->cat_ID,
'name' => $cat->cat_name,
);
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_tags( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$tags = get_tags( $args );
foreach ( $tags as $tag ) {
$this->content[] = array(
'value' => (string) $tag->term_id,
'name' => $tag->name,
);
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_tax_query( $query ) {
$args = ! empty( $query ) ? array( 'search' => $query ) : array();
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$tags = get_terms( VcLoopSettings::getTaxonomies(), $args );
foreach ( $tags as $tag ) {
$this->content[] = array(
'value' => $tag->term_id,
'name' => $tag->name . ' (' . $tag->taxonomy . ')',
);
}
}
/**
* @param $query
*
* @since 4.2
*/
public function get_by_id( $query ) {
$args = ! empty( $query ) ? array(
's' => $query,
'post_type' => 'any',
'no_found_rows' => true,
'orderby' => 'relevance',
) : array(
'post_type' => 'any',
'no_found_rows' => true,
'orderby' => 'relevance',
);
if ( ! empty( $this->exclude ) ) {
$args['exclude'] = $this->exclude;
}
$args['ignore_sticky_posts'] = true;
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$this->content[] = array(
'value' => $post->ID,
'name' => $post->post_title,
);
}
}
/**
* @since 4.2
*/
public function render() {
echo wp_json_encode( $this->content );
}
}
/**
* Build WP_Query object from query string.
* String created by loop controllers
*
* @param $query
* @param bool $exclude_id
*
* @return array
* @since 4.2
*/
function vc_build_loop_query( $query, $exclude_id = false ) {
return VcLoopSettings::buildWpQuery( $query, $exclude_id );
}
/**
* @since 4.2
*/
function vc_get_loop_suggestion() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$loop_suggestions = new VcLoopSuggestions( vc_post_param( 'field' ), vc_post_param( 'query' ), vc_post_param( 'exclude' ) );
$loop_suggestions->render();
die();
}
/**
* @since 4.2
*/
function vc_get_loop_settings_json() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$loop_settings = new VcLoopSettings( vc_post_param( 'value' ), vc_post_param( 'settings' ) );
$loop_settings->render();
die();
}
add_action( 'wp_ajax_wpb_get_loop_suggestion', 'vc_get_loop_suggestion' );
add_action( 'wp_ajax_wpb_get_loop_settings', 'vc_get_loop_settings_json' );
/**
* @since 4.2
*/
function vc_loop_include_templates() {
require_once vc_path_dir( 'TEMPLATES_DIR', 'params/loop/templates.html' );
}
add_action( 'admin_footer', 'vc_loop_include_templates' );
params/autocomplete/autocomplete.php 0000644 00000012034 15121635560 0013746 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_AutoComplete
* Param type 'autocomplete'
* Used to create input field with predefined or ajax values suggestions.
* See usage example in bottom of this file.
* @since 4.4
*/
class Vc_AutoComplete {
/**
* @since 4.4
* @var array $settings - param settings
*/
protected $settings;
/**
* @since 4.4
* @var string $value - current param value (if multiple it is splitted by ',' comma to make array)
*/
protected $value;
/**
* @since 4.4
* @var string $tag - shortcode name(base)
*/
protected $tag;
/**
* @param array $settings - param settings (from vc_map)
* @param string $value - current param value
* @param string $tag - shortcode name(base)
*
* @since 4.4
*/
public function __construct( $settings, $value, $tag ) {
$this->tag = $tag;
$this->settings = $settings;
$this->value = $value;
}
/**
* @return string
* @since 4.4
* vc_filter: vc_autocomplete_{shortcode_tag}_{param_name}_render - hook to define output for autocomplete item
*/
public function render() {
$output = sprintf( '<div class="vc_autocomplete-field"><ul class="vc_autocomplete%s">', ( isset( $this->settings['settings'], $this->settings['settings']['display_inline'] ) && true === $this->settings['settings']['display_inline'] ) ? ' vc_autocomplete-inline' : '' );
if ( isset( $this->value ) && strlen( $this->value ) > 0 ) {
$values = explode( ',', $this->value );
foreach ( $values as $key => $val ) {
$value = array(
'value' => trim( $val ),
'label' => trim( $val ),
);
if ( isset( $this->settings['settings'], $this->settings['settings']['values'] ) && ! empty( $this->settings['settings']['values'] ) ) {
foreach ( $this->settings['settings']['values'] as $data ) {
if ( trim( $data['value'] ) === trim( $val ) ) {
$value['label'] = $data['label'];
break;
}
}
} else {
// Magic is here. this filter is used to render value correctly ( must return array with 'value', 'label' keys )
$value = apply_filters( 'vc_autocomplete_' . $this->tag . '_' . $this->settings['param_name'] . '_render', $value, $this->settings, $this->tag );
}
if ( is_array( $value ) && isset( $value['value'], $value['label'] ) ) {
$output .= '<li data-value="' . $value['value'] . '" data-label="' . $value['label'] . '" data-index="' . $key . '" class="vc_autocomplete-label vc_data"><span class="vc_autocomplete-label">' . $value['label'] . '</span> <a class="vc_autocomplete-remove">×</a></li>';
}
}
}
$output .= sprintf( '<li class="vc_autocomplete-input"><span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input class="vc_auto_complete_param" type="text" placeholder="%s" value="%s" autocomplete="off"></li><li class="vc_autocomplete-clear"></li></ul>', esc_attr__( 'Click here and start typing...', 'js_composer' ), $this->value );
$output .= sprintf( '<input name="%s" class="wpb_vc_param_value %s %s_field" type="hidden" value="%s" %s /></div>', $this->settings['param_name'], $this->settings['param_name'], $this->settings['type'], $this->value, ( isset( $this->settings['settings'] ) && ! empty( $this->settings['settings'] ) ) ? ' data-settings="' . htmlentities( wp_json_encode( $this->settings['settings'] ), ENT_QUOTES, 'utf-8' ) . '" ' : '' );
return $output;
}
}
/**
* @action wp_ajax_vc_get_autocomplete_suggestion - since 4.4 used to hook ajax requests for autocomplete suggestions
*/
add_action( 'wp_ajax_vc_get_autocomplete_suggestion', 'vc_get_autocomplete_suggestion' );
/**
* @since 4.4
*/
function vc_get_autocomplete_suggestion() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$query = vc_post_param( 'query' );
$tag = wp_strip_all_tags( vc_post_param( 'shortcode' ) );
$param_name = vc_post_param( 'param' );
vc_render_suggestion( $query, $tag, $param_name );
}
/**
* @param $query
* @param $tag
* @param $param_name
*
* vc_filter: vc_autocomplete_{tag}_{param_name}_callback - hook to get suggestions from ajax. (here you need to hook).
* @since 4.4
*
*/
function vc_render_suggestion( $query, $tag, $param_name ) {
$suggestions = apply_filters( 'vc_autocomplete_' . stripslashes( $tag ) . '_' . stripslashes( $param_name ) . '_callback', $query, $tag, $param_name );
if ( is_array( $suggestions ) && ! empty( $suggestions ) ) {
die( wp_json_encode( $suggestions ) );
}
die( wp_json_encode( array() ) ); // if nothing found..
}
/**
* Function for rendering param in edit form (add element)
* Parse settings from vc_map and entered values.
*
* @param $settings
* @param $value
* @param $tag
*
* @return mixed rendered template for params in edit form
* @since 4.4
* vc_filter: vc_autocomplete_render_filter - hook to override output of edit for field "autocomplete"
*/
function vc_autocomplete_form_field( $settings, $value, $tag ) {
$auto_complete = new Vc_AutoComplete( $settings, $value, $tag );
return apply_filters( 'vc_autocomplete_render_filter', $auto_complete->render() );
}
params/tab_id/tab_id.php 0000644 00000000757 15121635560 0011221 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_tab_id_form_field( $settings, $value ) {
$output = sprintf( '<div class="my_param_block"><input name="%s" class="wpb_vc_param_value wpb-textinput %s_field" type="hidden" value="%s" /><label>%s</label></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), $value, $value );
return $output;
}
params/options/options.php 0000644 00000001733 15121635560 0011736 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.2
*/
function vc_options_form_field( $settings, $value ) {
return sprintf( '<div class="vc_options"><input name="%s" class="wpb_vc_param_value %s_field" type="hidden" value="%s"/><a href="#" class="button vc_options-edit %s_button">%s</a></div><div class="vc_options-fields" data-settings="%s"><a href="#" class="button vc_close-button">%s</a></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), $value, esc_attr( $settings['param_name'] ), esc_html__( 'Manage options', 'js_composer' ), htmlspecialchars( wp_json_encode( $settings['options'] ) ), esc_html__( 'Close', 'js_composer' ) );
}
/**
* @since 4.2
*/
function vc_options_include_templates() {
require_once vc_path_dir( 'TEMPLATES_DIR', 'params/options/templates.html' );
}
add_action( 'admin_footer', 'vc_options_include_templates' );
params/params.php 0000644 00000005614 15121635560 0010035 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes attributes class.
*
* This class and functions represents ability which will allow you to create attributes settings fields to
* control new attributes.
* New attributes can be added to shortcode settings by using param array in wp_map function
*
* @package WPBakeryPageBuilder
*
*/
/**
* Shortcode params class allows to create new params types.
* class WpbakeryShortcodeParams
* @since 4.2
*/
class WpbakeryShortcodeParams {
/**
* @since 4.2
* @var array - store shortcode attributes types
*/
protected static $params = array();
/**
* @since 4.2
* @var array - store shortcode javascript files urls
*/
protected static $scripts = array();
/**
* @since 4.7
* @var array - store params not required to init
*/
protected static $optional_init_params = array();
/**
* Get list of params that need to be initialized
*
* @return string[]
*/
public static function getRequiredInitParams() {
$all_params = array_keys( self::$params );
$optional_params = apply_filters( 'vc_edit_form_fields_optional_params', self::$optional_init_params );
$required_params = array_diff( $all_params, $optional_params );
return $required_params;
}
/**
* Create new attribute type
*
* @static
* @param $name - attribute name
* @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
* param list
* @param $script_url - javascript file url which will be attached at the end of settings form.
*
* @return bool - return true if attribute type created
* @since 4.2
*
*/
public static function addField( $name, $form_field_callback, $script_url = null ) {
$result = false;
if ( ! empty( $name ) && ! empty( $form_field_callback ) ) {
self::$params[ $name ] = array(
'callbacks' => array(
'form' => $form_field_callback,
),
);
$result = true;
if ( is_string( $script_url ) && ! in_array( $script_url, self::$scripts, true ) ) {
self::$scripts[] = $script_url;
}
}
return $result;
}
/**
* Calls hook for attribute type
* @param $name - attribute name
* @param $param_settings - attribute settings from shortcode
* @param $param_value - attribute value
* @param $tag - attribute tag
*
* @return mixed|string - returns html which will be render in hook
* @since 4.2
* @static
*
*/
public static function renderSettingsField( $name, $param_settings, $param_value, $tag ) {
if ( isset( self::$params[ $name ]['callbacks']['form'] ) ) {
return call_user_func( self::$params[ $name ]['callbacks']['form'], $param_settings, $param_value, $tag );
}
return '';
}
/**
* List of javascript files urls for shortcode attributes.
* @return array - list of js scripts
* @since 4.2
* @static
*/
public static function getScripts() {
return self::$scripts;
}
}
params/gutenberg/class-vc-gutenberg-param.php 0000644 00000012470 15121635560 0015323 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
/**
* Class Vc_Gutenberg_Param
*/
class Vc_Gutenberg_Param {
protected $postTypeSlug = 'wpb_gutenberg_param';
public function __construct() {
add_action( 'init', array(
$this,
'initialize',
) );
}
public function initialize() {
global $pagenow, $wp_version;
if ( version_compare( $wp_version, '4.9.8', '>' ) && 'post-new.php' === $pagenow && vc_user_access()->wpAll( 'edit_posts' )
->get() && vc_request_param( 'post_type' ) === $this->postTypeSlug ) {
$this->registerGutenbergAttributeType();
/** @see \Vc_Gutenberg_Param::removeAdminUi */
add_action( 'admin_enqueue_scripts', array(
$this,
'removeAdminUI',
) );
}
}
public function removeAdminUi() {
$style = '
#adminmenumain, #wpadminbar {
display: none;
}
html.wp-toolbar {
padding: 0 !important;
}
.wp-toolbar #wpcontent {
margin: 0;
}
.wp-toolbar #wpbody {
padding-top: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout .edit-post-header, html .block-editor-page .edit-post-header {
top: 0;
left: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout.is-sidebar-opened .edit-post-layout__content, html .block-editor-page .edit-post-layout.is-sidebar-opened .edit-post-layout__content {
margin-right: 0;
}
.gutenberg .gutenberg__editor .edit-post-layout .editor-post-publish-panel, html .block-editor-page .edit-post-layout .editor-post-publish-panel, html .block-editor-page .edit-post-header__settings {
display: none;
}
.editor-post-title {
display: none !important;
}
';
wp_add_inline_style( 'wp-edit-blocks', $style );
}
protected function registerGutenbergAttributeType() {
$labels = array(
'name' => _x( 'Gutenberg attrs', 'Post type general name', 'js_composer' ),
'singular_name' => _x( 'Gutenberg attr', 'Post type singular name', 'js_composer' ),
'menu_name' => _x( 'Gutenberg attrs', 'Admin Menu text', 'js_composer' ),
'name_admin_bar' => _x( 'Gutenberg attr', 'Add New on Toolbar', 'js_composer' ),
'add_new' => esc_html__( 'Add New', 'js_composer' ),
'add_new_item' => esc_html__( 'Add New Gutenberg attr', 'js_composer' ),
'new_item' => esc_html__( 'New Gutenberg attr', 'js_composer' ),
'edit_item' => esc_html__( 'Edit Gutenberg attr', 'js_composer' ),
'view_item' => esc_html__( 'View Gutenberg attr', 'js_composer' ),
'all_items' => esc_html__( 'All Gutenberg attrs', 'js_composer' ),
'search_items' => esc_html__( 'Search Gutenberg attrs', 'js_composer' ),
'parent_item_colon' => esc_html__( 'Parent Gutenberg attrs:', 'js_composer' ),
'not_found' => esc_html__( 'No Gutenberg attrs found.', 'js_composer' ),
'not_found_in_trash' => esc_html__( 'No Gutenberg attrs found in Trash.', 'js_composer' ),
'featured_image' => _x( 'Gutenberg attr Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'js_composer' ),
'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'js_composer' ),
'archives' => _x( 'Gutenberg attr archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'js_composer' ),
'insert_into_item' => _x( 'Add into Gutenberg attr', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'js_composer' ),
'uploaded_to_this_item' => _x( 'Uploaded to this Gutenberg attr', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'js_composer' ),
'filter_items_list' => _x( 'Filter Gutenberg attrs list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'js_composer' ),
'items_list_navigation' => _x( 'Gutenberg attrs list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'js_composer' ),
'items_list' => _x( 'Gutenberg attrs list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'js_composer' ),
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => false,
'query_var' => false,
'capability_type' => 'page',
'has_archive' => false,
'hierarchical' => false,
'menu_position' => null,
'show_in_rest' => true,
'supports' => array( 'editor' ),
);
register_post_type( $this->postTypeSlug, $args );
}
}
params/gutenberg/gutenberg.php 0000644 00000001217 15121635560 0012511 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Gutenberg field param.
*
* @param $settings
* @param $value
*
* @return string - html string.
*/
function vc_gutenberg_form_field( $settings, $value ) {
$value = htmlspecialchars( $value );
return '<div class="vc_gutenberg-field-wrapper"><button class="vc_btn vc_btn-grey vc_btn-sm" data-vc-action="open">Open Editor</button><div class="vc_gutenberg-modal-wrapper"></div><input name="' . $settings['param_name'] . '" class="wpb_vc_param_value vc_gutenberg-field vc_param-name-' . $settings['param_name'] . ' ' . $settings['type'] . '" type="hidden" value="' . $value . '"/></div>';
}
autoload/vc-image-filters.php 0000644 00000022122 15121635560 0012226 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_filter( 'attachment_fields_to_edit', 'vc_attachment_filter_field', 10, 2 );
add_filter( 'media_meta', 'vc_attachment_filter_media_meta', 10, 2 );
add_action( 'wp_ajax_vc_media_editor_add_image', 'vc_media_editor_add_image' );
add_action( 'wp_ajax_vc_media_editor_preview_image', 'vc_media_editor_preview_image' );
/**
* @return array
*/
function vc_get_filters() {
return array(
'antique' => esc_html__( 'Antique', 'js_composer' ),
'blackwhite' => esc_html__( 'Black & White', 'js_composer' ),
'boost' => esc_html__( 'Boost', 'js_composer' ),
'concentrate' => esc_html__( 'Concentrate', 'js_composer' ),
'country' => esc_html__( 'Country', 'js_composer' ),
'darken' => esc_html__( 'Darken', 'js_composer' ),
'dream' => esc_html__( 'Dream', 'js_composer' ),
'everglow' => esc_html__( 'Everglow', 'js_composer' ),
'forest' => esc_html__( 'Forest', 'js_composer' ),
'freshblue' => esc_html__( 'Fresh Blue', 'js_composer' ),
'frozen' => esc_html__( 'Frozen', 'js_composer' ),
'hermajesty' => esc_html__( 'Her Majesty', 'js_composer' ),
'light' => esc_html__( 'Light', 'js_composer' ),
'orangepeel' => esc_html__( 'Orange Peel', 'js_composer' ),
'rain' => esc_html__( 'Rain', 'js_composer' ),
'retro' => esc_html__( 'Retro', 'js_composer' ),
'sepia' => esc_html__( 'Sepia', 'js_composer' ),
'summer' => esc_html__( 'Summer', 'js_composer' ),
'tender' => esc_html__( 'Tender', 'js_composer' ),
'vintage' => esc_html__( 'Vintage', 'js_composer' ),
'washed' => esc_html__( 'Washed', 'js_composer' ),
);
}
/**
* Add Image Filter field to media uploader
*
* @param array $form_fields , fields to include in attachment form
* @param object $post , attachment record in database
*
* @return array $form_fields, modified form fields
*/
function vc_attachment_filter_field( $form_fields, $post ) {
// don't add filter field, if image already has filter applied
if ( get_post_meta( $post->ID, 'vc-applied-image-filter', true ) ) {
return $form_fields;
}
$options = vc_get_filters();
$html_options = '<option value="">' . esc_html__( 'None', 'js_composer' ) . '</option>';
foreach ( $options as $value => $title ) {
$html_options .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $title ) . '</option>';
}
$form_fields['vc-image-filter'] = array(
'label' => '',
'input' => 'html',
'html' => '
<div style="display:none">
<span class="vc-filter-label">' . esc_html__( 'Image filter', 'js_composer' ) . '</span>
<select name="attachments[' . esc_attr( $post->ID ) . '][vc-image-filter]" id="attachments-' . esc_attr( $post->ID ) . '-vc-image-filter" data-vc-preview-image-filter="' . esc_attr( $post->ID ) . '">
' . $html_options . '
</select>
</div>',
'value' => get_post_meta( $post->ID, 'vc_image_filter', true ),
'helps' => '',
);
return $form_fields;
}
/**
* Apply filters to specified images
*
* If image(s) has filter specified via filters _POST param:
* 1) copy it
* 2) apply specified filter
* 3) return new image id
*
* Required _POST params:
* - array ids: array of attachment ids
*
* Optional _POST params:
* - array filters: mapped array of ids and filters to apply
*
*/
function vc_media_editor_add_image() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'upload_files' )->validateDie();
require_once vc_path_dir( 'HELPERS_DIR', 'class-vc-image-filter.php' );
$response = array(
'success' => true,
'data' => array(
'ids' => array(),
),
);
$filters = (array) vc_post_param( 'filters', array() );
$ids = (array) vc_post_param( 'ids', array() );
if ( ! $ids ) {
wp_send_json( $response );
}
// default action is wp_handle_upload, which forces wp to check upload with is_uploaded_file()
// override action to anything else to skip security checks
$action = 'vc_handle_upload_imitation';
$file_key = 0;
$post_id = 0;
$post_data = array();
$overrides = array( 'action' => $action );
$_POST = array( 'action' => $action );
foreach ( $ids as $key => $attachment_id ) {
if ( ! empty( $filters[ $attachment_id ] ) ) {
$filter_name = $filters[ $attachment_id ];
} else {
continue;
}
$source_path = get_attached_file( $attachment_id );
if ( empty( $source_path ) ) {
continue;
}
$temp_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . basename( $source_path );
if ( ! copy( $source_path, $temp_path ) ) {
continue;
}
$extension = strtolower( pathinfo( $temp_path, PATHINFO_EXTENSION ) );
$mime_type = '';
switch ( $extension ) {
case 'jpeg':
case 'jpg':
$image = imagecreatefromjpeg( $temp_path );
$mime_type = 'image/jpeg';
break;
case 'png':
$image = imagecreatefrompng( $temp_path );
$mime_type = 'image/png';
break;
case 'gif':
$image = imagecreatefromgif( $temp_path );
$mime_type = 'image/gif';
break;
default:
$image = false;
}
if ( ! $image ) {
continue;
}
$Filter = new vcImageFilter( $image );
$Filter->$filter_name();
if ( ! vc_save_gd_resource( $Filter->getImage(), $temp_path ) ) {
continue;
}
$new_filename = basename( $temp_path, '.' . $extension ) . '-' . $filter_name . '.' . $extension;
$_FILES = array(
array(
'name' => $new_filename,
'type' => $mime_type,
'tmp_name' => $temp_path,
'error' => UPLOAD_ERR_OK,
'size' => filesize( $temp_path ),
),
);
$new_attachment_id = media_handle_upload( $file_key, $post_id, $post_data, $overrides );
if ( ! $new_attachment_id || is_wp_error( $new_attachment_id ) ) {
continue;
}
update_post_meta( $new_attachment_id, 'vc-applied-image-filter', $filter_name );
$ids[ $key ] = $new_attachment_id;
}
$response['data']['ids'] = $ids;
wp_send_json( $response );
}
/**
* Generate filter preview
*
* Preview url is generated as data uri (base64)
*
* Required _POST params:
* - string filter: filter name
* - int attachment_id: attachment id
*
* @return void Results are sent out as json
* @throws \Exception
*/
function vc_media_editor_preview_image() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'upload_files' )->validateDie();
require_once vc_path_dir( 'HELPERS_DIR', 'class-vc-image-filter.php' );
$response = array(
'success' => true,
'data' => array(
'src' => '',
),
);
$filter_name = vc_post_param( 'filter', '' );
$attachment_id = vc_post_param( 'attachment_id', false );
$preferred_size = vc_post_param( 'preferred_size', 'medium' );
if ( ! $filter_name || ! $attachment_id ) {
wp_send_json( $response );
}
$attachment_path = get_attached_file( $attachment_id );
$attachment_details = wp_prepare_attachment_for_js( $attachment_id );
if ( ! isset( $attachment_details['sizes'][ $preferred_size ] ) ) {
$preferred_size = 'thumbnail';
}
$attachment_url = wp_get_attachment_image_src( $attachment_id, $preferred_size );
if ( empty( $attachment_path ) || empty( $attachment_url[0] ) ) {
wp_send_json( $response );
}
$source_path = dirname( $attachment_path ) . '/' . basename( $attachment_url[0] );
$image = vc_get_gd_resource( $source_path );
if ( ! $image ) {
wp_send_json( $response );
}
$Filter = new vcImageFilter( $image );
$Filter->$filter_name();
$extension = strtolower( pathinfo( $source_path, PATHINFO_EXTENSION ) );
ob_start();
switch ( $extension ) {
case 'jpeg':
case 'jpg':
imagejpeg( $Filter->getImage() );
break;
case 'png':
imagepng( $Filter->getImage() );
break;
case 'gif':
imagegif( $Filter->getImage() );
break;
}
$data = ob_get_clean();
// @codingStandardsIgnoreLine
$response['data']['src'] = 'data:image/' . $extension . ';base64,' . base64_encode( $data );
wp_send_json( $response );
}
/**
* Read file from disk as GD resource
*
* @param string $file
*
* @return bool|resource
*/
function vc_get_gd_resource( $file ) {
$extension = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) );
switch ( $extension ) {
case 'jpeg':
case 'jpg':
return imagecreatefromjpeg( $file );
case 'png':
return imagecreatefrompng( $file );
case 'gif':
return imagecreatefromgif( $file );
}
return false;
}
/**
* Save GD resource to file
*
* @param resource $resource
* @param string $file
*
* @return bool
*/
function vc_save_gd_resource( $resource, $file ) {
$extension = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) );
switch ( $extension ) {
case 'jpeg':
case 'jpg':
return imagejpeg( $resource, $file );
case 'png':
return imagepng( $resource, $file );
case 'gif':
return imagegif( $resource, $file );
}
return false;
}
/**
* Add "Filter: ..." meta field to attachment details box
*
* @param array $media_meta , meta to include in attachment form
* @param object $post , attachment record in database
*
* @return array|string
*/
function vc_attachment_filter_media_meta( $media_meta, $post ) {
$filter_name = get_post_meta( $post->ID, 'vc-applied-image-filter', true );
if ( ! $filter_name ) {
return $media_meta;
}
$filters = vc_get_filters();
if ( ! isset( $filters[ $filter_name ] ) ) {
return $media_meta;
}
$media_meta .= esc_html__( 'Filter:', 'js_composer' ) . ' ' . $filters[ $filter_name ];
return $media_meta;
}
autoload/vc-pages/page-role-manager.php 0000644 00000005715 15121635560 0014071 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $tabs
* @return array
*/
function vc_settings_tabs_vc_roles( $tabs ) {
// inster after vc-general tab
if ( array_key_exists( 'vc-general', $tabs ) ) {
$new = array();
foreach ( $tabs as $key => $value ) {
$new[ $key ] = $value;
if ( 'vc-general' === $key ) {
$new['vc-roles'] = esc_html__( 'Role Manager', 'js_composer' );
}
}
$tabs = $new;
} else {
$tabs['vc-roles'] = esc_html__( 'Roles Manager', 'js_composer' );
}
return $tabs;
}
if ( ! is_network_admin() ) {
add_filter( 'vc_settings_tabs', 'vc_settings_tabs_vc_roles' );
}
/**
* @return string
*/
function vc_settings_render_tab_vc_roles() {
return 'pages/vc-settings/tab-vc-roles.php';
}
add_filter( 'vc_settings-render-tab-vc-roles', 'vc_settings_render_tab_vc_roles' );
function vc_roles_settings_save() {
if ( check_admin_referer( 'vc_settings-roles-action', 'vc_nonce_field' ) && current_user_can( 'manage_options' ) ) {
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' );
$vc_roles = new Vc_Roles();
$data = $vc_roles->save( vc_request_param( 'vc_roles', array() ) );
echo wp_json_encode( $data );
die();
}
}
add_action( 'wp_ajax_vc_roles_settings_save', 'vc_roles_settings_save' );
if ( 'vc-roles' === vc_get_param( 'page' ) ) {
function vc_settings_render_tab_vc_roles_scripts() {
wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
}
add_action( 'admin_init', 'vc_settings_render_tab_vc_roles_scripts' );
}
function wpb_unfiltered_html_state( $state, $role ) {
if ( is_null( $state ) ) {
if ( is_network_admin() && is_super_admin() ) {
return true;
}
return isset( $role, $role->name ) && $role->has_cap( 'unfiltered_html' );
}
return $state;
}
/**
* @param $start
* @param WP_Role $role
*/
function wpb_editor_access( $state, $role ) {
if ( is_null( $state ) ) {
if ( is_network_admin() && is_super_admin() ) {
return true;
}
return isset( $role, $role->name ) && in_array( $role->name, array(
'administrator',
'editor',
'author',
), true );
}
return $state;
}
add_filter( 'vc_role_access_with_unfiltered_html_get_state', 'wpb_unfiltered_html_state', 10, 2 );
add_filter( 'vc_role_access_with_grid_builder_get_state', 'wpb_editor_access', 10, 2 );
add_filter( 'vc_role_access_with_backend_editor_get_state', 'wpb_editor_access', 10, 2 );
add_filter( 'vc_role_access_with_frontend_editor_get_state', 'wpb_editor_access', 10, 2 );
function wpb_custom_html_elements_access( $state, $shortcode ) {
if ( in_array( $shortcode, array(
'vc_raw_html',
'vc_raw_js',
) ) ) {
$state = vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get();
}
return $state;
}
add_filter( 'vc_user_access_check-shortcode_edit', 'wpb_custom_html_elements_access', 10, 2 );
add_filter( 'vc_user_access_check-shortcode_all', 'wpb_custom_html_elements_access', 10, 2 );
autoload/vc-pages/settings-tabs.php 0000644 00000002313 15121635560 0013364 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
function vc_page_settings_render() {
$page = vc_get_param( 'page' );
do_action( 'vc_page_settings_render-' . $page );
vc_settings()->renderTab( $page );
}
function vc_page_settings_build() {
if ( ! vc_user_access()->wpAny( 'manage_options' )->get() ) {
return;
}
$tabs = vc_settings()->getTabs();
foreach ( $tabs as $slug => $title ) {
$has_access = vc_user_access()->part( 'settings' )->can( $slug . '-tab' )->get();
if ( $has_access ) {
$page = add_submenu_page( VC_PAGE_MAIN_SLUG, $title, $title, 'manage_options', $slug, 'vc_page_settings_render' );
add_action( 'load-' . $page, array(
vc_settings(),
'adminLoad',
) );
}
}
do_action( 'vc_page_settings_build' );
}
function vc_page_settings_admin_init() {
vc_settings()->initAdmin();
}
add_action( 'vc_menu_page_build', 'vc_page_settings_build' );
add_action( 'vc_network_menu_page_build', 'vc_page_settings_build' );
add_action( 'admin_init', 'vc_page_settings_admin_init' );
add_action( 'vc-settings-render-tab-vc-roles', 'vc_settings_enqueue_js' );
function vc_settings_enqueue_js() {
// enqueue accordion in vc-roles page only
wp_enqueue_script( 'vc_accordion_script' );
}
autoload/vc-pages/pages.php 0000644 00000004344 15121635560 0011702 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.5
*/
function vc_page_css_enqueue() {
wp_enqueue_style( 'vc_page-css', vc_asset_url( 'css/js_composer_settings.min.css' ), array(), WPB_VC_VERSION );
}
/**
* Build group page objects.
*
* @param $slug
* @param $title
* @param $tab
*
* @return Vc_Pages_Group
* @since 4.5
*
*/
function vc_pages_group_build( $slug, $title, $tab = '' ) {
$vc_page_welcome_tabs = vc_get_page_welcome_tabs();
require_once vc_path_dir( 'CORE_DIR', 'class-vc-page.php' );
require_once vc_path_dir( 'CORE_DIR', 'class-vc-pages-group.php' );
// Create page.
if ( ! strlen( $tab ) ) {
$tab = $slug;
}
$page = new Vc_Page();
$page->setSlug( $tab )->setTitle( $title )->setTemplatePath( 'pages/' . $slug . '/' . $tab . '.php' );
// Create page group to stick with other in template.
$pages_group = new Vc_Pages_Group();
$pages_group->setSlug( $slug )->setPages( $vc_page_welcome_tabs )->setActivePage( $page )->setTemplatePath( 'pages/vc-welcome/index.php' );
return $pages_group;
}
/**
* @since 4.5
*/
function vc_menu_page_build() {
if ( vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-general-tab' )->get() ) {
define( 'VC_PAGE_MAIN_SLUG', 'vc-general' );
} else {
define( 'VC_PAGE_MAIN_SLUG', 'vc-welcome' );
}
add_menu_page( esc_html__( 'WPBakery Page Builder', 'js_composer' ), esc_html__( 'WPBakery Page Builder', 'js_composer' ), 'edit_posts', VC_PAGE_MAIN_SLUG, null, vc_asset_url( 'vc/logo/wpb-logo-white_32.svg' ), 76 );
do_action( 'vc_menu_page_build' );
}
function vc_network_menu_page_build() {
if ( ! vc_is_network_plugin() ) {
return;
}
if ( vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-general-tab' )->get() && ! is_main_site() ) {
define( 'VC_PAGE_MAIN_SLUG', 'vc-general' );
} else {
define( 'VC_PAGE_MAIN_SLUG', 'vc-welcome' );
}
add_menu_page( esc_html__( 'WPBakery Page Builder', 'js_composer' ), esc_html__( 'WPBakery Page Builder', 'js_composer' ), 'exist', VC_PAGE_MAIN_SLUG, null, vc_asset_url( 'vc/logo/wpb-logo-white_32.svg' ), 76 );
do_action( 'vc_network_menu_page_build' );
}
add_action( 'admin_menu', 'vc_menu_page_build' );
add_action( 'network_admin_menu', 'vc_network_menu_page_build' );
autoload/vc-pages/automapper.php 0000644 00000001426 15121635560 0012756 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init() {
if ( vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-automapper-tab' )->get() ) {
vc_automapper()->addAjaxActions();
}
}
/**
* Returns automapper template.
*
* @return string
* @since 4.5
*/
function vc_page_automapper_build() {
return 'pages/vc-settings/vc-automapper.php';
}
// TODO: move to separate file in autoload
add_filter( 'vc_settings-render-tab-vc-automapper', 'vc_page_automapper_build' );
is_admin() && ( strpos( vc_request_param( 'action' ), 'vc_automapper' ) !== false || 'vc-automapper' === vc_get_param( 'page' ) ) && add_action( 'admin_init', 'vc_automapper_init' );
autoload/vc-pages/page-design-options.php 0000644 00000012756 15121635560 0014465 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Used to check for current less version during page open
*
* @since 4.5
*/
add_action( 'vc_before_init', 'vc_check_for_custom_css_build' );
/**
* Function check is system has custom build of css
* and check it version in comparison with current VC version
*
* @since 4.5
*/
function vc_check_for_custom_css_build() {
$version = vc_settings()->getCustomCssVersion();
if ( vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-color-tab' )
->get() && vc_settings()->useCustomCss() && ( ! $version || version_compare( WPB_VC_VERSION, $version, '<>' ) ) ) {
add_action( 'admin_notices', 'vc_custom_css_admin_notice' );
}
}
/**
* Display admin notice depending on current page
*
* @since 4.5
*/
function vc_custom_css_admin_notice() {
global $current_screen;
vc_settings()->set( 'compiled_js_composer_less', '' );
$class = 'notice notice-warning vc_settings-custom-design-notice';
$message_important = esc_html__( 'Important notice', 'js_composer' );
if ( is_object( $current_screen ) && isset( $current_screen->id ) && 'visual-composer_page_vc-color' === $current_screen->id ) {
$message = esc_html__( 'You have an outdated version of WPBakery Page Builder Design Options. It is required to review and save it.', 'js_composer' );
echo '<div class="' . esc_attr( $class ) . '"><p><strong>' . esc_html( $message_important ) . '</strong>: ' . esc_html( $message ) . '</p></div>';
} else {
$message = esc_html__( 'You have an outdated version of WPBakery Page Builder Design Options. It is required to review and save it.', 'js_composer' );
$btnClass = 'button button-primary button-large vc_button-settings-less';
echo '<div class="' . esc_attr( $class ) . '"><p><strong>' . esc_html( $message_important ) . '</strong>: ' . esc_html( $message ) . '</p>' . '<p>';
echo '<a ' . implode( ' ', array(
'href="' . esc_url( admin_url( 'admin.php?page=vc-color' ) ) . '"',
'class="' . esc_attr( $btnClass ) . '"',
'id="vc_less-save-button"',
'style="vertical-align: baseline;"',
// needed to fix ":active bug"
) ) . '>';
echo esc_html__( 'Open Design Options', 'js_composer' ) . '</a>';
echo '</p></div>';
}
}
/**
* @param $submitButtonAttributes
* @return mixed
*/
function vc_page_settings_tab_color_submit_attributes( $submitButtonAttributes ) {
$submitButtonAttributes['data-vc-less-path'] = vc_str_remove_protocol( vc_asset_url( 'less/js_composer.less' ) );
$submitButtonAttributes['data-vc-less-root'] = vc_str_remove_protocol( vc_asset_url( 'less' ) );
$submitButtonAttributes['data-vc-less-variables'] = wp_json_encode( apply_filters( 'vc_settings-less-variables', array(
// Main accent color:
'vc_grey' => array(
'key' => 'wpb_js_vc_color',
'default' => vc_settings()->getDefault( 'vc_color' ),
),
// Hover color
'vc_grey_hover' => array(
'key' => 'wpb_js_vc_color_hover',
'default' => vc_settings()->getDefault( 'vc_color_hover' ),
),
'vc_image_slider_link_active' => 'wpb_js_vc_color_hover',
// Call to action background color
'vc_call_to_action_bg' => 'wpb_js_vc_color_call_to_action_bg',
'vc_call_to_action_2_bg' => 'wpb_js_vc_color_call_to_action_bg',
'vc_call_to_action_border' => array(
'key' => 'wpb_js_vc_color_call_to_action_border',
// darken 5%
'default_key' => 'wpb_js_vc_color',
'modify_output' => array(
array(
'plain' => array(
'darken({{ value }}, 5%)',
),
),
),
),
// Google maps background color
'vc_google_maps_bg' => 'wpb_js_vc_color_google_maps_bg',
// Post slider caption background color
'vc_post_slider_caption_bg' => 'wpb_js_vc_color_post_slider_caption_bg',
// Progress bar background color
'vc_progress_bar_bg' => 'wpb_js_vc_color_progress_bar_bg',
// Separator border color
'vc_separator_border' => 'wpb_js_vc_color_separator_border',
// Tabs navigation background color
'vc_tab_bg' => 'wpb_js_vc_color_tab_bg',
// Active tab background color
'vc_tab_bg_active' => 'wpb_js_vc_color_tab_bg_active',
// Elements bottom margin
'vc_element_margin_bottom' => array(
'key' => 'wpb_js_margin',
'default' => vc_settings()->getDefault( 'margin' ),
),
// Grid gutter width
'grid-gutter-width' => array(
'key' => 'wpb_js_gutter',
'default' => vc_settings()->getDefault( 'gutter' ),
'modify_output' => array(
array(
'plain' => array(
'{{ value }}px',
),
),
),
),
'screen-sm-min' => array(
'key' => 'wpb_js_responsive_max',
'default' => vc_settings()->getDefault( 'responsive_max' ),
'modify_output' => array(
array(
'plain' => array(
'{{ value }}px',
),
),
),
),
'screen-md-min' => array(
'key' => 'wpb_js_responsive_md',
'default' => vc_settings()->getDefault( 'responsive_md' ),
'modify_output' => array(
array(
'plain' => array(
'{{ value }}px',
),
),
),
),
'screen-lg-min' => array(
'key' => 'wpb_js_responsive_lg',
'default' => vc_settings()->getDefault( 'responsive_lg' ),
'modify_output' => array(
array(
'plain' => array(
'{{ value }}px',
),
),
),
),
) ) );
return $submitButtonAttributes;
}
function vc_page_settings_desing_options_load() {
add_filter( 'vc_settings-tab-submit-button-attributes-color', 'vc_page_settings_tab_color_submit_attributes' );
wp_enqueue_script( 'vc_less_js', vc_asset_url( 'lib/bower/lessjs/dist/less.min.js' ), array(), WPB_VC_VERSION, true );
}
add_action( 'vc-settings-render-tab-vc-color', 'vc_page_settings_desing_options_load' );
autoload/vc-pages/welcome-screen.php 0000644 00000006166 15121635560 0013517 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Get welcome pages main slug.
*
* @return mixed|string
* @since 4.5
*/
function vc_page_welcome_slug() {
$vc_page_welcome_tabs = vc_get_page_welcome_tabs();
return isset( $vc_page_welcome_tabs ) ? key( $vc_page_welcome_tabs ) : '';
}
/**
* Build vc-welcome page block which will be shown after Vc installation.
*
* vc_filter: vc_page_welcome_render_capabilities
*
* @since 4.5
*/
function vc_page_welcome_render() {
$vc_page_welcome_tabs = vc_get_page_welcome_tabs();
$slug = vc_page_welcome_slug();
$tab_slug = vc_get_param( 'tab', $slug );
// If tab slug in the list please render;
if ( ! empty( $tab_slug ) && isset( $vc_page_welcome_tabs[ $tab_slug ] ) ) {
$pages_group = vc_pages_group_build( $slug, $vc_page_welcome_tabs[ $tab_slug ], $tab_slug );
$pages_group->render();
}
}
function vc_page_welcome_add_sub_page() {
// Add submenu page
$page = add_submenu_page( VC_PAGE_MAIN_SLUG, esc_html__( 'About', 'js_composer' ), esc_html__( 'About', 'js_composer' ), 'edit_posts', vc_page_welcome_slug(), 'vc_page_welcome_render' );
// Css for perfect styling.
add_action( 'admin_print_styles-' . $page, 'vc_page_css_enqueue' );
}
function vc_welcome_menu_hooks() {
$settings_tab_enabled = vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-general-tab' )->get();
add_action( 'vc_menu_page_build', 'vc_page_welcome_add_sub_page', $settings_tab_enabled ? 11 : 1 );
}
function vc_welcome_menu_hooks_network() {
if ( ! vc_is_network_plugin() ) {
return;
}
$settings_tab_enabled = vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-general-tab' )->get();
add_action( 'vc_network_menu_page_build', 'vc_page_welcome_add_sub_page', $settings_tab_enabled && ! is_main_site() ? 11 : 1 );
}
add_action( 'admin_menu', 'vc_welcome_menu_hooks', 9 );
add_action( 'network_admin_menu', 'vc_welcome_menu_hooks_network', 9 );
/**
* ====================
* Redirect to welcome page on plugin activation.
* ====================
*/
/**
* Set redirect transition on update or activation
* @since 4.5
*/
function vc_page_welcome_set_redirect() {
if ( ! is_network_admin() && ! vc_get_param( 'activate-multi' ) ) {
set_transient( '_vc_page_welcome_redirect', 1, 30 );
}
}
/**
* Do redirect if required on welcome page
* @since 4.5
*/
function vc_page_welcome_redirect() {
$redirect = get_transient( '_vc_page_welcome_redirect' );
delete_transient( '_vc_page_welcome_redirect' );
if ( $redirect ) {
wp_safe_redirect( admin_url( 'admin.php?page=' . rawurlencode( vc_page_welcome_slug() ) ) );
}
}
// Enables redirect on activation.
add_action( 'vc_activation_hook', 'vc_page_welcome_set_redirect' );
add_action( 'admin_init', 'vc_page_welcome_redirect' );
/**
* @return mixed|void
*/
function vc_get_page_welcome_tabs() {
global $vc_page_welcome_tabs;
$vc_page_welcome_tabs = apply_filters( 'vc_page-welcome-slugs-list', array(
'vc-welcome' => esc_html__( 'What\'s New', 'js_composer' ),
'vc-faq' => esc_html__( 'FAQ', 'js_composer' ),
'vc-resources' => esc_html__( 'Resources', 'js_composer' ),
) );
return $vc_page_welcome_tabs;
}
autoload/vc-pages/page-custom-css.php 0000644 00000000526 15121635560 0013613 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
function vc_page_settings_custom_css_load() {
wp_enqueue_script( 'ace-editor', vc_asset_url( 'lib/bower/ace-builds/src-min-noconflict/ace.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
}
add_action( 'vc-settings-render-tab-vc-custom_css', 'vc_page_settings_custom_css_load' );
autoload/vc-settings-presets.php 0000644 00000016122 15121635560 0013024 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_action( 'wp_ajax_vc_action_save_settings_preset', 'vc_action_save_settings_preset' );
add_action( 'wp_ajax_vc_action_set_as_default_settings_preset', 'vc_action_set_as_default_settings_preset' );
add_action( 'wp_ajax_vc_action_delete_settings_preset', 'vc_action_delete_settings_preset' );
add_action( 'wp_ajax_vc_action_restore_default_settings_preset', 'vc_action_restore_default_settings_preset' );
add_action( 'wp_ajax_vc_action_get_settings_preset', 'vc_action_get_settings_preset' );
add_action( 'wp_ajax_vc_action_render_settings_preset_popup', 'vc_action_render_settings_preset_popup' );
add_action( 'wp_ajax_vc_action_render_settings_preset_title_prompt', 'vc_action_render_settings_preset_title_prompt' );
add_action( 'wp_ajax_vc_action_render_settings_templates_prompt', 'vc_action_render_settings_templates_prompt' );
add_action( 'vc_restore_default_settings_preset', 'vc_action_set_as_default_settings_preset', 10, 2 );
add_action( 'vc_register_settings_preset', 'vc_register_settings_preset', 10, 4 );
add_filter( 'vc_add_new_elements_to_box', 'vc_add_new_elements_to_box' );
add_filter( 'vc_add_new_category_filter', 'vc_add_new_category_filter' );
function vc_include_settings_preset_class() {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
}
/**
* @return Vc_Vendor_Preset
*/
function vc_vendor_preset() {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-vendor-presets.php' );
return Vc_Vendor_Preset::getInstance();
}
/**
* Save settings preset for specific shortcode
*
* Include freshly rendered html in response
*
* Required _POST params:
* - shortcode_name string
* - title string
* - data string params in json
* - is_default
*
* @since 4.7
*/
function vc_action_save_settings_preset() {
vc_include_settings_preset_class();
vc_user_access()->part( 'presets' )->checkStateAny( true, null )->validateDie(); // user must have permission to save presets
$id = Vc_Settings_Preset::saveSettingsPreset( vc_post_param( 'shortcode_name' ), vc_post_param( 'title' ), vc_post_param( 'data' ), vc_post_param( 'is_default' ) );
$response = array(
'success' => (bool) $id,
'html' => Vc_Settings_Preset::getRenderedSettingsPresetPopup( vc_post_param( 'shortcode_name' ) ),
'id' => $id,
);
wp_send_json( $response );
}
/**
* Set existing preset as default
*
* Include freshly rendered html in response
*
* Required _POST params:
* - id int
* - shortcode_name string
*
* @since 4.7
*/
function vc_action_set_as_default_settings_preset() {
vc_include_settings_preset_class();
vc_user_access()->part( 'presets' )->checkStateAny( true, null )->validateDie(); // user must have permission to set as default presets
$id = vc_post_param( 'id' );
$shortcode_name = vc_post_param( 'shortcode_name' );
$status = Vc_Settings_Preset::setAsDefaultSettingsPreset( $id, $shortcode_name );
$response = array(
'success' => $status,
'html' => Vc_Settings_Preset::getRenderedSettingsPresetPopup( $shortcode_name ),
);
wp_send_json( $response );
}
/**
* Unmark current default preset as default
*
* Include freshly rendered html in response
*
* Required _POST params:
* - shortcode_name string
*
* @since 4.7
*/
function vc_action_restore_default_settings_preset() {
vc_include_settings_preset_class();
vc_user_access()->part( 'presets' )->checkStateAny( true, null )->validateDie(); // user must have permission to restore presets
$shortcode_name = vc_post_param( 'shortcode_name' );
$status = Vc_Settings_Preset::setAsDefaultSettingsPreset( null, $shortcode_name );
$response = array(
'success' => $status,
'html' => Vc_Settings_Preset::getRenderedSettingsPresetPopup( $shortcode_name ),
);
wp_send_json( $response );
}
/**
* Delete specific settings preset
*
* Include freshly rendered html in response
*
* Required _POST params:
* - shortcode_name string
* - id int
*
* @since 4.7
*/
function vc_action_delete_settings_preset() {
vc_include_settings_preset_class();
vc_user_access()->part( 'presets' )->checkStateAny( true, null )->validateDie(); // user must have permission to delete presets
$default = get_post_meta( vc_post_param( 'id' ), '_vc_default', true );
$status = Vc_Settings_Preset::deleteSettingsPreset( vc_post_param( 'id' ) );
$response = array(
'success' => $status,
'default' => $default,
'html' => Vc_Settings_Preset::getRenderedSettingsPresetPopup( vc_post_param( 'shortcode_name' ) ),
);
wp_send_json( $response );
}
/**
* Get data for specific settings preset
*
* Required _POST params:
* - id int
*
* @since 4.7
*/
function vc_action_get_settings_preset() {
vc_include_settings_preset_class();
$data = Vc_Settings_Preset::getSettingsPreset( vc_post_param( 'id' ), true );
if ( false !== $data ) {
$response = array(
'success' => true,
'data' => $data,
);
} else {
$response = array(
'success' => false,
);
}
wp_send_json( $response );
}
/**
* Respond with rendered popup menu
*
* Required _POST params:
* - shortcode_name string
*
* @since 4.7
*/
function vc_action_render_settings_preset_popup() {
vc_include_settings_preset_class();
$html = Vc_Settings_Preset::getRenderedSettingsPresetPopup( vc_post_param( 'shortcode_name' ) );
$response = array(
'success' => true,
'html' => $html,
);
wp_send_json( $response );
}
/**
* Return rendered title prompt
*
* @since 4.7
*
*/
function vc_action_render_settings_preset_title_prompt() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'presets' )->can()->validateDie();
ob_start();
vc_include_template( apply_filters( 'vc_render_settings_preset_title_prompt', 'editors/partials/prompt-presets.tpl.php' ) );
$html = ob_get_clean();
$response = array(
'success' => true,
'html' => $html,
);
wp_send_json( $response );
}
/**
* Return rendered template prompt
*/
function vc_action_render_settings_templates_prompt() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'templates' )->can()->validateDie();
ob_start();
vc_include_template( apply_filters( 'vc_render_settings_preset_title_prompt', 'editors/partials/prompt-templates.tpl.php' ) );
$html = ob_get_clean();
$response = array(
'success' => true,
'html' => $html,
);
wp_send_json( $response );
}
/**
* Register (add) new vendor preset
*
* @since 4.8
*
* @param string $title
* @param string $shortcode
* @param array $params
* @param bool $default
*/
function vc_register_settings_preset( $title, $shortcode, $params, $default = false ) {
vc_vendor_preset()->add( $title, $shortcode, $params, $default );
}
/**
* @param $shortcodes
* @return array
* @throws \Exception
*/
function vc_add_new_elements_to_box( $shortcodes ) {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
return Vc_Settings_Preset::addVcPresetsToShortcodes( $shortcodes );
}
/**
* @param $cat
* @return array
*/
function vc_add_new_category_filter( $cat ) {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
return Vc_Settings_Preset::addPresetCategory( $cat );
}
autoload/params-to-init.php 0000644 00000003435 15121635560 0011742 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_filter( 'vc_edit_form_fields_optional_params', 'vc_edit_for_fields_add_optional_params' );
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
add_action( 'vc_edit_form_fields_after_render', 'vc_output_required_params_to_init' );
add_filter( 'vc_edit_form_fields_optional_params', 'vc_edit_for_fields_add_optional_params' );
}
/**
* @param $params
* @return array
*/
function vc_edit_for_fields_add_optional_params( $params ) {
$arr = array(
'hidden',
'textfield',
'dropdown',
'checkbox',
'posttypes',
'taxonomies',
'taxomonies',
'exploded_textarea',
'textarea_raw_html',
'textarea_safe',
'textarea',
'attach_images',
'attach_image',
'widgetised_sidebars',
'colorpicker',
'loop',
'vc_link',
'sorted_list',
'tab_id',
'href',
'custom_markup',
'animation_style',
'iconpicker',
'el_id',
'vc_grid_item',
'google_fonts',
);
$params = array_values( array_unique( array_merge( $params, $arr ) ) );
return $params;
}
function vc_output_required_params_to_init() {
$params = WpbakeryShortcodeParams::getRequiredInitParams();
$js_array = array();
foreach ( $params as $param ) {
$js_array[] = '"' . $param . '"';
}
$data = '
if ( window.vc ) {
window.vc.required_params_to_init = [' . implode( ',', $js_array ) . '];
}';
$custom_tag = 'script';
$output = '<' . $custom_tag . '>' . $data . '</' . $custom_tag . '>';
echo $output;
}
add_action( 'wp_ajax_wpb_gallery_html', 'vc_gallery_html' );
function vc_gallery_html() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$images = vc_post_param( 'content' );
if ( ! empty( $images ) ) {
wp_send_json_success( vc_field_attached_images( explode( ',', $images ) ) );
}
die();
}
autoload/hook-vc-iconpicker-param.php 0000644 00000010417 15121635560 0013664 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/***
* @since 4.4
* Hook Vc-Iconpicker-Param.php
*
* Adds actions and filters for iconpicker param.
* Used to:
* - register/enqueue icons fonts for admin pages
* - register/enqueue js for iconpicker param
* - register/enqueue css for iconpicker param
*/
// @see Vc_Base::frontCss, used to append actions when frontCss(frontend editor/and real view mode) method called
// This action registers all styles(fonts) to be enqueue later
add_action( 'vc_base_register_front_css', 'vc_iconpicker_base_register_css' );
// @see Vc_Base::registerAdminCss, used to append action when registerAdminCss(backend editor) method called
// This action registers all styles(fonts) to be enqueue later
add_action( 'vc_base_register_admin_css', 'vc_iconpicker_base_register_css' );
// @see Vc_Base::registerAdminJavascript, used to append action when registerAdminJavascript(backend/frontend editor) method called
// This action will register needed js file, and also you can use it for localizing js.
add_action( 'vc_base_register_admin_js', 'vc_iconpicker_base_register_js' );
// @see Vc_Backend_Editor::printScriptsMessages (wp-content/plugins/js_composer/include/classes/editors/class-vc-backend-editor.php),
// used to enqueue needed js/css files when backend editor is rendering
add_action( 'vc_backend_editor_enqueue_js_css', 'vc_iconpicker_editor_jscss' );
// @see Vc_Frontend_Editor::enqueueAdmin (wp-content/plugins/js_composer/include/classes/editors/class-vc-frontend-editor.php),
// used to enqueue needed js/css files when frontend editor is rendering
add_action( 'vc_frontend_editor_enqueue_js_css', 'vc_iconpicker_editor_jscss' );
/**
* This action registers all styles(fonts) to be enqueue later
* @see filter 'vc_base_register_front_css' - preview/frontend-editor
* filter 'vc_base_register_admin_css' - backend editor
*
* @since 4.4
*/
function vc_iconpicker_base_register_css() {
// Vc Icon picker fonts:
wp_register_style( 'vc_font_awesome_5_shims', vc_asset_url( 'lib/bower/font-awesome/css/v4-shims.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_font_awesome_5', vc_asset_url( 'lib/bower/font-awesome/css/all.min.css' ), array( 'vc_font_awesome_5_shims' ), WPB_VC_VERSION );
wp_register_style( 'vc_typicons', vc_asset_url( 'css/lib/typicons/src/font/typicons.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_openiconic', vc_asset_url( 'css/lib/vc-open-iconic/vc_openiconic.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_linecons', vc_asset_url( 'css/lib/vc-linecons/vc_linecons_icons.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_entypo', vc_asset_url( 'css/lib/vc-entypo/vc_entypo.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_monosocialiconsfont', vc_asset_url( 'css/lib/monosocialiconsfont/monosocialiconsfont.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_material', vc_asset_url( 'css/lib/vc-material/vc_material.min.css' ), false, WPB_VC_VERSION );
// Theme
wp_register_style( 'vc-icon-picker-main-css', vc_asset_url( 'lib/bower/vcIconPicker/css/jquery.fonticonpicker.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc-icon-picker-main-css-theme', vc_asset_url( 'lib/bower/vcIconPicker/themes/grey-theme/jquery.fonticonpicker.vcgrey.min.css' ), false, WPB_VC_VERSION );
}
/**
* Register admin js for iconpicker functionality
*
* @since 4.4
*/
function vc_iconpicker_base_register_js() {
wp_register_script( 'vc-icon-picker', vc_asset_url( 'lib/bower/vcIconPicker/jquery.fonticonpicker.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
}
/**
* Enqueue ALL fonts/styles for Editor(admin) mode. (to allow easy change icons)
* - To append your icons fonts add action:
* vc_backend_editor_enqueue_jscss and vc_frontend_editor_enqueue_jscss
*
* @since 4.4
*/
function vc_iconpicker_editor_jscss() {
// Enqueue js and theme css files
wp_enqueue_script( 'vc-icon-picker' );
wp_enqueue_style( 'vc-icon-picker-main-css' );
wp_enqueue_style( 'vc-icon-picker-main-css-theme' );
// Fonts
wp_enqueue_style( 'vc_font_awesome_5' );
wp_enqueue_style( 'vc_openiconic' );
wp_enqueue_style( 'vc_typicons' );
wp_enqueue_style( 'vc_entypo' );
wp_enqueue_style( 'vc_linecons' );
wp_enqueue_style( 'vc_monosocialiconsfont' );
wp_enqueue_style( 'vc_material' );
}
autoload/ui-vc-pointers.php 0000644 00000006024 15121635560 0011757 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $vc_default_pointers, $vc_pointers;
$vc_default_pointers = (array) apply_filters( 'vc_pointers_list', array(
'vc_grid_item',
'vc_pointers_backend_editor',
'vc_pointers_frontend_editor',
) );
if ( is_admin() ) {
add_action( 'admin_enqueue_scripts', 'vc_pointer_load', 1000 );
}
function vc_pointer_load() {
global $vc_pointers;
// Don't run on WP < 3.3
if ( get_bloginfo( 'version' ) < '3.3' ) {
return;
}
$screen = get_current_screen();
$screen_id = $screen->id;
// Get pointers for this screen
$pointers = apply_filters( 'vc-ui-pointers', array() );
$pointers = apply_filters( 'vc_ui-pointers-' . $screen_id, $pointers );
if ( ! $pointers || ! is_array( $pointers ) ) {
return;
}
// Get dismissed pointers
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
$vc_pointers = array( 'pointers' => array() );
// Check pointers and remove dismissed ones.
foreach ( $pointers as $pointer_id => $pointer ) {
// Sanity check
if ( in_array( $pointer_id, $dismissed, true ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['name'] ) ) {
continue;
}
$pointer['pointer_id'] = $pointer_id;
// Add the pointer to $valid_pointers array
$vc_pointers['pointers'][] = $pointer;
}
// No valid pointers? Stop here.
if ( empty( $vc_pointers['pointers'] ) ) {
return;
}
wp_enqueue_style( 'wp-pointer' );
wp_enqueue_script( 'wp-pointer' );
// messages
$vc_pointers['texts'] = array(
'finish' => esc_html__( 'Finish', 'js_composer' ),
'next' => esc_html__( 'Next', 'js_composer' ),
'prev' => esc_html__( 'Prev', 'js_composer' ),
);
// Add pointer options to script.
wp_localize_script( 'wp-pointer', 'vcPointer', $vc_pointers );
}
/**
* Remove Vc pointers keys to show Tour markers again.
* @sine 4.5
*/
function vc_pointer_reset() {
global $vc_default_pointers;
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-general-tab' )->validateDie();
$pointers = (array) apply_filters( 'vc_pointers_list', $vc_default_pointers );
$prev_meta_value = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true );
$dismissed = explode( ',', (string) $prev_meta_value );
if ( count( $dismissed ) > 0 && count( $pointers ) ) {
$meta_value = implode( ',', array_diff( $dismissed, $pointers ) );
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $meta_value, $prev_meta_value );
}
wp_send_json( array( 'success' => true ) );
}
/**
* Reset tour guid
* @return bool
*/
function vc_pointers_is_dismissed() {
global $vc_default_pointers;
$pointers = (array) apply_filters( 'vc_pointers_list', $vc_default_pointers );
$prev_meta_value = get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true );
$dismissed = explode( ',', (string) $prev_meta_value );
return count( array_diff( $dismissed, $pointers ) ) < count( $dismissed );
}
add_action( 'wp_ajax_vc_pointer_reset', 'vc_pointer_reset' );
autoload/params/hidden.php 0000644 00000000717 15121635560 0011614 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* required hooks for hidden field.
* @since 4.5
*/
require_once vc_path_dir( 'PARAMS_DIR', 'hidden/hidden.php' );
vc_add_shortcode_param( 'hidden', 'vc_hidden_form_field' );
add_filter( 'vc_edit_form_fields_render_field_hidden_before', 'vc_edit_form_fields_render_field_hidden_before' );
add_filter( 'vc_edit_form_fields_render_field_hidden_after', 'vc_edit_form_fields_render_field_hidden_after' );
autoload/params/vc_grid_item.php 0000644 00000015527 15121635560 0013021 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $settings
* @param $value
* @return string
*/
function vc_vc_grid_item_form_field( $settings, $value ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$output = '<div data-vc-grid-element="container">' . '<select data-vc-grid-element="value" type="hidden" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value wpb-select ' . esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ) . '_field" ' . '>';
$vc_grid_item_templates = Vc_Grid_Item::predefinedTemplates();
if ( is_array( $vc_grid_item_templates ) ) {
foreach ( $vc_grid_item_templates as $key => $data ) {
$output .= '<option data-vc-link="' . esc_url( admin_url( 'post-new.php?post_type=vc_grid_item&vc_gitem_template=' . $key ) ) . '" value="' . esc_attr( $key ) . '"' . ( $key === $value ? ' selected="true"' : '' ) . '>' . esc_html( $data['name'] ) . '</option>';
}
}
$grid_item_posts = get_posts( array(
'posts_per_page' => '-1',
'orderby' => 'post_title',
'post_type' => Vc_Grid_Item_Editor::postType(),
) );
foreach ( $grid_item_posts as $post ) {
$output .= '<option data-vc-link="' . esc_url( get_edit_post_link( $post->ID ) ) . '"value="' . esc_attr( $post->ID ) . '"' . ( (string) $post->ID === $value ? ' selected="true"' : '' ) . '>' . esc_html( $post->post_title ) . '</option>';
}
$output .= '</select></div>';
return $output;
}
function vc_load_vc_grid_item_param() {
vc_add_shortcode_param( 'vc_grid_item', 'vc_vc_grid_item_form_field' );
}
add_action( 'vc_load_default_params', 'vc_load_vc_grid_item_param' );
/**
* @param $target
* @return string
*/
function vc_gitem_post_data_get_link_target_frontend_editor( $target ) {
return ' target="_blank"';
}
/**
* @param $rel
* @return string
*/
function vc_gitem_post_data_get_link_rel_frontend_editor( $rel ) {
return ' rel="' . esc_attr( $rel ) . '"';
}
/**
* @param $atts
* @param string $default_class
* @param string $title
* @return string
*/
function vc_gitem_create_link( $atts, $default_class = '', $title = '' ) {
$link = '';
$target = '';
$rel = '';
$title_attr = '';
$css_class = 'vc_gitem-link' . ( strlen( $default_class ) > 0 ? ' ' . $default_class : '' );
if ( isset( $atts['link'] ) ) {
if ( 'custom' === $atts['link'] && ! empty( $atts['url'] ) ) {
$link = vc_build_link( $atts['url'] );
if ( strlen( $link['target'] ) ) {
$target = ' target="' . esc_attr( $link['target'] ) . '"';
}
if ( strlen( $link['rel'] ) ) {
$rel = ' rel="' . esc_attr( $link['rel'] ) . '"';
}
if ( strlen( $link['title'] ) ) {
$title = $link['title'];
}
$link = 'a href="' . esc_url( $link['url'] ) . '" class="' . esc_attr( $css_class ) . '"';
} elseif ( 'post_link' === $atts['link'] ) {
$link = 'a href="{{ post_link_url }}" class="' . esc_attr( $css_class ) . '"';
if ( ! strlen( $title ) ) {
$title = '{{ post_title }}';
}
} elseif ( 'post_author' === $atts['link'] ) {
$link = 'a href="{{ post_author_href }}" class="' . esc_attr( $css_class ) . '"';
if ( ! strlen( $title ) ) {
$title = '{{ post_author }}';
}
} elseif ( 'image' === $atts['link'] ) {
$link = 'a{{ post_image_url_href }} class="' . esc_attr( $css_class ) . '"';
} elseif ( 'image_lightbox' === $atts['link'] ) {
$link = 'a{{ post_image_url_attr_prettyphoto:' . $css_class . ' }}';
}
}
if ( strlen( $title ) > 0 ) {
$title_attr = ' title="' . esc_attr( $title ) . '"';
}
return apply_filters( 'vc_gitem_post_data_get_link_link', $link, $atts, $css_class ) . apply_filters( 'vc_gitem_post_data_get_link_target', $target, $atts ) . apply_filters( 'vc_gitem_post_data_get_link_rel', $rel, $atts ) . apply_filters( 'vc_gitem_post_data_get_link_title', $title_attr, $atts );
}
/**
* @param $atts
* @param $post
* @param string $default_class
* @param string $title
* @return string
*/
function vc_gitem_create_link_real( $atts, $post, $default_class = '', $title = '' ) {
$link = '';
$target = '';
$rel = '';
$title_attr = '';
$link_css_class = 'vc_gitem-link';
if ( isset( $atts['link'] ) ) {
$link_css_class = 'vc_gitem-link' . ( strlen( $default_class ) > 0 ? ' ' . $default_class : '' );
if ( strlen( $atts['el_class'] ) > 0 ) {
$link_css_class .= ' ' . $atts['el_class'];
}
$link_css_class = trim( preg_replace( '/\s+/', ' ', $link_css_class ) );
if ( 'custom' === $atts['link'] && ! empty( $atts['url'] ) ) {
$link = vc_build_link( $atts['url'] );
if ( strlen( $link['target'] ) ) {
$target = ' target="' . esc_attr( $link['target'] ) . '"';
}
if ( strlen( $link['rel'] ) ) {
$rel = ' rel="' . esc_attr( $link['rel'] ) . '"';
}
if ( strlen( $link['title'] ) ) {
$title = $link['title'];
}
$link = 'a href="' . esc_url( $link['url'] ) . '" class="' . esc_attr( $link_css_class ) . '"';
} elseif ( 'post_link' === $atts['link'] ) {
$link = 'a href="' . esc_url( get_permalink( $post->ID ) ) . '" class="' . esc_attr( $link_css_class ) . '"';
if ( ! strlen( $title ) ) {
$title = the_title( '', '', false );
}
} elseif ( 'image' === $atts['link'] ) {
$href_link = vc_gitem_template_attribute_post_image_url( '', array(
'post' => $post,
'data' => '',
) );
$link = 'a href="' . esc_url( $href_link ) . '" class="' . esc_attr( $link_css_class ) . '"';
} elseif ( 'image_lightbox' === $atts['link'] ) {
$link = 'a' . vc_gitem_template_attribute_post_image_url_attr_lightbox( '', array(
'post' => $post,
'data' => esc_attr( $link_css_class ),
) );
}
}
if ( strlen( $title ) > 0 ) {
$title_attr = ' title="' . esc_attr( $title ) . '"';
}
return apply_filters( 'vc_gitem_post_data_get_link_real_link', $link, $atts, $post, $link_css_class ) . apply_filters( 'vc_gitem_post_data_get_link_real_target', $target, $atts, $post ) . apply_filters( 'vc_gitem_post_data_get_link_real_rel', $rel, $atts, $post ) . apply_filters( 'vc_gitem_post_data_get_link_real_title', $title_attr, $atts, $post );
}
/**
* @param $link
* @return string
*/
function vc_gitem_post_data_get_link_link_frontend_editor( $link ) {
return empty( $link ) ? 'a' : $link;
}
if ( vc_is_page_editable() ) {
add_filter( 'vc_gitem_post_data_get_link_link', 'vc_gitem_post_data_get_link_link_frontend_editor' );
add_filter( 'vc_gitem_post_data_get_link_real_link', 'vc_gitem_post_data_get_link_link_frontend_editor' );
add_filter( 'vc_gitem_post_data_get_link_target', 'vc_gitem_post_data_get_link_target_frontend_editor' );
add_filter( 'vc_gitem_post_data_get_link_rel', 'vc_gitem_post_data_get_link_rel_frontend_editor' );
add_filter( 'vc_gitem_post_data_get_link_real_target', 'vc_gitem_post_data_get_link_target_frontend_editor' );
add_filter( 'vc_gitem_post_data_get_link_real_rel', 'vc_gitem_post_data_get_link_rel_frontend_editor' );
}
autoload/vc-single-image.php 0000644 00000003745 15121635560 0012051 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
add_filter( 'vc_edit_form_fields_attributes_vc_single_image', 'vc_single_image_convert_old_link_to_new' );
}
/**
* Backward compatibility
*
* @param $atts
* @return mixed
* @since 4.6
*/
function vc_single_image_convert_old_link_to_new( $atts ) {
if ( empty( $atts['onclick'] ) && isset( $atts['img_link_large'] ) && 'yes' === $atts['img_link_large'] ) {
$atts['onclick'] = 'img_link_large';
unset( $atts['img_link_large'] );
} elseif ( empty( $atts['onclick'] ) && ( ! isset( $atts['img_link_large'] ) || 'yes' !== $atts['img_link_large'] ) ) {
unset( $atts['img_link_large'] );
}
if ( empty( $atts['onclick'] ) && ! empty( $atts['link'] ) ) {
$atts['onclick'] = 'custom_link';
}
return $atts;
}
add_action( 'wp_ajax_wpb_single_image_src', 'vc_single_image_src' );
function vc_single_image_src() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$image_id = (int) vc_post_param( 'content' );
$params = vc_post_param( 'params' );
$post_id = (int) vc_post_param( 'post_id' );
$img_size = vc_post_param( 'size' );
$img = '';
if ( ! empty( $params['source'] ) ) {
$source = $params['source'];
} else {
$source = 'media_library';
}
switch ( $source ) {
case 'media_library':
case 'featured_image':
if ( 'featured_image' === $source ) {
if ( $post_id && has_post_thumbnail( $post_id ) ) {
$img_id = get_post_thumbnail_id( $post_id );
} else {
$img_id = 0;
}
} else {
$img_id = preg_replace( '/[^\d]/', '', $image_id );
}
if ( ! $img_size ) {
$img_size = 'thumbnail';
}
if ( $img_id ) {
$img = wp_get_attachment_image_src( $img_id, $img_size );
if ( $img ) {
$img = $img[0];
}
}
break;
case 'external_link':
if ( ! empty( $params['custom_src'] ) ) {
$img = $params['custom_src'];
}
break;
}
echo esc_url( $img );
die();
}
autoload/class-vc-settings-presets.php 0000644 00000022345 15121635560 0014133 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Collection of static methods for work with settings presets
*
* @since 4.8
*/
class Vc_Settings_Preset {
/**
* Get default preset id for specific shortcode
*
* @since 4.7
*
* @param string $shortcode_name
*
* @return mixed int|null
*/
public static function getDefaultSettingsPresetId( $shortcode_name = null ) {
if ( ! $shortcode_name ) {
return null;
}
$args = array(
'post_type' => 'vc_settings_preset',
'post_mime_type' => self::constructShortcodeMimeType( $shortcode_name ),
'posts_per_page' => - 1,
'meta_key' => '_vc_default',
'meta_value' => true,
);
$posts = get_posts( $args );
if ( $posts ) {
$default_id = $posts[0]->ID;
} else {
// check for vendor presets
$default_id = vc_vendor_preset()->getDefaultId( $shortcode_name );
}
return $default_id;
}
/**
* Set existing preset as default
*
* If this is vendor preset, clone it and set new one as default
*
* @param int $id If falsy, no default will be set
* @param string $shortcode_name
*
* @return boolean
*
* @since 4.7
*/
public static function setAsDefaultSettingsPreset( $id, $shortcode_name ) {
$post_id = self::getDefaultSettingsPresetId( $shortcode_name );
if ( $post_id ) {
delete_post_meta( $post_id, '_vc_default' );
}
if ( $id ) {
if ( is_numeric( $id ) ) {
// user preset
update_post_meta( $id, '_vc_default', true );
} else {
// vendor preset
$preset = vc_vendor_preset()->get( $id );
if ( ! $preset || $shortcode_name !== $preset['shortcode'] ) {
return false;
}
self::saveSettingsPreset( $preset['shortcode'], $preset['title'], wp_json_encode( $preset['params'] ), true );
}
}
return true;
}
/**
* Get mime type for specific shortcode
*
* @since 4.7
*
* @param $shortcode_name
*
* @return string
*/
public static function constructShortcodeMimeType( $shortcode_name ) {
return 'vc-settings-preset/' . str_replace( '_', '-', $shortcode_name );
}
/**
* Get shortcode name from post's mime type
*
* @since 4.7
*
* @param string $post_mime_type
*
* @return string
*/
public static function extractShortcodeMimeType( $post_mime_type ) {
$chunks = explode( '/', $post_mime_type );
if ( 2 !== count( $chunks ) ) {
return '';
}
return str_replace( '-', '_', $chunks[1] );
}
/**
* Get all presets
*
* @since 5.2
*
* @return array E.g. array(preset_id => value, preset_id => value, ...)
*/
public static function listAllPresets() {
$list = array();
$args = array(
'post_type' => 'vc_settings_preset',
'posts_per_page' => - 1,
);
// user presets
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$shortcode_name = self::extractShortcodeMimeType( $post->post_mime_type );
$list[ $post->ID ] = (array) json_decode( $post->post_content );
}
// vendor presets
$presets = self::listDefaultVendorSettingsPresets();
foreach ( $presets as $shortcode => $params ) {
if ( ! isset( $list[ $shortcode ] ) ) {
$list[ $shortcode ] = $params;
}
}
return $list;
}
/**
* Get all default presets
*
* @since 4.7
*
* @return array E.g. array(shortcode_name => value, shortcode_name => value, ...)
*/
public static function listDefaultSettingsPresets() {
$list = array();
$args = array(
'post_type' => 'vc_settings_preset',
'posts_per_page' => - 1,
'meta_key' => '_vc_default',
'meta_value' => true,
);
// user presets
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$shortcode_name = self::extractShortcodeMimeType( $post->post_mime_type );
$list[ $shortcode_name ] = (array) json_decode( $post->post_content );
}
// vendor presets
$presets = self::listDefaultVendorSettingsPresets();
foreach ( $presets as $shortcode => $params ) {
if ( ! isset( $list[ $shortcode ] ) ) {
$list[ $shortcode ] = $params;
}
}
return $list;
}
/**
* Get all default vendor presets
*
* @since 4.8
*
* @return array E.g. array(shortcode_name => value, shortcode_name => value, ...)
*/
public static function listDefaultVendorSettingsPresets() {
$list = array();
$presets = vc_vendor_preset()->getDefaults();
foreach ( $presets as $id => $preset ) {
$list[ $preset['shortcode'] ] = $preset['params'];
}
return $list;
}
/**
* Save shortcode preset
*
* @since 4.7
*
* @param string $shortcode_name
* @param string $title
* @param string $content
* @param boolean $is_default
*
* @return mixed int|false Post ID
*/
public static function saveSettingsPreset( $shortcode_name, $title, $content, $is_default = false ) {
$post_id = wp_insert_post( array(
'post_title' => $title,
'post_content' => $content,
'post_status' => 'publish',
'post_type' => 'vc_settings_preset',
'post_mime_type' => self::constructShortcodeMimeType( $shortcode_name ),
), false );
if ( $post_id && $is_default ) {
self::setAsDefaultSettingsPreset( $post_id, $shortcode_name );
}
return $post_id;
}
/**
* Get list of all presets for specific shortcode
*
* @since 4.7
*
* @param string $shortcode_name
*
* @return array E.g. array(id1 => title1, id2 => title2, ...)
*/
public static function listSettingsPresets( $shortcode_name = null ) {
$list = array();
if ( ! $shortcode_name ) {
return $list;
}
$args = array(
'post_type' => 'vc_settings_preset',
'orderby' => array( 'post_date' => 'DESC' ),
'posts_per_page' => - 1,
'post_mime_type' => self::constructShortcodeMimeType( $shortcode_name ),
);
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$list[ $post->ID ] = $post->post_title;
}
return $list;
}
/**
* Get list of all vendor presets for specific shortcode
*
* @since 4.8
*
* @param string $shortcode_name
*
* @return array E.g. array(id1 => title1, id2 => title2, ...)
*/
public static function listVendorSettingsPresets( $shortcode_name = null ) {
$list = array();
if ( ! $shortcode_name ) {
return $list;
}
$presets = vc_vendor_preset()->getAll( $shortcode_name );
foreach ( $presets as $id => $preset ) {
$list[ $id ] = $preset['title'];
}
return $list;
}
/**
* Get specific shortcode preset
*
* @since 4.7
*
* @param mixed $id Can be int (user preset) or string (vendor preset)
* @param bool $array If true, return array instead of string
*
* @return mixed string?array Post content
*/
public static function getSettingsPreset( $id, $array = false ) {
if ( is_numeric( $id ) ) {
// user preset
$post = get_post( $id );
if ( ! $post ) {
return false;
}
$params = $array ? (array) json_decode( $post->post_content ) : $post->post_content;
} else {
// vendor preset
$preset = vc_vendor_preset()->get( $id );
if ( ! $preset ) {
return false;
}
$params = $preset['params'];
}
return $params;
}
/**
* Delete shortcode preset
*
* @since 4.7
*
* @param int $post_id Post must be of type 'vc_settings_preset'
*
* @return bool
*/
public static function deleteSettingsPreset( $post_id ) {
$post = get_post( $post_id );
if ( ! $post || 'vc_settings_preset' !== $post->post_type ) {
return false;
}
return (bool) wp_delete_post( $post_id, true );
}
/**
* Return rendered popup menu
*
* @since 4.7
*
* @param string $shortcode_name
*
* @return string
*/
public static function getRenderedSettingsPresetPopup( $shortcode_name ) {
$list_vendor_presets = self::listVendorSettingsPresets( $shortcode_name );
$list_presets = self::listSettingsPresets( $shortcode_name );
$default_id = self::getDefaultSettingsPresetId( $shortcode_name );
if ( ! $default_id ) {
$default_id = vc_vendor_preset()->getDefaultId( $shortcode_name );
}
ob_start();
vc_include_template( apply_filters( 'vc_render_settings_preset_popup', 'editors/partials/settings_presets_popup.tpl.php' ), array(
'list_presets' => array(
$list_presets,
$list_vendor_presets,
),
'default_id' => $default_id,
'shortcode_name' => $shortcode_name,
) );
$html = ob_get_clean();
return $html;
}
/**
* @param $shortcodes
*
* @return array
* @throws \Exception
*/
public static function addVcPresetsToShortcodes( $shortcodes ) {
if ( vc_user_access()->part( 'presets' )->can()->get() ) {
$shortcodesAndPresets = array();
foreach ( $shortcodes as $shortcode ) {
$presets = self::listSettingsPresets( $shortcode['base'] );
$shortcodesAndPresets[ $shortcode['base'] ] = $shortcode;
if ( ! empty( $presets ) ) {
foreach ( $presets as $presetId => $preset ) {
$shortcodesAndPresets[ $presetId ] = array(
'name' => $preset,
'base' => $shortcode['base'],
'description' => $shortcode['description'],
'presetId' => $presetId,
'_category_ids' => array( '_my_elements_' ),
);
if ( isset( $shortcode['icon'] ) ) {
$shortcodesAndPresets[ $presetId ]['icon'] = $shortcode['icon'];
}
}
}
}
return $shortcodesAndPresets;
}
return $shortcodes;
}
/**
* @param $category
*
* @return array
*/
public static function addPresetCategory( $category ) {
$presetCategory = (array) '_my_elements_';
$category = array_merge( $presetCategory, $category );
return $category;
}
}
autoload/vc-pointers-frontend-editor.php 0000644 00000005070 15121635560 0014445 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Add WP ui pointers to backend editor.
*/
function vc_frontend_editor_pointer() {
vc_is_frontend_editor() && add_filter( 'vc-ui-pointers', 'vc_frontend_editor_register_pointer' );
}
add_action( 'admin_init', 'vc_frontend_editor_pointer' );
/**
* @param $pointers
* @return mixed
*/
function vc_frontend_editor_register_pointer( $pointers ) {
global $post;
if ( is_object( $post ) && ! strlen( $post->post_content ) ) {
$pointers['vc_pointers_frontend_editor'] = array(
'name' => 'vcPointerController',
'messages' => array(
array(
'target' => '#vc_add-new-element',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Add Elements', 'js_composer' ), esc_html__( 'Add new element or start with a template.', 'js_composer' ) ),
'position' => array(
'edge' => 'top',
'align' => 'left',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'closeEvent' => 'shortcodes:add',
),
array(
'target' => '.vc_controls-out-tl:first',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Rows and Columns', 'js_composer' ), esc_html__( 'This is a row container. Divide it into columns and style it. You can add elements into columns.', 'js_composer' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'closeCallback' => 'vcPointersCloseInIFrame',
'showCallback' => 'vcPointersSetInIFrame',
),
array(
'target' => '.vc_controls-cc:first',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s <br/><br/> %s</p>', esc_html__( 'Control Elements', 'js_composer' ), esc_html__( 'You can edit your element at any time and drag it around your layout.', 'js_composer' ), sprintf( esc_html__( 'P.S. Learn more at our %sKnowledge Base%s.', 'js_composer' ), '<a href="https://kb.wpbakery.com" target="_blank">', '</a>' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'closeCallback' => 'vcPointersCloseInIFrame',
'showCallback' => 'vcPointersSetInIFrame',
),
),
);
}
return $pointers;
}
function vc_page_editable_enqueue_pointer_scripts() {
if ( vc_is_page_editable() ) {
wp_enqueue_style( 'wp-pointer' );
wp_enqueue_script( 'wp-pointer' );
}
}
add_action( 'wp_enqueue_scripts', 'vc_page_editable_enqueue_pointer_scripts' );
autoload/hook-vc-grid.php 0000644 00000013715 15121635560 0011371 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Hooks_Vc_Grid
* @since 4.4
*/
class Vc_Hooks_Vc_Grid {
protected $grid_id_unique_name = 'vc_gid'; // if you change this also change in vc-basic-grid.php
/**
* Initializing hooks for grid element,
* Add actions to save appended shortcodes to post meta (for rendering in preview with shortcode id)
* And add action to hook request for grid data, to output it.
* @since 4.4
*/
public function load() {
// Hook for set post settings meta with shortcodes data
/**
* @since 4.4.3
*/
add_filter( 'vc_hooks_vc_post_settings', array(
$this,
'gridSavePostSettingsId',
), 10, 3 );
/**
* Used to output shortcode data for ajax request. called on any page request.
*/
add_action( 'wp_ajax_vc_get_vc_grid_data', array(
$this,
'getGridDataForAjax',
) );
add_action( 'wp_ajax_nopriv_vc_get_vc_grid_data', array(
$this,
'getGridDataForAjax',
) );
}
/**
* @return string
* @since 4.4.3
*/
private function getShortcodeRegexForId() {
return '\\[' // Opening bracket
. '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
. '([\\w\-_]+)' // 2: Shortcode name
. '(?![\\w\-])' // Not followed by word character or hyphen
. '(' // 3: Unroll the loop: Inside the opening shortcode tag
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. ')*?'
. '(?:' . '(' . $this->grid_id_unique_name // 4: GridId must exist
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. ')+' . ')'
. ')' . '(?:' . '(\\/)' // 5: Self closing tag ...
. '\\]' // ... and closing bracket
. '|' . '\\]' // Closing bracket
. '(?:' . '(' // 6: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
. '[^\\[]*+' // Not an opening bracket
. '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
. '[^\\[]*+' // Not an opening bracket
. ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag
. ')?' . ')' . '(\\]?)'; // 7: Optional second closing brocket for escaping shortcodes: [[tag]]
}
/**
* @param array $settings
* @param $post_id
* @param $post
*
* @return array
* @since 4.4.3
*
*/
public function gridSavePostSettingsId( array $settings, $post_id, $post ) {
$pattern = $this->getShortcodeRegexForId();
$content = stripslashes( $post->post_content );
preg_match_all( "/$pattern/", $content, $found ); // fetch only needed shortcodes
if ( is_array( $found ) && ! empty( $found[0] ) ) {
$to_save = array();
if ( isset( $found[1] ) && is_array( $found[1] ) ) {
foreach ( $found[1] as $key => $parse_able ) {
if ( empty( $parse_able ) || '[' !== $parse_able ) {
$id_pattern = '/' . $this->grid_id_unique_name . '\:([\w\-_]+)/';
$id_value = $found[4][ $key ];
preg_match( $id_pattern, $id_value, $id_matches );
if ( ! empty( $id_matches ) ) {
$id_to_save = $id_matches[1];
// why we need to check if shortcode is parse able?
// 1: if it is escaped it must not be displayed (parsed)
// 2: so if 1 is true it must not be saved in database meta
$shortcode_tag = $found[2][ $key ];
$shortcode_atts_string = $found[3][ $key ];
/** @var array $atts */
$atts = shortcode_parse_atts( $shortcode_atts_string );
$content = $found[6][ $key ];
$data = array(
'tag' => $shortcode_tag,
'atts' => $atts,
'content' => $content,
);
$to_save[ $id_to_save ] = $data;
}
}
}
}
if ( ! empty( $to_save ) ) {
$settings['vc_grid_id'] = array( 'shortcodes' => $to_save );
}
}
return $settings;
}
/**
* @throws \Exception
* @since 4.4
*
* @output/@return string - grid data for ajax request.
*/
public function getGridDataForAjax() {
$tag = str_replace( '.', '', vc_request_param( 'tag' ) );
$allowed = apply_filters( 'vc_grid_get_grid_data_access', vc_verify_public_nonce() && $tag, $tag );
if ( $allowed ) {
$shortcode_fishbone = visual_composer()->getShortCode( $tag );
if ( is_object( $shortcode_fishbone ) && vc_get_shortcode( $tag ) ) {
/** @var WPBakeryShortcode_Vc_Basic_Grid $vc_grid */
$vc_grid = $shortcode_fishbone->shortcodeClass();
if ( method_exists( $vc_grid, 'isObjectPageable' ) && $vc_grid->isObjectPageable() && method_exists( $vc_grid, 'renderAjax' ) ) {
// @codingStandardsIgnoreLine
$renderAjaxResponse = apply_filters( 'vc_get_vc_grid_data_response', $vc_grid->renderAjax( vc_request_param( 'data' ), $tag, $vc_grid ) );
wp_die( $renderAjaxResponse );
}
}
}
}
}
/**
* @since 4.4
* @var Vc_Hooks_Vc_Grid $hook
*/
$hook = new Vc_Hooks_Vc_Grid();
// when WPBakery Page Builder initialized let's trigger Vc_Grid hooks.
add_action( 'vc_after_init', array(
$hook,
'load',
) );
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Basic_Grid' );
add_filter( 'vc_edit_form_fields_attributes_vc_basic_grid', array(
'WPBakeryShortCode_Vc_Basic_Grid',
'convertButton2ToButton3',
) );
add_filter( 'vc_edit_form_fields_attributes_vc_media_grid', array(
'WPBakeryShortCode_Vc_Basic_Grid',
'convertButton2ToButton3',
) );
add_filter( 'vc_edit_form_fields_attributes_vc_masonry_grid', array(
'WPBakeryShortCode_Vc_Basic_Grid',
'convertButton2ToButton3',
) );
add_filter( 'vc_edit_form_fields_attributes_vc_masonry_media_grid', array(
'WPBakeryShortCode_Vc_Basic_Grid',
'convertButton2ToButton3',
) );
}
autoload/vc-grid-item-editor.php 0000644 00000022671 15121635560 0012654 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
global $vc_grid_item_editor;
/**
* Creates new post type for grid_editor.
*
* @since 4.4
*/
function vc_grid_item_editor_create_post_type() {
if ( is_admin() ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
Vc_Grid_Item_Editor::createPostType();
add_action( 'vc_menu_page_build', 'vc_gitem_add_submenu_page' );
// TODO: add check vendor is active
add_filter( 'vc_vendor_qtranslate_enqueue_js_backend', 'vc_vendor_qtranslate_enqueue_js_backend_grid_editor' );
}
}
/**
* @since 4.5
*/
function vc_vendor_qtranslate_enqueue_js_backend_grid_editor() {
return true;
}
/**
* Set required objects to render editor for grid item
*
* @since 4.4
*/
function vc_grid_item_editor_init() {
global $vc_grid_item_editor;
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-wpb-map-grid-item.php' );
$vc_grid_item_editor = new Vc_Grid_Item_Editor();
$vc_grid_item_editor->addMetaBox();
add_action( 'wp_ajax_vc_grid_item_editor_load_template_preview', array(
&$vc_grid_item_editor,
'renderTemplatePreview',
) );
$vc_grid_item_editor->addHooksSettings();
}
/**
* Render preview for grid item
* @since 4.4
*/
function vc_grid_item_render_preview() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( array(
'edit_post',
(int) vc_request_param( 'post_id' ),
) )->validateDie()->part( 'grid_builder' )->can()->validateDie();
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$grid_item->mapShortcodes();
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-preview.php' );
$vcGridPreview = new Vc_Grid_Item_Preview();
add_filter( 'vc_gitem_template_attribute_post_image_background_image_css_value', array(
$vcGridPreview,
'addCssBackgroundImage',
) );
add_filter( 'vc_gitem_template_attribute_post_image_url_value', array(
$vcGridPreview,
'addImageUrl',
) );
add_filter( 'vc_gitem_template_attribute_post_image_html', array(
$vcGridPreview,
'addImage',
) );
add_filter( 'vc_gitem_attribute_featured_image_img', array(
$vcGridPreview,
'addPlaceholderImage',
) );
add_filter( 'vc_gitem_post_data_get_link_real_link', array(
$vcGridPreview,
'disableRealContentLink',
), 10, 4 );
add_filter( 'vc_gitem_post_data_get_link_link', array(
$vcGridPreview,
'disableContentLink',
), 10, 3 );
add_filter( 'vc_gitem_zone_image_block_link', array(
$vcGridPreview,
'disableGitemZoneLink',
) );
$vcGridPreview->render();
die();
}
/**
* Map grid element shortcodes.
*
* @since 4.5
*/
function vc_grid_item_map_shortcodes() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$grid_item->mapShortcodes();
vc_mapper()->setCheckForAccess( false );
}
/**
* Get current post type
*
* @return null|string
*/
function vc_grid_item_get_post_type() {
$post_type = null;
if ( vc_request_param( 'post_type' ) ) {
$post_type = vc_request_param( 'post_type' );
} elseif ( vc_request_param( 'post' ) ) {
$post = get_post( vc_request_param( 'post' ) );
$post_type = $post instanceof WP_Post && $post->post_type ? $post->post_type : null;
}
return $post_type;
}
/**
* Check and Map grid element shortcodes if required.
* @since 4.5
*/
function vc_grid_item_editor_shortcodes() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
// TODO: remove this because mapping can be based on post_type
if ( ( 'true' === vc_request_param( 'vc_grid_item_editor' ) || ( is_admin() && vc_grid_item_get_post_type() === Vc_Grid_Item_Editor::postType() ) && vc_user_access()
->wpAny( 'edit_posts', 'edit_pages' )->part( 'grid_builder' )->can()->get() ) ) {
global $vc_grid_item_editor;
add_action( 'vc_user_access_check-shortcode_edit', array(
&$vc_grid_item_editor,
'accessCheckShortcodeEdit',
), 10, 2 );
add_action( 'vc_user_access_check-shortcode_all', array(
&$vc_grid_item_editor,
'accessCheckShortcodeAll',
), 10, 2 );
vc_grid_item_map_shortcodes();
}
}
/**
* add action in admin for vc grid item editor manager
*/
add_action( 'init', 'vc_grid_item_editor_create_post_type' );
add_action( 'admin_init', 'vc_grid_item_editor_init' );
add_action( 'vc_after_init', 'vc_grid_item_editor_shortcodes' );
/**
* Call preview as ajax request is called.
*/
add_action( 'wp_ajax_vc_gitem_preview', 'vc_grid_item_render_preview', 5 );
/**
* Add WP ui pointers in grid element editor.
*/
if ( is_admin() ) {
add_filter( 'vc_ui-pointers-vc_grid_item', 'vc_grid_item_register_pointer' );
}
/**
* @param $pointers
* @return mixed
*/
function vc_grid_item_register_pointer( $pointers ) {
$screen = get_current_screen();
if ( 'add' === $screen->action ) {
$pointers['vc_grid_item'] = array(
'name' => 'vcPointersController',
'messages' => array(
array(
'target' => '#vc_templates-editor-button',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Start Here!', 'js_composer' ), esc_html__( 'Start easy - use predefined template as a starting point and modify it.', 'js_composer' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
),
),
array(
'target' => '[data-vc-navbar-control="animation"]',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Use Animations', 'js_composer' ), esc_html__( 'Select animation preset for grid element. "Hover" state will be added next to the "Normal" state tab.', 'js_composer' ) ),
'position' => array(
'edge' => 'right',
'align' => 'center',
),
),
),
array(
'target' => '.vc_gitem_animated_block-shortcode',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Style Design Options', 'js_composer' ), esc_html__( 'Edit "Normal" state to set "Featured image" as a background, control zone sizing proportions and other design options (Height mode: Select "Original" to scale image without cropping).', 'js_composer' ) ),
'position' => array(
'edge' => 'bottom',
'align' => 'center',
),
),
),
array(
'target' => '[data-vc-gitem="add-c"][data-vc-position="top"]',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Extend Element', 'js_composer' ), esc_html__( 'Additional content zone can be added to grid element edges (Note: This zone can not be animated).', 'js_composer' ) ) . '<p><img src="' . esc_url( vc_asset_url( 'vc/gb_additional_content.png' ) ) . '" alt="" /></p>',
'position' => array(
'edge' => 'right',
'align' => 'center',
),
),
),
array(
'target' => '#wpadminbar',
'options' => array(
'content' => sprintf( '<h3> %s </h3> %s', esc_html__( 'Watch Video Tutorial', 'js_composer' ), '<p>' . esc_html__( 'Have a look how easy it is to work with grid element builder.', 'js_composer' ) . '</p>' . '<iframe width="500" height="281" src="https://www.youtube.com/embed/sBvEiIL6Blo" frameborder="0" allowfullscreen></iframe>' ),
'position' => array(
'edge' => 'top',
'align' => 'center',
),
'pointerClass' => 'vc_gitem-animated-block-pointer-video',
'pointerWidth' => '530',
),
),
),
);
}
return $pointers;
}
/**
* @return array|mixed|void
*/
function vc_gitem_content_shortcodes() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$invalid_shortcodes = apply_filters( 'vc_gitem_zone_grid_item_not_content_shortcodes', array(
'vc_gitem',
'vc_gitem_animated_block',
'vc_gitem_zone',
'vc_gitem_zone_a',
'vc_gitem_zone_b',
'vc_gitem_zone_c',
'vc_gitem_row',
'vc_gitem_col',
) );
return array_diff( array_keys( $grid_item->shortcodes() ), $invalid_shortcodes );
}
/**
* @param $content
* @return false|int
*/
function vc_gitem_has_content( $content ) {
$tags = vc_gitem_content_shortcodes();
$regexp = vc_get_shortcode_regex( implode( '|', $tags ) );
return preg_match( '/' . $regexp . '/', $content );
}
/**
* Add sub page to WPBakery Page Builder pages
*
* @since 4.5
*/
function vc_gitem_add_submenu_page() {
if ( vc_user_access()->part( 'grid_builder' )->can()->get() ) {
$labels = Vc_Grid_Item_Editor::getPostTypesLabels();
add_submenu_page( VC_PAGE_MAIN_SLUG, $labels['name'], $labels['name'], 'edit_posts', 'edit.php?post_type=' . rawurlencode( Vc_Grid_Item_Editor::postType() ), '' );
}
}
/**
* Highlight Vc submenu.
* @since 4.5
*/
function vc_gitem_menu_highlight() {
global $parent_file, $submenu_file, $post_type;
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
if ( Vc_Grid_Item_Editor::postType() === $post_type && defined( 'VC_PAGE_MAIN_SLUG' ) ) {
$parent_file = VC_PAGE_MAIN_SLUG;
$submenu_file = 'edit.php?post_type=' . rawurlencode( Vc_Grid_Item_Editor::postType() );
}
}
add_action( 'admin_head', 'vc_gitem_menu_highlight' );
function vc_gitem_set_mapper_check_access() {
if ( vc_user_access()->checkAdminNonce()->wpAny( 'edit_posts', 'edit_pages' )->part( 'grid_builder' )->can()->get() && 'true' === vc_post_param( 'vc_grid_item_editor' ) ) {
vc_mapper()->setCheckForAccess( false );
}
}
add_action( 'wp_ajax_vc_edit_form', 'vc_gitem_set_mapper_check_access' );
autoload/post-type-default-template.php 0000644 00000013704 15121635560 0014275 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Return true value for filter 'wpb_vc_js_status_filter'.
* It allows to start backend editor on load.
* @return string
* @since 4.12
*
*/
function vc_set_default_content_for_post_type_wpb_vc_js_status_filter() {
return 'true';
}
/**
* Set default content by post type in editor.
*
* Data for post type templates stored in settings.
*
* @param $post_content
* @param $post
* @return null
* @throws \Exception
* @since 4.12
*
*/
function vc_set_default_content_for_post_type( $post_content, $post ) {
if ( ! empty( $post_content ) || ! vc_backend_editor()->isValidPostType( $post->post_type ) ) {
return $post_content;
}
$template_settings = new Vc_Setting_Post_Type_Default_Template_Field( 'general', 'default_template_post_type' );
$new_post_content = $template_settings->getTemplateByPostType( $post->post_type );
if ( null !== $new_post_content ) {
add_filter( 'wpb_vc_js_status_filter', 'vc_set_default_content_for_post_type_wpb_vc_js_status_filter' );
return $new_post_content;
}
return $post_content;
}
/**
* Default template for post types manager
*
* Class Vc_Setting_Post_Type_Default_Template_Field
*
* @since 4.12
*/
class Vc_Setting_Post_Type_Default_Template_Field {
protected $tab;
protected $key;
protected $post_types = false;
/**
* Vc_Setting_Post_Type_Default_Template_Field constructor.
* @param $tab
* @param $key
*/
public function __construct( $tab, $key ) {
$this->tab = $tab;
$this->key = $key;
add_action( 'vc_settings_tab-general', array(
$this,
'addField',
) );
}
/**
* @return string
*/
protected function getFieldName() {
return esc_html__( 'Default template for post types', 'js_composer' );
}
/**
* @return string
*/
protected function getFieldKey() {
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-settings.php' );
return Vc_Settings::getFieldPrefix() . $this->key;
}
/**
* @param $type
* @return bool
*/
protected function isValidPostType( $type ) {
return post_type_exists( $type );
}
/**
* @return array|bool
*/
protected function getPostTypes() {
if ( false === $this->post_types ) {
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' );
$vc_roles = new Vc_Roles();
$this->post_types = $vc_roles->getPostTypes();
}
return $this->post_types;
}
/**
* @return array
*/
protected function getTemplates() {
return $this->getTemplatesEditor()->getAllTemplates();
}
/**
* @return bool|\Vc_Templates_Panel_Editor
*/
protected function getTemplatesEditor() {
return visual_composer()->templatesPanelEditor();
}
/**
* Get settings data for default templates
*
* @return array|mixed
*/
protected function get() {
require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-settings.php' );
$value = Vc_Settings::get( $this->key );
return $value ? $value : array();
}
/**
* Get template's shortcodes string
*
* @param $template_data
* @return string|null
*/
protected function getTemplate( $template_data ) {
$template = null;
$template_settings = preg_split( '/\:\:/', $template_data );
$template_id = $template_settings[1];
$template_type = $template_settings[0];
if ( ! isset( $template_id, $template_type ) || '' === $template_id || '' === $template_type ) {
return $template;
}
WPBMap::addAllMappedShortcodes();
if ( 'my_templates' === $template_type ) {
$saved_templates = get_option( $this->getTemplatesEditor()->getOptionName() );
$content = trim( $saved_templates[ $template_id ]['template'] );
$content = str_replace( '\"', '"', $content );
$pattern = get_shortcode_regex();
$template = preg_replace_callback( "/{$pattern}/s", 'vc_convert_shortcode', $content );
} else {
if ( 'default_templates' === $template_type ) {
$template_data = $this->getTemplatesEditor()->getDefaultTemplate( (int) $template_id );
if ( isset( $template_data['content'] ) ) {
$template = $template_data['content'];
}
} else {
$template_preview = apply_filters( 'vc_templates_render_backend_template_preview', $template_id, $template_type );
if ( (string) $template_preview !== (string) $template_id ) {
$template = $template_preview;
}
}
}
return $template;
}
/**
* @param $type
* @return string|null
*/
public function getTemplateByPostType( $type ) {
$value = $this->get();
return isset( $value[ $type ] ) ? $this->getTemplate( $value[ $type ] ) : null;
}
/**
* @param $settings
* @return mixed
*/
public function sanitize( $settings ) {
foreach ( $settings as $type => $template ) {
if ( empty( $template ) ) {
unset( $settings[ $type ] );
} elseif ( ! $this->isValidPostType( $type ) || ! $this->getTemplate( $template ) ) {
add_settings_error( $this->getFieldKey(), 1, esc_html__( 'Invalid template or post type.', 'js_composer' ), 'error' );
return $settings;
}
}
return $settings;
}
public function render() {
vc_include_template( 'pages/vc-settings/default-template-post-type.tpl.php', array(
'post_types' => $this->getPostTypes(),
'templates' => $this->getTemplates(),
'title' => $this->getFieldName(),
'value' => $this->get(),
'field_key' => $this->getFieldKey(),
) );
}
/**
* Add field settings page
*
* Method called by vc hook vc_settings_tab-general.
*/
public function addField() {
vc_settings()->addField( $this->tab, $this->getFieldName(), $this->key, array(
$this,
'sanitize',
), array(
$this,
'render',
) );
}
}
/**
* Start only for admin part with hooks
*/
if ( is_admin() ) {
/**
* Initialize Vc_Setting_Post_Type_Default_Template_Field
* Called by admin_init hook
*/
function vc_settings_post_type_default_template_field_init() {
new Vc_Setting_Post_Type_Default_Template_Field( 'general', 'default_template_post_type' );
}
add_filter( 'default_content', 'vc_set_default_content_for_post_type', 100, 2 );
add_action( 'admin_init', 'vc_settings_post_type_default_template_field_init', 8 );
}
autoload/hook-vc-wp-text.php 0000644 00000000523 15121635560 0012045 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Wp_Text' );
add_filter( 'vc_edit_form_fields_attributes_vc_wp_text', array(
'WPBakeryShortCode_Vc_Wp_Text',
'convertTextAttributeToContent',
) );
}
autoload/vc-pointers-backend-editor.php 0000644 00000006104 15121635560 0014214 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Add WP ui pointers to backend editor.
*/
function vc_add_admin_pointer() {
if ( is_admin() ) {
foreach ( vc_editor_post_types() as $post_type ) {
add_filter( 'vc_ui-pointers-' . $post_type, 'vc_backend_editor_register_pointer' );
}
}
}
add_action( 'admin_init', 'vc_add_admin_pointer' );
/**
* @param $pointers
* @return mixed
*/
function vc_backend_editor_register_pointer( $pointers ) {
$screen = get_current_screen();
$block = false;
if ( method_exists( $screen, 'is_block_editor' ) ) {
if ( $screen->is_block_editor() ) {
$block = true;
}
}
if ( ! $block || 'add' === $screen->action ) {
$pointers['vc_pointers_backend_editor'] = array(
'name' => 'vcPointerController',
'messages' => array(
array(
'target' => '.composer-switch',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Welcome to WPBakery Page Builder', 'js_composer' ), esc_html__( 'Choose Backend or Frontend editor.', 'js_composer' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
),
array(
'target' => '#vc_templates-editor-button, #vc-templatera-editor-button',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Add Elements', 'js_composer' ), esc_html__( 'Add new element or start with a template.', 'js_composer' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'closeEvent' => 'shortcodes:vc_row:add',
'showEvent' => 'backendEditor.show',
),
array(
'target' => '[data-vc-control="add"]:first',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s </p>', esc_html__( 'Rows and Columns', 'js_composer' ), esc_html__( 'This is a row container. Divide it into columns and style it. You can add elements into columns.', 'js_composer' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'closeEvent' => 'click #wpb_visual_composer',
'showEvent' => 'shortcodeView:ready',
),
array(
'target' => '.wpb_column_container:first .wpb_content_element:first .vc_controls-cc',
'options' => array(
'content' => sprintf( '<h3> %s </h3> <p> %s <br/><br/> %s</p>', esc_html__( 'Control Elements', 'js_composer' ), esc_html__( 'You can edit your element at any time and drag it around your layout.', 'js_composer' ), sprintf( esc_html__( 'P.S. Learn more at our %sKnowledge Base%s.', 'js_composer' ), '<a href="https://kb.wpbakery.com" target="_blank">', '</a>' ) ),
'position' => array(
'edge' => 'left',
'align' => 'center',
),
'buttonsEvent' => 'vcPointersEditorsTourEvents',
),
'showCallback' => 'vcPointersShowOnContentElementControls',
'closeEvent' => 'click #wpb_visual_composer',
),
),
);
}
return $pointers;
}
autoload/class-vc-vendor-presets.php 0000644 00000004756 15121635560 0013576 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Singleton to hold all vendor presets
*
* @since 4.8
*/
class Vc_Vendor_Preset {
private static $instance;
private static $presets = array();
/**
* @return \Vc_Vendor_Preset
*/
public static function getInstance() {
if ( ! self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
protected function __construct() {
}
/**
* Add vendor preset to collection
*
* @param string $title
* @param string $shortcode
* @param array $params
* @param bool $default
*
* @return bool
* @since 4.8
*
*/
public function add( $title, $shortcode, $params, $default = false ) {
if ( ! $title || ! is_string( $title ) || ! $shortcode || ! is_string( $shortcode ) || ! $params || ! is_array( $params ) ) {
return false;
}
$preset = array(
'shortcode' => $shortcode,
'default' => $default,
'params' => $params,
'title' => $title,
);
// @codingStandardsIgnoreLine
$id = md5( serialize( $preset ) );
self::$presets[ $id ] = $preset;
return true;
}
/**
* Get specific vendor preset
*
* @param string $id
*
* @return mixed array|false
* @since 4.8
*
*/
public function get( $id ) {
if ( isset( self::$presets[ $id ] ) ) {
return self::$presets[ $id ];
}
return false;
}
/**
* Get all vendor presets for specific shortcode
*
* @param string $shortcode
*
* @return array
* @since 4.8
*
*/
public function getAll( $shortcode ) {
$list = array();
foreach ( self::$presets as $id => $preset ) {
if ( $shortcode === $preset['shortcode'] ) {
$list[ $id ] = $preset;
}
}
return $list;
}
/**
* Get all default vendor presets
*
* Include only one default preset per shortcode
*
* @return array
* @since 4.8
*
*/
public function getDefaults() {
$list = array();
$added = array();
foreach ( self::$presets as $id => $preset ) {
if ( $preset['default'] && ! in_array( $preset['shortcode'], $added, true ) ) {
$added[] = $preset['shortcode'];
$list[ $id ] = $preset;
}
}
return $list;
}
/**
* Get ID of default preset for specific shortcode
*
* If multiple presets are default, return first
*
* @param string $shortcode
*
* @return string|null
* @since 4.8
*
*/
public function getDefaultId( $shortcode ) {
foreach ( self::$presets as $id => $preset ) {
if ( $shortcode === $preset['shortcode'] && $preset['default'] ) {
return $id;
}
}
return null;
}
}
autoload/bc-access-rules-4.8.php 0000644 00000013753 15121635560 0012364 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// Part BC: Post types
// =========================
/**
* @param $state
* @return bool|string
*/
function vc_bc_access_rule_48_post_type_get_state( $state ) {
if ( null === $state ) {
$content_types = vc_settings()->get( 'content_types' );
if ( empty( $content_types ) ) {
$state = true;
} else {
$state = 'custom';
}
}
return $state;
}
/**
* @param $value
* @param $role
* @param $rule
* @return bool
* @throws \Exception
*/
function vc_bc_access_rule_48_post_type_rule( $value, $role, $rule ) {
if ( ! $role ) {
return $value;
}
global $vc_bc_access_rule_48_editor_post_types;
$part = vc_role_access()->who( $role->name )->part( 'post_types' );
if ( ! isset( $part->getRole()->capabilities[ $part->getStateKey() ] ) ) {
if ( is_null( $vc_bc_access_rule_48_editor_post_types ) ) {
$pt_array = vc_settings()->get( 'content_types' );
$vc_bc_access_rule_48_editor_post_types = $pt_array ? $pt_array : vc_default_editor_post_types();
}
return in_array( $rule, $vc_bc_access_rule_48_editor_post_types, true );
}
return $value;
}
// Part BC: shortcodes
// =========================
/**
* @param $state
* @param $role
* @return bool|string
*/
function vc_bc_access_rule_48_shortcodes_get_state( $state, $role ) {
if ( ! $role ) {
return $state;
}
if ( null === $state ) {
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
if ( ! isset( $group_access_settings[ $role->name ]['shortcodes'] ) ) {
$state = true;
} else {
$state = 'custom';
}
}
return $state;
}
/**
* @param $value
* @param $role
* @param $rule
* @return bool
* @throws \Exception
*/
function vc_bc_access_rule_48_shortcodes_rule( $value, $role, $rule ) {
if ( ! $role ) {
return $value;
}
if ( ! vc_bc_access_get_shortcodes_state_is_set( $role ) ) {
if ( preg_match( '/_edit$/', $rule ) ) {
return false;
}
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
if ( isset( $group_access_settings[ $role->name ]['shortcodes'] ) && ! empty( $group_access_settings[ $role->name ]['shortcodes'] ) ) {
$rule = preg_replace( '/_all$/', '', $rule );
return 'vc_row' === $rule || ( isset( $group_access_settings[ $role->name ]['shortcodes'][ $rule ] ) && 1 === (int) $group_access_settings[ $role->name ]['shortcodes'][ $rule ] );
} else {
return true;
}
}
return $value;
}
/**
* Check is state set
*
* @param $role
*
* @return bool
* @throws \Exception
*/
function vc_bc_access_get_shortcodes_state_is_set( $role ) {
if ( ! $role ) {
return false;
}
$part = vc_role_access()->who( $role->name )->part( 'shortcodes' );
return isset( $part->getRole()->capabilities[ $part->getStateKey() ] );
}
// Part BC: backened editor
// ===========================
/**
* @param $state
* @param $role
* @return bool|string
*/
function vc_bc_access_rule_48_backend_editor_get_state( $state, $role ) {
if ( ! $role ) {
return $state;
}
if ( null === $state ) {
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
if ( ! isset( $group_access_settings[ $role->name ]['show'] ) || 'all' === $group_access_settings[ $role->name ]['show'] ) {
$state = true;
} elseif ( 'no' === $group_access_settings[ $role->name ]['show'] ) {
$state = false;
} else {
$state = 'default';
}
}
return $state;
}
/**
* @param $state
* @param $role
* @return bool
*/
function vc_bc_access_rule_48_frontend_editor_get_state( $state, $role ) {
if ( ! $role ) {
return $state;
}
if ( null === $state ) {
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
if ( isset( $group_access_settings[ $role->name ]['show'] ) && 'no' === $group_access_settings[ $role->name ]['show'] ) {
$state = false;
} else {
$state = true;
}
}
return $state;
}
/**
* @param $value
* @param $role
* @return bool
* @throws \Exception
*/
function vc_bc_access_rule_48_backend_editor_can_disabled_ce_editor_rule( $value, $role ) {
if ( ! $role ) {
return $value;
}
$part = vc_role_access()->who( $role->name )->part( 'backend_editor' );
if ( ! isset( $part->getRole()->capabilities[ $part->getStateKey() ] ) ) {
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
return isset( $group_access_settings[ $role->name ]['show'] ) && 'only' === $group_access_settings[ $role->name ]['show'];
}
return $value;
}
/**
* @param $role
* @return mixed
* @throws \Exception
*/
function vc_bc_access_rule_48_backend_editor_add_cap_disabled_ce_editor( $role ) {
if ( ! $role ) {
return $role;
}
$part = vc_role_access()->who( $role->name )->part( 'backend_editor' );
if ( ! isset( $part->getRole()->capabilities[ $part->getStateKey() ] ) ) {
$group_access_settings = vc_settings()->get( 'groups_access_rules' );
if ( isset( $group_access_settings[ $role->name ]['show'] ) && 'only' === $group_access_settings[ $role->name ]['show'] ) {
$role->capabilities[ $part->getStateKey() . '/disabled_ce_editor' ] = true;
}
}
return $role;
}
function vc_bc_access_rule_48() {
add_filter( 'vc_role_access_with_post_types_get_state', 'vc_bc_access_rule_48_post_type_get_state' );
add_filter( 'vc_role_access_with_post_types_can', 'vc_bc_access_rule_48_post_type_rule', 10, 3 );
add_filter( 'vc_role_access_with_shortcodes_get_state', 'vc_bc_access_rule_48_shortcodes_get_state', 10, 3 );
add_filter( 'vc_role_access_with_shortcodes_can', 'vc_bc_access_rule_48_shortcodes_rule', 10, 3 );
add_filter( 'vc_role_access_with_backend_editor_get_state', 'vc_bc_access_rule_48_backend_editor_get_state', 10, 3 );
add_filter( 'vc_role_access_with_backend_editor_can_disabled_ce_editor', 'vc_bc_access_rule_48_backend_editor_can_disabled_ce_editor_rule', 10, 2 );
add_filter( 'vc_role_access_with_frontend_editor_get_state', 'vc_bc_access_rule_48_frontend_editor_get_state', 10, 3 );
add_filter( 'vc_role_access_all_caps_role', 'vc_bc_access_rule_48_backend_editor_add_cap_disabled_ce_editor' );
}
// BC function for shortcode
add_action( 'vc_before_init', 'vc_bc_access_rule_48' );
autoload/vendors/rankmath-seo.php 0000644 00000001303 15121635560 0013137 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
function vc_rank_math_seo_image_filter( $images, $id ) {
if ( empty( $images ) ) {
$post = get_post( $id );
if ( $post && strpos( $post->post_content, '[vc_row' ) !== false ) {
preg_match_all( '/(?:image|images|ids|include)\=\"([^\"]+)\"/', $post->post_content, $matches );
foreach ( $matches[1] as $m ) {
$ids = explode( ',', $m );
foreach ( $ids as $id ) {
if ( (int) $id ) {
$images[] = array(
'src' => wp_get_attachment_url( $id ),
'title' => get_the_title( $id ),
);
}
}
}
}
}
return $images;
}
add_filter( 'rank_math/sitemap/urlimages', 'vc_rank_math_seo_image_filter', 10, 2 );
autoload/vendors/mqtranslate.php 0000644 00000001345 15121635560 0013107 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin mqtranslate vendor
*/
add_action( 'plugins_loaded', 'vc_init_vendor_mqtranslate' );
function vc_init_vendor_mqtranslate() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'mqtranslate/mqtranslate.php' ) || function_exists( 'mqtranslate_activation_check' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-mqtranslate.php' );
$vendor = new Vc_Vendor_Mqtranslate();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/layerslider.php 0000644 00000001271 15121635560 0013071 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin layerslider vendor.
*/
add_action( 'plugins_loaded', 'vc_init_vendor_layerslider' );
function vc_init_vendor_layerslider() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'LayerSlider/layerslider.php' ) || class_exists( 'LS_Sliders' ) || defined( 'LS_ROOT_PATH' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-layerslider.php' );
$vendor = new Vc_Vendor_Layerslider();
$vendor->load();
}
}
autoload/vendors/yoast_seo.php 0000644 00000001715 15121635560 0012562 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin yoast vendor.
*/
// 16 is required to be called after WPSEO_Admin_Init constructor. @since 4.9
add_action( 'plugins_loaded', 'vc_init_vendor_yoast', 16 );
function vc_init_vendor_yoast() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) || class_exists( 'WPSEO_Metabox' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-yoast_seo.php' );
$vendor = new Vc_Vendor_YoastSeo();
if ( defined( 'WPSEO_VERSION' ) && version_compare( WPSEO_VERSION, '3.0.0' ) === - 1 ) {
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
} elseif ( is_admin() && 'vc_inline' === vc_action() ) {
$vendor->frontendEditorBuild();
}
}
}
autoload/vendors/gravity_forms.php 0000644 00000007203 15121635560 0013446 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to add gravity forms shortcode into WPBakery Page Builder
*/
add_action( 'plugins_loaded', 'vc_init_vendor_gravity_forms' );
function vc_init_vendor_gravity_forms() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'gravityforms/gravityforms.php' ) || class_exists( 'RGForms' ) || class_exists( 'RGFormsModel' ) ) {
// Call on map
add_action( 'vc_after_init', 'vc_vendor_gravityforms_load' );
} // if gravityforms active
}
function vc_vendor_gravityforms_load() {
$gravity_forms_array[ esc_html__( 'No Gravity forms found.', 'js_composer' ) ] = '';
$gravity_forms = array();
if ( class_exists( 'RGFormsModel' ) && 'vc_edit_form' === vc_request_param( 'action' ) ) {
/** @noinspection PhpUndefinedClassInspection */
$gravity_forms = RGFormsModel::get_forms( 1, 'title' );
if ( $gravity_forms ) {
$gravity_forms_array = array( esc_html__( 'Select a form to display.', 'js_composer' ) => '' );
foreach ( $gravity_forms as $gravity_form ) {
$gravity_forms_array[ $gravity_form->title ] = $gravity_form->id;
}
}
}
vc_map( array(
'name' => esc_html__( 'Gravity Form', 'js_composer' ),
'base' => 'gravityform',
'icon' => 'icon-wpb-vc_gravityform',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place Gravity form', 'js_composer' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Form', 'js_composer' ),
'param_name' => 'id',
'value' => $gravity_forms_array,
'save_always' => true,
'description' => esc_html__( 'Select a form to add it to your post or page.', 'js_composer' ),
'admin_label' => true,
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Display Form Title', 'js_composer' ),
'param_name' => 'title',
'value' => array(
esc_html__( 'No', 'js_composer' ) => 'false',
esc_html__( 'Yes', 'js_composer' ) => 'true',
),
'save_always' => true,
'description' => esc_html__( 'Would you like to display the forms title?', 'js_composer' ),
'dependency' => array(
'element' => 'id',
'not_empty' => true,
),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Display Form Description', 'js_composer' ),
'param_name' => 'description',
'value' => array(
esc_html__( 'No', 'js_composer' ) => 'false',
esc_html__( 'Yes', 'js_composer' ) => 'true',
),
'save_always' => true,
'description' => esc_html__( 'Would you like to display the forms description?', 'js_composer' ),
'dependency' => array(
'element' => 'id',
'not_empty' => true,
),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Enable AJAX?', 'js_composer' ),
'param_name' => 'ajax',
'value' => array(
esc_html__( 'No', 'js_composer' ) => 'false',
esc_html__( 'Yes', 'js_composer' ) => 'true',
),
'save_always' => true,
'description' => esc_html__( 'Enable AJAX submission?', 'js_composer' ),
'dependency' => array(
'element' => 'id',
'not_empty' => true,
),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Tab Index', 'js_composer' ),
'param_name' => 'tabindex',
'description' => esc_html__( '(Optional) Specify the starting tab index for the fields of this form. Leave blank if you\'re not sure what this is.', 'js_composer' ),
'dependency' => array(
'element' => 'id',
'not_empty' => true,
),
),
),
) );
}
autoload/vendors/qtranslate.php 0000644 00000001322 15121635560 0012725 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin qtranslate vendor.
*/
add_action( 'plugins_loaded', 'vc_init_vendor_qtranslate' );
function vc_init_vendor_qtranslate() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'qtranslate/qtranslate.php' ) || defined( 'QT_SUPPORTED_WP_VERSION' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-qtranslate.php' );
$vendor = new Vc_Vendor_Qtranslate();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/jwplayer.php 0000644 00000001110 15121635560 0012377 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin jwplayer vendor for frontend editor.
*/
add_action( 'plugins_loaded', 'vc_init_vendor_jwplayer' );
function vc_init_vendor_jwplayer() {
if ( is_plugin_active( 'jw-player-plugin-for-wordpress/jwplayermodule.php' ) || defined( 'JWP6' ) || class_exists( 'JWP6_Plugin' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-jwplayer.php' );
$vendor = new Vc_Vendor_Jwplayer();
$vendor->load();
}
}
autoload/vendors/shortcode-vc-gutenberg.php 0000644 00000003017 15121635560 0015132 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return array(
'name' => esc_html__( 'Gutenberg Editor', 'js_composer' ),
'icon' => 'vc_icon-vc-gutenberg',
'wrapper_class' => 'clearfix',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Insert Gutenberg editor in your layout', 'js_composer' ),
'weight' => - 10,
'params' => array(
array(
'type' => 'gutenberg',
'holder' => 'div',
'heading' => esc_html__( 'Text', 'js_composer' ),
'param_name' => 'content',
'value' => '<!-- wp:paragraph --><p>Hello! This is the Gutenberg block you can edit directly from the WPBakery Page Builder.</p><!-- /wp:paragraph -->',
),
vc_map_add_css_animation(),
array(
'type' => 'el_id',
'heading' => esc_html__( 'Element ID', 'js_composer' ),
'param_name' => 'el_id',
'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'js_composer' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
array(
'type' => 'css_editor',
'heading' => esc_html__( 'CSS box', 'js_composer' ),
'param_name' => 'css',
'group' => esc_html__( 'Design Options', 'js_composer' ),
),
),
);
autoload/vendors/acf.php 0000644 00000002034 15121635560 0011301 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize advanced custom fields vendor.
*/
add_action( 'acf/init', 'vc_init_vendor_acf' ); // pro version
add_action( 'acf/register_fields', 'vc_init_vendor_acf' ); // free version
add_action( 'plugins_loaded', 'vc_init_vendor_acf' );
add_action( 'after_setup_theme', 'vc_init_vendor_acf' ); // for themes
function vc_init_vendor_acf() {
if ( did_action( 'vc-vendor-acf-load' ) ) {
return;
}
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( class_exists( 'acf' ) || is_plugin_active( 'advanced-custom-fields/acf.php' ) || is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-advanced-custom-fields.php' );
$vendor = new Vc_Vendor_AdvancedCustomFields();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/woocommerce.php 0000644 00000004000 15121635560 0013062 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Add script for grid item add to card link
*
* @since 4.5
*/
function vc_woocommerce_add_to_cart_script() {
if ( 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ) {
wp_enqueue_script( 'vc_woocommerce-add-to-cart-js', vc_asset_url( 'js/vendors/woocommerce-add-to-cart.js' ), array( 'wc-add-to-cart' ), WPB_VC_VERSION );
}
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin WooCommerce vendor. (adds tons of WooCommerce shortcodes and some fixes)
*/
add_action( 'plugins_loaded', 'vc_init_vendor_woocommerce' );
function vc_init_vendor_woocommerce() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) || class_exists( 'WooCommerce' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-woocommerce.php' );
$vendor = new Vc_Vendor_Woocommerce();
add_action( 'vc_before_init', array(
$vendor,
'load',
), 0 );
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/woocommerce/grid-item-filters.php' );
// Add 'add to card' link to the list of Add link.
add_filter( 'vc_gitem_add_link_param', 'vc_gitem_add_link_param_woocommerce' );
// Filter to add link attributes for grid element shortcode.
add_filter( 'vc_gitem_post_data_get_link_link', 'vc_gitem_post_data_get_link_link_woocommerce', 10, 3 );
add_filter( 'vc_gitem_post_data_get_link_target', 'vc_gitem_post_data_get_link_target_woocommerce', 12, 2 );
add_filter( 'vc_gitem_post_data_get_link_real_link', 'vc_gitem_post_data_get_link_real_link_woocommerce', 10, 4 );
add_filter( 'vc_gitem_post_data_get_link_real_target', 'vc_gitem_post_data_get_link_real_target_woocommerce', 12, 3 );
add_filter( 'vc_gitem_zone_image_block_link', 'vc_gitem_zone_image_block_link_woocommerce', 10, 3 );
add_action( 'wp_enqueue_scripts', 'vc_woocommerce_add_to_cart_script' );
}
}
autoload/vendors/wpml.php 0000644 00000000574 15121635560 0011536 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_action( 'plugins_loaded', 'vc_init_vendor_wpml' );
function vc_init_vendor_wpml() {
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-wpml.php' );
$vendor = new Vc_Vendor_WPML();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/gutenberg.php 0000644 00000007034 15121635560 0012537 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @param $post
* @return bool
*/
function vcv_disable_gutenberg_for_classic_editor( $post ) {
return false;
}
/**
* @param \Vc_Settings $settings
*/
function vc_gutenberg_add_settings( $settings ) {
global $wp_version;
if ( function_exists( 'the_gutenberg_project' ) || version_compare( $wp_version, '4.9.8', '>' ) ) {
$settings->addField( 'general', esc_html__( 'Disable Gutenberg Editor', 'js_composer' ), 'gutenberg_disable', 'vc_gutenberg_sanitize_disable_callback', 'vc_gutenberg_disable_render_callback' );
}
}
/**
* @param $rules
*
* @return mixed
*/
function vc_gutenberg_sanitize_disable_callback( $rules ) {
return (bool) $rules;
}
/**
* Not responsive checkbox callback function
*/
function vc_gutenberg_disable_render_callback() {
$checked = ( $checked = get_option( 'wpb_js_gutenberg_disable' ) ) ? $checked : false;
?>
<label>
<input type="checkbox"<?php echo esc_attr( $checked ) ? ' checked' : ''; ?> value="1"
name="<?php echo 'wpb_js_gutenberg_disable' ?>">
<?php esc_html_e( 'Disable', 'js_composer' ) ?>
</label><br/>
<p
class="description indicator-hint"><?php esc_html_e( 'Disable Gutenberg Editor.', 'js_composer' ); ?></p>
<?php
}
/**
* @param $result
* @param $postType
* @return bool
*/
function vc_gutenberg_check_disabled( $result, $postType ) {
global $pagenow;
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
// we are in single post type editing
if ( isset( $_GET['classic-editor'] ) && ! isset( $_GET['classic-editor__forget'] ) ) {
return false;
}
if ( isset( $_GET['classic-editor__forget'] ) ) {
return true;
}
if ( 'wpb_gutenberg_param' === $postType ) {
return true;
}
if ( ! isset( $_GET['vcv-gutenberg-editor'] ) && ( get_option( 'wpb_js_gutenberg_disable' ) || vc_is_wpb_content() || isset( $_GET['classic-editor'] ) ) ) {
return false;
}
}
return $result;
}
/**
* @param $result
* @param $postType
* @return bool
*/
function vc_gutenberg_check_disabled_regular( $editors, $postType ) {
if ( 'wpb_gutenberg_param' === $postType ) {
$editors['gutenberg_editor'] = false;
}
if ( ! isset( $_GET['vcv-gutenberg-editor'] ) && ( get_option( 'wpb_js_gutenberg_disable' ) || vc_is_wpb_content() || isset( $_GET['classic-editor'] ) ) ) {
$editors['gutenberg_editor'] = false;
$editors['classic_editor'] = false;
}
return $editors;
}
function vc_classic_editor_post_states( $state ) {
if ( vc_is_wpb_content() ) {
unset( $state['classic-editor-plugin'] );
}
return $state;
}
/**
* @return bool
*/
function vc_is_wpb_content() {
$post = get_post();
if ( ! empty( $post ) && isset( $post->post_content ) && preg_match( '/\[vc_row/', $post->post_content ) ) {
return true;
}
return false;
}
function vc_gutenberg_map() {
global $wp_version;
if ( function_exists( 'the_gutenberg_project' ) || version_compare( $wp_version, '4.9.8', '>' ) ) {
vc_lean_map( 'vc_gutenberg', null, dirname( __FILE__ ) . '/shortcode-vc-gutenberg.php' );
}
}
add_filter( 'classic_editor_enabled_editors_for_post', 'vc_gutenberg_check_disabled_regular', 10, 2 );
add_filter( 'use_block_editor_for_post_type', 'vc_gutenberg_check_disabled', 10, 2 );
add_filter( 'display_post_states', 'vc_classic_editor_post_states', 11, 2 );
add_action( 'vc_settings_tab-general', 'vc_gutenberg_add_settings' );
add_action( 'init', 'vc_gutenberg_map' );
/** @see include/params/gutenberg/class-vc-gutenberg-param.php */
require_once vc_path_dir( 'PARAMS_DIR', 'gutenberg/class-vc-gutenberg-param.php' );
new Vc_Gutenberg_Param();
autoload/vendors/revslider.php 0000644 00000001215 15121635560 0012547 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin revslider vendor.
*/
add_action( 'plugins_loaded', 'vc_init_vendor_revslider' );
function vc_init_vendor_revslider() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'revslider/revslider.php' ) || class_exists( 'RevSlider' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-revslider.php' );
$vendor = new Vc_Vendor_Revslider();
$vendor->load();
}
}
autoload/vendors/qtranslate-x.php 0000644 00000001023 15121635560 0013170 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin qtranslate vendor.
*/
add_action( 'plugins_loaded', 'vc_init_vendor_qtranslatex' );
function vc_init_vendor_qtranslatex() {
if ( defined( 'QTX_VERSION' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-qtranslate-x.php' );
$vendor = new Vc_Vendor_QtranslateX();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/rank-math.php 0000644 00000001220 15121635560 0012426 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_action( 'plugins_loaded', 'wpb_init_vendor_rank_math', 16 );
function wpb_init_vendor_rank_math() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'seo-by-rank-math/rank-math.php' ) || class_exists( 'RankMath' ) ) {
add_action( 'vc_backend_editor_render', 'wpb_enqueue_rank_math_assets' );
}
}
function wpb_enqueue_rank_math_assets() {
wp_enqueue_script( 'vc_vendor_seo_js', vc_asset_url( 'js/vendors/seo.js' ), array(
'jquery-core',
'underscore',
), WPB_VC_VERSION, true );
}
autoload/vendors/ninja_forms.php 0000644 00000001401 15121635560 0013052 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin ninja forms vendor
*/
add_action( 'plugins_loaded', 'vc_init_vendor_ninja_forms' );
function vc_init_vendor_ninja_forms() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'ninja-forms/ninja-forms.php' ) || defined( 'NINJA_FORMS_DIR' ) || function_exists( 'ninja_forms_get_all_forms' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-ninja-forms.php' );
$vendor = new Vc_Vendor_NinjaForms();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
}
}
autoload/vendors/cf7.php 0000644 00000001441 15121635560 0011230 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.4 vendors initialization moved to hooks in autoload/vendors.
*
* Used to initialize plugin contact form 7 vendor - fix load cf7 shortcode when in editor (frontend)
*/
add_action( 'plugins_loaded', 'vc_init_vendor_cf7' );
function vc_init_vendor_cf7() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Require class-vc-wxr-parser-plugin.php to use is_plugin_active() below
if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) || defined( 'WPCF7_PLUGIN' ) ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-contact-form7.php' );
$vendor = new Vc_Vendor_ContactForm7();
add_action( 'vc_after_set_mode', array(
$vendor,
'load',
) );
} // if contact form7 plugin active
}
autoload/vc-shortcode-autoloader.php 0000644 00000015523 15121635560 0013634 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class VcShortcodeAutoloader
*/
class VcShortcodeAutoloader {
private static $instance = null;
private static $config = null;
private static $cached = null;
/**
* @param bool $load_config
* @return \VcShortcodeAutoloader|null
*/
public static function getInstance( $load_config = true ) {
if ( null === self::$instance ) {
self::$instance = new VcShortcodeAutoloader( $load_config );
}
return self::$instance;
}
/**
* VcShortcodeAutoloader constructor.
* @param bool $load_config
*/
private function __construct( $load_config = true ) {
if ( ! $load_config ) {
return;
}
$this->loadConfig();
}
/**
* Include class dependencies
*
* @param string $class Class name
*
* @return string[] Included (if any) files
*/
public static function includeClass( $class ) {
// call the constructor (php 7.4 compat)
self::getInstance();
if ( ! is_array( self::$config ) ) {
self::loadConfig();
}
$class = strtolower( $class );
$files = array();
if ( self::$config['classmap'] ) {
$files = isset( self::$config['classmap'][ $class ] ) ? self::$config['classmap'][ $class ] : array();
}
if ( $files ) {
foreach ( $files as $k => $file ) {
if ( self::$cached ) {
$files[ $k ] = $file = self::$config['root_dir'] . DIRECTORY_SEPARATOR . $file;
}
if ( is_file( $file ) ) {
require_once $file;
}
}
}
return $files;
}
/**
* Find all classes defined in file
*
* @param string $file Full path to file
*
* @return string[]
*/
public static function extractClassNames( $file ) {
$classes = array();
// @codingStandardsIgnoreLine
$contents = file_get_contents( $file );
if ( ! $contents ) {
return $classes;
}
$tokens = token_get_all( $contents );
$class_token = false;
foreach ( $tokens as $token ) {
if ( is_array( $token ) ) {
if ( T_CLASS === $token[0] ) {
$class_token = true;
} elseif ( $class_token && T_STRING === $token[0] ) {
$classes[] = $token[1];
$class_token = false;
}
}
}
return $classes;
}
/**
* Extract all classes from file with their extends
*
* @param $file
*
* @return array Associative array where key is class name and value is parent class name (if any))
*/
public static function extractClassesAndExtends( $file ) {
$classes = array();
// @codingStandardsIgnoreLine
$contents = file_get_contents( $file );
if ( ! $contents ) {
return $classes;
}
// class Foo extends Bar {
preg_match_all( '/class\s+(\w+)\s+extends\s(\w+)\s+\{/i', $contents, $matches, PREG_SET_ORDER );
foreach ( $matches as $v ) {
$classes[ $v[1] ] = $v[2];
}
// class Foo {
preg_match_all( '/class\s+(\w+)\s+\{/i', $contents, $matches, PREG_SET_ORDER );
foreach ( $matches as $v ) {
$classes[ $v[1] ] = null;
}
return $classes;
}
/**
* Find file by class name
*
* Search is case-insensitive
*
* @param string $class
* @param string[]|string $dirs One or more directories where to look (recursive)
*
* @return string|false Full path to class file
*/
public static function findClassFile( $class, $dirs ) {
foreach ( (array) $dirs as $dir ) {
$Directory = new RecursiveDirectoryIterator( $dir );
$Iterator = new RecursiveIteratorIterator( $Directory );
$Regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH );
$class = strtolower( $class );
foreach ( $Regex as $file => $object ) {
$classes = self::extractClassNames( $file );
if ( $classes && in_array( $class, array_map( 'strtolower', $classes ), true ) ) {
return $file;
}
}
}
return false;
}
/**
* Construct full dependency list of classes for each class in right order (including class itself)
*
* @param string[]|string $dirs Directories where to look (recursive)
*
* @return array Associative array where key is lowercase class name and value is array of files to include for
* that class to work
*/
public static function generateClassMap( $dirs ) {
$flat_map = array();
foreach ( (array) $dirs as $dir ) {
$Directory = new RecursiveDirectoryIterator( $dir );
$Iterator = new RecursiveIteratorIterator( $Directory );
$Regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $Regex as $file => $object ) {
$classes = self::extractClassesAndExtends( $file );
foreach ( $classes as $class => $extends ) {
$class = strtolower( $class );
$extends = strtolower( $extends );
if ( in_array( $extends, array(
'wpbakeryshortcodescontainer',
'wpbakeryvisualcomposer',
'wpbakeryshortcode',
'wpbmap',
), true ) ) {
$extends = null;
}
$flat_map[ $class ] = array(
'class' => $class,
'file' => $file,
'extends' => $extends,
);
}
}
}
$map = array();
foreach ( $flat_map as $params ) {
$dependencies = array(
array(
'class' => $params['class'],
'file' => $params['file'],
),
);
if ( $params['extends'] ) {
$queue = array( $params['extends'] );
while ( $queue ) {
$current_class = array_pop( $queue );
$current_class = $flat_map[ $current_class ];
$dependencies[] = array(
'class' => $current_class['class'],
'file' => $current_class['file'],
);
if ( ! empty( $current_class['extends'] ) ) {
$queue[] = $current_class['extends'];
}
}
$map[ $params['class'] ] = array_reverse( $dependencies );
} else {
$map[ $params['class'] ] = $dependencies;
}
}
// simplify array
$classmap = array();
foreach ( $map as $class => $dependencies ) {
$classmap[ $class ] = array();
foreach ( $dependencies as $v ) {
$classmap[ $class ][] = str_replace( '\\', '/', $v['file'] );
}
}
return $classmap;
}
/**
* Regenerate and save class map file
*
* @param string[]|string $dirs Directories where to look (recursive)
* @param string $target Output file
*
* @return bool
*/
public static function saveClassMap( $dirs, $target ) {
if ( ! $target ) {
return false;
}
$classmap = self::generateClassMap( $dirs );
// @codingStandardsIgnoreLine
$code = '<?php return (array) json_decode(\'' . json_encode( $classmap ) . '\') ?>';
// @codingStandardsIgnoreLine
return (bool) file_put_contents( $target, $code );
}
protected static function loadConfig() {
$config = array(
'classmap_file' => vc_path_dir( 'APP_ROOT', 'vc_classmap.json.php' ),
'shortcodes_dir' => vc_path_dir( 'SHORTCODES_DIR' ),
'root_dir' => vc_path_dir( 'APP_ROOT' ),
);
if ( is_file( $config['classmap_file'] ) ) {
$config['classmap'] = require $config['classmap_file'];
self::$cached = true;
} else {
$config['classmap'] = self::generateClassMap( $config['shortcodes_dir'] );
self::$cached = false;
}
self::$config = $config;
}
}
autoload/hook-vc-message.php 0000644 00000000524 15121635560 0012062 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Message' );
add_filter( 'vc_edit_form_fields_attributes_vc_message', array(
'WPBakeryShortCode_Vc_Message',
'convertAttributesToMessageBox2',
) );
}
autoload/vc-undoredo.php 0000644 00000000457 15121635560 0011324 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
function vc_navbar_undoredo() {
if ( vc_is_frontend_editor() || is_admin() ) {
require_once vc_path_dir( 'EDITORS_DIR', 'navbar/class-vc-navbar-undoredo.php' );
new Vc_Navbar_Undoredo();
}
}
add_action( 'admin_init', 'vc_navbar_undoredo' );
autoload/hook-vc-progress-bar.php 0000644 00000000546 15121635560 0013050 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Progress_Bar' );
add_filter( 'vc_edit_form_fields_attributes_vc_progress_bar', array(
'WPBakeryShortCode_Vc_Progress_Bar',
'convertAttributesToNewProgressBar',
) );
}
autoload/bc-multisite-options.php 0000644 00000001365 15121635560 0013170 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
add_action( 'vc_activation_hook', 'vc_bc_multisite_options', 9 );
/**
* @param $networkWide
*/
function vc_bc_multisite_options( $networkWide ) {
global $current_site;
if ( ! is_multisite() || empty( $current_site ) || ! $networkWide || get_site_option( 'vc_bc_options_called', false ) || get_site_option( 'wpb_js_js_composer_purchase_code', false ) ) {
return;
}
// Now we need to check BC with license keys
$is_main_blog_activated = get_blog_option( (int) $current_site->id, 'wpb_js_js_composer_purchase_code' );
if ( $is_main_blog_activated ) {
update_site_option( 'wpb_js_js_composer_purchase_code', $is_main_blog_activated );
}
update_site_option( 'vc_bc_options_called', true );
}
autoload/hook-vc-pie.php 0000644 00000000476 15121635560 0011221 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( 'vc_edit_form' === vc_post_param( 'action' ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Pie' );
add_filter( 'vc_edit_form_fields_attributes_vc_pie', array(
'WPBakeryShortCode_Vc_Pie',
'convertOldColorsToNew',
) );
}
autoload/components.json 0000644 00000003763 15121635560 0011451 0 ustar 00 {
"params/hidden.php": "",
"params/vc_grid_item.php": "",
"vendors/acf.php": "",
"vendors/cf7.php": "",
"vendors/gravity_forms.php": "",
"vendors/jwplayer.php": "",
"vendors/layerslider.php": "",
"vendors/mqtranslate.php": "",
"vendors/ninja_forms.php": "",
"vendors/qtranslate.php": "",
"vendors/qtranslate-x.php": "",
"vendors/revslider.php": "",
"vendors/woocommerce.php": "",
"vendors/yoast_seo.php": "",
"vendors/rank-math.php": "",
"vendors/wpml.php": "",
"vendors/rankmath-seo.php": "",
"vendors/gutenberg.php": "",
"hook-vc-grid.php": "Logic for shortcode vc_grid",
"hook-vc-iconpicker-param.php": "Logic for shortcode param iconpicker",
"hook-vc-message.php": "Logic for shortcode vc_message",
"hook-vc-progress-bar.php": "Logic for shortcode vc_progress_bar",
"hook-vc-wp-text.php": "Logic for shortcode vc_wp_text fix",
"hook-vc-pie.php": "Logic for shortcode vc_pie",
"vc-grid-item-editor.php": "Create new post type vc_grid_item or Grid item",
"ui-vc-pointers.php": "Integrating With WordPress’ UI: Admin Pointers",
"vc-pages/automapper.php": "",
"vc-pages/page-custom-css.php": "Vc Special pages.",
"vc-pages/page-design-options.php": "Vc Special pages.",
"vc-pages/page-role-manager.php": "Vc Special pages.",
"vc-pages/pages.php": "Vc Special pages.",
"vc-pages/settings-tabs.php": "Vc Special pages.",
"vc-pages/welcome-screen.php": "Vc Special pages.",
"vc-pointers-backend-editor.php": "Backend editor VC Pointers",
"vc-pointers-frontend-editor.php": "Frontend editor VC Pointers",
"vc-image-filters.php": "PHP class for photo effects like Instagram",
"vc-settings-presets.php": "Logic for settings presets",
"vc-single-image.php": "add bc for single image",
"params-to-init.php": "add required init params",
"bc-access-rules-4.8.php": "BC for roles via filters >= VC 4.8",
"post-type-default-template.php": "Load default templates",
"bc-multisite-options.php": "BC for multisite options",
"vc-undoredo.php": "Undo Redo logic"
} classes/core/access/class-vc-current-user-access-controller.php 0000644 00000002205 15121635560 0020675 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-role-access-controller.php' );
/**
* Class Vc_Current_User_Access_Controller
*/
class Vc_Current_User_Access_Controller extends Vc_Role_Access_Controller {
/**
* Get capability for current user
*
* @param $rule
*
* @return bool
*/
public function getCapRule( $rule ) {
$role_rule = $this->getStateKey() . '/' . $rule;
return current_user_can( $role_rule );
}
/**
* Add capability to role.
*
* @param $rule
* @param bool $value
*/
public function setCapRule( $rule, $value = true ) {
$role_rule = $this->getStateKey() . '/' . $rule;
wp_get_current_user()->add_cap( $role_rule, $value );
}
/**
* @return bool|\WP_Role|null
*/
public function getRole() {
if ( ! $this->roleName && function_exists( 'wp_get_current_user' ) ) {
$user = wp_get_current_user();
$user_roles = array_intersect( array_values( (array) $user->roles ), array_keys( (array) get_editable_roles() ) );
$this->roleName = reset( $user_roles );
$this->role = get_role( $this->roleName );
}
return $this->role;
}
}
classes/core/access/class-vc-current-user-access.php 0000644 00000006240 15121635560 0016517 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-role-access.php' );
/**
* Class Vc_User_Access
*/
class Vc_Current_User_Access extends Vc_Role_Access {
/**
* @param $part
*
* @return Vc_Current_User_Access_Controller;
*/
public function part( $part ) {
if ( ! isset( $this->parts[ $part ] ) ) {
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-current-user-access-controller.php' );
/** @var Vc_Current_User_Access_Controller $user_access_controller */
$this->parts[ $part ] = new Vc_Current_User_Access_Controller( $part );
}
/** @var Vc_Current_User_Access_Controller $user_access_controller */
$user_access_controller = $this->parts[ $part ];
// we also check for user "logged_in" status
$is_user_logged_in = function_exists( 'is_user_logged_in' ) && is_user_logged_in();
$user_access_controller->setValidAccess( $is_user_logged_in && $this->getValidAccess() ); // send current status to upper level
$this->setValidAccess( true ); // reset
return $user_access_controller;
}
/**
* @param $method
* @param $valid
* @param $argsList
* @return $this
*/
public function wpMulti( $method, $valid, $argsList ) {
if ( $this->getValidAccess() ) {
$access = ! $valid;
foreach ( $argsList as &$args ) {
if ( ! is_array( $args ) ) {
$args = array( $args );
}
array_unshift( $args, 'current_user_can' );
$this->setValidAccess( true );
call_user_func_array( array(
$this,
$method,
), $args );
if ( $valid === $this->getValidAccess() ) {
$access = $valid;
break;
}
}
$this->setValidAccess( $access );
}
return $this;
}
/**
* Check WordPress capability. Should be valid one cap at least.
*
* @return Vc_Current_User_Access
*/
public function wpAny() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->wpMulti( 'check', true, $args );
}
return $this;
}
/**
* Check WordPress capability. Should be valid all caps.
*
* @return Vc_Current_User_Access
*/
public function wpAll() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->wpMulti( 'check', false, $args );
}
return $this;
}
public function canEdit( $id ) {
// @codingStandardsIgnoreStart
$post = get_post( $id );
if ( ! $post ) {
$this->setValidAccess( false );
return $this;
}
if ( $post->post_status === 'trash' ) {
$this->setValidAccess( false );
return $this;
}
if ( 'page' !== $post->post_type ) {
if ( 'publish' === $post->post_status && $this->wpAll( [
get_post_type_object( $post->post_type )->cap->edit_published_posts,
$post->ID,
] )->get() ) {
$this->setValidAccess( true );
return $this;
} elseif ( 'publish' !== $post->post_status && $this->wpAll( [
get_post_type_object( $post->post_type )->cap->edit_posts,
$post->ID,
] )->get() ) {
$this->setValidAccess( true );
return $this;
}
} elseif ( 'page' === $post->post_type && $this->wpAll( [
'edit_pages',
$post->ID,
] )->get() ) {
$this->setValidAccess( true );
return $this;
}
$this->setValidAccess( false );
return $this;
}
}
classes/core/access/abstract-class-vc-access.php 0000644 00000006366 15121635560 0015675 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Access
*
* @package WPBakeryPageBuilder
* @since 4.8
*/
abstract class Vc_Access {
/**
* @var bool
*/
protected $validAccess = true;
/**
* @return bool
*/
public function getValidAccess() {
return is_multisite() && is_super_admin() ? true : $this->validAccess;
}
/**
* @param mixed $validAccess
*
* @return $this
*/
public function setValidAccess( $validAccess ) {
$this->validAccess = $validAccess;
return $this;
}
/**
* Check multi access settings by method inside class object.
*
* @param $method
* @param $valid
* @param $argsList
*
* @return $this
*/
public function checkMulti( $method, $valid, $argsList ) {
if ( $this->getValidAccess() ) {
$access = ! $valid;
foreach ( $argsList as $args ) {
if ( ! is_array( $args ) ) {
$args = array( $args );
}
$this->setValidAccess( true );
call_user_func_array( array(
$this,
$method,
), $args );
if ( $valid === $this->getValidAccess() ) {
$access = $valid;
break;
}
}
$this->setValidAccess( $access );
}
return $this;
}
/**
* Get current validation state and reset it to true. ( should be never called twice )
* @return bool
*/
public function get() {
$result = $this->getValidAccess();
$this->setValidAccess( true );
return $result;
}
/**
* Call die() function with message if access is invalid.
*
* @param string $message
* @return $this
* @throws \Exception
*/
public function validateDie( $message = '' ) {
$result = $this->getValidAccess();
$this->setValidAccess( true );
if ( ! $result ) {
if ( defined( 'VC_DIE_EXCEPTION' ) && VC_DIE_EXCEPTION ) {
throw new Exception( $message );
} else {
die( esc_html( $message ) );
}
}
return $this;
}
/**
* @param $func
*
* @return $this
*/
public function check( $func ) {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$args = array_slice( $args, 1 );
if ( ! empty( $func ) ) {
$this->setValidAccess( call_user_func_array( $func, $args ) );
}
}
return $this;
}
/**
* Any of provided rules should be valid.
* Usage: checkAny(
* 'vc_verify_admin_nonce',
* array( 'current_user_can', 'edit_post', 12 ),
* array( 'current_user_can', 'edit_posts' ),
* )
* @return $this
*/
public function checkAny() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->checkMulti( 'check', true, $args );
}
return $this;
}
/**
* All provided rules should be valid.
* Usage: checkAll(
* 'vc_verify_admin_nonce',
* array( 'current_user_can', 'edit_post', 12 ),
* array( 'current_user_can', 'edit_posts' ),
* )
* @return $this
*/
public function checkAll() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->checkMulti( 'check', false, $args );
}
return $this;
}
/**
* @param string $nonce
*
* @return Vc_Access
*/
public function checkAdminNonce( $nonce = '' ) {
return $this->check( 'vc_verify_admin_nonce', $nonce );
}
/**
* @param string $nonce
*
* @return Vc_Access
*/
public function checkPublicNonce( $nonce = '' ) {
return $this->check( 'vc_verify_public_nonce', $nonce );
}
}
classes/core/access/class-vc-role-access.php 0000644 00000003323 15121635560 0015021 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'CORE_DIR', 'access/abstract-class-vc-access.php' );
/**
* Class Vc_Role_Access
*/
class Vc_Role_Access extends Vc_Access {
/**
* @var bool
*/
protected $roleName = false;
/**
* @var array
*/
protected $parts = array();
/**
*
*/
public function __construct() {
require_once ABSPATH . 'wp-admin/includes/user.php';
}
/**
* @param $part
* @return \Vc_Role_Access_Controller
* @throws \Exception
*/
public function part( $part ) {
$role_name = $this->getRoleName();
if ( ! $role_name ) {
throw new Exception( 'roleName for vc_role_access is not set, please use ->who(roleName) method to set!' );
}
$key = $part . '_' . $role_name;
if ( ! isset( $this->parts[ $key ] ) ) {
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-role-access-controller.php' );
/** @var Vc_Role_Access_Controller $role_access_controller */
$this->parts[ $key ] = new Vc_Role_Access_Controller( $part );
$role_access_controller = $this->parts[ $key ];
$role_access_controller->setRoleName( $this->getRoleName() );
}
/** @var Vc_Role_Access_Controller $role_access_controller */
$role_access_controller = $this->parts[ $key ];
$role_access_controller->setValidAccess( $this->getValidAccess() ); // send current status to upper level
$this->setValidAccess( true ); // reset
return $role_access_controller;
}
/**
* Set role to get access to data.
*
* @param $roleName
* @return $this
* @internal param $role
*
*/
public function who( $roleName ) {
$this->roleName = $roleName;
return $this;
}
/**
* @return null|string
*/
public function getRoleName() {
return $this->roleName;
}
}
classes/core/access/class-vc-role-access-controller.php 0000644 00000014313 15121635560 0017203 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'CORE_DIR', 'access/abstract-class-vc-access.php' );
/**
* Class Vc_Role_Access_Controller
*
* @since 4.8
*/
class Vc_Role_Access_Controller extends Vc_Access {
protected static $part_name_prefix = 'vc_access_rules_';
protected $part = false;
protected $roleName = false;
protected $role = false;
protected $validAccess = true;
protected $mergedCaps = array(
'vc_row_inner_all' => 'vc_row_all',
'vc_column_all' => 'vc_row_all',
'vc_column_inner_all' => 'vc_row_all',
'vc_row_inner_edit' => 'vc_row_edit',
'vc_column_edit' => 'vc_row_edit',
'vc_column_inner_edit' => 'vc_row_edit',
);
/**
* Vc_Role_Access_Controller constructor.
* @param $part
*/
public function __construct( $part ) {
$this->part = $part;
}
/**
* Set role name.
*
* @param $role_name
*/
public function setRoleName( $role_name ) {
$this->roleName = $role_name;
}
/**
* Get part for role.
* @return bool
*/
public function getPart() {
return $this->part;
}
/**
* Get state of the Vc access rules part.
*
* @return mixed;
* @throws \Exception
*/
public function getState() {
$role = $this->getRole();
$state = null;
if ( $role && isset( $role->capabilities, $role->capabilities[ $this->getStateKey() ] ) ) {
$state = $role->capabilities[ $this->getStateKey() ];
}
return apply_filters( 'vc_role_access_with_' . $this->getPart() . '_get_state', $state, $this->getRole() );
}
/**
* Set state for full part.
*
* State can have 3 values:
* true - all allowed under this part;
* false - all disabled under this part;
* string|'custom' - custom settings. It means that need to check exact capability.
*
* @param bool $value
*
* @return $this
* @throws \Exception
*/
public function setState( $value = true ) {
$this->getRole() && $this->getRole()->add_cap( $this->getStateKey(), $value );
return $this;
}
/**
* Can user do what he doo.
* Any rule has three types of state: true, false, string.
*
* @param string $rule
* @param bool|true $check_state
*
* @return $this
* @throws \Exception
*/
public function can( $rule = '', $check_state = true ) {
if ( null === $this->getRole() ) {
$this->setValidAccess( is_super_admin() );
} elseif ( $this->getValidAccess() ) {
// YES it is hard coded :)
if ( 'administrator' === $this->getRole()->name && 'settings' === $this->getPart() && ( 'vc-roles-tab' === $rule || 'vc-updater-tab' === $rule ) ) {
$this->setValidAccess( true );
return $this;
}
$rule = $this->updateMergedCaps( $rule );
if ( true === $check_state ) {
$state = $this->getState();
$return = false !== $state;
if ( null === $state ) {
$return = true;
} elseif ( is_bool( $state ) ) {
$return = $state;
} elseif ( '' !== $rule ) {
$return = $this->getCapRule( $rule );
}
} else {
$return = $this->getCapRule( $rule );
}
$return = apply_filters( 'vc_role_access_with_' . $this->getPart() . '_can', $return, $this->getRole(), $rule );
$return = apply_filters( 'vc_role_access_with_' . $this->getPart() . '_can_' . $rule, $return, $this->getRole() );
$this->setValidAccess( $return );
}
return $this;
}
/**
* Can user do what he doo.
* Any rule has three types of state: true,false, string.
*/
public function canAny() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->checkMulti( 'can', true, $args );
}
return $this;
}
/**
* Can user do what he doo.
* Any rule has three types of state: true,false, string.
*/
public function canAll() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->checkMulti( 'can', false, $args );
}
return $this;
}
/**
* Get capability for role
*
* @param $rule
*
* @return bool
* @throws \Exception
*/
public function getCapRule( $rule ) {
$rule = $this->getStateKey() . '/' . $rule;
return $this->getRole() ? $this->getRole()->has_cap( $rule ) : false;
}
/**
* Add capability to role.
*
* @param $rule
* @param bool $value
* @throws \Exception
*/
public function setCapRule( $rule, $value = true ) {
$role_rule = $this->getStateKey() . '/' . $rule;
$this->getRole() && $this->getRole()->add_cap( $role_rule, $value );
}
/**
* Get all capability for this part.
* @throws \Exception
*/
public function getAllCaps() {
$role = $this->getRole();
$caps = array();
if ( $role ) {
$role = apply_filters( 'vc_role_access_all_caps_role', $role );
if ( isset( $role->capabilities ) && is_array( $role->capabilities ) ) {
foreach ( $role->capabilities as $key => $value ) {
if ( preg_match( '/^' . $this->getStateKey() . '\//', $key ) ) {
$rule = preg_replace( '/^' . $this->getStateKey() . '\//', '', $key );
$caps[ $rule ] = $value;
}
}
}
}
return $caps;
}
/**
* @return null|\WP_Role
* @throws Exception
*/
public function getRole() {
if ( ! $this->role ) {
if ( ! $this->getRoleName() ) {
throw new Exception( 'roleName for role_manager is not set, please use ->who(roleName) method to set!' );
}
$this->role = get_role( $this->getRoleName() );
}
return $this->role;
}
/**
* @return null|string
*/
public function getRoleName() {
return $this->roleName;
}
/**
* @return string
*/
public function getStateKey() {
return self::$part_name_prefix . $this->getPart();
}
/**
* @param $data
* @return $this
* @throws \Exception
*/
public function checkState( $data ) {
if ( $this->getValidAccess() ) {
$this->setValidAccess( $this->getState() === $data );
}
return $this;
}
/**
* @return $this
*/
public function checkStateAny() {
if ( $this->getValidAccess() ) {
$args = func_get_args();
$this->checkMulti( 'checkState', true, $args );
}
return $this;
}
/**
* Return access value.
* @return string
*/
public function __toString() {
return (string) $this->get();
}
/**
* @param $rule
* @return mixed
*/
public function updateMergedCaps( $rule ) {
if ( isset( $this->mergedCaps[ $rule ] ) ) {
return $this->mergedCaps[ $rule ];
}
return $rule;
}
/**
* @return array
*/
public function getMergedCaps() {
return $this->mergedCaps;
}
}
classes/core/class-vc-page.php 0000644 00000001772 15121635560 0012302 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Page
*/
class Vc_Page {
protected $slug;
protected $title;
protected $templatePath;
/**
* @return string
*
*/
public function getSlug() {
return $this->slug;
}
/**
* @param mixed $slug
*
* @return $this;
*/
public function setSlug( $slug ) {
$this->slug = (string) $slug;
return $this;
}
/**
* @return mixed
*/
public function getTitle() {
return $this->title;
}
/**
* @param string $title
*
* @return $this
*/
public function setTitle( $title ) {
$this->title = (string) $title;
return $this;
}
/**
* @return mixed
*/
public function getTemplatePath() {
return $this->templatePath;
}
/**
* @param mixed $templatePath
*
* @return $this
*/
public function setTemplatePath( $templatePath ) {
$this->templatePath = $templatePath;
return $this;
}
public function render() {
vc_include_template( $this->getTemplatePath(), array(
'page' => $this,
) );
}
}
classes/core/class-vc-mapper.php 0000644 00000012142 15121635560 0012643 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder Main manager.
*
* @package WPBakeryPageBuilder
* @since 4.2
*/
/**
* Vc mapper new class. On maintenance
* Allows to bind hooks for shortcodes.
* @since 4.2
*/
class Vc_Mapper {
/**
* @since 4.2
* Stores mapping activities list which where called before initialization
* @var array
*/
protected $init_activity = array();
/**
*
*
* @since 4.9
*
* @var array
*/
protected $element_activities = array();
protected $hasAccess = array();
protected $checkForAccess = true;
/**
* @since 4.2
*/
public function __construct() {
}
/**
* Include params list objects and calls all stored activity methods.
*
* @since 4.2
* @access public
*/
public function init() {
do_action( 'vc_mapper_init_before' );
require_once vc_path_dir( 'PARAMS_DIR', 'load.php' );
WPBMap::setInit();
require_once vc_path_dir( 'CONFIG_DIR', 'lean-map.php' );
$this->callActivities();
do_action( 'vc_mapper_init_after' );
}
/**
* This method is called by VC objects methods if it is called before VC initialization.
*
* @param $object - mame of class object
* @param $method - method name
* @param array $params - list of attributes for object method
* @since 4.2
* @access public
*
* @see WPBMAP
*/
public function addActivity( $object, $method, $params = array() ) {
$this->init_activity[] = array(
$object,
$method,
$params,
);
}
/**
* This method is called by VC objects methods if it is called before VC initialization.
*
* @param $tag - shortcode tag of element
* @param $method - method name
* @param array $params - list of attributes for object method
* @since 4.9
* @access public
*
* @see WPBMAP
*/
public function addElementActivity( $tag, $method, $params = array() ) {
if ( ! isset( $this->element_activities[ $tag ] ) ) {
$this->element_activities[ $tag ] = array();
}
$this->element_activities[ $tag ][] = array(
$method,
$params,
);
}
/**
* Call all stored activities.
*
* Called by init method. List of activities stored by $init_activity are created by other objects called after
* initialization.
*
* @since 4.2
* @access public
*/
protected function callActivities() {
do_action( 'vc_mapper_call_activities_before' );
foreach ( $this->init_activity as $activity ) {
list( $object, $method, $params ) = $activity;
if ( 'mapper' === $object ) {
switch ( $method ) {
case 'map':
$currentScope = WPBMap::getScope();
if ( isset( $params['scope'] ) ) {
WPBMap::setScope( $params['scope'] );
}
WPBMap::map( $params['tag'], $params['attributes'] );
WPBMap::setScope( $currentScope );
break;
case 'drop_param':
WPBMap::dropParam( $params['name'], $params['attribute_name'] );
break;
case 'add_param':
WPBMap::addParam( $params['name'], $params['attribute'] );
break;
case 'mutate_param':
WPBMap::mutateParam( $params['name'], $params['attribute'] );
break;
case 'drop_all_shortcodes':
WPBMap::dropAllShortcodes();
break;
case 'drop_shortcode':
WPBMap::dropShortcode( $params['name'] );
break;
case 'modify':
WPBMap::modify( $params['name'], $params['setting_name'], $params['value'] );
break;
}
}
}
}
/**
* Does user has access to modify/clone/delete/add shortcode
*
* @param $shortcode
*
* @return bool
* @since 4.5
* @todo fix_roles and maybe remove/@deprecate this
*/
public function userHasAccess( $shortcode ) {
if ( $this->isCheckForAccess() ) {
if ( isset( $this->hasAccess[ $shortcode ] ) ) {
return $this->hasAccess[ $shortcode ];
} else {
$this->hasAccess[ $shortcode ] = vc_user_access_check_shortcode_edit( $shortcode );
}
return $this->hasAccess[ $shortcode ];
}
return true;
}
/**
* @return bool
* @since 4.5
* @todo fix_roles and maybe remove/@deprecate this
*/
public function isCheckForAccess() {
return $this->checkForAccess;
}
/**
* @param bool $checkForAccess
* @since 4.5
*
* @todo fix_roles and maybe remove/@deprecate this
*/
public function setCheckForAccess( $checkForAccess ) {
$this->checkForAccess = $checkForAccess;
}
/**
* @param $tag
* @throws \Exception
*/
public function callElementActivities( $tag ) {
do_action( 'vc_mapper_call_activities_before' );
if ( isset( $this->element_activities[ $tag ] ) ) {
foreach ( $this->element_activities[ $tag ] as $activity ) {
list( $method, $params ) = $activity;
switch ( $method ) {
case 'drop_param':
WPBMap::dropParam( $params['name'], $params['attribute_name'] );
break;
case 'add_param':
WPBMap::addParam( $params['name'], $params['attribute'] );
break;
case 'mutate_param':
WPBMap::mutateParam( $params['name'], $params['attribute'] );
break;
case 'drop_shortcode':
WPBMap::dropShortcode( $params['name'] );
break;
case 'modify':
WPBMap::modify( $params['name'], $params['setting_name'], $params['value'] );
break;
}
}
}
}
}
classes/core/class-vc-base.php 0000644 00000062275 15121635560 0012305 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery Page Builder basic class.
* @since 4.2
*/
class Vc_Base {
/**
* Shortcode's edit form.
*
* @since 4.2
* @access protected
* @var bool|Vc_Shortcode_Edit_Form
*/
protected $shortcode_edit_form = false;
/**
* Templates management panel editor.
* @since 4.4
* @access protected
* @var bool|Vc_Templates_Panel_Editor
*/
protected $templates_panel_editor = false;
/**
* Presets management panel editor.
* @since 5.2
* @access protected
* @var bool|Vc_Preset_Panel_Editor
*/
protected $preset_panel_editor = false;
/**
* Post object for VC in Admin.
*
* @since 4.4
* @access protected
* @var bool|Vc_Post_Admin
*/
protected $post_admin = false;
/**
* Post object for VC.
*
* @since 4.4.3
* @access protected
* @var bool|Vc_Post_Admin
*/
protected $post = false;
/**
* List of shortcodes map to VC.
*
* @since 4.2
* @access public
* @var array WPBakeryShortCodeFishBones
*/
protected $shortcodes = array();
/** @var Vc_Shared_Templates */
public $shared_templates;
/**
* Load default object like shortcode parsing.
*
* @since 4.2
* @access public
*/
public function init() {
do_action( 'vc_before_init_base' );
$this->postAdmin()->init();
add_filter( 'body_class', array(
$this,
'bodyClass',
) );
add_filter( 'the_excerpt', array(
$this,
'excerptFilter',
) );
add_action( 'wp_head', array(
$this,
'addMetaData',
) );
if ( is_admin() ) {
$this->initAdmin();
} else {
$this->initPage();
}
do_action( 'vc_after_init_base' );
}
/**
* Post object for interacting with Current post data.
* @return Vc_Post_Admin
* @since 4.4
*/
public function postAdmin() {
if ( false === $this->post_admin ) {
require_once vc_path_dir( 'CORE_DIR', 'class-vc-post-admin.php' );
$this->post_admin = new Vc_Post_Admin();
}
return $this->post_admin;
}
/**
* Build VC for frontend pages.
*
* @since 4.2
* @access public
*/
public function initPage() {
do_action( 'vc_build_page' );
add_action( 'template_redirect', array(
$this,
'frontCss',
) );
add_action( 'template_redirect', array(
'WPBMap',
'addAllMappedShortcodes',
) );
add_action( 'wp_head', array(
$this,
'addFrontCss',
), 1000 );
add_action( 'wp_head', array(
$this,
'addNoScript',
), 1000 );
add_action( 'template_redirect', array(
$this,
'frontJsRegister',
) );
add_filter( 'the_content', array(
$this,
'fixPContent',
), 11 );
}
/**
* Load admin required modules and elements
*
* @since 4.2
* @access public
*/
public function initAdmin() {
do_action( 'vc_build_admin_page' );
// editors actions:
$this->editForm()->init();
$this->templatesPanelEditor()->init();
$this->shared_templates->init();
// plugins list page actions links
add_filter( 'plugin_action_links', array(
$this,
'pluginActionLinks',
), 10, 2 );
}
/**
* Setter for edit form.
* @param Vc_Shortcode_Edit_Form $form
* @since 4.2
*
*/
public function setEditForm( Vc_Shortcode_Edit_Form $form ) {
$this->shortcode_edit_form = $form;
}
/**
* Get Shortcodes Edit form object.
*
* @return Vc_Shortcode_Edit_Form
* @since 4.2
* @access public
* @see Vc_Shortcode_Edit_Form::__construct
*/
public function editForm() {
return $this->shortcode_edit_form;
}
/**
* Setter for Templates editor.
* @param Vc_Templates_Panel_Editor $editor
* @since 4.4
*
*/
public function setTemplatesPanelEditor( Vc_Templates_Panel_Editor $editor ) {
$this->templates_panel_editor = $editor;
}
/**
* Setter for Preset editor.
* @param Vc_Preset_Panel_Editor $editor
* @since 5.2
*
*/
public function setPresetPanelEditor( Vc_Preset_Panel_Editor $editor ) {
$this->preset_panel_editor = $editor;
}
/**
* Get templates manager.
* @return bool|Vc_Templates_Panel_Editor
* @since 4.4
* @access public
* @see Vc_Templates_Panel_Editor::__construct
*/
public function templatesPanelEditor() {
return $this->templates_panel_editor;
}
/**
* Get preset manager.
* @return bool|Vc_Preset_Panel_Editor
* @since 5.2
* @access public
* @see Vc_Preset_Panel_Editor::__construct
*/
public function presetPanelEditor() {
return $this->preset_panel_editor;
}
/**
* Get shortcode class instance.
*
* @param string $tag
*
* @return Vc_Shortcodes_Manager|null
* @see WPBakeryShortCodeFishBones
* @since 4.2
* @access public
*
*/
public function getShortCode( $tag ) {
return Vc_Shortcodes_Manager::getInstance()->setTag( $tag );
}
/**
* Remove shortcode from shortcodes list of VC.
*
* @param $tag - shortcode tag
* @since 4.2
* @access public
*
*/
public function removeShortCode( $tag ) {
remove_shortcode( $tag );
}
/**
* Set or modify new settings for shortcode.
*
* This function widely used by WPBMap class methods to modify shortcodes mapping
*
* @param $tag
* @param $name
* @param $value
* @throws \Exception
* @since 4.3
*/
public function updateShortcodeSetting( $tag, $name, $value ) {
Vc_Shortcodes_Manager::getInstance()->getElementClass( $tag )->setSettings( $name, $value );
}
/**
* Build custom css styles for page from shortcodes attributes created by VC editors.
*
* Called by save method, which is hooked by edit_post action.
* Function creates meta data for post with the key '_wpb_shortcodes_custom_css'
* and value as css string, which will be added to the footer of the page.
*
* @param $id
* @throws \Exception
* @since 4.2
* @access public
*/
public function buildShortcodesCustomCss( $id ) {
if ( 'dopreview' === vc_post_param( 'wp-preview' ) && wp_revisions_enabled( get_post( $id ) ) ) {
$latest_revision = wp_get_post_revisions( $id );
if ( ! empty( $latest_revision ) ) {
$array_values = array_values( $latest_revision );
$id = $array_values[0]->ID;
}
}
$post = get_post( $id );
/**
* vc_filter: vc_base_build_shortcodes_custom_css
* @since 4.4
*/
$css = apply_filters( 'vc_base_build_shortcodes_custom_css', $this->parseShortcodesCustomCss( $post->post_content ), $id );
if ( empty( $css ) ) {
delete_metadata( 'post', $id, '_wpb_shortcodes_custom_css' );
} else {
update_metadata( 'post', $id, '_wpb_shortcodes_custom_css', $css );
}
}
/**
* Parse shortcodes custom css string.
*
* This function is used by self::buildShortcodesCustomCss and creates css string from shortcodes attributes
* like 'css_editor'.
*
* @param $content
*
* @return string
* @throws \Exception
* @see WPBakeryVisualComposerCssEditor
* @since 4.2
* @access public
*/
public function parseShortcodesCustomCss( $content ) {
$css = '';
if ( ! preg_match( '/\s*(\.[^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/', $content ) ) {
return $css;
}
WPBMap::addAllMappedShortcodes();
preg_match_all( '/' . get_shortcode_regex() . '/', $content, $shortcodes );
foreach ( $shortcodes[2] as $index => $tag ) {
$shortcode = WPBMap::getShortCode( $tag );
$attr_array = shortcode_parse_atts( trim( $shortcodes[3][ $index ] ) );
if ( isset( $shortcode['params'] ) && ! empty( $shortcode['params'] ) ) {
foreach ( $shortcode['params'] as $param ) {
if ( isset( $param['type'] ) && 'css_editor' === $param['type'] && isset( $attr_array[ $param['param_name'] ] ) ) {
$css .= $attr_array[ $param['param_name'] ];
}
}
}
}
foreach ( $shortcodes[5] as $shortcode_content ) {
$css .= $this->parseShortcodesCustomCss( $shortcode_content );
}
return $css;
}
/**
* Hooked class method by wp_head WP action to output post custom css.
*
* Method gets post meta value for page by key '_wpb_post_custom_css' and if it is not empty
* outputs css string wrapped into style tag.
*
* @param int $id
* @since 4.2
* @access public
*
*/
public function addPageCustomCss( $id = null ) {
if ( is_front_page() || is_home() ) {
$id = get_queried_object_id();
} elseif ( is_singular() ) {
if ( ! $id ) {
$id = get_the_ID();
}
}
if ( $id ) {
if ( 'true' === vc_get_param( 'preview' ) && wp_revisions_enabled( get_post( $id ) ) ) {
$latest_revision = wp_get_post_revisions( $id );
if ( ! empty( $latest_revision ) ) {
$array_values = array_values( $latest_revision );
$id = $array_values[0]->ID;
}
}
$post_custom_css = get_metadata( 'post', $id, '_wpb_post_custom_css', true );
$post_custom_css = apply_filters( 'vc_post_custom_css', $post_custom_css, $id );
if ( ! empty( $post_custom_css ) ) {
$post_custom_css = wp_strip_all_tags( $post_custom_css );
echo '<style type="text/css" data-type="vc_custom-css">';
echo $post_custom_css;
echo '</style>';
}
}
}
/**
* Hooked class method by wp_footer WP action to output shortcodes css editor settings from page meta data.
*
* Method gets post meta value for page by key '_wpb_shortcodes_custom_css' and if it is not empty
* outputs css string wrapped into style tag.
*
* @param int $id
*
* @since 4.2
* @access public
*
*/
public function addShortcodesCustomCss( $id = null ) {
if ( ! $id && is_singular() ) {
$id = get_the_ID();
}
if ( $id ) {
if ( 'true' === vc_get_param( 'preview' ) && wp_revisions_enabled( get_post( $id ) ) ) {
$latest_revision = wp_get_post_revisions( $id );
if ( ! empty( $latest_revision ) ) {
$array_values = array_values( $latest_revision );
$id = $array_values[0]->ID;
}
}
$shortcodes_custom_css = get_metadata( 'post', $id, '_wpb_shortcodes_custom_css', true );
$shortcodes_custom_css = apply_filters( 'vc_shortcodes_custom_css', $shortcodes_custom_css, $id );
if ( ! empty( $shortcodes_custom_css ) ) {
$shortcodes_custom_css = wp_strip_all_tags( $shortcodes_custom_css );
echo '<style type="text/css" data-type="vc_shortcodes-custom-css">';
echo $shortcodes_custom_css;
echo '</style>';
}
}
}
/**
* Add css styles for current page and elements design options added w\ editor.
*/
public function addFrontCss() {
$this->addPageCustomCss();
$this->addShortcodesCustomCss();
}
public function addNoScript() {
$custom_tag = 'style';
$second_tag = 'noscript';
echo '<' . esc_attr( $second_tag ) . '>';
echo '<' . esc_attr( $custom_tag ) . '>';
echo ' .wpb_animate_when_almost_visible { opacity: 1; }';
echo '</' . esc_attr( $custom_tag ) . '>';
echo '</' . esc_attr( $second_tag ) . '>';
}
/**
* Register front css styles.
*
* Calls wp_register_style for required css libraries files.
*
* @since 3.1
* @access public
*/
public function frontCss() {
wp_register_style( 'flexslider', vc_asset_url( 'lib/flexslider/flexslider.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'nivo-slider-css', vc_asset_url( 'lib/bower/nivoslider/nivo-slider.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'nivo-slider-theme', vc_asset_url( 'lib/bower/nivoslider/themes/default/default.min.css' ), array( 'nivo-slider-css' ), WPB_VC_VERSION );
wp_register_style( 'prettyphoto', vc_asset_url( 'lib/prettyphoto/css/prettyPhoto.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'isotope-css', vc_asset_url( 'css/lib/isotope.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_font_awesome_5_shims', vc_asset_url( 'lib/bower/font-awesome/css/v4-shims.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_font_awesome_5', vc_asset_url( 'lib/bower/font-awesome/css/all.min.css' ), array( 'vc_font_awesome_5_shims' ), WPB_VC_VERSION );
wp_register_style( 'vc_animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'lightbox2', vc_asset_url( 'lib/bower/lightbox2/dist/css/lightbox.min.css' ), array(), WPB_VC_VERSION );
$front_css_file = vc_asset_url( 'css/js_composer.min.css' );
$upload_dir = wp_upload_dir();
$vc_upload_dir = vc_upload_dir();
if ( '1' === vc_settings()->get( 'use_custom' ) && is_file( $upload_dir['basedir'] . '/' . $vc_upload_dir . '/js_composer_front_custom.css' ) ) {
$front_css_file = $upload_dir['baseurl'] . '/' . $vc_upload_dir . '/js_composer_front_custom.css';
$front_css_file = vc_str_remove_protocol( $front_css_file );
}
wp_register_style( 'js_composer_front', $front_css_file, array(), WPB_VC_VERSION );
$custom_css_path = $upload_dir['basedir'] . '/' . $vc_upload_dir . '/custom.css';
if ( is_file( $upload_dir['basedir'] . '/' . $vc_upload_dir . '/custom.css' ) && filesize( $custom_css_path ) > 0 ) {
$custom_css_url = $upload_dir['baseurl'] . '/' . $vc_upload_dir . '/custom.css';
$custom_css_url = vc_str_remove_protocol( $custom_css_url );
wp_register_style( 'js_composer_custom_css', $custom_css_url, array(), WPB_VC_VERSION );
}
add_action( 'wp_enqueue_scripts', array(
$this,
'enqueueStyle',
) );
/**
* @since 4.4
*/
do_action( 'vc_base_register_front_css' );
}
/**
* Enqueue base css class for VC elements and enqueue custom css if exists.
*/
public function enqueueStyle() {
$post = get_post();
if ( $post && strpos( $post->post_content, '[vc_row' ) !== false ) {
wp_enqueue_style( 'js_composer_front' );
}
wp_enqueue_style( 'js_composer_custom_css' );
}
/**
* Register front javascript libs.
*
* Calls wp_register_script for required css libraries files.
*
* @since 3.1
* @access public
*/
public function frontJsRegister() {
wp_register_script( 'prettyphoto', vc_asset_url( 'lib/prettyphoto/js/jquery.prettyPhoto.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'lightbox2', vc_asset_url( 'lib/bower/lightbox2/dist/js/lightbox.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_waypoints', vc_asset_url( 'lib/vc_waypoints/vc-waypoints.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
// @deprecated used in old tabs
wp_register_script( 'jquery_ui_tabs_rotate', vc_asset_url( 'lib/bower/jquery-ui-tabs-rotate/jquery-ui-tabs-rotate.min.js' ), array(
'jquery-core',
'jquery-ui-tabs',
), WPB_VC_VERSION, true );
// used in vc_gallery, old grid
wp_register_script( 'isotope', vc_asset_url( 'lib/bower/isotope/dist/isotope.pkgd.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'twbs-pagination', vc_asset_url( 'lib/bower/twbs-pagination/jquery.twbsPagination.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'nivo-slider', vc_asset_url( 'lib/bower/nivoslider/jquery.nivo.slider.pack.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'flexslider', vc_asset_url( 'lib/flexslider/jquery.flexslider.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
/**
* @since 4.4
*/
do_action( 'vc_base_register_front_js' );
}
/**
* Register admin javascript libs.
*
* Calls wp_register_script for required css libraries files for Admin dashboard.
*
* @since 3.1
* vc_filter: vc_i18n_locale_composer_js_view, since 4.4 - override localization for js
* @access public
*/
public function registerAdminJavascript() {
/**
* @since 4.4
*/
do_action( 'vc_base_register_admin_js' );
}
/**
* Register admin css styles.
*
* Calls wp_register_style for required css libraries files for admin dashboard.
*
* @since 3.1
* @access public
*/
public function registerAdminCss() {
/**
* @since 4.4
*/
do_action( 'vc_base_register_admin_css' );
}
/**
* Add Settings link in plugin's page
* @param $links
* @param $file
*
* @return array
* @throws \Exception
* @since 4.2
*/
public function pluginActionLinks( $links, $file ) {
if ( plugin_basename( vc_path_dir( 'APP_DIR', '/js_composer.php' ) ) === $file ) {
$title = esc_html__( 'WPBakery Page Builder Settings', 'js_composer' );
$html = esc_html__( 'Settings', 'js_composer' );
if ( ! vc_user_access()->part( 'settings' )->can( 'vc-general-tab' )->get() ) {
$title = esc_html__( 'About WPBakery Page Builder', 'js_composer' );
$html = esc_html__( 'About', 'js_composer' );
}
$link = '<a title="' . esc_attr( $title ) . '" href="' . esc_url( $this->getSettingsPageLink() ) . '">' . $html . '</a>';
array_unshift( $links, $link ); // Add to top
}
return $links;
}
/**
* Get settings page link
* @return string url to settings page
* @throws \Exception
* @since 4.2
*/
public function getSettingsPageLink() {
$page = 'vc-general';
if ( ! vc_user_access()->part( 'settings' )->can( 'vc-general-tab' )->get() ) {
$page = 'vc-welcome';
}
return add_query_arg( array( 'page' => $page ), admin_url( 'admin.php' ) );
}
/**
* Hooked class method by wp_head WP action.
* @since 4.2
* @access public
*/
public function addMetaData() {
echo '<meta name="generator" content="Powered by WPBakery Page Builder - drag and drop page builder for WordPress."/>' . "\n";
}
/**
* Method adds css class to body tag.
*
* Hooked class method by body_class WP filter. Method adds custom css class to body tag of the page to help
* identify and build design specially for VC shortcodes.
*
* @param $classes
*
* @return array
* @since 4.2
* @access public
*
*/
public function bodyClass( $classes ) {
return js_composer_body_class( $classes );
}
/**
* Builds excerpt for post from content.
*
* Hooked class method by the_excerpt WP filter. When user creates content with VC all content is always wrapped by
* shortcodes. This methods calls do_shortcode for post's content and then creates a new excerpt.
*
* @param $output
*
* @return string
* @since 4.2
* @access public
*
*/
public function excerptFilter( $output ) {
global $post;
if ( empty( $output ) && ! empty( $post->post_content ) ) {
$text = wp_strip_all_tags( do_shortcode( $post->post_content ) );
$excerpt_length = apply_filters( 'excerpt_length', 55 );
$excerpt_more = apply_filters( 'excerpt_more', ' [...]' );
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
return $text;
}
return $output;
}
/**
* Remove unwanted wraping with p for content.
*
* Hooked by 'the_content' filter.
* @param null $content
*
* @return string|null
* @since 4.2
*
*/
public function fixPContent( $content = null ) {
if ( $content ) {
$s = array(
'/' . preg_quote( '</div>', '/' ) . '[\s\n\f]*' . preg_quote( '</p>', '/' ) . '/i',
'/' . preg_quote( '<p>', '/' ) . '[\s\n\f]*' . preg_quote( '<div ', '/' ) . '/i',
'/' . preg_quote( '<p>', '/' ) . '[\s\n\f]*' . preg_quote( '<section ', '/' ) . '/i',
'/' . preg_quote( '</section>', '/' ) . '[\s\n\f]*' . preg_quote( '</p>', '/' ) . '/i',
);
$r = array(
'</div>',
'<div ',
'<section ',
'</section>',
);
$content = preg_replace( $s, $r, $content );
return $content;
}
return null;
}
/**
* Get array of string for locale.
*
* @return array
* @since 4.7
*
*/
public function getEditorsLocale() {
return array(
'add_remove_picture' => esc_html__( 'Add/remove picture', 'js_composer' ),
'finish_adding_text' => esc_html__( 'Finish Adding Images', 'js_composer' ),
'add_image' => esc_html__( 'Add Image', 'js_composer' ),
'add_images' => esc_html__( 'Add Images', 'js_composer' ),
'settings' => esc_html__( 'Settings', 'js_composer' ),
'main_button_title' => esc_html__( 'WPBakery Page Builder', 'js_composer' ),
'main_button_title_backend_editor' => esc_html__( 'Backend Editor', 'js_composer' ),
'main_button_title_frontend_editor' => esc_html__( 'Frontend Editor', 'js_composer' ),
'main_button_title_revert' => esc_html__( 'Classic Mode', 'js_composer' ),
'main_button_title_gutenberg' => esc_html__( 'Gutenberg Editor', 'js_composer' ),
'please_enter_templates_name' => esc_html__( 'Enter template name you want to save.', 'js_composer' ),
'confirm_deleting_template' => esc_html__( 'Confirm deleting "{template_name}" template, press Cancel to leave. This action cannot be undone.', 'js_composer' ),
'press_ok_to_delete_section' => esc_html__( 'Press OK to delete section, Cancel to leave', 'js_composer' ),
'drag_drop_me_in_column' => esc_html__( 'Drag and drop me in the column', 'js_composer' ),
'press_ok_to_delete_tab' => esc_html__( 'Press OK to delete "{tab_name}" tab, Cancel to leave', 'js_composer' ),
'slide' => esc_html__( 'Slide', 'js_composer' ),
'tab' => esc_html__( 'Tab', 'js_composer' ),
'section' => esc_html__( 'Section', 'js_composer' ),
'please_enter_new_tab_title' => esc_html__( 'Please enter new tab title', 'js_composer' ),
'press_ok_delete_section' => esc_html__( 'Press OK to delete "{tab_name}" section, Cancel to leave', 'js_composer' ),
'section_default_title' => esc_html__( 'Section', 'js_composer' ),
'please_enter_section_title' => esc_html__( 'Please enter new section title', 'js_composer' ),
'error_please_try_again' => esc_html__( 'Error. Please try again.', 'js_composer' ),
'if_close_data_lost' => esc_html__( 'If you close this window all shortcode settings will be lost. Close this window?', 'js_composer' ),
'header_select_element_type' => esc_html__( 'Select element type', 'js_composer' ),
'header_media_gallery' => esc_html__( 'Media gallery', 'js_composer' ),
'header_element_settings' => esc_html__( 'Element settings', 'js_composer' ),
'add_tab' => esc_html__( 'Add tab', 'js_composer' ),
'are_you_sure_convert_to_new_version' => esc_html__( 'Are you sure you want to convert to new version?', 'js_composer' ),
'loading' => esc_html__( 'Loading...', 'js_composer' ),
// Media editor
'set_image' => esc_html__( 'Set Image', 'js_composer' ),
'are_you_sure_reset_css_classes' => esc_html__( 'Are you sure that you want to remove all your data?', 'js_composer' ),
'loop_frame_title' => esc_html__( 'Loop settings', 'js_composer' ),
'enter_custom_layout' => esc_html__( 'Custom row layout', 'js_composer' ),
'wrong_cells_layout' => esc_html__( 'Wrong row layout format! Example: 1/2 + 1/2 or span6 + span6.', 'js_composer' ),
'row_background_color' => esc_html__( 'Row background color', 'js_composer' ),
'row_background_image' => esc_html__( 'Row background image', 'js_composer' ),
'column_background_color' => esc_html__( 'Column background color', 'js_composer' ),
'column_background_image' => esc_html__( 'Column background image', 'js_composer' ),
'guides_on' => esc_html__( 'Guides ON', 'js_composer' ),
'guides_off' => esc_html__( 'Guides OFF', 'js_composer' ),
'template_save' => esc_html__( 'New template successfully saved.', 'js_composer' ),
'template_added' => esc_html__( 'Template added to the page.', 'js_composer' ),
'template_added_with_id' => esc_html__( 'Template added to the page. Template has ID attributes, make sure that they are not used more than once on the same page.', 'js_composer' ),
'template_removed' => esc_html__( 'Template successfully removed.', 'js_composer' ),
'template_is_empty' => esc_html__( 'Template is empty: There is no content to be saved as a template.', 'js_composer' ),
'template_save_error' => esc_html__( 'Error while saving template.', 'js_composer' ),
'css_updated' => esc_html__( 'Page settings updated!', 'js_composer' ),
'update_all' => esc_html__( 'Update all', 'js_composer' ),
'confirm_to_leave' => esc_html__( 'The changes you made will be lost if you navigate away from this page.', 'js_composer' ),
'inline_element_saved' => esc_html__( '%s saved!', 'js_composer' ),
'inline_element_deleted' => esc_html__( '%s deleted!', 'js_composer' ),
'inline_element_cloned' => sprintf( __( '%%s cloned. %sEdit now?%s', 'js_composer' ), '<a href="#" class="vc_edit-cloned" data-model-id="%s">', '</a>' ),
'gfonts_loading_google_font_failed' => esc_html__( 'Loading Google Font failed', 'js_composer' ),
'gfonts_loading_google_font' => esc_html__( 'Loading Font...', 'js_composer' ),
'gfonts_unable_to_load_google_fonts' => esc_html__( 'Unable to load Google Fonts', 'js_composer' ),
'no_title_parenthesis' => sprintf( '(%s)', esc_html__( 'no title', 'js_composer' ) ),
'error_while_saving_image_filtered' => esc_html__( 'Error while applying filter to the image. Check your server and memory settings.', 'js_composer' ),
'ui_saved' => sprintf( '<i class="vc-composer-icon vc-c-icon-check"></i> %s', esc_html__( 'Saved!', 'js_composer' ) ),
'ui_danger' => sprintf( '<i class="vc-composer-icon vc-c-icon-close"></i> %s', esc_html__( 'Failed to Save!', 'js_composer' ) ),
'delete_preset_confirmation' => esc_html__( 'You are about to delete this preset. This action can not be undone.', 'js_composer' ),
'ui_template_downloaded' => esc_html__( 'Downloaded', 'js_composer' ),
'ui_template_update' => esc_html__( 'Update', 'js_composer' ),
'ui_templates_failed_to_download' => esc_html__( 'Failed to download template', 'js_composer' ),
'preset_removed' => esc_html__( 'Element successfully removed.', 'js_composer' ),
'vc_successfully_updated' => esc_html__( 'Successfully updated!', 'js_composer' ),
'gutenbergDoesntWorkProperly' => esc_html__( 'Gutenberg plugin doesn\'t work properly. Please check Gutenberg plugin.', 'js_composer' ),
'unfiltered_html_access' => esc_html__( 'Custom HTML is disabled for your user role. Please contact your site Administrator to change your capabilities.', 'js_composer' ),
);
}
}
classes/core/class-wpb-map.php 0000644 00000062604 15121635560 0012324 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder Main manager.
*
* @package WPBakeryPageBuilder
* @since 4.2
*/
class WPBMap {
protected static $scope = 'default';
/**
* @var array
*/
protected static $sc = array();
protected static $scopes = array(
'default' => array(),
);
protected static $removedElements = array();
/**
* @var bool
*/
protected static $sorted_sc = false;
/**
* @var array|false
*/
protected static $categories = false;
/**
* @var bool
*/
protected static $user_sc = false;
/**
* @var bool
*/
protected static $user_sorted_sc = false;
/**
* @var bool
*/
protected static $user_categories = false;
/**
* @var Vc_Settings $settings
*/
protected static $settings;
/**
* @var
*/
protected static $user_role;
/**
* @var
*/
protected static $tags_regexp;
/**
* @var bool
*/
protected static $is_init = false;
/**
* @var bool
*/
protected static $init_elements = array();
protected static $init_elements_scoped = array(
'default' => array(),
);
/**
* Set init status fro WPMap.
*
* if $is_init is FALSE, then all activity like add, update and delete for shortcodes attributes will be hold in
* the list of activity and will be executed after initialization.
*
* @param bool $value
* @see Vc_Mapper::iniy.
* @static
*
*/
public static function setInit( $value = true ) {
self::$is_init = $value;
}
/**
* Gets user role and access rules for current user.
*
* @static
* @return mixed
*/
protected static function getSettings() {
global $current_user;
// @todo fix_roles? what is this and why it is inside class-wpb-map?
if ( null !== self::$settings ) {
if ( function_exists( 'wp_get_current_user' ) ) {
wp_get_current_user();
/** @var Vc_Settings $settings - get use group access rules */
if ( ! empty( $current_user->roles ) ) {
self::$user_role = $current_user->roles[0];
} else {
self::$user_role = 'author';
}
} else {
self::$user_role = 'author';
}
self::$settings = vc_settings()->get( 'groups_access_rules' );
}
return self::$settings;
}
/**
* Check is shortcode with a tag mapped to VC.
*
* @static
*
* @param $tag - shortcode tag.
*
* @return bool
*/
public static function exists( $tag ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
if ( isset( self::$scopes[ $currentScope ], self::$scopes[ $currentScope ][ $tag ] ) ) {
return true;
}
}
return (bool) isset( self::$sc[ $tag ] );
}
/**
* Map shortcode to VC.
*
* This method maps shortcode to VC.
* You need to shortcode's tag and settings to map correctly.
* Default shortcodes are mapped in config/map.php file.
* The best way is to call this method with "init" action callback function of WP.
*
* vc_filter: vc_mapper_tag - to change shortcode tag, arguments 2 ( $tag, $attributes )
* vc_filter: vc_mapper_attributes - to change shortcode attributes (like params array), arguments 2 ( $attributes,
* $tag ) vc_filter: vc_mapper_attribute - to change singe shortcode param data, arguments 2 ( $attribute, $tag )
* vc_filter: vc_mapper_attribute_{PARAM_TYPE} - to change singe shortcode param data by param type, arguments 2 (
* $attribute, $tag )
*
* @static
*
* @param $tag
* @param $attributes
*
* @return bool
*/
public static function map( $tag, $attributes ) {
if ( in_array( $tag, self::$removedElements, true ) ) {
return false;
}
if ( ! self::$is_init ) {
if ( empty( $attributes['name'] ) ) {
throw new Exception( sprintf( esc_html__( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $tag ) );
} elseif ( empty( $attributes['base'] ) ) {
throw new Exception( sprintf( esc_html__( 'Wrong base for shortcode:%s. Base required', 'js_composer' ), $tag ) );
} else {
vc_mapper()->addActivity( 'mapper', 'map', array(
'tag' => $tag,
'attributes' => $attributes,
'scope' => self::getScope(),
) );
return true;
}
return false;
}
if ( empty( $attributes['name'] ) ) {
throw new Exception( sprintf( esc_html__( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $tag ) );
} elseif ( empty( $attributes['base'] ) ) {
throw new Exception( sprintf( esc_html__( 'Wrong base for shortcode:%s. Base required', 'js_composer' ), $tag ) );
} else {
if ( self::getScope() !== 'default' ) {
if ( ! isset( self::$scopes[ self::getScope() ] ) ) {
self::$scopes[ self::getScope() ] = array();
}
self::$scopes[ self::getScope() ][ $tag ] = $attributes;
} else {
self::$sc[ $tag ] = $attributes;
}
// Unset cache class object in case if re-map called
if ( Vc_Shortcodes_Manager::getInstance()->isShortcodeClassInitialized( $tag ) ) {
Vc_Shortcodes_Manager::getInstance()->unsetElementClass( $tag );
}
return true;
}
return false;
}
/**
* Lazy method to map shortcode to VC.
*
* This method maps shortcode to VC.
* You can shortcode settings as you do in self::map method. Bu also you
* can pass function name or file, which will be used to add settings for
* element. But this will be done only when element data is really required.
*
* @static
* @param $tag
* @param $settings_file
* @param $settings_function
* @param $attributes
*
* @return bool
* @since 4.9
*
*/
public static function leanMap( $tag, $settings_function = null, $settings_file = null, $attributes = array() ) {
if ( in_array( $tag, self::$removedElements, true ) ) {
return false;
}
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
if ( ! isset( self::$scopes[ $currentScope ] ) ) {
self::$scopes[ $currentScope ] = array();
}
self::$scopes[ $currentScope ][ $tag ] = $attributes;
self::$scopes[ $currentScope ][ $tag ]['base'] = $tag;
if ( is_string( $settings_file ) ) {
self::$scopes[ $currentScope ][ $tag ]['__vc_settings_file'] = $settings_file;
}
if ( ! is_null( $settings_function ) ) {
self::$scopes[ $currentScope ][ $tag ]['__vc_settings_function'] = $settings_function;
}
} else {
self::$sc[ $tag ] = $attributes;
self::$sc[ $tag ]['base'] = $tag;
if ( is_string( $settings_file ) ) {
self::$sc[ $tag ]['__vc_settings_file'] = $settings_file;
}
if ( ! is_null( $settings_function ) ) {
self::$sc[ $tag ]['__vc_settings_function'] = $settings_function;
}
}
return true;
}
/**
* Generates list of shortcodes taking into account the access rules for shortcodes from VC Settings page.
*
* This method parses the list of mapped shortcodes and creates categories list for users.
*
* @static
*
* @param bool $force - force data generation even data already generated.
* @throws \Exception
*/
protected static function generateUserData( $force = false ) {
if ( ! $force && false !== self::$user_sc && false !== self::$user_categories ) {
return;
}
self::$user_sc = array();
self::$user_categories = array();
self::$user_sorted_sc = array();
$deprecated = 'deprecated';
$add_deprecated = false;
if ( is_array( self::$sc ) && ! empty( self::$sc ) ) {
foreach ( array_keys( self::$sc ) as $name ) {
self::setElementSettings( $name );
if ( ! isset( self::$sc[ $name ] ) ) {
continue;
}
$values = self::$sc[ $name ];
if ( vc_user_access_check_shortcode_all( $name ) ) {
if ( ! isset( $values['content_element'] ) || true === $values['content_element'] ) {
$categories = isset( $values['category'] ) ? $values['category'] : '_other_category_';
$values['_category_ids'] = array();
if ( isset( $values['deprecated'] ) && false !== $values['deprecated'] ) {
$add_deprecated = true;
$values['_category_ids'][] = 'deprecated';
} else {
if ( is_array( $categories ) && ! empty( $categories ) ) {
foreach ( $categories as $c ) {
if ( false === array_search( $c, self::$user_categories, true ) ) {
self::$user_categories[] = $c;
}
$values['_category_ids'][] = md5( $c );
}
} else {
if ( false === array_search( $categories, self::$user_categories, true ) ) {
self::$user_categories[] = $categories;
}
$values['_category_ids'][] = md5( $categories );
}
}
}
if ( ! empty( $values['params'] ) ) {
$params = $values['params'];
$values['params'] = array();
foreach ( $params as $attribute ) {
$attribute = apply_filters( 'vc_mapper_attribute', $attribute, $name );
$attribute = apply_filters( 'vc_mapper_attribute_' . $attribute['type'], $attribute, $name );
$values['params'][] = $attribute;
}
$sort = new Vc_Sort( $values['params'] );
$values['params'] = $sort->sortByKey();
}
self::$user_sc[ $name ] = $values;
self::$user_sorted_sc[] = $values;
}
}
}
if ( $add_deprecated ) {
self::$user_categories[] = $deprecated;
}
$sort = new Vc_Sort( self::$user_sorted_sc );
self::$user_sorted_sc = $sort->sortByKey();
}
/**
* Generates list of shortcodes.
*
* This method parses the list of mapped shortcodes and creates categories list.
*
* @static_other_category_
*
* @param bool $force - force data generation even data already generated.
* @throws \Exception
*/
protected static function generateData( $force = false ) {
if ( ! $force && false !== self::$categories ) {
return;
}
foreach ( self::$sc as $tag => $settings ) {
self::setElementSettings( $tag );
}
self::$categories = self::collectCategories( self::$sc );
$sort = new Vc_Sort( array_values( self::$sc ) );
self::$sorted_sc = $sort->sortByKey();
}
/**
* Get mapped shortcode settings.
*
* @static
* @return array
*/
public static function getShortCodes() {
return self::$sc;
}
/**
* Get mapped shortcode settings.
*
* @static
* @return array
* @throws \Exception
*/
public static function getAllShortCodes() {
self::generateData();
return self::$sc;
}
/**
* Get mapped shortcode settings.
*
* @static
* @return bool
* @throws \Exception
*/
public static function getSortedAllShortCodes() {
self::generateData();
return self::$sorted_sc;
}
/**
* Get sorted list of mapped shortcode settings for current user.
*
* Sorting depends on the weight attribute and mapping order.
*
* @static
* @return bool
* @throws \Exception
*/
public static function getSortedUserShortCodes() {
self::generateUserData();
return self::$user_sorted_sc;
}
/**
* Get list of mapped shortcode settings for current user.
* @static
* @return bool - associated array of shortcodes settings with tag as the key.
* @throws \Exception
*/
public static function getUserShortCodes() {
self::generateUserData();
return self::$user_sc;
}
/**
* Get mapped shortcode settings by tag.
*
* @static
*
* @param $tag - shortcode tag.
*
* @return array|null null @since 4.4.3
* @throws \Exception
*/
public static function getShortCode( $tag ) {
return self::setElementSettings( $tag );
}
/**
* Get mapped shortcode settings by tag.
*
* @param $tag - shortcode tag.
*
* @return array|null
* @throws \Exception
* @since 4.5.2
* @static
*/
public static function getUserShortCode( $tag ) {
self::generateUserData();
if ( isset( self::$user_sc[ $tag ] ) && is_array( self::$user_sc[ $tag ] ) ) {
$shortcode = self::$user_sc[ $tag ];
if ( ! empty( $shortcode['params'] ) ) {
$params = $shortcode['params'];
$shortcode['params'] = array();
foreach ( $params as $attribute ) {
$attribute = apply_filters( 'vc_mapper_attribute', $attribute, $tag );
$attribute = apply_filters( 'vc_mapper_attribute_' . $attribute['type'], $attribute, $tag );
$shortcode['params'][] = $attribute;
}
$sort = new Vc_Sort( $shortcode['params'] );
$shortcode['params'] = $sort->sortByKey();
}
return $shortcode;
}
return null;
}
/**
* Get all categories for mapped shortcodes.
*
* @static
* @return array
* @throws \Exception
*/
public static function getCategories() {
self::generateData();
return self::$categories;
}
/**
* Get all categories for current user.
*
* Category is added to the list when at least one shortcode of this category is allowed for current user
* by Vc access rules.
*
* @static
* @return bool
* @throws \Exception
*/
public static function getUserCategories() {
self::generateUserData();
return self::$user_categories;
}
/**
* Drop shortcode param.
*
* @static
*
* @param $name
* @param $attribute_name
*
* @return bool
*/
public static function dropParam( $name, $attribute_name ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::dropParam( $name, $attribute_name );
self::setScope( $currentScope );
return $res;
}
if ( ! isset( self::$init_elements[ $name ] ) ) {
vc_mapper()->addElementActivity( $name, 'drop_param', array(
'name' => $name,
'attribute_name' => $attribute_name,
) );
return true;
}
if ( isset( self::$sc[ $name ], self::$sc[ $name ]['params'] ) && is_array( self::$sc[ $name ]['params'] ) ) {
foreach ( self::$sc[ $name ]['params'] as $index => $param ) {
if ( $param['param_name'] === $attribute_name ) {
unset( self::$sc[ $name ]['params'][ $index ] );
// fix indexes
self::$sc[ $name ]['params'] = array_merge( self::$sc[ $name ]['params'] );
return true;
}
}
}
return true;
}
/**
* Returns param settings for mapped shortcodes.
*
* @static
*
* @param $tag
* @param $param_name
*
* @return bool| array
* @throws \Exception
*/
public static function getParam( $tag, $param_name ) {
$currentScope = self::getScope();
$element = false;
if ( 'default' !== $currentScope ) {
if ( isset( self::$scopes[ $currentScope ][ $tag ], self::$scopes[ $currentScope ][ $tag ] ) ) {
$element = self::$scopes[ $currentScope ][ $tag ];
}
}
if ( ! $element && isset( self::$sc[ $tag ] ) ) {
$element = self::$sc[ $tag ];
}
if ( ! $element ) {
// No element found
return false;
}
if ( isset( $element['__vc_settings_function'] ) || isset( $element['__vc_settings_file'] ) ) {
$element = self::setElementSettings( $tag );
}
if ( ! isset( $element['params'] ) ) {
return false;
}
foreach ( $element['params'] as $index => $param ) {
if ( $param['param_name'] === $param_name ) {
return $element['params'][ $index ];
}
}
return false;
}
/**
* Add new param to shortcode params list.
*
* @static
*
* @param $name
* @param array $attribute
*
* @return bool - true if added, false if scheduled/rejected
*/
public static function addParam( $name, $attribute = array() ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::addParam( $name, $attribute );
self::setScope( $currentScope );
return $res;
}
if ( ! isset( self::$init_elements[ $name ] ) ) {
vc_mapper()->addElementActivity( $name, 'add_param', array(
'name' => $name,
'attribute' => $attribute,
) );
return false;
}
if ( ! isset( self::$sc[ $name ] ) ) {
// No shortcode found
return false;
} elseif ( ! isset( $attribute['param_name'] ) ) {
throw new Exception( sprintf( esc_html__( "Wrong attribute for '%s' shortcode. Attribute 'param_name' required", 'js_composer' ), $name ) );
} else {
$replaced = false;
if ( is_array( self::$sc[ $name ]['params'] ) ) {
foreach ( self::$sc[ $name ]['params'] as $index => $param ) {
if ( $param['param_name'] === $attribute['param_name'] ) {
$replaced = true;
self::$sc[ $name ]['params'][ $index ] = $attribute;
break;
}
}
} else {
self::$sc[ $name ]['params'] = array();
}
if ( false === $replaced ) {
self::$sc[ $name ]['params'][] = $attribute;
}
$sort = new Vc_Sort( self::$sc[ $name ]['params'] );
self::$sc[ $name ]['params'] = $sort->sortByKey();
return true;
}
return false;
}
/**
* Change param attributes of mapped shortcode.
*
* @static
*
* @param $name
* @param array $attribute
*
* @return bool
*/
public static function mutateParam( $name, $attribute = array() ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::mutateParam( $name, $attribute );
self::setScope( $currentScope );
return $res;
}
if ( ! isset( self::$init_elements[ $name ] ) ) {
vc_mapper()->addElementActivity( $name, 'mutate_param', array(
'name' => $name,
'attribute' => $attribute,
) );
return false;
}
if ( ! isset( self::$sc[ $name ] ) ) {
// No shortcode found
return false;
} elseif ( ! isset( $attribute['param_name'] ) ) {
throw new Exception( sprintf( esc_html__( "Wrong attribute for '%s' shortcode. Attribute 'param_name' required", 'js_composer' ), $name ) );
} else {
$replaced = false;
foreach ( self::$sc[ $name ]['params'] as $index => $param ) {
if ( $param['param_name'] === $attribute['param_name'] ) {
$replaced = true;
self::$sc[ $name ]['params'][ $index ] = array_merge( $param, $attribute );
break;
}
}
if ( false === $replaced ) {
self::$sc[ $name ]['params'][] = $attribute;
}
$sort = new Vc_Sort( self::$sc[ $name ]['params'] );
self::$sc[ $name ]['params'] = $sort->sortByKey();
}
return true;
}
/**
* Removes shortcode from mapping list.
*
* @static
*
* @param $name
*
* @return bool
*/
public static function dropShortcode( $name ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::dropShortcode( $name );
self::setScope( $currentScope );
return $res;
}
self::$removedElements[] = $name;
if ( ! isset( self::$init_elements[ $name ] ) ) {
vc_mapper()->addElementActivity( $name, 'drop_shortcode', array(
'name' => $name,
) );
}
unset( self::$sc[ $name ] );
visual_composer()->removeShortCode( $name );
return true;
}
/**
* @return bool
*/
public static function dropAllShortcodes() {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::dropAllShortcodes();
self::setScope( $currentScope );
return $res;
}
if ( ! self::$is_init ) {
vc_mapper()->addActivity( '*', 'drop_all_shortcodes', array() );
return false;
}
foreach ( self::$sc as $name => $data ) {
visual_composer()->removeShortCode( $name );
}
self::$sc = array();
self::$user_sc = false;
self::$user_categories = false;
self::$user_sorted_sc = false;
return true;
}
/**
* Modify shortcode's mapped settings.
* You can modify only one option of the group options.
* Call this method with $settings_name param as associated array to mass modifications.
*
* @static
*
* @param $name - shortcode' name.
* @param $setting_name - option key name or the array of options.
* @param string $value - value of settings if $setting_name is option key.
*
* @return array|bool
* @throws \Exception
*/
public static function modify( $name, $setting_name, $value = '' ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
self::setScope( 'default' );
$res = self::modify( $name, $setting_name, $value );
self::setScope( $currentScope );
return $res;
}
if ( ! isset( self::$init_elements[ $name ] ) ) {
vc_mapper()->addElementActivity( $name, 'modify', array(
'name' => $name,
'setting_name' => $setting_name,
'value' => $value,
) );
return false;
}
if ( ! isset( self::$sc[ $name ] ) ) {
// No shortcode found
return false;
} elseif ( 'base' === $setting_name ) {
throw new Exception( sprintf( esc_html__( "Wrong setting_name for shortcode:%s. Base can't be modified.", 'js_composer' ), $name ) );
}
if ( is_array( $setting_name ) ) {
foreach ( $setting_name as $key => $value ) {
self::modify( $name, $key, $value );
}
} else {
if ( is_array( $value ) ) {
// fix indexes
$value = array_merge( $value );
}
self::$sc[ $name ][ $setting_name ] = $value;
visual_composer()->updateShortcodeSetting( $name, $setting_name, $value );
}
return self::$sc;
}
/**
* Returns "|" separated list of mapped shortcode tags.
*
* @static
* @return string
*/
public static function getTagsRegexp() {
if ( empty( self::$tags_regexp ) ) {
self::$tags_regexp = implode( '|', array_keys( self::$sc ) );
}
return self::$tags_regexp;
}
/**
* Sorting method for WPBMap::generateUserData method. Called by uasort php function.
* @param $a
* @param $b
*
* @return int
* @deprecated - use Vc_Sort::sortByKey since 4.4
* @static
*
*/
public static function sort( $a, $b ) {
$a_weight = isset( $a['weight'] ) ? (int) $a['weight'] : 0;
$b_weight = isset( $b['weight'] ) ? (int) $b['weight'] : 0;
if ( $a_weight === $b_weight ) {
// @codingStandardsIgnoreLine
$cmpa = array_search( $a, (array) self::$user_sorted_sc, true );
// @codingStandardsIgnoreLine
$cmpb = array_search( $b, (array) self::$user_sorted_sc, true );
return ( $cmpa > $cmpb ) ? 1 : - 1;
}
return ( $a_weight < $b_weight ) ? 1 : - 1;
}
/**
* @param $shortcodes
* @return array
*/
public static function collectCategories( &$shortcodes ) {
$categories_list = array();
$deprecated = 'deprecated';
$add_deprecated = false;
if ( is_array( $shortcodes ) && ! empty( $shortcodes ) ) {
foreach ( $shortcodes as $name => $values ) {
$values['_category_ids'] = array();
if ( isset( $values['deprecated'] ) && false !== $values['deprecated'] ) {
$add_deprecated = true;
$values['_category_ids'][] = 'deprecated';
} elseif ( isset( $values['category'] ) ) {
$categories = $values['category'];
if ( is_array( $categories ) && ! empty( $categories ) ) {
foreach ( $categories as $c ) {
if ( false === array_search( $c, $categories_list, true ) ) {
$categories[] = $c;
}
$values['_category_ids'][] = md5( $c );
}
} else {
if ( false === array_search( $categories, $categories_list, true ) ) {
$categories_list[] = $categories;
}
/** @var string $categories */
$values['_category_ids'][] = md5( $categories );
}
}
$shortcodes[ $name ] = $values;
}
}
if ( $add_deprecated ) {
$categories_list[] = $deprecated;
}
return $categories_list;
}
/**
* Process files/functions for lean mapping settings
*
* @param $tag
*
* @return array|null
* @throws \Exception
* @since 4.9
*/
public static function setElementSettings( $tag ) {
$currentScope = self::getScope();
if ( 'default' !== $currentScope ) {
if ( isset( self::$scopes[ $currentScope ], self::$scopes[ $currentScope ][ $tag ] ) && ! in_array( $tag, self::$removedElements, true ) ) {
if ( isset( self::$init_elements_scoped[ $currentScope ], self::$init_elements_scoped[ $currentScope ][ $tag ] ) && ! empty( self::$init_elements_scoped[ $currentScope ][ $tag ] ) ) {
return self::$scopes[ $currentScope ][ $tag ];
}
$settings = self::$scopes[ $currentScope ][ $tag ];
if ( isset( $settings['__vc_settings_function'] ) ) {
self::$scopes[ $currentScope ][ $tag ] = call_user_func( $settings['__vc_settings_function'], $tag );
} elseif ( isset( $settings['__vc_settings_file'] ) ) {
self::$scopes[ $currentScope ][ $tag ] = include $settings['__vc_settings_file'];
}
self::$scopes[ $currentScope ][ $tag ]['base'] = $tag;
self::$init_elements_scoped[ $currentScope ][ $tag ] = true;
vc_mapper()->callElementActivities( $tag );
return self::$scopes[ $currentScope ][ $tag ];
}
}
if ( ! isset( self::$sc[ $tag ] ) || in_array( $tag, self::$removedElements, true ) ) {
return null;
}
if ( isset( self::$init_elements[ $tag ] ) && self::$init_elements[ $tag ] ) {
return self::$sc[ $tag ];
}
$settings = self::$sc[ $tag ];
if ( isset( $settings['__vc_settings_function'] ) ) {
self::$sc[ $tag ] = call_user_func( $settings['__vc_settings_function'], $tag );
} elseif ( isset( $settings['__vc_settings_file'] ) ) {
self::$sc[ $tag ] = include $settings['__vc_settings_file'];
}
self::$sc[ $tag ] = apply_filters( 'vc_element_settings_filter', self::$sc[ $tag ], $tag );
self::$sc[ $tag ]['base'] = $tag;
self::$init_elements[ $tag ] = true;
vc_mapper()->callElementActivities( $tag );
return self::$sc[ $tag ];
}
/**
* Add elements as shortcodes
*
* @since 4.9
*/
public static function addAllMappedShortcodes() {
foreach ( self::$sc as $tag => $settings ) {
if ( ! in_array( $tag, self::$removedElements, true ) && ! shortcode_exists( $tag ) ) {
add_shortcode( $tag, 'vc_do_shortcode' );
}
}
// Map also custom scopes
foreach ( self::$scopes as $scopeName => $scopeElements ) {
foreach ( $scopeElements as $tag => $settings ) {
if ( ! in_array( $tag, self::$removedElements, true ) && ! shortcode_exists( $tag ) ) {
add_shortcode( $tag, 'vc_do_shortcode' );
}
}
}
}
/**
* @param string $scope
*/
public static function setScope( $scope = 'default' ) {
if ( ! isset( self::$scopes[ $scope ] ) ) {
self::$scopes[ $scope ] = array();
self::$init_elements_scoped[ $scope ] = array();
}
self::$scope = $scope;
}
public static function resetScope() {
self::$scope = 'default';
}
/**
* @return string
*/
public static function getScope() {
return self::$scope;
}
}
classes/core/class-vc-modifications.php 0000644 00000000636 15121635560 0014214 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
class Vc_Modifications {
public static $modified = false;
public function __construct() {
add_action( 'wp_footer', array(
$this,
'renderScript',
) );
}
public function renderScript() {
if ( self::$modified ) {
// output script
$tag = 'script';
echo '<' . $tag . ' type="text/html" id="wpb-modifications"></' . $tag . '>';
}
}
}
classes/core/class-vc-shared-library.php 0000644 00000015536 15121635560 0014301 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/*** WPBakery Page Builder Content elements refresh ***/
class VcSharedLibrary {
// Here we will store plugin wise (shared) settings. Colors, Locations, Sizes, etc...
/**
* @var array
*/
private static $colors = array(
'Blue' => 'blue',
'Turquoise' => 'turquoise',
'Pink' => 'pink',
'Violet' => 'violet',
'Peacoc' => 'peacoc',
'Chino' => 'chino',
'Mulled Wine' => 'mulled_wine',
'Vista Blue' => 'vista_blue',
'Black' => 'black',
'Grey' => 'grey',
'Orange' => 'orange',
'Sky' => 'sky',
'Green' => 'green',
'Juicy pink' => 'juicy_pink',
'Sandy brown' => 'sandy_brown',
'Purple' => 'purple',
'White' => 'white',
);
/**
* @var array
*/
public static $icons = array(
'Glass' => 'glass',
'Music' => 'music',
'Search' => 'search',
);
/**
* @var array
*/
public static $sizes = array(
'Mini' => 'xs',
'Small' => 'sm',
'Normal' => 'md',
'Large' => 'lg',
);
/**
* @var array
*/
public static $button_styles = array(
'Rounded' => 'rounded',
'Square' => 'square',
'Round' => 'round',
'Outlined' => 'outlined',
'3D' => '3d',
'Square Outlined' => 'square_outlined',
);
/**
* @var array
*/
public static $message_box_styles = array(
'Standard' => 'standard',
'Solid' => 'solid',
'Solid icon' => 'solid-icon',
'Outline' => 'outline',
'3D' => '3d',
);
/**
* Toggle styles
* @var array
*/
public static $toggle_styles = array(
'Default' => 'default',
'Simple' => 'simple',
'Round' => 'round',
'Round Outline' => 'round_outline',
'Rounded' => 'rounded',
'Rounded Outline' => 'rounded_outline',
'Square' => 'square',
'Square Outline' => 'square_outline',
'Arrow' => 'arrow',
'Text Only' => 'text_only',
);
/**
* Animation styles
* @var array
*/
public static $animation_styles = array(
'Bounce' => 'easeOutBounce',
'Elastic' => 'easeOutElastic',
'Back' => 'easeOutBack',
'Cubic' => 'easeInOutCubic',
'Quint' => 'easeInOutQuint',
'Quart' => 'easeOutQuart',
'Quad' => 'easeInQuad',
'Sine' => 'easeOutSine',
);
/**
* @var array
*/
public static $cta_styles = array(
'Rounded' => 'rounded',
'Square' => 'square',
'Round' => 'round',
'Outlined' => 'outlined',
'Square Outlined' => 'square_outlined',
);
/**
* @var array
*/
public static $txt_align = array(
'Left' => 'left',
'Right' => 'right',
'Center' => 'center',
'Justify' => 'justify',
);
/**
* @var array
*/
public static $el_widths = array(
'100%' => '',
'90%' => '90',
'80%' => '80',
'70%' => '70',
'60%' => '60',
'50%' => '50',
'40%' => '40',
'30%' => '30',
'20%' => '20',
'10%' => '10',
);
/**
* @var array
*/
public static $sep_widths = array(
'1px' => '',
'2px' => '2',
'3px' => '3',
'4px' => '4',
'5px' => '5',
'6px' => '6',
'7px' => '7',
'8px' => '8',
'9px' => '9',
'10px' => '10',
);
/**
* @var array
*/
public static $sep_styles = array(
'Border' => '',
'Dashed' => 'dashed',
'Dotted' => 'dotted',
'Double' => 'double',
'Shadow' => 'shadow',
);
/**
* @var array
*/
public static $box_styles = array(
'Default' => '',
'Rounded' => 'vc_box_rounded',
'Border' => 'vc_box_border',
'Outline' => 'vc_box_outline',
'Shadow' => 'vc_box_shadow',
'Bordered shadow' => 'vc_box_shadow_border',
'3D Shadow' => 'vc_box_shadow_3d',
);
/**
* Round box styles
*
* @var array
*/
public static $round_box_styles = array(
'Round' => 'vc_box_circle',
'Round Border' => 'vc_box_border_circle',
'Round Outline' => 'vc_box_outline_circle',
'Round Shadow' => 'vc_box_shadow_circle',
'Round Border Shadow' => 'vc_box_shadow_border_circle',
);
/**
* Circle box styles
*
* @var array
*/
public static $circle_box_styles = array(
'Circle' => 'vc_box_circle_2',
'Circle Border' => 'vc_box_border_circle_2',
'Circle Outline' => 'vc_box_outline_circle_2',
'Circle Shadow' => 'vc_box_shadow_circle_2',
'Circle Border Shadow' => 'vc_box_shadow_border_circle_2',
);
/**
* @return array
*/
public static function getColors() {
return self::$colors;
}
/**
* @return array
*/
public static function getIcons() {
return self::$icons;
}
/**
* @return array
*/
public static function getSizes() {
return self::$sizes;
}
/**
* @return array
*/
public static function getButtonStyles() {
return self::$button_styles;
}
/**
* @return array
*/
public static function getMessageBoxStyles() {
return self::$message_box_styles;
}
/**
* @return array
*/
public static function getToggleStyles() {
return self::$toggle_styles;
}
/**
* @return array
*/
public static function getAnimationStyles() {
return self::$animation_styles;
}
/**
* @return array
*/
public static function getCtaStyles() {
return self::$cta_styles;
}
/**
* @return array
*/
public static function getTextAlign() {
return self::$txt_align;
}
/**
* @return array
*/
public static function getBorderWidths() {
return self::$sep_widths;
}
/**
* @return array
*/
public static function getElementWidths() {
return self::$el_widths;
}
/**
* @return array
*/
public static function getSeparatorStyles() {
return self::$sep_styles;
}
/**
* Get list of box styles
*
* Possible $groups values:
* - default
* - round
* - circle
*
* @param array $groups Array of groups to include. If not specified, return all
*
* @return array
*/
public static function getBoxStyles( $groups = array() ) {
$list = array();
$groups = (array) $groups;
if ( ! $groups || in_array( 'default', $groups, true ) ) {
$list += self::$box_styles;
}
if ( ! $groups || in_array( 'round', $groups, true ) ) {
$list += self::$round_box_styles;
}
if ( ! $groups || in_array( 'cirlce', $groups, true ) ) {
$list += self::$circle_box_styles;
}
return $list;
}
/**
* @return array
*/
public static function getColorsDashed() {
$colors = array(
esc_html__( 'Blue', 'js_composer' ) => 'blue',
esc_html__( 'Turquoise', 'js_composer' ) => 'turquoise',
esc_html__( 'Pink', 'js_composer' ) => 'pink',
esc_html__( 'Violet', 'js_composer' ) => 'violet',
esc_html__( 'Peacoc', 'js_composer' ) => 'peacoc',
esc_html__( 'Chino', 'js_composer' ) => 'chino',
esc_html__( 'Mulled Wine', 'js_composer' ) => 'mulled-wine',
esc_html__( 'Vista Blue', 'js_composer' ) => 'vista-blue',
esc_html__( 'Black', 'js_composer' ) => 'black',
esc_html__( 'Grey', 'js_composer' ) => 'grey',
esc_html__( 'Orange', 'js_composer' ) => 'orange',
esc_html__( 'Sky', 'js_composer' ) => 'sky',
esc_html__( 'Green', 'js_composer' ) => 'green',
esc_html__( 'Juicy pink', 'js_composer' ) => 'juicy-pink',
esc_html__( 'Sandy brown', 'js_composer' ) => 'sandy-brown',
esc_html__( 'Purple', 'js_composer' ) => 'purple',
esc_html__( 'White', 'js_composer' ) => 'white',
);
return $colors;
}
}
classes/core/class-vc-pages-group.php 0000644 00000002371 15121635560 0013613 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vs_Pages_Group Show the groups of the pages likes pages with tabs.
*
* @since 4.5
*/
class Vc_Pages_Group extends Vc_Page {
protected $activePage;
protected $pages;
protected $templatePath;
/**
* @return mixed
*/
public function getActivePage() {
return $this->activePage;
}
/**
* @param Vc_Page $activePage
*
* @return $this
*/
public function setActivePage( Vc_Page $activePage ) {
$this->activePage = $activePage;
return $this;
}
/**
* @return mixed
*/
public function getPages() {
return $this->pages;
}
/**
* @param mixed $pages
*
* @return $this
*/
public function setPages( $pages ) {
$this->pages = $pages;
return $this;
}
/**
* @return mixed
*/
public function getTemplatePath() {
return $this->templatePath;
}
/**
* @param mixed $templatePath
*
* @return $this
*/
public function setTemplatePath( $templatePath ) {
$this->templatePath = $templatePath;
return $this;
}
/**
* Render html output for current page.
*/
public function render() {
vc_include_template( $this->getTemplatePath(), array(
'pages' => $this->getPages(),
'active_page' => $this->activePage,
'page' => $this,
) );
}
}
classes/core/shared-templates/importer/class-vc-wxr-parser.php 0000644 00000004341 15121635560 0020576 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once dirname( __FILE__ ) . '/class-vc-wxr-parser-regex.php';
require_once dirname( __FILE__ ) . '/class-vc-wxr-parser-simplexml.php';
require_once dirname( __FILE__ ) . '/class-vc-wxr-parser-xml.php';
/**
* WordPress eXtended RSS file parser implementations
*
* @package WordPress
* @subpackage Importer
*/
/**
* WordPress Importer class for managing parsing of WXR files.
*/
class Vc_WXR_Parser {
/**
* @param $file
* @return array|\WP_Error
*/
public function parse( $file ) {
// Attempt to use proper XML parsers first
if ( extension_loaded( 'simplexml' ) ) {
$parser = new Vc_WXR_Parser_SimpleXML();
$result = $parser->parse( $file );
// If SimpleXML succeeds or this is an invalid WXR file then return the results
if ( ! is_wp_error( $result ) || 'SimpleXML_parse_error' !== $result->get_error_code() ) {
return $result;
}
} elseif ( extension_loaded( 'xml' ) ) {
$parser = new Vc_WXR_Parser_XML();
$result = $parser->parse( $file );
// If XMLParser succeeds or this is an invalid WXR file then return the results
if ( ! is_wp_error( $result ) || 'XML_parse_error' !== $result->get_error_code() ) {
return $result;
}
}
// We have a malformed XML file, so display the error and fallthrough to regex
if ( isset( $result ) && defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
echo '<pre>';
if ( 'SimpleXML_parse_error' === $result->get_error_code() ) {
foreach ( $result->get_error_data() as $error ) {
echo esc_html( $error->line . ':' . $error->column ) . ' ' . esc_html( $error->message ) . "\n";
}
} elseif ( 'XML_parse_error' === $result->get_error_code() ) {
$error = $result->get_error_data();
echo esc_html( $error[0] . ':' . $error[1] ) . ' ' . esc_html( $error[2] );
}
echo '</pre>';
echo '<p><strong>' . esc_html__( 'There was an error when reading this WXR file', 'js_composer' ) . '</strong><br />';
echo esc_html__( 'Details are shown above. The importer will now try again with a different parser...', 'js_composer' ) . '</p>';
}
// use regular expressions if nothing else available or this is bad XML
$parser = new Vc_WXR_Parser_Regex();
return $parser->parse( $file );
}
}
classes/core/shared-templates/importer/class-vc-wxr-parser-regex.php 0000644 00000025005 15121635560 0021706 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WXR Parser that uses regular expressions. Fallback for installs without an XML parser.
*/
class Vc_WXR_Parser_Regex {
/**
* @var array
*/
public $authors = array();
/**
* @var array
*/
public $posts = array();
/**
* @var array
*/
public $categories = array();
/**
* @var array
*/
public $tags = array();
/**
* @var array
*/
public $terms = array();
/**
* @var string
*/
public $base_url = '';
/**
* Vc_WXR_Parser_Regex constructor.
*/
public function __construct() {
$this->has_gzip = is_callable( 'gzopen' );
}
/**
* @param $file
* @return array|\WP_Error
*/
public function parse( $file ) {
$wxr_version = false;
$in_post = false;
$fp = $this->fopen( $file, 'r' );
if ( $fp ) {
while ( ! $this->feof( $fp ) ) {
$importline = rtrim( $this->fgets( $fp ) );
if ( ! $wxr_version && preg_match( '|<wp:wxr_version>(\d+\.\d+)</wp:wxr_version>|', $importline, $version ) ) {
$wxr_version = $version[1];
}
if ( false !== strpos( $importline, '<wp:base_site_url>' ) ) {
preg_match( '|<wp:base_site_url>(.*?)</wp:base_site_url>|is', $importline, $url );
$this->base_url = $url[1];
continue;
}
if ( false !== strpos( $importline, '<wp:category>' ) ) {
preg_match( '|<wp:category>(.*?)</wp:category>|is', $importline, $category );
$this->categories[] = $this->process_category( $category[1] );
continue;
}
if ( false !== strpos( $importline, '<wp:tag>' ) ) {
preg_match( '|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag );
$this->tags[] = $this->process_tag( $tag[1] );
continue;
}
if ( false !== strpos( $importline, '<wp:term>' ) ) {
preg_match( '|<wp:term>(.*?)</wp:term>|is', $importline, $term );
$this->terms[] = $this->process_term( $term[1] );
continue;
}
if ( false !== strpos( $importline, '<wp:author>' ) ) {
preg_match( '|<wp:author>(.*?)</wp:author>|is', $importline, $author );
$a = $this->process_author( $author[1] );
$this->authors[ $a['author_login'] ] = $a;
continue;
}
if ( false !== strpos( $importline, '<item>' ) ) {
$post = '';
$in_post = true;
continue;
}
if ( false !== strpos( $importline, '</item>' ) ) {
$in_post = false;
$this->posts[] = $this->process_post( $post );
continue;
}
if ( $in_post ) {
$post .= $importline . "\n";
}
}
$this->fclose( $fp );
}
if ( ! $wxr_version ) {
return new WP_Error( 'WXR_parse_error', esc_html__( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'js_composer' ) );
}
return array(
'authors' => $this->authors,
'posts' => $this->posts,
'categories' => $this->categories,
'tags' => $this->tags,
'terms' => $this->terms,
'base_url' => $this->base_url,
'version' => $wxr_version,
);
}
/**
* @param $string
* @param $tag
* @return mixed|string|string[]|null
*/
public function get_tag( $string, $tag ) {
preg_match( "|<$tag.*?>(.*?)</$tag>|is", $string, $return );
if ( isset( $return[1] ) ) {
if ( substr( $return[1], 0, 9 ) === '<![CDATA[' ) {
if ( strpos( $return[1], ']]]]><![CDATA[>' ) !== false ) {
preg_match_all( '|<!\[CDATA\[(.*?)\]\]>|s', $return[1], $matches );
$return = '';
foreach ( $matches[1] as $match ) {
$return .= $match;
}
} else {
$return = preg_replace( '|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1] );
}
} else {
$return = $return[1];
}
} else {
$return = '';
}
return $return;
}
/**
* @param $c
* @return array
*/
public function process_category( $c ) {
return array(
'term_id' => $this->get_tag( $c, 'wp:term_id' ),
'cat_name' => $this->get_tag( $c, 'wp:cat_name' ),
'category_nicename' => $this->get_tag( $c, 'wp:category_nicename' ),
'category_parent' => $this->get_tag( $c, 'wp:category_parent' ),
'category_description' => $this->get_tag( $c, 'wp:category_description' ),
);
}
/**
* @param $t
* @return array
*/
public function process_tag( $t ) {
return array(
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
'tag_name' => $this->get_tag( $t, 'wp:tag_name' ),
'tag_slug' => $this->get_tag( $t, 'wp:tag_slug' ),
'tag_description' => $this->get_tag( $t, 'wp:tag_description' ),
);
}
/**
* @param $t
* @return array
*/
public function process_term( $t ) {
return array(
'term_id' => $this->get_tag( $t, 'wp:term_id' ),
'term_taxonomy' => $this->get_tag( $t, 'wp:term_taxonomy' ),
'slug' => $this->get_tag( $t, 'wp:term_slug' ),
'term_parent' => $this->get_tag( $t, 'wp:term_parent' ),
'term_name' => $this->get_tag( $t, 'wp:term_name' ),
'term_description' => $this->get_tag( $t, 'wp:term_description' ),
);
}
/**
* @param $a
* @return array
*/
public function process_author( $a ) {
return array(
'author_id' => $this->get_tag( $a, 'wp:author_id' ),
'author_login' => $this->get_tag( $a, 'wp:author_login' ),
'author_email' => $this->get_tag( $a, 'wp:author_email' ),
'author_display_name' => $this->get_tag( $a, 'wp:author_display_name' ),
'author_first_name' => $this->get_tag( $a, 'wp:author_first_name' ),
'author_last_name' => $this->get_tag( $a, 'wp:author_last_name' ),
);
}
/**
* @param $post
* @return array
*/
public function process_post( $post ) {
$post_id = $this->get_tag( $post, 'wp:post_id' );
$post_title = $this->get_tag( $post, 'title' );
$post_date = $this->get_tag( $post, 'wp:post_date' );
$post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
$comment_status = $this->get_tag( $post, 'wp:comment_status' );
$ping_status = $this->get_tag( $post, 'wp:ping_status' );
$status = $this->get_tag( $post, 'wp:status' );
$post_name = $this->get_tag( $post, 'wp:post_name' );
$post_parent = $this->get_tag( $post, 'wp:post_parent' );
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
$post_type = $this->get_tag( $post, 'wp:post_type' );
$post_password = $this->get_tag( $post, 'wp:post_password' );
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
$guid = $this->get_tag( $post, 'guid' );
$post_author = $this->get_tag( $post, 'dc:creator' );
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
$post_excerpt = preg_replace_callback( '|<(/?[A-Z]+)|', array(
$this,
'normalize_tag',
), $post_excerpt );
$post_excerpt = str_replace( '<br>', '<br />', $post_excerpt );
$post_excerpt = str_replace( '<hr>', '<hr />', $post_excerpt );
$post_content = $this->get_tag( $post, 'content:encoded' );
$post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array(
$this,
'normalize_tag',
), $post_content );
$post_content = str_replace( '<br>', '<br />', $post_content );
$post_content = str_replace( '<hr>', '<hr />', $post_content );
$postdata = compact( 'post_id', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password', 'is_sticky' );
$attachment_url = $this->get_tag( $post, 'wp:attachment_url' );
if ( $attachment_url ) {
$postdata['attachment_url'] = $attachment_url;
}
preg_match_all( '|<category domain="([^"]+?)" nicename="([^"]+?)">(.+?)</category>|is', $post, $terms, PREG_SET_ORDER );
foreach ( $terms as $t ) {
$post_terms[] = array(
'slug' => $t[2],
'domain' => $t[1],
'name' => str_replace( array(
'<![CDATA[',
']]>',
), '', $t[3] ),
);
}
if ( ! empty( $post_terms ) ) {
$postdata['terms'] = $post_terms;
}
preg_match_all( '|<wp:comment>(.+?)</wp:comment>|is', $post, $comments );
$comments = $comments[1];
if ( $comments ) {
foreach ( $comments as $comment ) {
preg_match_all( '|<wp:commentmeta>(.+?)</wp:commentmeta>|is', $comment, $commentmeta );
$commentmeta = $commentmeta[1];
$c_meta = array();
foreach ( $commentmeta as $m ) {
$c_meta[] = array(
'key' => $this->get_tag( $m, 'wp:meta_key' ),
'value' => $this->get_tag( $m, 'wp:meta_value' ),
);
}
$post_comments[] = array(
'comment_id' => $this->get_tag( $comment, 'wp:comment_id' ),
'comment_author' => $this->get_tag( $comment, 'wp:comment_author' ),
'comment_author_email' => $this->get_tag( $comment, 'wp:comment_author_email' ),
'comment_author_IP' => $this->get_tag( $comment, 'wp:comment_author_IP' ),
'comment_author_url' => $this->get_tag( $comment, 'wp:comment_author_url' ),
'comment_date' => $this->get_tag( $comment, 'wp:comment_date' ),
'comment_date_gmt' => $this->get_tag( $comment, 'wp:comment_date_gmt' ),
'comment_content' => $this->get_tag( $comment, 'wp:comment_content' ),
'comment_approved' => $this->get_tag( $comment, 'wp:comment_approved' ),
'comment_type' => $this->get_tag( $comment, 'wp:comment_type' ),
'comment_parent' => $this->get_tag( $comment, 'wp:comment_parent' ),
'comment_user_id' => $this->get_tag( $comment, 'wp:comment_user_id' ),
'commentmeta' => $c_meta,
);
}
}
if ( ! empty( $post_comments ) ) {
$postdata['comments'] = $post_comments;
}
preg_match_all( '|<wp:postmeta>(.+?)</wp:postmeta>|is', $post, $postmeta );
$postmeta = $postmeta[1];
if ( $postmeta ) {
foreach ( $postmeta as $p ) {
$post_postmeta[] = array(
'key' => $this->get_tag( $p, 'wp:meta_key' ),
'value' => $this->get_tag( $p, 'wp:meta_value' ),
);
}
}
if ( ! empty( $post_postmeta ) ) {
$postdata['postmeta'] = $post_postmeta;
}
return $postdata;
}
/**
* @param $matches
* @return string
*/
public function normalize_tag( $matches ) {
return '<' . strtolower( $matches[1] );
}
/**
* @param $filename
* @param string $mode
* @return bool|resource
*/
public function fopen( $filename, $mode = 'r' ) {
if ( $this->has_gzip ) {
return gzopen( $filename, $mode );
}
// @codingStandardsIgnoreLine
return fopen( $filename, $mode );
}
/**
* @param $fp
* @return bool|int
*/
public function feof( $fp ) {
if ( $this->has_gzip ) {
return gzeof( $fp );
}
// @codingStandardsIgnoreLine
return feof( $fp );
}
/**
* @param $fp
* @param int $len
* @return bool|string
*/
public function fgets( $fp, $len = 8192 ) {
if ( $this->has_gzip ) {
return gzgets( $fp, $len );
}
// @codingStandardsIgnoreLine
return fgets( $fp, $len );
}
/**
* @param $fp
* @return bool
*/
public function fclose( $fp ) {
if ( $this->has_gzip ) {
return gzclose( $fp );
}
// @codingStandardsIgnoreLine
return fclose( $fp );
}
}
classes/core/shared-templates/importer/class-vc-wxr-parser-plugin.php 0000644 00000012372 15121635560 0022075 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_WXR_Parser_Plugin
*/
class Vc_WXR_Parser_Plugin {
public $shortcodes = array(
'gallery' => array(
'ids',
),
'vc_single_image' => array(
'image',
),
'vc_gallery' => array(
'images',
),
'vc_images_carousel' => array(
'images',
),
'vc_media_grid' => array(
'include',
),
'vc_masonry_media_grid' => array(
'include',
),
);
protected $remaps = 0;
public function __construct() {
$this->shortcodes = apply_filters( 'vc_shared_templates_import_shortcodes', $this->shortcodes );
add_filter( 'vc_import_post_data_processed', array(
$this,
'processPostContent',
) );
add_action( 'vc_import_pre_end', array(
$this,
'remapIdsInPosts',
) );
}
private $idsRemap = array();
/**
* @param array $postdata
*
* @return array
*/
public function processPostContent( $postdata ) {
if ( ! empty( $postdata['post_content'] ) && 'vc4_templates' === $postdata['post_type'] ) {
$this->parseShortcodes( $postdata['post_content'] );
}
return $postdata;
}
/**
* @param Vc_WP_Import $importer
*/
public function remapIdsInPosts( $importer ) {
$currentPost = reset( $importer->processed_posts );
// Nothing to remap or something wrong
if ( ! $currentPost ) {
return;
}
$post = get_post( $currentPost );
if ( empty( $post ) || ! is_object( $post ) || 'vc4_templates' !== $post->post_type ) {
return;
}
// We ready to remap attributes in processed attachments
$attachments = $importer->processed_attachments;
$this->remaps = 0;
$newContent = $this->processAttachments( $attachments, $post->post_content );
if ( $this->remaps ) {
$post->post_content = $newContent;
wp_update_post( $post );
}
}
/**
* @param $attachments
* @param $content
* @return mixed
*/
protected function processAttachments( $attachments, $content ) {
if ( ! empty( $this->idsRemap ) ) {
foreach ( $this->idsRemap as $shortcode ) {
$tag = $shortcode['tag'];
$attributes = $this->shortcodes[ $tag ];
$rawQuery = $shortcode['attrs_query'];
$newQuery = $this->shortcodeAttributes( $shortcode, $attributes, $rawQuery, $attachments );
if ( $newQuery ) {
$content = str_replace( $rawQuery, $newQuery, $content );
$this->remaps ++;
}
}
}
$urlRegex = '#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|(?:[^[:punct:]\s]|/))#';
$urlMatches = array();
preg_match_all( $urlRegex, $content, $urlMatches );
if ( ! empty( $urlMatches[0] ) ) {
foreach ( $urlMatches[0] as $url ) {
$idsMatches = array();
preg_match_all( '/id\=(?P<id>\d+)/', $url, $idsMatches );
if ( ! empty( $idsMatches['id'] ) ) {
$this->remaps = true;
$vals = array_map( 'intval', $idsMatches['id'] );
$content = $this->remapAttachmentUrls( $attachments, $content, $url, $vals );
}
}
}
return $content;
}
/**
* @param $attachments
* @param $content
* @param $url
* @param $vals
* @return mixed
*/
protected function remapAttachmentUrls( $attachments, $content, $url, $vals ) {
foreach ( $vals as $oldAttachmentId ) {
if ( isset( $attachments[ $oldAttachmentId ] ) ) {
$newUrl = wp_get_attachment_url( $attachments[ $oldAttachmentId ] );
$content = str_replace( $url, $newUrl . '?id=' . $attachments[ $oldAttachmentId ], $content );
}
}
return $content;
}
/**
* @param $shortcode
* @param $attributes
* @param $newQuery
* @param $attachments
* @return bool|mixed
*/
protected function shortcodeAttributes( $shortcode, $attributes, $newQuery, $attachments ) {
$replacements = 0;
foreach ( $attributes as $attribute ) {
// for example in vc_single_image 'image' attribute
if ( isset( $shortcode['attrs'][ $attribute ] ) ) {
$attributeValue = $shortcode['attrs'][ $attribute ];
$attributeValues = explode( ',', $attributeValue );
$newValues = $attributeValues;
array_walk( $newValues, array(
$this,
'attributesWalker',
), array(
'attachments' => $attachments,
) );
$newAttributeValue = implode( ',', $newValues );
$newQuery = str_replace( sprintf( '%s="%s"', $attribute, $attributeValue ), sprintf( '%s="%s"', $attribute, $newAttributeValue ), $newQuery );
$replacements ++;
}
}
if ( $replacements ) {
return $newQuery;
}
return false;
}
/**
* @param $attributeValue
* @param $key
* @param $data
*/
public function attributesWalker( &$attributeValue, $key, $data ) {
$intValue = intval( $attributeValue );
if ( array_key_exists( $intValue, $data['attachments'] ) ) {
$attributeValue = $data['attachments'][ $intValue ];
}
}
/**
* @param $content
* @return array
*/
private function parseShortcodes( $content ) {
WPBMap::addAllMappedShortcodes();
preg_match_all( '/' . get_shortcode_regex() . '/', trim( $content ), $found );
if ( count( $found[2] ) === 0 ) {
return $this->idsRemap;
}
foreach ( $found[2] as $index => $tag ) {
$content = $found[5][ $index ];
$shortcode = array(
'tag' => $tag,
'attrs_query' => $found[3][ $index ],
'attrs' => shortcode_parse_atts( $found[3][ $index ] ),
);
if ( array_key_exists( $tag, $this->shortcodes ) ) {
$this->idsRemap[] = $shortcode;
}
$this->idsRemap = $this->parseShortcodes( $content );
}
return $this->idsRemap;
}
}
classes/core/shared-templates/importer/class-vc-wxr-parser-simplexml.php 0000644 00000017013 15121635560 0022606 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WXR Parser that makes use of the SimpleXML PHP extension.
*/
class Vc_WXR_Parser_SimpleXML {
/**
* @param $file
* @return array|\WP_Error
*/
public function parse( $file ) {
$authors = array();
$posts = array();
$categories = array();
$tags = array();
$terms = array();
$internal_errors = libxml_use_internal_errors( true );
$dom = new DOMDocument();
$old_value = null;
if ( function_exists( 'libxml_disable_entity_loader' ) ) {
$old_value = libxml_disable_entity_loader( true );
}
/** @var \WP_Filesystem_Direct $wp_filesystem */
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem( false, false, true );
}
$success = $dom->loadXML( $wp_filesystem->get_contents( $file ) );
if ( ! is_null( $old_value ) ) {
libxml_disable_entity_loader( $old_value );
}
if ( ! $success || isset( $dom->doctype ) ) {
return new WP_Error( 'SimpleXML_parse_error', esc_html__( 'There was an error when reading this WXR file', 'js_composer' ), libxml_get_errors() );
}
$xml = simplexml_import_dom( $dom );
unset( $dom );
// halt if loading produces an error
if ( ! $xml ) {
return new WP_Error( 'SimpleXML_parse_error', esc_html__( 'There was an error when reading this WXR file', 'js_composer' ), libxml_get_errors() );
}
$wxr_version = $xml->xpath( '/rss/channel/wp:wxr_version' );
if ( ! $wxr_version ) {
return new WP_Error( 'WXR_parse_error', esc_html__( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'js_composer' ) );
}
$wxr_version = (string) trim( $wxr_version[0] );
// confirm that we are dealing with the correct file format
if ( ! preg_match( '/^\d+\.\d+$/', $wxr_version ) ) {
return new WP_Error( 'WXR_parse_error', esc_html__( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'js_composer' ) );
}
$base_url = $xml->xpath( '/rss/channel/wp:base_site_url' );
$base_url = (string) trim( $base_url[0] );
$namespaces = $xml->getDocNamespaces();
if ( ! isset( $namespaces['wp'] ) ) {
$namespaces['wp'] = 'http://wordpress.org/export/1.1/';
}
if ( ! isset( $namespaces['excerpt'] ) ) {
$namespaces['excerpt'] = 'http://wordpress.org/export/1.1/excerpt/';
}
// grab authors
foreach ( $xml->xpath( '/rss/channel/wp:author' ) as $author_arr ) {
$a = $author_arr->children( $namespaces['wp'] );
$login = (string) $a->author_login;
$authors[ $login ] = array(
'author_id' => (int) $a->author_id,
'author_login' => $login,
'author_email' => (string) $a->author_email,
'author_display_name' => (string) $a->author_display_name,
'author_first_name' => (string) $a->author_first_name,
'author_last_name' => (string) $a->author_last_name,
);
}
// grab cats, tags and terms
foreach ( $xml->xpath( '/rss/channel/wp:category' ) as $term_arr ) {
$t = $term_arr->children( $namespaces['wp'] );
$category = array(
'term_id' => (int) $t->term_id,
'category_nicename' => (string) $t->category_nicename,
'category_parent' => (string) $t->category_parent,
'cat_name' => (string) $t->cat_name,
'category_description' => (string) $t->category_description,
);
foreach ( $t->termmeta as $meta ) {
$category['termmeta'][] = array(
'key' => (string) $meta->meta_key,
'value' => (string) $meta->meta_value,
);
}
$categories[] = $category;
}
foreach ( $xml->xpath( '/rss/channel/wp:tag' ) as $term_arr ) {
$t = $term_arr->children( $namespaces['wp'] );
$tag = array(
'term_id' => (int) $t->term_id,
'tag_slug' => (string) $t->tag_slug,
'tag_name' => (string) $t->tag_name,
'tag_description' => (string) $t->tag_description,
);
foreach ( $t->termmeta as $meta ) {
$tag['termmeta'][] = array(
'key' => (string) $meta->meta_key,
'value' => (string) $meta->meta_value,
);
}
$tags[] = $tag;
}
foreach ( $xml->xpath( '/rss/channel/wp:term' ) as $term_arr ) {
$t = $term_arr->children( $namespaces['wp'] );
$term = array(
'term_id' => (int) $t->term_id,
'term_taxonomy' => (string) $t->term_taxonomy,
'slug' => (string) $t->term_slug,
'term_parent' => (string) $t->term_parent,
'term_name' => (string) $t->term_name,
'term_description' => (string) $t->term_description,
);
foreach ( $t->termmeta as $meta ) {
$term['termmeta'][] = array(
'key' => (string) $meta->meta_key,
'value' => (string) $meta->meta_value,
);
}
$terms[] = $term;
}
// grab posts
foreach ( $xml->channel->item as $item ) {
$post = array(
'post_title' => (string) $item->title,
'guid' => (string) $item->guid,
);
$dc = $item->children( 'http://purl.org/dc/elements/1.1/' );
$post['post_author'] = (string) $dc->creator;
$content = $item->children( 'http://purl.org/rss/1.0/modules/content/' );
$excerpt = $item->children( $namespaces['excerpt'] );
$post['post_content'] = (string) $content->encoded;
$post['post_excerpt'] = (string) $excerpt->encoded;
$wp = $item->children( $namespaces['wp'] );
$post['post_id'] = (int) $wp->post_id;
$post['post_date'] = (string) $wp->post_date;
$post['post_date_gmt'] = (string) $wp->post_date_gmt;
$post['comment_status'] = (string) $wp->comment_status;
$post['ping_status'] = (string) $wp->ping_status;
$post['post_name'] = (string) $wp->post_name;
$post['status'] = (string) $wp->status;
$post['post_parent'] = (int) $wp->post_parent;
$post['menu_order'] = (int) $wp->menu_order;
$post['post_type'] = (string) $wp->post_type;
$post['post_password'] = (string) $wp->post_password;
$post['is_sticky'] = (int) $wp->is_sticky;
if ( isset( $wp->attachment_url ) ) {
$post['attachment_url'] = (string) $wp->attachment_url;
}
foreach ( $item->category as $c ) {
$att = $c->attributes();
if ( isset( $att['nicename'] ) ) {
$post['terms'][] = array(
'name' => (string) $c,
'slug' => (string) $att['nicename'],
'domain' => (string) $att['domain'],
);
}
}
foreach ( $wp->postmeta as $meta ) {
$post['postmeta'][] = array(
'key' => (string) $meta->meta_key,
'value' => (string) $meta->meta_value,
);
}
foreach ( $wp->comment as $comment ) {
$meta = array();
if ( isset( $comment->commentmeta ) ) {
foreach ( $comment->commentmeta as $m ) {
$meta[] = array(
'key' => (string) $m->meta_key,
'value' => (string) $m->meta_value,
);
}
}
$post['comments'][] = array(
'comment_id' => (int) $comment->comment_id,
'comment_author' => (string) $comment->comment_author,
'comment_author_email' => (string) $comment->comment_author_email,
'comment_author_IP' => (string) $comment->comment_author_IP,
'comment_author_url' => (string) $comment->comment_author_url,
'comment_date' => (string) $comment->comment_date,
'comment_date_gmt' => (string) $comment->comment_date_gmt,
'comment_content' => (string) $comment->comment_content,
'comment_approved' => (string) $comment->comment_approved,
'comment_type' => (string) $comment->comment_type,
'comment_parent' => (string) $comment->comment_parent,
'comment_user_id' => (int) $comment->comment_user_id,
'commentmeta' => $meta,
);
}
$posts[] = $post;
}
return array(
'authors' => $authors,
'posts' => $posts,
'categories' => $categories,
'tags' => $tags,
'terms' => $terms,
'base_url' => $base_url,
'version' => $wxr_version,
);
}
}
classes/core/shared-templates/importer/class-vc-wp-import.php 0000644 00000050370 15121635560 0020425 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/*
* Modified by WPBakery Page Builder team
WordPress Importer
http://wordpress.org/extend/plugins/wordpress-importer/
Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file.
Author: wordpressdotorg
Author URI: http://wordpress.org/
Version: 0.6.3 with fixes and enchancements from WPBakery Page Builder
Text Domain: js_composer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
// Load Importer API
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) ) {
require $class_wp_importer;
}
}
// include WXR file parsers
require_once dirname( __FILE__ ) . '/class-vc-wxr-parser.php';
/**
* WordPress Importer class for managing the import process of a WXR file
*
* @package WordPress
* @subpackage Importer
*/
if ( class_exists( 'WP_Importer' ) ) {
/**
* Class Vc_WP_Import
*/
class Vc_WP_Import extends WP_Importer {
/**
* @var float
*/
public $max_wxr_version = 1.2; // max. supported WXR version
/**
* @var
*/
public $id;
/**
* @var information to import from WXR file
*/
public $version;
/**
* @var array
*/
public $posts = array();
/**
* @var string
*/
public $base_url = '';
// mappings from old information to new
/**
* @var array
*/
public $processed_posts = array();
/**
* @var array
*/
public $processed_attachments = array();
/**
* @var array
*/
public $post_orphans = array();
/**
* @var bool
*/
public $fetch_attachments = true;
/**
* @var array
*/
public $url_remap = array();
/**
* @var array
*/
public $featured_images = array();
/**
* The main controller for the actual import stage.
*
* @param string $file Path to the WXR file for importing
*/
public function import( $file ) {
add_filter( 'vc_import_post_meta_key', array(
$this,
'is_valid_meta_key',
) );
add_filter( 'http_request_timeout', array(
$this,
'bump_request_timeout',
) );
$this->import_start( $file );
wp_suspend_cache_invalidation( true );
$this->process_posts();
wp_suspend_cache_invalidation( false );
// update incorrect/missing information in the DB
$this->backfill_parents();
$this->backfill_attachment_urls();
$this->remap_featured_images();
do_action( 'vc_import_pre_end', $this );
$this->import_end();
}
/**
* Parses the WXR file and prepares us for the task of processing parsed data
*
* @param string $file Path to the WXR file for importing
*/
public function import_start( $file ) {
if ( ! is_file( $file ) ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'js_composer' ) . '</strong><br />';
echo esc_html__( 'The file does not exist, please try again.', 'js_composer' ) . '</p>';
die();
}
$import_data = $this->parse( $file );
if ( is_wp_error( $import_data ) ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'js_composer' ) . '</strong><br />';
/** @var \WP_Error $import_data */
echo esc_html( $import_data->get_error_message() ) . '</p>';
die();
}
$this->version = $import_data['version'];
$this->posts = $import_data['posts'];
$this->base_url = esc_url( $import_data['base_url'] );
wp_defer_term_counting( true );
wp_defer_comment_counting( true );
do_action( 'vc_import_start' );
}
/**
* Performs post-import cleanup of files and the cache
*/
public function import_end() {
wp_import_cleanup( $this->id );
wp_cache_flush();
foreach ( get_taxonomies() as $tax ) {
delete_option( "{$tax}_children" );
_get_term_hierarchy( $tax );
}
wp_defer_term_counting( false );
wp_defer_comment_counting( false );
do_action( 'vc_import_end' );
return true;
}
/**
* Handles the WXR upload and initial parsing of the file to prepare for
* displaying author import options
*
* @return bool False if error uploading or invalid file, true otherwise
*/
public function handle_upload() {
$file = wp_import_handle_upload();
if ( isset( $file['error'] ) ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'js_composer' ) . '</strong><br />';
echo esc_html( $file['error'] ) . '</p>';
return false;
} elseif ( ! file_exists( $file['file'] ) ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'js_composer' ) . '</strong><br />';
printf( esc_html__( 'The export file could not be found at %s. It is likely that this was caused by a permissions problem.', 'js_composer' ), '<code>' . esc_html( $file['file'] ) . '</code>' );
echo '</p>';
return false;
}
$this->id = (int) $file['id'];
$import_data = $this->parse( $file['file'] );
if ( is_wp_error( $import_data ) ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'js_composer' ) . '</strong><br />';
/** @var \WP_Error $import_data */
echo esc_html( $import_data->get_error_message() ) . '</p>';
return false;
}
$this->version = $import_data['version'];
if ( $this->version > $this->max_wxr_version ) {
echo '<div class="error"><p><strong>';
printf( esc_html__( 'This WXR file (version %s) may not be supported by this version of the importer. Please consider updating.', 'js_composer' ), esc_html( $import_data['version'] ) );
echo '</strong></p></div>';
}
return true;
}
/**
* Create new posts based on import information
*
* Posts marked as having a parent which doesn't exist will become top level items.
* Doesn't create a new post if: the post type doesn't exist, the given post ID
* is already noted as imported or a post with the same title and date already exists.
* Note that new/updated terms, comments and meta are imported for the last of the above.
*/
public function process_posts() {
$status = array();
$this->posts = apply_filters( 'vc_import_posts', $this->posts );
if ( is_array( $this->posts ) && ! empty( $this->posts ) ) {
foreach ( $this->posts as $post ) {
$post = apply_filters( 'vc_import_post_data_raw', $post );
if ( ! post_type_exists( $post['post_type'] ) ) {
$status[] = array(
'success' => false,
'code' => 'invalid_post_type',
'post' => $post,
);
do_action( 'vc_import_post_exists', $post );
continue;
}
if ( isset( $this->processed_posts[ $post['post_id'] ] ) && ! empty( $post['post_id'] ) ) {
continue;
}
if ( 'auto-draft' === $post['status'] ) {
continue;
}
$post_parent = (int) $post['post_parent'];
if ( $post_parent ) {
// if we already know the parent, map it to the new local ID
if ( isset( $this->processed_posts[ $post_parent ] ) ) {
$post_parent = $this->processed_posts[ $post_parent ];
// otherwise record the parent for later
} else {
$this->post_orphans[ intval( $post['post_id'] ) ] = $post_parent;
$post_parent = 0;
}
}
// map the post author
$author = (int) get_current_user_id();
$postdata = array(
'post_author' => $author,
'post_date' => $post['post_date'],
'post_date_gmt' => $post['post_date_gmt'],
'post_content' => $post['post_content'],
'post_excerpt' => $post['post_excerpt'],
'post_title' => $post['post_title'],
'post_status' => $post['status'],
'post_name' => $post['post_name'],
'comment_status' => $post['comment_status'],
'ping_status' => $post['ping_status'],
'guid' => $post['guid'],
'post_parent' => $post_parent,
'menu_order' => $post['menu_order'],
'post_type' => $post['post_type'],
'post_password' => $post['post_password'],
);
$original_post_ID = $post['post_id'];
$postdata = apply_filters( 'vc_import_post_data_processed', $postdata, $post, $this );
$postdata = wp_slash( $postdata );
if ( 'attachment' === $postdata['post_type'] ) {
$remote_url = ! empty( $post['attachment_url'] ) ? $post['attachment_url'] : $post['guid'];
// try to use _wp_attached file for upload folder placement to ensure the same location as the export site
// e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
$postdata['upload_date'] = $post['post_date'];
if ( isset( $post['postmeta'] ) ) {
foreach ( $post['postmeta'] as $meta ) {
if ( '_wp_attached_file' === $meta['key'] ) {
if ( preg_match( '%^[0-9]{4}/[0-9]{2}%', $meta['value'], $matches ) ) {
$postdata['upload_date'] = $matches[0];
}
break;
}
}
}
$post_id = $this->process_attachment( $postdata, $remote_url, $original_post_ID );
} else {
$post_id = wp_insert_post( $postdata, true );
do_action( 'vc_import_insert_post', $post_id, $original_post_ID, $postdata, $post );
// map pre-import ID to local ID
$this->processed_posts[ intval( $post['post_id'] ) ] = (int) $post_id;
}
if ( is_wp_error( $post_id ) ) {
$status[] = array(
'success' => false,
'code' => 'wp_error',
'post' => $post_id,
);
continue;
}
if ( true === $post['is_sticky'] ) {
stick_post( $post_id );
}
if ( ! isset( $post['postmeta'] ) ) {
$post['postmeta'] = array();
}
$post['postmeta'] = apply_filters( 'vc_import_post_meta', $post['postmeta'], $post_id, $post );
// add/update post meta
if ( ! empty( $post['postmeta'] ) ) {
foreach ( $post['postmeta'] as $meta ) {
$key = apply_filters( 'vc_import_post_meta_key', $meta['key'], $post_id, $post );
$value = false;
if ( '_edit_last' === $key ) {
$key = false;
}
if ( $key ) {
// export gets meta straight from the DB so could have a serialized string
if ( ! $value ) {
$value = maybe_unserialize( $meta['value'] );
}
add_post_meta( $post_id, $key, $value );
do_action( 'vc_import_post_meta', $post_id, $key, $value );
// if the post has a featured image, take note of this in case of remap
if ( '_thumbnail_id' === $key ) {
$this->featured_images[ $post_id ] = (int) $value;
}
}
}
}
}
}
unset( $this->posts );
return $status;
}
/**
* If fetching attachments is enabled then attempt to create a new attachment
*
* @param array $post Attachment post details from WXR
* @param string $url URL to fetch attachment from
* @param $original_post_ID
* @return int|\WP_Error Post ID on success, WP_Error otherwise
*/
public function process_attachment( $post, $url, $original_post_ID ) {
if ( ! $this->fetch_attachments ) {
return new WP_Error( 'attachment_processing_error', esc_html__( 'Fetching attachments is not enabled', 'js_composer' ) );
}
// if the URL is absolute, but does not contain address, then upload it assuming base_site_url
if ( preg_match( '|^/[\w\W]+$|', $url ) ) {
$url = rtrim( $this->base_url, '/' ) . $url;
}
$upload = $this->fetch_remote_file( $url, $post );
if ( is_wp_error( $upload ) ) {
return $upload;
}
$info = wp_check_filetype( $upload['file'] );
if ( $info ) {
$post['post_mime_type'] = $info['type'];
} else {
return new WP_Error( 'attachment_processing_error', esc_html__( 'Invalid file type', 'js_composer' ) );
}
$post['guid'] = $upload['url'];
// as per wp-admin/includes/upload.php
$post_id = wp_insert_attachment( $post, $upload['file'] );
wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
// remap resized image URLs, works by stripping the extension and remapping the URL stub.
if ( preg_match( '!^image/!', $info['type'] ) ) {
$parts = pathinfo( $url );
$name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
$parts_new = pathinfo( $upload['url'] );
$name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
$this->url_remap[ $parts['dirname'] . '/' . $name ] = $parts_new['dirname'] . '/' . $name_new;
}
$this->processed_attachments[ intval( $original_post_ID ) ] = (int) $post_id;
return $post_id;
}
/**
* @param $url
* @param bool $file_path
* @return array|bool|\Requests_Utility_CaseInsensitiveDictionary
*/
private function wp_get_http( $url, $file_path = false ) {
set_time_limit( 60 );
$options = array();
$options['redirection'] = 5;
$options['method'] = 'GET';
$response = wp_safe_remote_request( $url, $options );
if ( is_wp_error( $response ) ) {
return false;
}
$headers = wp_remote_retrieve_headers( $response );
$headers['response'] = wp_remote_retrieve_response_code( $response );
if ( ! $file_path ) {
return $headers;
}
// GET request - write it to the supplied filename
// @codingStandardsIgnoreLine
$out_fp = fopen( $file_path, 'w' );
if ( ! $out_fp ) {
return $headers;
}
// @codingStandardsIgnoreLine
fwrite( $out_fp, wp_remote_retrieve_body( $response ) );
// @codingStandardsIgnoreLine
fclose( $out_fp );
clearstatcache();
return $headers;
}
/**
* Attempt to download a remote file attachment
*
* @param string $url URL of item to fetch
* @param array $post Attachment details
* @return array|WP_Error Local file location details on success, WP_Error otherwise
*/
public function fetch_remote_file( $url, $post ) {
// extract the file name and extension from the url
$file_name = basename( $url );
// get placeholder file in the upload dir with a unique, sanitized filename
$upload = wp_upload_bits( $file_name, null, '', $post['upload_date'] );
if ( $upload['error'] ) {
return new WP_Error( 'upload_dir_error', $upload['error'] );
}
// fetch the remote url and write it to the placeholder file
$headers = $this->wp_get_http( $url, $upload['file'] );
// request failed
if ( ! $headers ) {
// @codingStandardsIgnoreLine
@unlink( $upload['file'] );
return new WP_Error( 'import_file_error', esc_html__( 'Remote server did not respond', 'js_composer' ) );
}
// make sure the fetch was successful
if ( intval( $headers['response'] ) !== 200 ) {
// @codingStandardsIgnoreLine
@unlink( $upload['file'] );
return new WP_Error( 'import_file_error', sprintf( esc_html__( 'Remote server returned error response %1$d %2$s', 'js_composer' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) ) );
}
$filesize = filesize( $upload['file'] );
if ( isset( $headers['content-length'] ) && intval( $headers['content-length'] ) !== $filesize ) {
// @codingStandardsIgnoreLine
@unlink( $upload['file'] );
return new WP_Error( 'import_file_error', esc_html__( 'Remote file is incorrect size', 'js_composer' ) );
}
if ( ! $filesize ) {
// @codingStandardsIgnoreLine
@unlink( $upload['file'] );
return new WP_Error( 'import_file_error', esc_html__( 'Zero size file downloaded', 'js_composer' ) );
}
$max_size = (int) $this->max_attachment_size();
if ( ! empty( $max_size ) && $filesize > $max_size ) {
// @codingStandardsIgnoreLine
@unlink( $upload['file'] );
return new WP_Error( 'import_file_error', sprintf( esc_html__( 'Remote file is too large, limit is %s', 'js_composer' ), size_format( $max_size ) ) );
}
// keep track of the old and new urls so we can substitute them later
$this->url_remap[ $url ] = $upload['url'];
$this->url_remap[ $post['guid'] ] = $upload['url']; // r13735, really needed?
// keep track of the destination if the remote url is redirected somewhere else
if ( isset( $headers['x-final-location'] ) && $headers['x-final-location'] !== $url ) {
$this->url_remap[ $headers['x-final-location'] ] = $upload['url'];
}
return $upload;
}
/**
* Attempt to associate posts and menu items with previously missing parents
*
* An imported post's parent may not have been imported when it was first created
* so try again. Similarly for child menu items and menu items which were missing
* the object (e.g. post) they represent in the menu
*/
public function backfill_parents() {
global $wpdb;
// find parents for post orphans
foreach ( $this->post_orphans as $child_id => $parent_id ) {
$local_child_id = false;
$local_parent_id = false;
if ( isset( $this->processed_posts[ $child_id ] ) ) {
$local_child_id = $this->processed_posts[ $child_id ];
}
if ( isset( $this->processed_posts[ $parent_id ] ) ) {
$local_parent_id = $this->processed_posts[ $parent_id ];
}
if ( $local_child_id && $local_parent_id ) {
// @codingStandardsIgnoreLine
$wpdb->update( $wpdb->posts, array( 'post_parent' => $local_parent_id ), array( 'ID' => $local_child_id ), '%d', '%d' );
}
}
}
/**
* Use stored mapping information to update old attachment URLs
*/
public function backfill_attachment_urls() {
global $wpdb;
// make sure we do the longest urls first, in case one is a substring of another
uksort( $this->url_remap, array(
$this,
'cmpr_strlen',
) );
foreach ( $this->url_remap as $from_url => $to_url ) {
// remap urls in post_content
// @codingStandardsIgnoreLine
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ) );
// remap enclosure urls
// @codingStandardsIgnoreLine
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url ) );
}
}
/**
* Update _thumbnail_id meta to new, imported attachment IDs
*/
public function remap_featured_images() {
// cycle through posts that have a featured image
foreach ( $this->featured_images as $post_id => $value ) {
if ( isset( $this->processed_posts[ $value ] ) ) {
$new_id = $this->processed_posts[ $value ];
// only update if there's a difference
if ( $new_id !== $value ) {
update_post_meta( $post_id, '_thumbnail_id', $new_id );
}
}
}
}
/**
* Parse a WXR file
*
* @param string $file Path to WXR file for parsing
* @return array Information gathered from the WXR file
*/
public function parse( $file ) {
$parser = new Vc_WXR_Parser();
return $parser->parse( $file );
}
/**
* Decide if the given meta key maps to information we will want to import
*
* @param string $key The meta key to check
* @return string|bool The key if we do want to import, false if not
*/
public function is_valid_meta_key( $key ) {
// skip attachment metadata since we'll regenerate it from scratch
// skip _edit_lock as not relevant for import
if ( in_array( $key, array(
'_wp_attached_file',
'_wp_attachment_metadata',
'_edit_lock',
), true ) ) {
return false;
}
return $key;
}
/**
* Decide whether or not the importer is allowed to create users.
* Default is true, can be filtered via import_allow_create_users
*
* @return bool True if creating users is allowed
*/
public function allow_create_users() {
return false;
}
/**
* Decide whether or not the importer should attempt to download attachment files.
* Default is true, can be filtered via import_allow_fetch_attachments. The choice
* made at the import options screen must also be true, false here hides that checkbox.
*
* @return bool True if downloading attachments is allowed
*/
public function allow_fetch_attachments() {
return apply_filters( 'vc_import_allow_fetch_attachments', true );
}
/**
* Decide what the maximum file size for downloaded attachments is.
* Default is 0 (unlimited), can be filtered via import_attachment_size_limit
*
* @return int Maximum attachment file size to import
*/
public function max_attachment_size() {
return apply_filters( 'vc_import_attachment_size_limit', 0 );
}
/**
* return the difference in length between two strings
* @param string $a
* @param string $b
* @return int
*/
public function cmpr_strlen( $a, $b ) {
return strlen( $b ) - strlen( $a );
}
}
}
classes/core/shared-templates/importer/class-vc-wxr-parser-xml.php 0000644 00000014406 15121635560 0021377 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WXR Parser that makes use of the XML Parser PHP extension.
*/
class Vc_WXR_Parser_XML {
/**
* @var array
*/
public $wp_tags = array(
'wp:post_id',
'wp:post_date',
'wp:post_date_gmt',
'wp:comment_status',
'wp:ping_status',
'wp:attachment_url',
'wp:status',
'wp:post_name',
'wp:post_parent',
'wp:menu_order',
'wp:post_type',
'wp:post_password',
'wp:is_sticky',
'wp:term_id',
'wp:category_nicename',
'wp:category_parent',
'wp:cat_name',
'wp:category_description',
'wp:tag_slug',
'wp:tag_name',
'wp:tag_description',
'wp:term_taxonomy',
'wp:term_parent',
'wp:term_name',
'wp:term_description',
'wp:author_id',
'wp:author_login',
'wp:author_email',
'wp:author_display_name',
'wp:author_first_name',
'wp:author_last_name',
);
/**
* @var array
*/
public $wp_sub_tags = array(
'wp:comment_id',
'wp:comment_author',
'wp:comment_author_email',
'wp:comment_author_url',
'wp:comment_author_IP',
'wp:comment_date',
'wp:comment_date_gmt',
'wp:comment_content',
'wp:comment_approved',
'wp:comment_type',
'wp:comment_parent',
'wp:comment_user_id',
);
/**
* @param $file
* @return array|\WP_Error
*/
public function parse( $file ) {
$this->wxr_version = false;
$this->in_post = false;
$this->cdata = false;
$this->data = false;
$this->sub_data = false;
$this->in_tag = false;
$this->in_sub_tag = false;
$this->authors = array();
$this->posts = array();
$this->term = array();
$this->category = array();
$this->tag = array();
$xml = xml_parser_create( 'UTF-8' );
xml_parser_set_option( $xml, XML_OPTION_SKIP_WHITE, 1 );
xml_parser_set_option( $xml, XML_OPTION_CASE_FOLDING, 0 );
xml_set_object( $xml, $this );
xml_set_character_data_handler( $xml, 'cdata' );
xml_set_element_handler( $xml, 'tag_open', 'tag_close' );
/** @var \WP_Filesystem_Direct $wp_filesystem */ global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem( false, false, true );
}
if ( ! xml_parse( $xml, $wp_filesystem->get_contents( $file ), true ) ) {
$current_line = xml_get_current_line_number( $xml );
$current_column = xml_get_current_column_number( $xml );
$error_code = xml_get_error_code( $xml );
$error_string = xml_error_string( $error_code );
return new WP_Error( 'XML_parse_error', 'There was an error when reading this WXR file', array(
$current_line,
$current_column,
$error_string,
) );
}
xml_parser_free( $xml );
if ( ! preg_match( '/^\d+\.\d+$/', $this->wxr_version ) ) {
return new WP_Error( 'WXR_parse_error', esc_html__( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'js_composer' ) );
}
return array(
'authors' => $this->authors,
'posts' => $this->posts,
'categories' => $this->category,
'tags' => $this->tag,
'terms' => $this->term,
'base_url' => $this->base_url,
'version' => $this->wxr_version,
);
}
/**
* @param $parse
* @param $tag
* @param $attr
*/
public function tag_open( $parse, $tag, $attr ) {
if ( in_array( $tag, $this->wp_tags, true ) ) {
$this->in_tag = substr( $tag, 3 );
return;
}
if ( in_array( $tag, $this->wp_sub_tags, true ) ) {
$this->in_sub_tag = substr( $tag, 3 );
return;
}
switch ( $tag ) {
case 'category':
if ( isset( $attr['domain'], $attr['nicename'] ) ) {
$this->sub_data['domain'] = $attr['domain'];
$this->sub_data['slug'] = $attr['nicename'];
}
break;
case 'item':
$this->in_post = true;
if ( $this->in_post ) {
$this->in_tag = 'post_title';
}
break;
case 'title':
if ( $this->in_post ) {
$this->in_tag = 'post_title';
}
break;
case 'guid':
$this->in_tag = 'guid';
break;
case 'dc:creator':
$this->in_tag = 'post_author';
break;
case 'content:encoded':
$this->in_tag = 'post_content';
break;
case 'excerpt:encoded':
$this->in_tag = 'post_excerpt';
break;
case 'wp:term_slug':
$this->in_tag = 'slug';
break;
case 'wp:meta_key':
$this->in_sub_tag = 'key';
break;
case 'wp:meta_value':
$this->in_sub_tag = 'value';
break;
}
}
/**
* @param $parser
* @param $cdata
*/
public function cdata( $parser, $cdata ) {
if ( ! trim( $cdata ) ) {
return;
}
if ( false !== $this->in_tag || false !== $this->in_sub_tag ) {
$this->cdata .= $cdata;
} else {
$this->cdata .= trim( $cdata );
}
}
/**
* @param $parser
* @param $tag
*/
public function tag_close( $parser, $tag ) {
switch ( $tag ) {
case 'wp:comment':
unset( $this->sub_data['key'], $this->sub_data['value'] ); // remove meta sub_data
if ( ! empty( $this->sub_data ) ) {
$this->data['comments'][] = $this->sub_data;
}
$this->sub_data = false;
break;
case 'wp:commentmeta':
$this->sub_data['commentmeta'][] = array(
'key' => $this->sub_data['key'],
'value' => $this->sub_data['value'],
);
break;
case 'category':
if ( ! empty( $this->sub_data ) ) {
$this->sub_data['name'] = $this->cdata;
$this->data['terms'][] = $this->sub_data;
}
$this->sub_data = false;
break;
case 'wp:postmeta':
if ( ! empty( $this->sub_data ) ) {
$this->data['postmeta'][] = $this->sub_data;
}
$this->sub_data = false;
break;
case 'item':
$this->posts[] = $this->data;
$this->data = false;
break;
case 'wp:category':
case 'wp:tag':
case 'wp:term':
$n = substr( $tag, 3 );
array_push( $this->$n, $this->data );
$this->data = false;
break;
case 'wp:author':
if ( ! empty( $this->data['author_login'] ) ) {
$this->authors[ $this->data['author_login'] ] = $this->data;
}
$this->data = false;
break;
case 'wp:base_site_url':
$this->base_url = $this->cdata;
break;
case 'wp:wxr_version':
$this->wxr_version = $this->cdata;
break;
default:
if ( $this->in_sub_tag ) {
$this->sub_data[ $this->in_sub_tag ] = ! empty( $this->cdata ) ? $this->cdata : '';
$this->in_sub_tag = false;
} elseif ( $this->in_tag ) {
$this->data[ $this->in_tag ] = ! empty( $this->cdata ) ? $this->cdata : '';
$this->in_tag = false;
}
}
$this->cdata = false;
}
}
classes/core/shared-templates/class-vc-shared-templates.php 0000644 00000021174 15121635560 0020070 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once dirname( __FILE__ ) . '/importer/class-vc-wp-import.php';
require_once dirname( __FILE__ ) . '/importer/class-vc-wxr-parser-plugin.php';
/**
* Class Vc_Shared_Templates
*/
class Vc_Shared_Templates {
/**
* @var bool
*/
protected $initialized = false;
/**
* @var string
*/
protected $download_link_url = 'https://support.wpbakery.com/templates/download-link';
/**
*
*/
public function init() {
if ( $this->initialized ) {
return;
}
$this->initialized = true;
add_filter( 'vc_templates_render_category', array(
$this,
'renderTemplateBlock',
), 10 );
add_filter( 'vc_templates_render_frontend_template', array(
$this,
'renderFrontendTemplate',
), 10, 2 );
add_filter( 'vc_templates_render_backend_template', array(
$this,
'renderBackendTemplate',
), 10, 2 );
add_filter( 'vc_templates_render_backend_template_preview', array(
$this,
'renderBackendTemplate',
), 10, 2 );
add_action( 'vc_templates_delete_templates', array(
$this,
'delete',
), 10, 2 );
add_filter( 'wp_ajax_vc_shared_templates_download', array(
$this,
'ajaxDownloadTemplate',
) );
add_filter( 'vc_get_all_templates', array(
$this,
'addTemplatesTab',
) );
$this->registerPostType();
}
/**
* @param $templateId
* @param $templateType
* @return string
*/
public function renderBackendTemplate( $templateId, $templateType ) {
if ( 'shared_templates' === $templateType ) {
$templates = get_posts( array(
'post_type' => 'vc4_templates',
'include' => intval( $templateId ),
'numberposts' => 1,
) );
if ( ! empty( $templates ) ) {
$template = $templates[0];
return $template->post_content;
}
wp_send_json_error( array(
'code' => 'Wrong ID or no Template found',
) );
}
return $templateId;
}
/**
* @param $templateId
* @param $templateType
* @return mixed
*/
public function renderFrontendTemplate( $templateId, $templateType ) {
if ( 'shared_templates' === $templateType ) {
$templates = get_posts( array(
'post_type' => 'vc4_templates',
'include' => intval( $templateId ),
'numberposts' => 1,
) );
if ( ! empty( $templates ) ) {
$template = $templates[0];
vc_frontend_editor()->setTemplateContent( $template->post_content );
vc_frontend_editor()->enqueueRequired();
vc_include_template( 'editors/frontend_template.tpl.php', array(
'editor' => vc_frontend_editor(),
) );
die();
}
wp_send_json_error( array(
'code' => 'Wrong ID or no Template found #3',
) );
}
return $templateId;
}
/**
* @param $templateId
* @param $templateType
* @return mixed
*/
public function delete( $templateId, $templateType ) {
if ( 'shared_templates' === $templateType ) {
$templates = get_posts( array(
'post_type' => 'vc4_templates',
'include' => intval( $templateId ),
'numberposts' => 1,
) );
if ( ! empty( $templates ) ) {
$template = $templates[0];
if ( wp_delete_post( $template->ID ) ) {
wp_send_json_success();
}
}
wp_send_json_error( array(
'code' => 'Wrong ID or no Template found #2',
) );
}
return $templateId;
}
/**
* Post type from templates registration in WordPress
*/
private function registerPostType() {
register_post_type( 'vc4_templates', array(
'label' => 'Vc Templates',
'public' => false,
'publicly_queryable' => false,
'exclude_from_search' => false,
'show_ui' => false,
'show_in_menu' => false,
'menu_position' => 10,
'menu_icon' => 'dashicons-admin-page',
'hierarchical' => false,
'taxonomies' => array(),
'has_archive' => false,
'rewrite' => false,
'query_var' => false,
'show_in_nav_menus' => false,
) );
}
/**
* Ajax request processing from templates panel
*/
public function ajaxDownloadTemplate() {
/** @var Vc_Current_User_Access $access */
$access = vc_user_access()->checkAdminNonce()->validateDie( wp_json_encode( array(
'success' => false,
'message' => 'access denied',
) ) )->part( 'templates' )->checkStateAny( true, null )->validateDie( wp_json_encode( array(
'success' => false,
'message' => 'part access denied',
) ) )->check( array(
vc_license(),
'isActivated',
) );
$access->validateDie( wp_json_encode( array(
'success' => false,
'message' => 'license is not activated',
) ) );
$templateId = vc_request_param( 'id' );
$requestUrl = $this->getTemplateDownloadLink( $templateId );
$status = false;
$file = $this->downloadTemplate( $requestUrl );
$data = array();
if ( is_string( $file ) && ! empty( $file ) ) {
new Vc_WXR_Parser_Plugin();
$importer = new Vc_WP_Import();
ob_start();
$importer->import( $file );
if ( ! empty( $importer->processed_posts ) ) {
$status = true;
$postId = reset( $importer->processed_posts );
$data['post_id'] = $postId;
}
ob_end_clean();
}
if ( $status ) {
wp_send_json_success( $data );
} else {
wp_send_json_error( is_array( $file ) ? $file : null );
}
}
/**
* @param $requestUrl
*
* @return bool|string
*/
private function downloadTemplate( $requestUrl ) {
// FIX SSL SNI
$filter_add = true;
if ( function_exists( 'curl_version' ) ) {
$version = curl_version();
if ( version_compare( $version['version'], '7.18', '>=' ) ) {
$filter_add = false;
}
}
if ( $filter_add ) {
add_filter( 'https_ssl_verify', '__return_false' );
}
$downloadUrlRequest = wp_remote_get( $requestUrl, array(
'timeout' => 30,
) );
if ( $filter_add ) {
remove_filter( 'https_ssl_verify', '__return_false' );
}
if ( is_array( $downloadUrlRequest ) && 200 === $downloadUrlRequest['response']['code'] ) {
return $this->parseRequest( $downloadUrlRequest );
}
return false;
}
/**
* @param $request
*
* @return bool|string|array
*/
private function parseRequest( $request ) {
$body = json_decode( $request['body'], true );
if ( isset( $body['status'], $body['url'] ) && 1 === $body['status'] ) {
$downloadUrl = $body['url'];
$downloadedTemplateFile = download_url( $downloadUrl );
if ( is_wp_error( $downloadedTemplateFile ) || ! $downloadedTemplateFile ) {
return false;
}
return $downloadedTemplateFile;
} elseif ( isset( $body['error'] ) ) {
return array(
'code' => 1,
'message' => $body['error'],
);
}
return false;
}
/**
* @param $data
*
* @return array
*/
public function addTemplatesTab( $data ) {
if ( vc_user_access()->part( 'templates' )->checkStateAny( true, null, 'add' )->get() ) {
$templates = $this->getTemplates();
if ( ! empty( $templates ) || vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) {
$newCategory = array(
'category' => 'shared_templates',
'category_name' => esc_html__( 'Template library', 'js_composer' ),
'category_weight' => 10,
'templates' => $this->getTemplates(),
);
$data[] = $newCategory;
}
}
return $data;
}
/**
* @param $category
*
* @return mixed
*/
public function renderTemplateBlock( $category ) {
if ( 'shared_templates' === $category['category'] ) {
$category['output'] = $this->getTemplateBlockTemplate();
}
return $category;
}
/**
* @return string
*/
private function getTemplateBlockTemplate() {
ob_start();
vc_include_template( 'editors/popups/shared-templates/category.tpl.php', array(
'controller' => $this,
'templates' => $this->getTemplates(),
) );
return ob_get_clean();
}
/**
* @return array
*/
public function getTemplates() {
$posts = get_posts( 'post_type=vc4_templates&numberposts=-1' );
$templates = array();
if ( ! empty( $posts ) ) {
foreach ( $posts as $post ) {
/** @var WP_Post $post */
$id = get_post_meta( $post->ID, '_vc4_templates-id', true );
$template = array();
$template['title'] = $post->post_title;
$template['version'] = get_post_meta( $post->ID, '_vc4_templates-version', true );
$template['id'] = $id;
$template['post_id'] = $post->ID;
$template['name'] = $post->post_title; // For Settings
$template['type'] = 'shared_templates'; // For Settings
$template['unique_id'] = $id; // For Settings
$templates[] = $template;
}
}
return $templates;
}
/**
* Create url for request to download
* It requires a license key, product and version
*
* @param $id
*
* @return string
*/
private function getTemplateDownloadLink( $id ) {
$url = esc_url( vc_license()->getSiteUrl() );
$key = rawurlencode( vc_license()->getLicenseKey() );
$url = $this->download_link_url . '?product=vc&url=' . $url . '&key=' . $key . '&version=' . WPB_VC_VERSION . '&id=' . esc_attr( $id );
return $url;
}
}
classes/core/class-vc-manager.php 0000644 00000053627 15121635560 0013006 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Vc starts here. Manager sets mode, adds required wp hooks and loads required object of structure
*
* Manager controls and access to all modules and classes of VC.
*
* @package WPBakeryVisualComposer
* @since 4.2
*/
class Vc_Manager {
/**
* Set status/mode for VC.
*
* It depends on what functionality is required from vc to work with current page/part of WP.
*
* Possible values:
* none - current status is unknown, default mode;
* page - simple wp page;
* admin_page - wp dashboard;
* admin_frontend_editor - WPBakery Page Builder front end editor version;
* admin_settings_page - settings page
* page_editable - inline version for iframe in front end editor;
*
* @since 4.2
* @var string
*/
private $mode = 'none';
/**
* Enables WPBakery Page Builder to act as the theme plugin.
*
* @since 4.2
* @var bool
*/
private $is_as_theme = false;
/**
* Vc is network plugin or not.
* @since 4.2
* @var bool
*/
private $is_network_plugin = null;
/**
* List of paths.
*
* @since 4.2
* @var array
*/
private $paths = array();
/**
* Default post types where to activate WPBakery Page Builder meta box settings
* @since 4.2
* @var array
*/
private $editor_default_post_types = array( 'page' ); // TODO: move to Vc settings
/**
* Directory name in theme folder where composer should search for alternative templates of the shortcode.
* @since 4.2
* @var string
*/
private $custom_user_templates_dir = false;
/**
* Set updater mode
* @since 4.2
* @var bool
*/
private $disable_updater = false;
/**
* Modules and objects instances list
* @since 4.2
* @var array
*/
private $factory = array();
/**
* File name for components manifest file.
*
* @since 4.4
* @var string
*/
private $components_manifest = 'components.json';
/**
* @var string
*/
private $plugin_name = 'js_composer/js_composer.php';
/**
* Core singleton class
* @var self - pattern realization
*/
private static $instance;
/**
* @var Vc_Current_User_Access|false
* @since 4.8
*/
private $current_user_access = false;
/**
* @var Vc_Role_Access|false
* @since 4.8
*/
private $role_access = false;
public $editor_post_types;
/**
* Constructor loads API functions, defines paths and adds required wp actions
*
* @since 4.2
*/
private function __construct() {
$dir = WPB_PLUGIN_DIR;
/**
* Define path settings for WPBakery Page Builder.
*
* APP_ROOT - plugin directory.
* WP_ROOT - WP application root directory.
* APP_DIR - plugin directory name.
* CONFIG_DIR - configuration directory.
* ASSETS_DIR - asset directory full path.
* ASSETS_DIR_NAME - directory name for assets. Used from urls creating.
* CORE_DIR - classes directory for core vc files.
* HELPERS_DIR - directory with helpers functions files.
* SHORTCODES_DIR - shortcodes classes.
* SETTINGS_DIR - main dashboard settings classes.
* TEMPLATES_DIR - directory where all html templates are hold.
* EDITORS_DIR - editors for the post contents
* PARAMS_DIR - complex params for shortcodes editor form.
* UPDATERS_DIR - automatic notifications and updating classes.
*/
$this->setPaths( array(
'APP_ROOT' => $dir,
'WP_ROOT' => preg_replace( '/$\//', '', ABSPATH ),
'APP_DIR' => basename( plugin_basename( $dir ) ),
'CONFIG_DIR' => $dir . '/config',
'ASSETS_DIR' => $dir . '/assets',
'ASSETS_DIR_NAME' => 'assets',
'AUTOLOAD_DIR' => $dir . '/include/autoload',
'CORE_DIR' => $dir . '/include/classes/core',
'HELPERS_DIR' => $dir . '/include/helpers',
'SHORTCODES_DIR' => $dir . '/include/classes/shortcodes',
'SETTINGS_DIR' => $dir . '/include/classes/settings',
'TEMPLATES_DIR' => $dir . '/include/templates',
'EDITORS_DIR' => $dir . '/include/classes/editors',
'PARAMS_DIR' => $dir . '/include/params',
'UPDATERS_DIR' => $dir . '/include/classes/updaters',
'VENDORS_DIR' => $dir . '/include/classes/vendors',
'DEPRECATED_DIR' => $dir . '/include/classes/deprecated',
) );
// Load API
require_once $this->path( 'HELPERS_DIR', 'helpers_factory.php' );
require_once $this->path( 'HELPERS_DIR', 'helpers.php' );
require_once $this->path( 'DEPRECATED_DIR', 'interfaces.php' );
require_once $this->path( 'CORE_DIR', 'class-vc-sort.php' ); // used by wpb-map
require_once $this->path( 'CORE_DIR', 'class-wpb-map.php' );
require_once $this->path( 'CORE_DIR', 'class-vc-shared-library.php' );
require_once $this->path( 'HELPERS_DIR', 'helpers_api.php' );
require_once $this->path( 'DEPRECATED_DIR', 'helpers_deprecated.php' );
require_once $this->path( 'PARAMS_DIR', 'params.php' );
require_once $this->path( 'AUTOLOAD_DIR', 'vc-shortcode-autoloader.php' );
require_once $this->path( 'SHORTCODES_DIR', 'core/class-vc-shortcodes-manager.php' );
require_once $this->path( 'CORE_DIR', 'class-vc-modifications.php' );
// Add hooks
add_action( 'plugins_loaded', array(
$this,
'pluginsLoaded',
), 9 );
add_action( 'init', array(
$this,
'init',
), 11 );
$this->setPluginName( $this->path( 'APP_DIR', 'js_composer.php' ) );
register_activation_hook( WPB_PLUGIN_FILE, array(
$this,
'activationHook',
) );
}
/**
* Get the instane of VC_Manager
*
* @return self
*/
public static function getInstance() {
if ( ! ( self::$instance instanceof self ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Callback function WP plugin_loaded action hook. Loads locale
*
* @since 4.2
* @access public
*/
public function pluginsLoaded() {
// Setup locale
do_action( 'vc_plugins_loaded' );
load_plugin_textdomain( 'js_composer', false, $this->path( 'APP_DIR', 'locale' ) );
}
/**
* Callback function for WP init action hook. Sets Vc mode and loads required objects.
*
* @return void
* @throws \Exception
* @since 4.2
* @access public
*/
public function init() {
if ( method_exists( 'LiteSpeed_Cache_API', 'esi_enabled' ) && LiteSpeed_Cache_API::esi_enabled() ) {
LiteSpeed_Cache_API::hook_tpl_esi( 'js_composer', 'vc_hook_esi' );
}
ob_start();
do_action( 'vc_before_init' );
ob_end_clean(); // FIX for whitespace issues (#76147)
$this->setMode();
do_action( 'vc_after_set_mode' );
/**
* Set version of VC if required.
*/
$this->setVersion();
// Load required
! vc_is_updater_disabled() && vc_updater()->init();
/**
* Init default hooks and options to load.
*/
$this->vc()->init();
/**
* if is admin and not front end editor.
*/
is_admin() && ! vc_is_frontend_editor() && $this->asAdmin();
/**
* if frontend editor is enabled init editor.
*/
vc_enabled_frontend() && vc_frontend_editor()->init();
do_action( 'vc_before_mapping' ); // VC ACTION
// Include default shortcodes.
$this->mapper()->init(); // execute all required
do_action( 'vc_after_mapping' ); // VC ACTION
// Load && Map shortcodes from Automapper.
vc_automapper()->map();
new Vc_Modifications();
if ( vc_user_access()->wpAny( 'manage_options' )->part( 'settings' )->can( 'vc-updater-tab' )->get() ) {
vc_license()->setupReminder();
}
do_action( 'vc_after_init' );
}
/**
* @return Vc_Current_User_Access
* @since 4.8
*/
public function getCurrentUserAccess() {
if ( ! $this->current_user_access ) {
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-current-user-access.php' );
$this->current_user_access = new Vc_Current_User_Access();
}
return $this->current_user_access;
}
/**
* @param false|Vc_Current_User_Access $current_user_access
*/
public function setCurrentUserAccess( $current_user_access ) {
$this->current_user_access = $current_user_access;
}
/**
* @return Vc_Role_Access
* @since 4.8
*/
public function getRoleAccess() {
if ( ! $this->role_access ) {
require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-role-access.php' );
$this->role_access = new Vc_Role_Access();
}
return $this->role_access;
}
/**
* @param false|Vc_Role_Access $role_access
*/
public function setRoleAccess( $role_access ) {
$this->role_access = $role_access;
}
/**
* Enables to add hooks in activation process.
* @param $networkWide
* @since 4.5
*
*/
public function activationHook( $networkWide = false ) {
do_action( 'vc_activation_hook', $networkWide );
}
/**
* Load required components to enable useful functionality.
*
* @access public
* @since 4.4
*/
public function loadComponents() {
$manifest_file = apply_filters( 'vc_autoload_components_manifest_file', vc_path_dir( 'AUTOLOAD_DIR', $this->components_manifest ) );
if ( is_file( $manifest_file ) ) {
ob_start();
require_once $manifest_file;
$data = ob_get_clean();
if ( $data ) {
$components = (array) json_decode( $data );
$components = apply_filters( 'vc_autoload_components_list', $components );
$dir = vc_path_dir( 'AUTOLOAD_DIR' );
foreach ( $components as $component => $description ) {
$component_path = $dir . '/' . $component;
if ( false === strpos( $component_path, '*' ) ) {
require_once $component_path;
} else {
$components_paths = glob( $component_path );
if ( is_array( $components_paths ) ) {
foreach ( $components_paths as $path ) {
if ( false === strpos( $path, '*' ) ) {
require_once $path;
}
}
}
}
}
}
}
}
/**
* Load required logic for operating in Wp Admin dashboard.
*
* @return void
* @since 4.2
* @access protected
*
*/
protected function asAdmin() {
vc_license()->init();
vc_backend_editor()->addHooksSettings();
}
/**
* Set VC mode.
*
* Mode depends on which page is requested by client from server and request parameters like vc_action.
*
* @return void
* @throws \Exception
* @since 4.2
* @access protected
*/
protected function setMode() {
/**
* TODO: Create another system (When ajax rebuild).
* Use vc_action param to define mode.
* 1. admin_frontend_editor - set by editor or request param
* 2. admin_backend_editor - set by editor or request param
* 3. admin_frontend_editor_ajax - set by request param
* 4. admin_backend_editor_ajax - set by request param
* 5. admin_updater - by vc_action
* 6. page_editable - by vc_action
*/
if ( is_admin() ) {
if ( 'vc_inline' === vc_action() ) {
vc_user_access()->wpAny( array(
'edit_post',
(int) vc_request_param( 'post_id' ),
) )->validateDie()->part( 'frontend_editor' )->can()->validateDie();
$this->mode = 'admin_frontend_editor';
} elseif ( ( vc_user_access()->wpAny( 'edit_posts', 'edit_pages' )
->get() ) && ( 'vc_upgrade' === vc_action() || ( 'update-selected' === vc_get_param( 'action' ) && $this->pluginName() === vc_get_param( 'plugins' ) ) ) ) {
$this->mode = 'admin_updater';
} elseif ( vc_user_access()->wpAny( 'manage_options' )->get() && array_key_exists( vc_get_param( 'page' ), vc_settings()->getTabs() ) ) {
$this->mode = 'admin_settings_page';
} else {
$this->mode = 'admin_page';
}
} else {
if ( 'true' === vc_get_param( 'vc_editable' ) ) {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( array(
'edit_post',
(int) vc_request_param( 'vc_post_id' ),
) )->validateDie()->part( 'frontend_editor' )->can()->validateDie();
$this->mode = 'page_editable';
} else {
$this->mode = 'page';
}
}
}
/**
* Sets version of the VC in DB as option `vc_version`
*
* @return void
* @since 4.3.2
* @access protected
*
*/
protected function setVersion() {
$version = get_option( 'vc_version' );
if ( ! is_string( $version ) || version_compare( $version, WPB_VC_VERSION ) !== 0 ) {
add_action( 'vc_after_init', array(
vc_settings(),
'rebuild',
) );
update_option( 'vc_version', WPB_VC_VERSION );
}
}
/**
* Get current mode for VC.
*
* @return string
* @since 4.2
* @access public
*
*/
public function mode() {
return $this->mode;
}
/**
* Setter for paths
*
* @param $paths
* @since 4.2
* @access protected
*
*/
protected function setPaths( $paths ) {
$this->paths = $paths;
}
/**
* Gets absolute path for file/directory in filesystem.
*
* @param $name - name of path dir
* @param string $file - file name or directory inside path
*
* @return string
* @since 4.2
* @access public
*
*/
public function path( $name, $file = '' ) {
$path = $this->paths[ $name ] . ( strlen( $file ) > 0 ? '/' . preg_replace( '/^\//', '', $file ) : '' );
return apply_filters( 'vc_path_filter', $path );
}
/**
* Set default post types. Vc editors are enabled for such kind of posts.
*
* @param array $type - list of default post types.
*/
public function setEditorDefaultPostTypes( array $type ) {
$this->editor_default_post_types = $type;
}
/**
* Returns list of default post types where user can use WPBakery Page Builder editors.
*
* @return array
* @since 4.2
* @access public
*
*/
public function editorDefaultPostTypes() {
return $this->editor_default_post_types;
}
/**
* Get post types where VC editors are enabled.
*
* @return array
* @throws \Exception
* @since 4.2
* @access public
*/
public function editorPostTypes() {
if ( null === $this->editor_post_types ) {
$post_types = array_keys( vc_user_access()->part( 'post_types' )->getAllCaps() );
$this->editor_post_types = $post_types ? $post_types : $this->editorDefaultPostTypes();
}
return $this->editor_post_types;
}
/**
* Set post types where VC editors are enabled.
*
* @param array $post_types
* @throws \Exception
* @since 4.4
* @access public
*/
public function setEditorPostTypes( array $post_types ) {
$this->editor_post_types = ! empty( $post_types ) ? $post_types : $this->editorDefaultPostTypes();
require_once ABSPATH . 'wp-admin/includes/user.php';
$editable_roles = get_editable_roles();
foreach ( $editable_roles as $role => $settings ) {
$part = vc_role_access()->who( $role )->part( 'post_types' );
$all_post_types = $part->getAllCaps();
foreach ( $all_post_types as $post_type => $value ) {
$part->getRole()->remove_cap( $part->getStateKey() . '/' . $post_type );
}
$part->setState( 'custom' );
foreach ( $this->editor_post_types as $post_type ) {
$part->setCapRule( $post_type );
}
}
}
/**
* Setter for as-theme-plugin status for VC.
*
* @param bool $value
* @since 4.2
* @access public
*
*/
public function setIsAsTheme( $value = true ) {
$this->is_as_theme = (bool) $value;
}
/**
* Get as-theme-plugin status
*
* As theme plugin status used by theme developers. It disables settings
*
* @return bool
* @since 4.2
* @access public
*
*/
public function isAsTheme() {
return (bool) $this->is_as_theme;
}
/**
* Setter for as network plugin for MultiWP.
*
* @param bool $value
* @since 4.2
* @access public
*
*/
public function setAsNetworkPlugin( $value = true ) {
$this->is_network_plugin = $value;
}
/**
* Gets VC is activated as network plugin.
*
* @return bool
* @since 4.2
* @access public
*
*/
public function isNetworkPlugin() {
if ( is_null( $this->is_network_plugin ) ) {
// Check is VC as network plugin
if ( is_multisite() && ( is_plugin_active_for_network( $this->pluginName() ) || is_network_only_plugin( $this->pluginName() ) ) ) {
$this->setAsNetworkPlugin( true );
}
}
return $this->is_network_plugin ? true : false;
}
/**
* Setter for disable updater variable.
* @param bool $value
*
* @since 4.2
*/
public function disableUpdater( $value = true ) {
$this->disable_updater = $value;
}
/**
* Get is vc updater is disabled;
*
* @return bool
* @see to where updater will be
*
* @since 4.2
*/
public function isUpdaterDisabled() {
return is_admin() && $this->disable_updater;
}
/**
* Set user directory name.
*
* Directory name is the directory name vc should scan for custom shortcodes template.
*
* @param $dir - path to shortcodes templates inside developers theme
* @since 4.2
* @access public
*
*/
public function setCustomUserShortcodesTemplateDir( $dir ) {
preg_replace( '/\/$/', '', $dir );
$this->custom_user_templates_dir = $dir;
}
/**
* Get default directory where shortcodes templates area placed.
*
* @return string - path to default shortcodes
* @since 4.2
* @access public
*
*/
public function getDefaultShortcodesTemplatesDir() {
return vc_path_dir( 'TEMPLATES_DIR', 'shortcodes' );
}
/**
*
* Get shortcodes template dir.
*
* @param $template
*
* @return string
* @since 4.2
* @access public
*
*/
public function getShortcodesTemplateDir( $template ) {
return false !== $this->custom_user_templates_dir ? $this->custom_user_templates_dir . '/' . $template : locate_template( 'vc_templates/' . $template );
}
/**
* Directory name where template files will be stored.
*
* @return string
* @since 4.2
* @access public
*
*/
public function uploadDir() {
return 'js_composer';
}
/**
* Getter for VC_Mapper instance
*
* @return Vc_Mapper
* @since 4.2
* @access public
*
*/
public function mapper() {
if ( ! isset( $this->factory['mapper'] ) ) {
require_once $this->path( 'CORE_DIR', 'class-vc-mapper.php' );
$this->factory['mapper'] = new Vc_Mapper();
}
return $this->factory['mapper'];
}
/**
* WPBakery Page Builder.
*
* @return Vc_Base
* @since 4.2
* @access public
*
*/
public function vc() {
if ( ! isset( $this->factory['vc'] ) ) {
do_action( 'vc_before_init_vc' );
require_once $this->path( 'CORE_DIR', 'class-vc-base.php' );
$vc = new Vc_Base();
// DI Set template new modal editor.
require_once $this->path( 'EDITORS_DIR', 'popups/class-vc-templates-panel-editor.php' );
require_once $this->path( 'CORE_DIR', 'shared-templates/class-vc-shared-templates.php' );
$vc->setTemplatesPanelEditor( new Vc_Templates_Panel_Editor() );
// Create shared templates
$vc->shared_templates = new Vc_Shared_Templates();
// DI Set edit form
require_once $this->path( 'EDITORS_DIR', 'popups/class-vc-shortcode-edit-form.php' );
$vc->setEditForm( new Vc_Shortcode_Edit_Form() );
// DI Set preset new modal editor.
require_once $this->path( 'EDITORS_DIR', 'popups/class-vc-preset-panel-editor.php' );
$vc->setPresetPanelEditor( new Vc_Preset_Panel_Editor() );
$this->factory['vc'] = $vc;
do_action( 'vc_after_init_vc' );
}
return $this->factory['vc'];
}
/**
* Vc options.
*
* @return Vc_Settings
* @since 4.2
* @access public
*
*/
public function settings() {
if ( ! isset( $this->factory['settings'] ) ) {
do_action( 'vc_before_init_settings' );
require_once $this->path( 'SETTINGS_DIR', 'class-vc-settings.php' );
$this->factory['settings'] = new Vc_Settings();
do_action( 'vc_after_init_settings' );
}
return $this->factory['settings'];
}
/**
* Vc license settings.
*
* @return Vc_License
* @since 4.2
* @access public
*
*/
public function license() {
if ( ! isset( $this->factory['license'] ) ) {
do_action( 'vc_before_init_license' );
require_once $this->path( 'SETTINGS_DIR', 'class-vc-license.php' );
$this->factory['license'] = new Vc_License();
do_action( 'vc_after_init_license' );
}
return $this->factory['license'];
}
/**
* Get frontend VC editor.
*
* @return Vc_Frontend_Editor
* @since 4.2
* @access public
*
*/
public function frontendEditor() {
if ( ! isset( $this->factory['frontend_editor'] ) ) {
do_action( 'vc_before_init_frontend_editor' );
require_once $this->path( 'EDITORS_DIR', 'class-vc-frontend-editor.php' );
$this->factory['frontend_editor'] = new Vc_Frontend_Editor();
}
return $this->factory['frontend_editor'];
}
/**
* Get backend VC editor. Edit page version.
*
* @return Vc_Backend_Editor
* @since 4.2
*
*/
public function backendEditor() {
if ( ! isset( $this->factory['backend_editor'] ) ) {
do_action( 'vc_before_init_backend_editor' );
require_once $this->path( 'EDITORS_DIR', 'class-vc-backend-editor.php' );
$this->factory['backend_editor'] = new Vc_Backend_Editor();
}
return $this->factory['backend_editor'];
}
/**
* Gets automapper instance.
*
* @return Vc_Automapper
* @since 4.2
* @access public
*
*/
public function automapper() {
if ( ! isset( $this->factory['automapper'] ) ) {
do_action( 'vc_before_init_automapper' );
require_once $this->path( 'SETTINGS_DIR', 'automapper/automapper.php' );
require_once $this->path( 'SETTINGS_DIR', 'automapper/class-vc-automap-model.php' );
require_once $this->path( 'SETTINGS_DIR', 'automapper/class-vc-automapper.php' );
$this->factory['automapper'] = new Vc_Automapper();
do_action( 'vc_after_init_automapper' );
}
return $this->factory['automapper'];
}
/**
* Gets updater instance.
* @return Vc_Updater
* @since 4.2
*
*/
public function updater() {
if ( ! isset( $this->factory['updater'] ) ) {
do_action( 'vc_before_init_updater' );
require_once $this->path( 'UPDATERS_DIR', 'class-vc-updater.php' );
$updater = new Vc_Updater();
require_once vc_path_dir( 'UPDATERS_DIR', 'class-vc-updating-manager.php' );
$updater->setUpdateManager( new Vc_Updating_Manager( WPB_VC_VERSION, $updater->versionUrl(), $this->pluginName() ) );
$this->factory['updater'] = $updater;
do_action( 'vc_after_init_updater' );
}
return $this->factory['updater'];
}
/**
* Getter for plugin name variable.
* @return string
* @since 4.2
*
*/
public function pluginName() {
return $this->plugin_name;
}
/**
* @param $name
* @since 4.8.1
*/
public function setPluginName( $name ) {
$this->plugin_name = $name;
}
/**
* Get absolute url for VC asset file.
*
* Assets are css, javascript, less files and images.
*
* @param $file
*
* @return string
* @since 4.2
*
*/
public function assetUrl( $file ) {
return preg_replace( '/\s/', '%20', plugins_url( $this->path( 'ASSETS_DIR_NAME', $file ), WPB_PLUGIN_FILE ) );
}
}
classes/core/class-vc-post-admin.php 0000644 00000012404 15121635560 0013433 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Ability to interact with post data.
*
* @since 4.4
*/
class Vc_Post_Admin {
/**
* Add hooks required to save, update and manipulate post
*/
public function init() {
// Called in BE
add_action( 'save_post', array(
$this,
'save',
) );
// Called in FE
add_action( 'wp_ajax_vc_save', array(
$this,
'saveAjaxFe',
) );
add_filter( 'content_save_pre', 'wpb_remove_custom_html' );
}
/**
* @throws \Exception
*/
public function saveAjaxFe() {
$post_id = intval( vc_post_param( 'post_id' ) );
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->canEdit( $post_id )->validateDie();
if ( $post_id > 0 ) {
ob_start();
// Update post_content, title and etc.
// post_title
// content
// post_status
if ( vc_post_param( 'content' ) ) {
$post = get_post( $post_id );
$post->post_content = stripslashes( vc_post_param( 'content' ) );
$post_status = vc_post_param( 'post_status' );
$post_title = vc_post_param( 'post_title' );
if ( null !== $post_title ) {
$post->post_title = $post_title;
}
if ( vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get() ) {
kses_remove_filters();
}
remove_filter( 'content_save_pre', 'balanceTags', 50 );
if ( $post_status && 'publish' === $post_status ) {
if ( vc_user_access()->wpAll( array(
get_post_type_object( $post->post_type )->cap->publish_posts,
$post_id,
) )->get() ) {
if ( 'private' !== $post->post_status && 'future' !== $post->post_status ) {
$post->post_status = 'publish';
}
} else {
$post->post_status = 'pending';
}
}
wp_update_post( $post );
$this->setPostMeta( $post_id );
}
visual_composer()->buildShortcodesCustomCss( $post_id );
wp_cache_flush();
ob_clean();
wp_send_json_success();
}
wp_send_json_error();
}/** @noinspection PhpDocMissingThrowsInspection */
/**
* Save generated shortcodes, html and WPBakery Page Builder status in posts meta.
*
* @access public
* @param $post_id - current post id
*
* @return void
* @since 4.4
*
*/
public function save( $post_id ) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || vc_is_inline() ) {
return;
}
$this->setPostMeta( $post_id );
}
/**
* Saves VC Backend editor meta box visibility status.
*
* If post param 'wpb_vc_js_status' set to true, then methods adds/updated post
* meta option with tag '_wpb_vc_js_status'.
* @param $post_id
* @since 4.4
*
*/
public function setJsStatus( $post_id ) {
$value = vc_post_param( 'wpb_vc_js_status' );
if ( null !== $value ) {
if ( '' === get_post_meta( $post_id, '_wpb_vc_js_status' ) ) {
add_post_meta( $post_id, '_wpb_vc_js_status', $value, true );
} elseif ( get_post_meta( $post_id, '_wpb_vc_js_status', true ) !== $value ) {
update_post_meta( $post_id, '_wpb_vc_js_status', $value );
} elseif ( '' === $value ) {
delete_post_meta( $post_id, '_wpb_vc_js_status', get_post_meta( $post_id, '_wpb_vc_js_status', true ) );
}
}
}
/**
* Saves VC interface version which is used for building post content.
* @param $post_id
* @since 4.4
* @todo check is it used everywhere and is it needed?!
* @deprecated not needed anywhere
*/
public function setInterfaceVersion( $post_id ) {
_deprecated_function( '\Vc_Post_Admin::setInterfaceVersion', '4.4', '' );
}
/**
* Set Post Settings for VC.
*
* It is possible to add any data to post settings by adding filter with tag 'vc_hooks_vc_post_settings'.
* @param $post_id
* @since 4.4
* vc_filter: vc_hooks_vc_post_settings - hook to override post meta settings for WPBakery Page Builder (used in grid for
* example)
*
*/
public function setSettings( $post_id ) {
$settings = array();
$settings = apply_filters( 'vc_hooks_vc_post_settings', $settings, $post_id, get_post( $post_id ) );
if ( is_array( $settings ) && ! empty( $settings ) ) {
update_post_meta( $post_id, '_vc_post_settings', $settings );
} else {
delete_post_meta( $post_id, '_vc_post_settings' );
}
}
/**
* @param $id
* @throws \Exception
*/
protected function setPostMeta( $id ) {
if ( ! vc_user_access()->wpAny( array(
'edit_post',
$id,
) )->get() ) {
return;
}
$this->setJsStatus( $id );
if ( 'dopreview' === vc_post_param( 'wp-preview' ) && wp_revisions_enabled( get_post( $id ) ) ) {
$latest_revision = wp_get_post_revisions( $id );
if ( ! empty( $latest_revision ) ) {
$array_values = array_values( $latest_revision );
$id = $array_values[0]->ID;
}
}
if ( 'dopreview' !== vc_post_param( 'wp-preview' ) ) {
$this->setSettings( $id );
}
/**
* vc_filter: vc_base_save_post_custom_css
* @since 4.4
*/
$post_custom_css = apply_filters( 'vc_base_save_post_custom_css', vc_post_param( 'vc_post_custom_css' ), $id );
if ( null !== $post_custom_css && empty( $post_custom_css ) ) {
delete_metadata( 'post', $id, '_wpb_post_custom_css' );
} elseif ( null !== $post_custom_css ) {
$post_custom_css = wp_strip_all_tags( $post_custom_css );
update_metadata( 'post', $id, '_wpb_post_custom_css', $post_custom_css );
}
visual_composer()->buildShortcodesCustomCss( $id );
}
}
classes/core/class-vc-sort.php 0000644 00000003534 15121635560 0012353 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Sort array values by key, default key is 'weight'
* Used in uasort() function.
* For fix equal weight problem used $this->data array_search
*
* @since 4.4
*/
/**
* Class Vc_Sort
* @since 4.4
*/
class Vc_Sort {
/**
* @since 4.4
* @var array $data - sorting data
*/
protected $data = array();
/**
* @since 4.4
* @var string $key - key for search
*/
protected $key = 'weight';
/**
* @param $data - array to sort
* @since 4.4
*
*/
public function __construct( $data ) {
$this->data = $data;
}
/**
* Used to change/set data to sort
*
* @param $data
* @since 4.5
*
*/
public function setData( $data ) {
$this->data = $data;
}
/**
* Sort $this->data by user key, used in class-vc-mapper.
* If keys are equals it SAVES a position in array (index).
*
* @param string $key
*
* @return array - sorted array
* @since 4.4
*
*/
public function sortByKey( $key = 'weight' ) {
$this->key = $key;
uasort( $this->data, array(
$this,
'key',
) );
return array_merge( $this->data ); // reset array keys to 0..N
}
/**
* Sorting by key callable for usort function
* @param $a - compare value
* @param $b - compare value
*
* @return int
* @since 4.4
*
*/
private function key( $a, $b ) {
$a_weight = isset( $a[ $this->key ] ) ? (int) $a[ $this->key ] : 0;
$b_weight = isset( $b[ $this->key ] ) ? (int) $b[ $this->key ] : 0;
// To save real-ordering
if ( $a_weight === $b_weight ) {
// @codingStandardsIgnoreLine
$cmp_a = array_search( $a, $this->data );
// @codingStandardsIgnoreLine
$cmp_b = array_search( $b, $this->data );
return $cmp_a - $cmp_b;
}
return $b_weight - $a_weight;
}
/**
* @return array - sorting data
* @since 4.4
*
*/
public function getData() {
return $this->data;
}
}
classes/deprecated/interfaces.php 0000644 00000001222 15121635561 0013137 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @since 4.3
* @deprecated since 5.8
* Interface for editors
*/
interface Vc_Editor_Interface {
/**
* @return mixed
* @deprecated 5.8
* @since 4.3
*/
public function renderEditor();
}
/**
* @since 4.3
* @deprecated 5.8
* Default render interface
*/
interface Vc_Render {
/**
* @return mixed
* @deprecated 5.8
* @since 4.3
*/
public function render();
}
/**
* @since 4.3
* @deprecated 5.8
* Interface for third-party plugins classes loader.
*/
interface Vc_Vendor_Interface {
/**
* @return mixed
* @deprecated 5.8
* @since 4.3
*/
public function load();
}
classes/deprecated/helpers_deprecated.php 0000644 00000004261 15121635561 0014644 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Helper function to register new shortcode attribute hook.
*
* @param $name - attribute name
* @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
* param list
* @param $script_url - javascript file url which will be attached at the end of settings form.
*
* @return bool
* @deprecated due to without prefix name 4.4
* @since 4.2
*/
function add_shortcode_param( $name, $form_field_callback, $script_url = null ) {
_deprecated_function( 'add_shortcode_param', '4.4 (will be removed in 6.0)', 'vc_add_shortcode_param' );
return vc_add_shortcode_param( $name, $form_field_callback, $script_url );
}
/**
* @return mixed|string
* @since 4.2
* @deprecated 4.2
*/
function get_row_css_class() {
_deprecated_function( 'get_row_css_class', '4.2 (will be removed in 6.0)' );
$custom = vc_settings()->get( 'row_css_class' );
return ! empty( $custom ) ? $custom : 'vc_row-fluid';
}
/**
* @return string
* @deprecated 5.2
*/
function vc_generate_dependencies_attributes() {
_deprecated_function( 'vc_generate_dependencies_attributes', '5.1', '' );
return '';
}
/**
* Extract width/height from string
*
* @param string $dimensions WxH
* @return mixed array(width, height) or false
* @since 4.7
*
* @deprecated since 5.8
*/
function vcExtractDimensions( $dimensions ) {
_deprecated_function( 'vcExtractDimensions', '5.8', 'vc_extract_dimensions' );
return vc_extract_dimensions( $dimensions );
}
/**
* @param array $images IDs or srcs of images
* @return string
* @since 4.2
* @deprecated since 2019, 5.8
*/
function fieldAttachedImages( $images = array() ) {
_deprecated_function( 'fieldAttachedImages', '5.8', 'vc_field_attached_images' );
return vc_field_attached_images( $images );
}
/**
* @param string $asset
*
* @return array|string
* @deprecated
*/
function getVcShared( $asset = '' ) {
return vc_get_shared( $asset );
}
/**
* Return a action param for ajax
* @return bool
* @since 4.8
* @deprecated 6.1
*/
function vc_wp_action() {
_deprecated_function( 'vc_wp_action', '6.1', 'vc_request_param' );
return vc_request_param( 'action' );
}
classes/settings/class-vc-roles.php 0000644 00000007137 15121635561 0013424 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Manage role.
* @since 4.8
*
* Class Vc_Roles
*/
class Vc_Roles {
protected $post_types = false;
protected $vc_excluded_post_types = false;
protected $parts = array(
'post_types',
'backend_editor',
'frontend_editor',
'unfiltered_html',
'post_settings',
'settings',
'templates',
'shortcodes',
'grid_builder',
'presets',
'dragndrop',
);
/**
* Get list of parts
* @return mixed
*/
public function getParts() {
return apply_filters( 'vc_roles_parts_list', $this->parts );
}
/**
* Check required capability for this role to have user access.
*
* @param $part
*
* @return array|string
*/
public function getPartCapability( $part ) {
return 'settings' !== $part ? array(
'edit_posts',
'edit_pages',
) : 'manage_options';
}
/**
* @param $role
* @param $caps
* @return bool
*/
public function hasRoleCapability( $role, $caps ) {
$has = false;
$wp_role = get_role( $role );
if ( is_string( $caps ) ) {
$has = $wp_role->has_cap( $caps );
} elseif ( is_array( $caps ) ) {
$i = 0;
$count = count( $caps );
while ( false === $has && $i < $count ) {
$has = $this->hasRoleCapability( $role, $caps[ $i ++ ] );
}
}
return $has;
}
/**
* @return \WP_Roles
*/
public function getWpRoles() {
global $wp_roles;
if ( function_exists( 'wp_roles' ) ) {
return $wp_roles;
} else {
if ( ! isset( $wp_roles ) ) {
// @codingStandardsIgnoreLine
$wp_roles = new WP_Roles();
}
}
return $wp_roles;
}
/**
* @param array $params
* @return array
* @throws \Exception
*/
public function save( $params = array() ) {
$data = array( 'message' => '' );
$roles = $this->getWpRoles();
$editable_roles = get_editable_roles();
foreach ( $params as $role => $parts ) {
if ( is_string( $parts ) ) {
$parts = json_decode( stripslashes( $parts ), true );
}
if ( isset( $editable_roles[ $role ] ) ) {
foreach ( $parts as $part => $settings ) {
$part_key = vc_role_access()->who( $role )->part( $part )->getStateKey();
$stateValue = '0';
$roles->use_db = false; // Disable saving in DB on every cap change
foreach ( $settings as $key => $value ) {
if ( '_state' === $key ) {
$stateValue = in_array( $value, array(
'0',
'1',
), true ) ? (bool) $value : $value;
} else {
if ( empty( $value ) ) {
$roles->remove_cap( $role, $part_key . '/' . $key );
} else {
$roles->add_cap( $role, $part_key . '/' . $key, true );
}
}
}
$roles->use_db = true; // Enable for the lat change in cap of role to store data in DB
$roles->add_cap( $role, $part_key, $stateValue );
}
}
}
$data['message'] = esc_html__( 'Roles settings successfully saved.', 'js_composer' );
return $data;
}
/**
* @return array|bool
*/
public function getPostTypes() {
if ( false === $this->post_types ) {
$this->post_types = array();
$exclude = $this->getExcludePostTypes();
foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) {
if ( ! in_array( $post_type, $exclude, true ) ) {
$this->post_types[] = array(
$post_type,
$post_type,
);
}
}
}
return $this->post_types;
}
/**
* @return bool|mixed|void
*/
public function getExcludePostTypes() {
if ( false === $this->vc_excluded_post_types ) {
$this->vc_excluded_post_types = apply_filters( 'vc_settings_exclude_post_type', array(
'attachment',
'revision',
'nav_menu_item',
'mediapage',
) );
}
return $this->vc_excluded_post_types;
}
}
classes/settings/class-vc-settings.php 0000644 00000102313 15121635561 0014130 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Settings page for VC. list of tabs for function composer
*
* Settings page for VC creates menu item in admin menu as subpage of Settings section.
* Settings are build with WP settings API and organized as tabs.
*
* List of tabs
* 1. General Settings - set access rules and allowed content types for editors.
* 2. Design Options - custom color and spacing editor for VC shortcodes elements.
* 3. Custom CSS - add custom css to your WP pages.
* 4. Product License - license key activation for automatic VC updates.
* 5. My Shortcodes - automated mapping tool for shortcodes.
*
* @link http://codex.wordpress.org/Settings_API WordPress settings API
* @since 3.4
*/
class Vc_Settings {
public $tabs;
public $deactivate;
public $locale;
/**
* @var string
*/
protected $option_group = 'wpb_js_composer_settings';
/**
* @var string
*/
protected $page = 'vc_settings';
/**
* @var string
*/
protected static $field_prefix = 'wpb_js_';
/**
* @var string
*/
protected static $notification_name = 'wpb_js_notify_user_about_element_class_names';
/**
* @var
*/
protected static $color_settings;
/**
* @var
*/
protected static $defaults;
/**
* @var
*/
protected $composer;
/**
* @var array
*/
protected $google_fonts_subsets_default = array( 'latin' );
/**
* @var array
*/
protected $google_fonts_subsets = array(
'latin',
'vietnamese',
'cyrillic',
'latin-ext',
'greek',
'cyrillic-ext',
'greek-ext',
);
/**
* @var array
*/
public $google_fonts_subsets_excluded = array();
/**
* @param string $field_prefix
*/
public static function setFieldPrefix( $field_prefix ) {
self::$field_prefix = $field_prefix;
}
/**
* @return string
*/
public function page() {
return $this->page;
}
/**
* @return bool
*/
public function isEditorEnabled() {
global $current_user;
wp_get_current_user();
/** @var $settings - get use group access rules */
$settings = $this->get( 'groups_access_rules' );
$show = true;
foreach ( $current_user->roles as $role ) {
if ( isset( $settings[ $role ]['show'] ) && 'no' === $settings[ $role ]['show'] ) {
$show = false;
break;
}
}
return $show;
}
/**
*
*/
public function setTabs() {
$this->tabs = array();
if ( $this->showConfigurationTabs() ) {
$this->tabs['vc-general'] = esc_html__( 'General Settings', 'js_composer' );
if ( ! vc_is_as_theme() || apply_filters( 'vc_settings_page_show_design_tabs', false ) ) {
$this->tabs['vc-color'] = esc_html__( 'Design Options', 'js_composer' );
$this->tabs['vc-custom_css'] = esc_html__( 'Custom CSS', 'js_composer' );
}
}
if ( ! vc_is_network_plugin() || ( vc_is_network_plugin() && is_network_admin() ) ) {
if ( ! vc_is_updater_disabled() ) {
$this->tabs['vc-updater'] = esc_html__( 'Product License', 'js_composer' );
}
}
// TODO: may allow to disable automapper
if ( ! is_network_admin() && ! vc_automapper_is_disabled() ) {
$this->tabs['vc-automapper'] = vc_automapper()->title();
}
}
/**
* @return mixed|void
*/
public function getTabs() {
if ( ! isset( $this->tabs ) ) {
$this->setTabs();
}
return apply_filters( 'vc_settings_tabs', $this->tabs );
}
/**
* @return bool
*/
public function showConfigurationTabs() {
return ! vc_is_network_plugin() || ! is_network_admin();
}
/**
* Render
*
* @param $tab
* @throws \Exception
*/
public function renderTab( $tab ) {
require_once vc_path_dir( 'CORE_DIR', 'class-vc-page.php' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
if ( ( ( '1' === vc_get_param( 'build_css' ) || 'true' === vc_get_param( 'build_css' ) ) ) || ( ( '1' === vc_get_param( 'settings-updated' ) || 'true' === vc_get_param( 'settings-updated' ) ) ) ) {
$this->buildCustomCss(); // TODO: remove this - no needs to re-save always
}
$tabs = $this->getTabs();
foreach ( $tabs as $key => $value ) {
if ( ! vc_user_access()->part( 'settings' )->can( $key . '-tab' )->get() ) {
unset( $tabs[ $key ] );
}
}
do_action( 'vc-settings-render-tab-' . $tab );
$page = new Vc_Page();
$page->setSlug( $tab )->setTitle( isset( $tabs[ $tab ] ) ? $tabs[ $tab ] : '' )->setTemplatePath( apply_filters( 'vc_settings-render-tab-' . $tab, 'pages/vc-settings/tab.php' ) );
vc_include_template( 'pages/vc-settings/index.php', array(
'pages' => $tabs,
'active_page' => $page,
'vc_settings' => $this,
) );
}
/**
* Init settings page && menu item
* vc_filter: vc_settings_tabs - hook to override settings tabs
*/
public function initAdmin() {
$this->setTabs();
self::$color_settings = array(
array( 'vc_color' => array( 'title' => esc_html__( 'Main accent color', 'js_composer' ) ) ),
array( 'vc_color_hover' => array( 'title' => esc_html__( 'Hover color', 'js_composer' ) ) ),
array( 'vc_color_call_to_action_bg' => array( 'title' => esc_html__( 'Call to action background color', 'js_composer' ) ) ),
array( 'vc_color_google_maps_bg' => array( 'title' => esc_html__( 'Google maps background color', 'js_composer' ) ) ),
array( 'vc_color_post_slider_caption_bg' => array( 'title' => esc_html__( 'Post slider caption background color', 'js_composer' ) ) ),
array( 'vc_color_progress_bar_bg' => array( 'title' => esc_html__( 'Progress bar background color', 'js_composer' ) ) ),
array( 'vc_color_separator_border' => array( 'title' => esc_html__( 'Separator border color', 'js_composer' ) ) ),
array( 'vc_color_tab_bg' => array( 'title' => esc_html__( 'Tabs navigation background color', 'js_composer' ) ) ),
array( 'vc_color_tab_bg_active' => array( 'title' => esc_html__( 'Active tab background color', 'js_composer' ) ) ),
);
self::$defaults = array(
'vc_color' => '#f7f7f7',
'vc_color_hover' => '#F0F0F0',
'margin' => '35px',
'gutter' => '15',
'responsive_max' => '768',
'responsive_md' => '992',
'responsive_lg' => '1200',
'compiled_js_composer_less' => '',
);
if ( 'restore_color' === vc_post_param( 'vc_action' ) && vc_user_access()->check( 'wp_verify_nonce', vc_post_param( '_wpnonce' ), vc_settings()->getOptionGroup() . '_color' . '-options' )
->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-color-tab' )->validateDie()->get() ) {
$this->restoreColor();
}
/**
* @since 4.5 used to call update file once option is changed
*/
add_action( 'update_option_wpb_js_compiled_js_composer_less', array(
$this,
'buildCustomColorCss',
) );
/**
* @since 4.5 used to call update file once option is changed
*/
add_action( 'update_option_wpb_js_custom_css', array(
$this,
'buildCustomCss',
) );
/**
* @since 4.5 used to call update file once option is changed
*/
add_action( 'add_option_wpb_js_compiled_js_composer_less', array(
$this,
'buildCustomColorCss',
) );
/**
* @since 4.5 used to call update file once option is changed
*/
add_action( 'add_option_wpb_js_custom_css', array(
$this,
'buildCustomCss',
) );
/**
* Tab: General Settings
*/
$tab = 'general';
$this->addSection( $tab );
$this->addField( $tab, esc_html__( 'Disable responsive content elements', 'js_composer' ), 'not_responsive_css', array(
$this,
'sanitize_not_responsive_css_callback',
), array(
$this,
'not_responsive_css_field_callback',
) );
$this->addField( $tab, esc_html__( 'Google fonts subsets', 'js_composer' ), 'google_fonts_subsets', array(
$this,
'sanitize_google_fonts_subsets_callback',
), array(
$this,
'google_fonts_subsets_callback',
) );
/**
* Tab: Design Options
*/
$tab = 'color';
$this->addSection( $tab );
// Use custom checkbox
$this->addField( $tab, esc_html__( 'Use custom design options', 'js_composer' ), 'use_custom', array(
$this,
'sanitize_use_custom_callback',
), array(
$this,
'use_custom_callback',
) );
foreach ( self::$color_settings as $color_set ) {
foreach ( $color_set as $key => $data ) {
$this->addField( $tab, $data['title'], $key, array(
$this,
'sanitize_color_callback',
), array(
$this,
'color_callback',
), array(
'id' => $key,
) );
}
}
// Margin
$this->addField( $tab, esc_html__( 'Elements bottom margin', 'js_composer' ), 'margin', array(
$this,
'sanitize_margin_callback',
), array(
$this,
'margin_callback',
) );
// Gutter
$this->addField( $tab, esc_html__( 'Grid gutter width', 'js_composer' ), 'gutter', array(
$this,
'sanitize_gutter_callback',
), array(
$this,
'gutter_callback',
) );
// Responsive max width
$this->addField( $tab, esc_html__( 'Mobile breakpoint', 'js_composer' ), 'responsive_max', array(
$this,
'sanitize_responsive_max_callback',
), array(
$this,
'responsive_max_callback',
) );
$this->addField( $tab, esc_html__( 'Desktop breakpoint', 'js_composer' ), 'responsive_md', array(
$this,
'sanitize_responsive_md_callback',
), array(
$this,
'responsive_md_callback',
) );
$this->addField( $tab, esc_html__( 'Large Desktop breakpoint', 'js_composer' ), 'responsive_lg', array(
$this,
'sanitize_responsive_lg_callback',
), array(
$this,
'responsive_lg_callback',
) );
$this->addField( $tab, false, 'compiled_js_composer_less', array(
$this,
'sanitize_compiled_js_composer_less_callback',
), array(
$this,
'compiled_js_composer_less_callback',
) );
/**
* Tab: Custom CSS
*/
$tab = 'custom_css';
$this->addSection( $tab );
$this->addField( $tab, esc_html__( 'Paste your CSS code', 'js_composer' ), 'custom_css', array(
$this,
'sanitize_custom_css_callback',
), array(
$this,
'custom_css_field_callback',
) );
/**
* Custom Tabs
*/
foreach ( $this->getTabs() as $tab => $title ) {
do_action( 'vc_settings_tab-' . preg_replace( '/^vc\-/', '', $tab ), $this );
}
/**
* Tab: Updater
*/
$tab = 'updater';
$this->addSection( $tab );
}
/**
* Creates new section.
*
* @param $tab - tab key name as tab section
* @param $title - Human title
* @param $callback - function to build section header.
*/
public function addSection( $tab, $title = null, $callback = null ) {
add_settings_section( $this->option_group . '_' . $tab, $title, ( null !== $callback ? $callback : array(
$this,
'setting_section_callback_function',
) ), $this->page . '_' . $tab );
}
/**
* Create field in section.
*
* @param $tab
* @param $title
* @param $field_name
* @param $sanitize_callback
* @param $field_callback
* @param array $args
*
* @return $this
*/
public function addField( $tab, $title, $field_name, $sanitize_callback, $field_callback, $args = array() ) {
register_setting( $this->option_group . '_' . $tab, self::$field_prefix . $field_name, $sanitize_callback );
add_settings_field( self::$field_prefix . $field_name, $title, $field_callback, $this->page . '_' . $tab, $this->option_group . '_' . $tab, $args );
return $this; // chaining
}
/**
*
*/
public function restoreColor() {
foreach ( self::$color_settings as $color_sett ) {
foreach ( $color_sett as $key => $value ) {
delete_option( self::$field_prefix . $key );
}
}
delete_option( self::$field_prefix . 'margin' );
delete_option( self::$field_prefix . 'gutter' );
delete_option( self::$field_prefix . 'responsive_max' );
delete_option( self::$field_prefix . 'responsive_md' );
delete_option( self::$field_prefix . 'responsive_lg' );
delete_option( self::$field_prefix . 'use_custom' );
delete_option( self::$field_prefix . 'compiled_js_composer_less' );
delete_option( self::$field_prefix . 'less_version' );
}
/**
* @param $option_name
*
* @param bool $defaultValue
*
* @return mixed
*/
public static function get( $option_name, $defaultValue = false ) {
return get_option( self::$field_prefix . $option_name, $defaultValue );
}
/**
* @param $option_name
* @param $value
*
* @return bool
*/
public static function set( $option_name, $value ) {
return update_option( self::$field_prefix . $option_name, $value );
}
/**
* Set up the enqueue for the CSS & JavaScript files.
*
*/
public function adminLoad() {
wp_register_script( 'wpb_js_composer_settings', vc_asset_url( 'js/dist/settings.min.js' ), array(), WPB_VC_VERSION, true );
wp_enqueue_style( 'js_composer_settings', vc_asset_url( 'css/js_composer_settings.min.css' ), false, WPB_VC_VERSION );
wp_enqueue_script( 'backbone' );
wp_enqueue_script( 'shortcode' );
wp_enqueue_script( 'underscore' );
wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'wpb_js_composer_settings' );
$this->locale = array(
'are_you_sure_reset_css_classes' => esc_html__( 'Are you sure you want to reset to defaults?', 'js_composer' ),
'are_you_sure_reset_color' => esc_html__( 'Are you sure you want to reset to defaults?', 'js_composer' ),
'saving' => esc_html__( 'Saving...', 'js_composer' ),
'save' => esc_html__( 'Save Changes', 'js_composer' ),
'saved' => esc_html__( 'Design Options successfully saved.', 'js_composer' ),
'save_error' => esc_html__( 'Design Options could not be saved', 'js_composer' ),
'form_save_error' => esc_html__( 'Problem with AJAX request execution, check internet connection and try again.', 'js_composer' ),
'are_you_sure_delete' => esc_html__( 'Are you sure you want to delete this shortcode?', 'js_composer' ),
'are_you_sure_delete_param' => esc_html__( "Are you sure you want to delete the shortcode's param?", 'js_composer' ),
'my_shortcodes_category' => esc_html__( 'My shortcodes', 'js_composer' ),
'error_shortcode_name_is_required' => esc_html__( 'Shortcode name is required.', 'js_composer' ),
'error_enter_valid_shortcode_tag' => esc_html__( 'Please enter valid shortcode tag.', 'js_composer' ),
'error_enter_required_fields' => esc_html__( 'Please enter all required fields for params.', 'js_composer' ),
'new_shortcode_mapped' => esc_html__( 'New shortcode mapped from string!', 'js_composer' ),
'shortcode_updated' => esc_html__( 'Shortcode updated!', 'js_composer' ),
'error_content_param_not_manually' => esc_html__( 'Content param can not be added manually, please use checkbox.', 'js_composer' ),
'error_param_already_exists' => esc_html__( 'Param %s already exists. Param names must be unique.', 'js_composer' ),
'error_wrong_param_name' => esc_html__( 'Please use only letters, numbers and underscore for param name', 'js_composer' ),
'error_enter_valid_shortcode' => esc_html__( 'Please enter valid shortcode to parse!', 'js_composer' ),
);
wp_localize_script( 'wpb_js_composer_settings', 'vcData', apply_filters( 'vc_global_js_data', array(
'version' => WPB_VC_VERSION,
'debug' => false,
) ) );
wp_localize_script( 'wpb_js_composer_settings', 'i18nLocaleSettings', $this->locale );
}
/**
*
*/
public function custom_css_field_callback() {
$value = get_option( self::$field_prefix . 'custom_css' );
if ( empty( $value ) ) {
$value = '';
}
echo '<textarea name="' . esc_attr( self::$field_prefix ) . 'custom_css' . '" class="wpb_csseditor custom_css" style="display:none">' . esc_textarea( $value ) . '</textarea>';
echo '<pre id="wpb_csseditor" class="wpb_content_element custom_css" >' . esc_textarea( $value ) . '</pre>';
echo '<p class="description indicator-hint">' . esc_html__( 'Add custom CSS code to the plugin without modifying files.', 'js_composer' ) . '</p>';
}
/**
* Not responsive checkbox callback function
*/
public function not_responsive_css_field_callback() {
$checked = get_option( self::$field_prefix . 'not_responsive_css' );
if ( empty( $checked ) ) {
$checked = false;
}
?>
<label>
<input type="checkbox"<?php echo $checked ? ' checked' : ''; ?> value="1" id="wpb_js_not_responsive_css" name="<?php echo esc_attr( self::$field_prefix . 'not_responsive_css' ); ?>">
<?php esc_html_e( 'Disable', 'js_composer' ); ?>
</label><br/>
<p
class="description indicator-hint"><?php esc_html_e( 'Disable content elements from "stacking" one on top other on small media screens (Example: mobile devices).', 'js_composer' ); ?></p>
<?php
}
/**
* Google fonts subsets callback
*/
public function google_fonts_subsets_callback() {
$pt_array = get_option( self::$field_prefix . 'google_fonts_subsets' );
$pt_array = $pt_array ? $pt_array : $this->googleFontsSubsets();
foreach ( $this->getGoogleFontsSubsets() as $pt ) {
if ( ! in_array( $pt, $this->getGoogleFontsSubsetsExcluded(), true ) ) {
$checked = ( in_array( $pt, $pt_array, true ) ) ? ' checked' : '';
?>
<label>
<input type="checkbox"<?php echo esc_attr( $checked ); ?> value="<?php echo esc_attr( $pt ); ?>"
id="wpb_js_gf_subsets_<?php echo esc_attr( $pt ); ?>"
name="<?php echo esc_attr( self::$field_prefix . 'google_fonts_subsets' ); ?>[]">
<?php echo esc_html( $pt ); ?>
</label><br>
<?php
}
}
?>
<p class="description indicator-hint"><?php esc_html_e( 'Select subsets for Google Fonts available to content elements.', 'js_composer' ); ?></p>
<?php
}
/**
* Get subsets for google fonts.
*
* @return array
* @since 4.3
* @access public
*/
public function googleFontsSubsets() {
if ( ! isset( $this->google_fonts_subsets_settings ) ) {
$pt_array = vc_settings()->get( 'google_fonts_subsets' );
$this->google_fonts_subsets_settings = $pt_array ? $pt_array : $this->googleFontsSubsetsDefault();
}
return $this->google_fonts_subsets_settings;
}
/**
* @return array
*/
public function googleFontsSubsetsDefault() {
return $this->google_fonts_subsets_default;
}
/**
* @return array
*/
public function getGoogleFontsSubsets() {
return $this->google_fonts_subsets;
}
/**
* @param $subsets
*
* @return bool
*/
public function setGoogleFontsSubsets( $subsets ) {
if ( is_array( $subsets ) ) {
$this->google_fonts_subsets = $subsets;
return true;
}
return false;
}
/**
* @return array
*/
public function getGoogleFontsSubsetsExcluded() {
return $this->google_fonts_subsets_excluded;
}
/**
* @param $excluded
*
* @return bool
*/
public function setGoogleFontsSubsetsExcluded( $excluded ) {
if ( is_array( $excluded ) ) {
$this->google_fonts_subsets_excluded = $excluded;
return true;
}
return false;
}
/**
* Not responsive checkbox callback function
*
*/
public function use_custom_callback() {
$field = 'use_custom';
$checked = get_option( self::$field_prefix . $field );
$checked = $checked ? $checked : false;
?>
<label>
<input type="checkbox"<?php echo( $checked ? ' checked' : '' ); ?> value="1"
id="wpb_js_<?php echo esc_attr( $field ); ?>" name="<?php echo esc_attr( self::$field_prefix . $field ); ?>">
<?php esc_html_e( 'Enable', 'js_composer' ); ?>
</label><br/>
<p class="description indicator-hint"><?php esc_html_e( 'Enable the use of custom design options (Note: when checked - custom css file will be used).', 'js_composer' ); ?></p>
<?php
}
/**
* @param $args
*/
public function color_callback( $args ) {
$field = $args['id'];
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="color-control css-control">';
}
/**
*
*/
public function margin_callback() {
$field = 'margin';
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="css-control">';
echo '<p class="description indicator-hint css-control">' . esc_html__( 'Change default vertical spacing between content elements (Example: 20px).', 'js_composer' ) . '</p>';
}
/**
*
*/
public function gutter_callback() {
$field = 'gutter';
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="css-control"> px';
echo '<p class="description indicator-hint css-control">' . esc_html__( 'Change default horizontal spacing between columns, enter new value in pixels.', 'js_composer' ) . '</p>';
}
/**
*
*/
public function responsive_max_callback() {
$field = 'responsive_max';
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="css-control"> px';
echo '<p class="description indicator-hint css-control">' . esc_html__( 'Content elements stack one on top other when the screen size is smaller than entered value. Change it to control when your layout stacks and adopts to a particular viewport or device size.', 'js_composer' ) . '</p>';
}
public function responsive_md_callback() {
$field = 'responsive_md';
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="css-control"> px';
echo '<p class="description indicator-hint css-control">' . esc_html__( 'Content elements stack one on top other when the screen size is smaller than entered value. Change it to control when your layout stacks and adopts to a particular viewport or device size.', 'js_composer' ) . '</p>';
}
public function responsive_lg_callback() {
$field = 'responsive_lg';
$value = get_option( self::$field_prefix . $field );
$value = $value ? $value : $this->getDefault( $field );
echo '<input type="text" name="' . esc_attr( self::$field_prefix . $field ) . '" value="' . esc_attr( $value ) . '" class="css-control"> px';
echo '<p class="description indicator-hint css-control">' . esc_html__( 'Content elements stack one on top other when the screen size is smaller than entered value. Change it to control when your layout stacks and adopts to a particular viewport or device size.', 'js_composer' ) . '</p>';
}
/**
*
*/
public function compiled_js_composer_less_callback() {
$field = 'compiled_js_composer_less';
echo '<input type="hidden" name="' . esc_attr( self::$field_prefix . $field ) . '" value="">'; // VALUE must be empty
}
/**
* @param $key
*
* @return string
*/
public function getDefault( $key ) {
return ! empty( self::$defaults[ $key ] ) ? self::$defaults[ $key ] : '';
}
/**
* Callback function for settings section
*
* @param $tab
*/
public function setting_section_callback_function( $tab ) {
if ( 'wpb_js_composer_settings_color' === $tab['id'] ) {
echo '<div class="tab_intro">
<p>' . esc_html__( 'Here you can tweak default WPBakery Page Builder content elements visual appearance. By default WPBakery Page Builder is using neutral light-grey theme. Changing "Main accent color" will affect all content elements if no specific "content block" related color is set.', 'js_composer' ) . '
</p>
</div>';
}
}
/**
* @param $rules
*
* @return mixed
*/
public function sanitize_not_responsive_css_callback( $rules ) {
return (bool) $rules;
}
/**
* @param $subsets
*
* @return array
*/
public function sanitize_google_fonts_subsets_callback( $subsets ) {
$pt_array = array();
if ( isset( $subsets ) && is_array( $subsets ) ) {
foreach ( $subsets as $pt ) {
if ( ! in_array( $pt, $this->getGoogleFontsSubsetsExcluded(), true ) && in_array( $pt, $this->getGoogleFontsSubsets(), true ) ) {
$pt_array[] = $pt;
}
}
}
return $pt_array;
}
/**
* @param $rules
*
* @return mixed
*/
public function sanitize_use_custom_callback( $rules ) {
return (bool) $rules;
}
/**
* @param $css
*
* @return mixed
*/
public function sanitize_custom_css_callback( $css ) {
return wp_strip_all_tags( $css );
}
/**
* @param $css
*
* @return mixed
*/
public function sanitize_compiled_js_composer_less_callback( $css ) {
return $css;
}
/**
* @param $color
*
* @return mixed
*/
public function sanitize_color_callback( $color ) {
return $color;
}
/**
* @param $margin
*
* @return mixed
*/
public function sanitize_margin_callback( $margin ) {
$margin = preg_replace( '/\s/', '', $margin );
if ( ! preg_match( '/^\d+(px|%|em|pt){0,1}$/', $margin ) ) {
add_settings_error( self::$field_prefix . 'margin', 1, esc_html__( 'Invalid Margin value.', 'js_composer' ), 'error' );
}
return $margin;
}
/**
* @param $gutter
*
* @return mixed
*/
public function sanitize_gutter_callback( $gutter ) {
$gutter = preg_replace( '/[^\d]/', '', $gutter );
if ( ! $this->_isGutterValid( $gutter ) ) {
add_settings_error( self::$field_prefix . 'gutter', 1, esc_html__( 'Invalid Gutter value.', 'js_composer' ), 'error' );
}
return $gutter;
}
/**
* @param $responsive_max
*
* @return mixed
*/
public function sanitize_responsive_max_callback( $responsive_max ) {
if ( ! $this->_isNumberValid( $responsive_max ) ) {
add_settings_error( self::$field_prefix . 'responsive_max', 1, esc_html__( 'Invalid "Responsive mobile" value.', 'js_composer' ), 'error' );
}
return $responsive_max;
}
/**
* @param $responsive_md
*
* @return mixed
*/
public function sanitize_responsive_md_callback( $responsive_md ) {
if ( ! $this->_isNumberValid( $responsive_md ) ) {
add_settings_error( self::$field_prefix . 'responsive_md', 1, esc_html__( 'Invalid "Responsive md" value.', 'js_composer' ), 'error' );
}
return $responsive_md;
}
/**
* @param $responsive_lg
*
* @return mixed
*/
public function sanitize_responsive_lg_callback( $responsive_lg ) {
if ( ! $this->_isNumberValid( $responsive_lg ) ) {
add_settings_error( self::$field_prefix . 'responsive_lg', 1, esc_html__( 'Invalid "Responsive lg" value.', 'js_composer' ), 'error' );
}
return $responsive_lg;
}
/**
* @param $number
*
* @return int
*/
public static function _isNumberValid( $number ) {
return preg_match( '/^[\d]+(\.\d+){0,1}$/', $number );
}
/**
* @param $gutter
*
* @return int
*/
public static function _isGutterValid( $gutter ) {
return self::_isNumberValid( $gutter );
}
/**
* @return mixed|void
*/
public function useCustomCss() {
$use_custom = get_option( self::$field_prefix . 'use_custom', false );
return $use_custom;
}
/**
* @return mixed|void
*/
public function getCustomCssVersion() {
$less_version = get_option( self::$field_prefix . 'less_version', false );
return $less_version;
}
/**
*
*/
public function rebuild() {
/** WordPress Template Administration API */
require_once ABSPATH . 'wp-admin/includes/template.php';
/** WordPress Administration File API */
require_once ABSPATH . 'wp-admin/includes/file.php';
delete_option( self::$field_prefix . 'compiled_js_composer_less' );
$this->initAdmin();
$this->buildCustomCss(); // TODO: remove this - no needs to re-save always
}
/**
*
*/
public static function buildCustomColorCss() {
/**
* Filesystem API init.
* */
$url = wp_nonce_url( 'admin.php?page=vc-color&build_css=1', 'wpb_js_settings_save_action' );
self::getFileSystem( $url );
/** @var \WP_Filesystem_Direct $wp_filesystem */ global $wp_filesystem;
/**
*
* Building css file.
*
*/
$js_composer_upload_dir = self::checkCreateUploadDir( $wp_filesystem, 'use_custom', 'js_composer_front_custom.css' );
if ( ! $js_composer_upload_dir ) {
return;
}
$filename = $js_composer_upload_dir . '/js_composer_front_custom.css';
$use_custom = get_option( self::$field_prefix . 'use_custom' );
if ( ! $use_custom ) {
$wp_filesystem->put_contents( $filename, '', FS_CHMOD_FILE );
return;
}
$css_string = get_option( self::$field_prefix . 'compiled_js_composer_less' );
if ( strlen( trim( $css_string ) ) > 0 ) {
update_option( self::$field_prefix . 'less_version', WPB_VC_VERSION );
delete_option( self::$field_prefix . 'compiled_js_composer_less' );
$css_string = wp_strip_all_tags( $css_string );
// HERE goes the magic
if ( ! $wp_filesystem->put_contents( $filename, $css_string, FS_CHMOD_FILE ) ) {
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
add_settings_error( self::$field_prefix . 'main_color', $wp_filesystem->errors->get_error_code(), esc_html__( 'Something went wrong: js_composer_front_custom.css could not be created.', 'js_composer' ) . ' ' . $wp_filesystem->errors->get_error_message(), 'error' );
} elseif ( ! $wp_filesystem->connect() ) {
add_settings_error( self::$field_prefix . 'main_color', $wp_filesystem->errors->get_error_code(), esc_html__( 'js_composer_front_custom.css could not be created. Connection error.', 'js_composer' ), 'error' );
} elseif ( ! $wp_filesystem->is_writable( $filename ) ) {
add_settings_error( self::$field_prefix . 'main_color', $wp_filesystem->errors->get_error_code(), sprintf( esc_html__( 'js_composer_front_custom.css could not be created. Cannot write custom css to "%s".', 'js_composer' ), $filename ), 'error' );
} else {
add_settings_error( self::$field_prefix . 'main_color', $wp_filesystem->errors->get_error_code(), esc_html__( 'js_composer_front_custom.css could not be created. Problem with access.', 'js_composer' ), 'error' );
}
delete_option( self::$field_prefix . 'use_custom' );
delete_option( self::$field_prefix . 'less_version' );
}
}
}
/**
* Builds custom css file using css options from vc settings.
*
* @return bool
*/
public static function buildCustomCss() {
/**
* Filesystem API init.
* */
$url = wp_nonce_url( 'admin.php?page=vc-color&build_css=1', 'wpb_js_settings_save_action' );
self::getFileSystem( $url );
/** @var \WP_Filesystem_Direct $wp_filesystem */ global $wp_filesystem;
/**
* Building css file.
*/
$js_composer_upload_dir = self::checkCreateUploadDir( $wp_filesystem, 'custom_css', 'custom.css' );
if ( ! $js_composer_upload_dir ) {
return true;
}
$filename = $js_composer_upload_dir . '/custom.css';
$css_string = '';
$custom_css_string = get_option( self::$field_prefix . 'custom_css' );
if ( ! empty( $custom_css_string ) ) {
$assets_url = vc_asset_url( '' );
$css_string .= preg_replace( '/(url\(\.\.\/(?!\.))/', 'url(' . $assets_url, $custom_css_string );
$css_string = wp_strip_all_tags( $css_string );
}
if ( ! $wp_filesystem->put_contents( $filename, $css_string, FS_CHMOD_FILE ) ) {
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
add_settings_error( self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), esc_html__( 'Something went wrong: custom.css could not be created.', 'js_composer' ) . $wp_filesystem->errors->get_error_message(), 'error' );
} elseif ( ! $wp_filesystem->connect() ) {
add_settings_error( self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), esc_html__( 'custom.css could not be created. Connection error.', 'js_composer' ), 'error' );
} elseif ( ! $wp_filesystem->is_writable( $filename ) ) {
add_settings_error( self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), sprintf( esc_html__( 'custom.css could not be created. Cannot write custom css to %s.', 'js_composer' ), $filename ), 'error' );
} else {
add_settings_error( self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), esc_html__( 'custom.css could not be created. Problem with access.', 'js_composer' ), 'error' );
}
return false;
}
return true;
}
/**
* @param \WP_Filesystem_Direct $wp_filesystem
* @param $option
* @param $filename
*
* @return bool|string
*/
public static function checkCreateUploadDir( $wp_filesystem, $option, $filename ) {
$js_composer_upload_dir = self::uploadDir();
if ( ! $wp_filesystem->is_dir( $js_composer_upload_dir ) ) {
if ( ! $wp_filesystem->mkdir( $js_composer_upload_dir, 0777 ) ) {
add_settings_error( self::$field_prefix . $option, $wp_filesystem->errors->get_error_code(), sprintf( esc_html__( '%s could not be created. Not available to create js_composer directory in uploads directory (%s).', 'js_composer' ), $filename, $js_composer_upload_dir ), 'error' );
return false;
}
}
return $js_composer_upload_dir;
}
/**
* @return string
*/
public static function uploadDir() {
$upload_dir = wp_upload_dir();
/** @var \WP_Filesystem_Direct $wp_filesystem */ global $wp_filesystem;
return $wp_filesystem->find_folder( $upload_dir['basedir'] ) . vc_upload_dir();
}
/**
* @return string
*/
public static function uploadURL() {
$upload_dir = wp_upload_dir();
return $upload_dir['baseurl'] . vc_upload_dir();
}
/**
* @return string
*/
public static function getFieldPrefix() {
return self::$field_prefix;
}
/**
* @param string $url
* @return \WP_Filesystem_Direct|bool
*/
protected static function getFileSystem( $url = '' ) {
/** @var \WP_Filesystem_Direct $wp_filesystem */ global $wp_filesystem;
$status = true;
if ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
$status = WP_Filesystem( false, false, true );
}
return $status ? $wp_filesystem : false;
}
/**
* @return string
*/
public function getOptionGroup() {
return $this->option_group;
}
}
classes/settings/class-vc-license.php 0000644 00000033012 15121635561 0013711 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder Plugin
*
* @package WPBakeryPageBuilder
*
*/
/**
* Manage license
*
* Activation/deactivation is done via support portal and does not use Envato username and
* api_key anymore
*/
class Vc_License {
/**
* Option name where license key is stored
*
* @var string
*/
protected static $license_key_option = 'js_composer_purchase_code';
/**
* Option name where license key token is stored
*
* @var string
*/
protected static $license_key_token_option = 'license_key_token';
/**
* @var string
*/
protected static $support_host = 'https://support.wpbakery.com';
/**
* @var string
*/
public $error = null;
public function init() {
if ( 'vc-updater' === vc_get_param( 'page' ) ) {
$activate = vc_get_param( 'activate' );
$deactivate = vc_get_param( 'deactivate' );
if ( $activate ) {
$this->finishActivationDeactivation( true, $activate );
} elseif ( $deactivate ) {
$this->finishActivationDeactivation( false, $deactivate );
}
}
add_action( 'wp_ajax_vc_get_activation_url', array(
$this,
'startActivationResponse',
) );
add_action( 'wp_ajax_vc_get_deactivation_url', array(
$this,
'startDeactivationResponse',
) );
add_action( 'wp_ajax_nopriv_vc_check_license_key', array(
vc_license(),
'checkLicenseKeyFromRemote',
) );
}
/**
* Output notice
*
* @param string $message
* @param bool $success
*/
public function outputNotice( $message, $success = true ) {
echo sprintf( '<div class="%s"><p>%s</p></div>', (bool) $success ? 'updated' : 'error', esc_html( $message ) );
}
/**
* Show error
*
* @param string $error
*/
public function showError( $error ) {
$this->error = $error;
add_action( 'admin_notices', array(
$this,
'outputLastError',
) );
}
/**
* Output last error
*/
public function outputLastError() {
$this->outputNotice( $this->error, false );
}
/**
* Output successful activation message
*/
public function outputActivatedSuccess() {
$this->outputNotice( esc_html__( 'WPBakery Page Builder successfully activated.', 'js_composer' ), true );
}
/**
* Output successful deactivation message
*/
public function outputDeactivatedSuccess() {
$this->outputNotice( esc_html__( 'WPBakery Page Builder successfully deactivated.', 'js_composer' ), true );
}
/**
* Finish pending activation/deactivation
*
* 1) Make API call to support portal
* 2) Receive success status and license key
* 3) Set new license key
*
* @param bool $activation
* @param string $user_token
*
* @return bool
*/
public function finishActivationDeactivation( $activation, $user_token ) {
if ( ! $this->isValidToken( $user_token ) ) {
$this->showError( esc_html__( 'Token is not valid or has expired', 'js_composer' ) );
return false;
}
if ( $activation ) {
$url = self::$support_host . '/finish-license-activation';
} else {
$url = self::$support_host . '/finish-license-deactivation';
}
$params = array(
'body' => array( 'token' => $user_token ),
'timeout' => 30,
);
// FIX SSL SNI
$filter_add = true;
if ( function_exists( 'curl_version' ) ) {
$version = curl_version();
if ( version_compare( $version['version'], '7.18', '>=' ) ) {
$filter_add = false;
}
}
if ( $filter_add ) {
add_filter( 'https_ssl_verify', '__return_false' );
}
$response = wp_remote_post( $url, $params );
if ( $filter_add ) {
remove_filter( 'https_ssl_verify', '__return_false' );
}
if ( is_wp_error( $response ) ) {
$this->showError( sprintf( esc_html__( '%s. Please try again.', 'js_composer' ), $response->get_error_message() ) );
return false;
}
if ( 200 !== $response['response']['code'] ) {
$this->showError( sprintf( esc_html__( 'Server did not respond with OK: %s', 'js_composer' ), $response['response']['code'] ) );
return false;
}
$json = json_decode( $response['body'], true );
if ( ! $json || ! isset( $json['status'] ) ) {
$this->showError( esc_html__( 'Invalid response structure. Please contact us for support.', 'js_composer' ) );
return false;
}
if ( ! $json['status'] ) {
$this->showError( esc_html__( 'Something went wrong. Please contact us for support.', 'js_composer' ) );
return false;
}
if ( $activation ) {
if ( ! isset( $json['license_key'] ) || ! $this->isValidFormat( $json['license_key'] ) ) {
$this->showError( esc_html__( 'Invalid response structure. Please contact us for support.', 'js_composer' ) );
return false;
}
$this->setLicenseKey( $json['license_key'] );
add_action( 'admin_notices', array(
$this,
'outputActivatedSuccess',
) );
} else {
$this->setLicenseKey( '' );
add_action( 'admin_notices', array(
$this,
'outputDeactivatedSuccess',
) );
}
$this->setLicenseKeyToken( '' );
return true;
}
/**
* @return boolean
*/
public function isActivated() {
return true;
}
/**
* Check license key from remote
*
* Function is used by support portal to check if VC w/ specific license is still installed
*/
public function checkLicenseKeyFromRemote() {
$license_key = vc_request_param( 'license_key' );
if ( ! $this->isValid( $license_key ) ) {
$response = array(
'status' => false,
'error' => esc_html__( 'Invalid license key', 'js_composer' ),
);
} else {
$response = array( 'status' => true );
}
die( wp_json_encode( $response ) );
}
/**
* Generate action URL
*
* @return string
*/
public function generateActivationUrl() {
$token = sha1( $this->newLicenseKeyToken() );
$url = esc_url( self::getSiteUrl() );
$redirect = esc_url( vc_updater()->getUpdaterUrl() );
return sprintf( '%s/activate-license?token=%s&url=%s&redirect=%s', self::$support_host, $token, $url, $redirect );
}
/**
* Generate action URL
*
* @return string
*/
public function generateDeactivationUrl() {
$license_key = $this->getLicenseKey();
$token = sha1( $this->newLicenseKeyToken() );
$url = esc_url( self::getSiteUrl() );
$redirect = esc_url( vc_updater()->getUpdaterUrl() );
return sprintf( '%s/deactivate-license?license_key=%s&token=%s&url=%s&redirect=%s', self::$support_host, $license_key, $token, $url, $redirect );
}
/**
* Start activation process and output redirect URL as JSON
*/
public function startActivationResponse() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-updater-tab' )->validateDie();
$response = array(
'status' => true,
'url' => $this->generateActivationUrl(),
);
die( wp_json_encode( $response ) );
}
/**
* Start deactivation process and output redirect URL as JSON
*/
public function startDeactivationResponse() {
vc_user_access()->checkAdminNonce()->validateDie( 'Failed nonce check' )->wpAny( 'manage_options' )->validateDie( 'Failed access check' )->part( 'settings' )->can( 'vc-updater-tab' )
->validateDie( 'Failed access check #2' );
$response = array(
'status' => true,
'url' => $this->generateDeactivationUrl(),
);
die( wp_json_encode( $response ) );
}
/**
* Set license key
*
* @param string $license_key
*/
public function setLicenseKey( $license_key ) {
if ( vc_is_network_plugin() ) {
update_site_option( 'wpb_js_' . self::$license_key_option, $license_key );
} else {
vc_settings()->set( self::$license_key_option, $license_key );
}
}
/**
* Get license key
*
* @return string
*/
public function getLicenseKey() {
if ( vc_is_network_plugin() ) {
$value = get_site_option( 'wpb_js_' . self::$license_key_option );
} else {
$value = vc_settings()->get( self::$license_key_option );
}
return $value;
}
/**
* Check if specified license key is valid
*
* @param string $license_key
*
* @return bool
*/
public function isValid( $license_key ) {
return true;
}
/**
* Set up license activation notice if needed
*
* Don't show notice on dev environment
*/
public function setupReminder() {
if ( self::isDevEnvironment() ) {
return;
}
$version1 = isset( $_COOKIE['vchideactivationmsg_vc11'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['vchideactivationmsg_vc11'] ) ) : '';
if ( ! $this->isActivated() && ( empty( $version1 ) || version_compare( $version1, WPB_VC_VERSION, '<' ) ) && ! ( vc_is_network_plugin() && is_network_admin() ) ) {
add_action( 'admin_notices', array(
$this,
'adminNoticeLicenseActivation',
) );
}
}
/**
* Check if current enviroment is dev
*
* Environment is considered dev if host is:
* - ip address
* - tld is local, dev, wp, test, example, localhost or invalid
* - no tld (localhost, custom hosts)
*
* @param string $host Hostname to check. If null, use HTTP_HOST
*
* @return boolean
*/
public static function isDevEnvironment( $host = null ) {
if ( ! $host ) {
$host = self::getSiteUrl();
}
$chunks = explode( '.', $host );
if ( 1 === count( $chunks ) ) {
return true;
}
if ( in_array( end( $chunks ), array(
'local',
'dev',
'wp',
'test',
'example',
'localhost',
'invalid',
), true ) ) {
return true;
}
if ( preg_match( '/^[0-9\.]+$/', $host ) ) {
return true;
}
return false;
}
public function adminNoticeLicenseActivation() {
if ( vc_is_network_plugin() ) {
update_site_option( 'wpb_js_composer_license_activation_notified', 'yes' );
} else {
vc_settings()->set( 'composer_license_activation_notified', 'yes' );
}
$redirect = esc_url( vc_updater()->getUpdaterUrl() );
$first_tag = 'style';
$second_tag = 'script';
// @codingStandardsIgnoreStart
?>
<<?php echo esc_attr( $first_tag ); ?>>
.vc_license-activation-notice {
position: relative;
}
</<?php echo esc_attr( $first_tag ); ?>>
<<?php echo esc_attr( $second_tag ); ?>>
(function ( $ ) {
var setCookie = function ( c_name, value, exdays ) {
var exdate = new Date();
exdate.setDate( exdate.getDate() + exdays );
var c_value = encodeURIComponent( value ) + ((null === exdays) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
};
$( document ).off( 'click.vc-notice-dismiss' ).on( 'click.vc-notice-dismiss',
'.vc-notice-dismiss',
function ( e ) {
e.preventDefault();
var $el = $( this ).closest(
'#vc_license-activation-notice' );
$el.fadeTo( 100, 0, function () {
$el.slideUp( 100, function () {
$el.remove();
} );
} );
setCookie( 'vchideactivationmsg_vc11',
'<?php echo esc_attr( WPB_VC_VERSION ); ?>',
30 );
} );
})( window.jQuery );
</<?php echo esc_attr( $second_tag ); ?>>
<?php
echo '<div class="updated vc_license-activation-notice" id="vc_license-activation-notice"><p>' . sprintf( esc_html__( 'Hola! Would you like to receive automatic updates and unlock premium support? Please %sactivate your copy%s of WPBakery Page Builder.', 'js_composer' ), '<a href="' . esc_url( wp_nonce_url( $redirect ) ) . '">', '</a>' ) . '</p>' . '<button type="button" class="notice-dismiss vc-notice-dismiss"><span class="screen-reader-text">' . esc_html__( 'Dismiss this notice.', 'js_composer' ) . '</span></button></div>';
// @codingStandardsIgnoreEnd
}
/**
* Get license key token
*
* @return string
*/
public function getLicenseKeyToken() {
$value = vc_is_network_plugin() ? get_site_option( self::$license_key_token_option ) : get_option( self::$license_key_token_option );
return $value;
}
/**
* Set license key token
*
* @param string $token
*
* @return string
*/
public function setLicenseKeyToken( $token ) {
if ( vc_is_network_plugin() ) {
$value = update_site_option( self::$license_key_token_option, $token );
} else {
$value = update_option( self::$license_key_token_option, $token );
}
return $value;
}
/**
* Return new license key token
*
* Token is used to change license key from remote location
*
* Format is: timestamp|20-random-characters
*
* @return string
*/
public function generateLicenseKeyToken() {
$token = current_time( 'timestamp' ) . '|' . vc_random_string( 20 );
return $token;
}
/**
* Generate and set new license key token
*
* @return string
*/
public function newLicenseKeyToken() {
$token = $this->generateLicenseKeyToken();
$this->setLicenseKeyToken( $token );
return $token;
}
/**
* Check if specified license key token is valid
*
* @param string $token_to_check SHA1 hashed token
* @param int $ttl_in_seconds Time to live in seconds. Default = 20min
*
* @return boolean
*/
public function isValidToken( $token_to_check, $ttl_in_seconds = 1200 ) {
$token = $this->getLicenseKeyToken();
if ( ! $token_to_check || sha1( $token ) !== $token_to_check ) {
return false;
}
$chunks = explode( '|', $token );
if ( intval( $chunks[0] ) < ( current_time( 'timestamp' ) - $ttl_in_seconds ) ) {
return false;
}
return true;
}
/**
* Check if license key format is valid
*
* license key is version 4 UUID, that have form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
* where x is any hexadecimal digit and y is one of 8, 9, A, or B.
*
* @param string $license_key
*
* @return boolean
*/
public function isValidFormat( $license_key ) {
$pattern = '/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i';
return (bool) preg_match( $pattern, $license_key );
}
/**
* @return string|void
*/
/**
* @return string|void
*/
public static function getSiteUrl() {
if ( vc_is_network_plugin() ) {
return network_site_url();
} else {
return site_url();
}
}
}
classes/settings/automapper/class-vc-automap-model.php 0000644 00000006202 15121635561 0017211 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( ! class_exists( 'Vc_Automap_Model' ) ) {
/**
* Shortcode as model for automapper. Provides crud functionality for storing data for shortcodes that mapped by ATM
*
* @see Vc_Automapper
* @since 4.1
*/
class Vc_Automap_Model {
/**
* @var string
*/
protected static $option_name = 'vc_automapped_shortcodes';
/**
* @var
*/
protected static $option_data;
/**
* @var array|bool
*/
public $id = false;
public $tag;
/**
* @var mixed
*/
protected $data;
/**
* @var array
*/
protected $vars = array(
'tag',
'name',
'category',
'description',
'params',
);
public $name;
/**
* @param $data
*/
public function __construct( $data ) {
$this->loadOptionData();
$this->id = is_array( $data ) && isset( $data['id'] ) ? esc_attr( $data['id'] ) : $data;
if ( is_array( $data ) ) {
$this->data = stripslashes_deep( $data );
}
foreach ( $this->vars as $var ) {
$this->{$var} = $this->get( $var );
}
}
/**
* @return array
*/
public static function findAll() {
self::loadOptionData();
$records = array();
foreach ( self::$option_data as $id => $record ) {
$record['id'] = $id;
$model = new self( $record );
if ( $model ) {
$records[] = $model;
}
}
return $records;
}
/**
* @return array|mixed
*/
final protected static function loadOptionData() {
if ( is_null( self::$option_data ) ) {
self::$option_data = get_option( self::$option_name );
}
if ( ! self::$option_data ) {
self::$option_data = array();
}
return self::$option_data;
}
/**
* @param $key
*
* @return null
*/
public function get( $key ) {
if ( is_null( $this->data ) ) {
$this->data = isset( self::$option_data[ $this->id ] ) ? self::$option_data[ $this->id ] : array();
}
return isset( $this->data[ $key ] ) ? $this->data[ $key ] : null;
}
/**
* @param $attr
* @param null $value
*/
public function set( $attr, $value = null ) {
if ( is_array( $attr ) ) {
foreach ( $attr as $key => $value ) {
$this->set( $key, $value );
}
} elseif ( ! is_null( $value ) ) {
$this->{$attr} = $value;
}
}
/**
* @return bool
*/
public function save() {
if ( ! $this->isValid() ) {
return false;
}
foreach ( $this->vars as $var ) {
$this->data[ $var ] = $this->{$var};
}
return $this->saveOption();
}
/**
* @return bool
*/
public function delete() {
return $this->deleteOption();
}
/**
* @return bool
*/
public function isValid() {
if ( ! is_string( $this->name ) || empty( $this->name ) ) {
return false;
}
if ( ! preg_match( '/^\S+$/', $this->tag ) ) {
return false;
}
return true;
}
/**
* @return bool
*/
protected function saveOption() {
self::$option_data[ $this->id ] = $this->data;
return update_option( self::$option_name, self::$option_data );
}
/**
* @return bool
*/
protected function deleteOption() {
unset( self::$option_data[ $this->id ] );
return delete_option( self::$option_name );
}
}
}
classes/settings/automapper/automapper.php 0000644 00000001424 15121635561 0015112 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// Helpers
if ( ! function_exists( 'vc_atm_build_categories_array' ) ) {
/**
* @param $string
*
* @return array
*/
function vc_atm_build_categories_array( $string ) {
return explode( ',', preg_replace( '/\,\s+/', ',', trim( $string ) ) );
}
}
if ( ! function_exists( 'vc_atm_build_params_array' ) ) {
/**
* @param $array
*
* @return array
*/
function vc_atm_build_params_array( $array ) {
$params = array();
if ( is_array( $array ) ) {
foreach ( $array as $param ) {
if ( 'dropdown' === $param['type'] ) {
$param['value'] = explode( ',', preg_replace( '/\,\s+/', ',', trim( $param['value'] ) ) );
}
$param['save_always'] = true;
$params[] = $param;
}
}
return $params;
}
}
classes/settings/automapper/class-vc-automapper.php 0000644 00000035223 15121635561 0016627 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
if ( ! class_exists( 'Vc_Automapper' ) ) {
/**
* Automated shortcode mapping
*
* Automapper adds settings tab for VC settings tabs with ability to map custom shortcodes to VC editors,
* if shortcode is not mapped by default or developers haven't done this yet.
* No more shortcode copy/paste. Add any third party shortcode to the list of VC menu elements for reuse.
* Edit params, values and description.
*
* @since 4.1
*/
class Vc_Automapper {
/**
* @var bool
*/
protected static $disabled = false;
protected $title;
/**
*
*/
public function __construct() {
$this->title = esc_attr__( 'Shortcode Mapper', 'js_composer' );
}
/**
*
*/
public function addAjaxActions() {
add_action( 'wp_ajax_vc_automapper_create', array(
$this,
'create',
) );
add_action( 'wp_ajax_vc_automapper_read', array(
$this,
'read',
) );
add_action( 'wp_ajax_vc_automapper_update', array(
$this,
'update',
) );
add_action( 'wp_ajax_vc_automapper_delete', array(
$this,
'delete',
) );
return $this;
}
/**
* Builds html for Automapper CRUD like administration block
*
* @return bool
*/
public function renderHtml() {
if ( $this->disabled() ) {
return false;
}
?>
<div class="tab_intro">
<p><?php esc_html_e( 'WPBakery Page Builder Shortcode Mapper adds custom 3rd party vendors shortcodes to the list of WPBakery Page Builder content elements menu (Note: to map shortcode it needs to be installed on site).', 'js_composer' ); ?></p>
</div>
<div class="vc_automapper-toolbar">
<a href=javascript:;" class="button button-primary"
id="vc_automapper-add-btn"><?php esc_html_e( 'Map Shortcode', 'js_composer' ); ?></a>
</div>
<ul class="vc_automapper-list">
</ul>
<?php $this->renderTemplates(); ?>
<?php
return true;
}
/**
* @param $shortcode
*/
public function renderListItem( $shortcode ) {
echo sprintf( '<li class="vc_automapper-item" data-item-id=""><label>%s</label><span class="vc_automapper-item-controls"><a href="javascript:;" class="vc_automapper-edit-btn" data-id="%s" data-tag="%s"></a><a href="javascript:;" class="vc_automapper-delete-btn" data-id="%s" data-tag="%s"></a></span></li>', esc_html( $shortcode->name ), esc_attr( $shortcode->id ), esc_attr( $shortcode->tag ), esc_attr( $shortcode->id ), esc_attr( $shortcode->tag ) );
}
/**
*
*/
public function renderMapFormTpl() {
$custom_tag = 'script'; // Maybe use html shadow dom or ajax response for templates
?>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_automapper-add-form-tpl">
<label for="vc_atm-shortcode-string"
class="vc_info"><?php esc_html_e( 'Shortcode string', 'js_composer' ); ?></label>
<div class="vc_wrapper">
<div class="vc_string">
<input id="vc_atm-shortcode-string"
placeholder="<?php esc_attr_e( 'Please enter valid shortcode', 'js_composer' ); ?>"
type="text" class="vc_atm-string">
</div>
<div class="vc_buttons">
<a href="#" id="vc_atm-parse-string"
class="button button-primary vc_parse-btn"><?php esc_attr_e( 'Parse Shortcode', 'js_composer' ); ?></a>
<a href="#" class="button vc_atm-cancel"><?php esc_attr_e( 'Cancel', 'js_composer' ); ?></a>
</div>
</div>
<span
class="description"><?php esc_html_e( 'Enter valid shortcode (Example: [my_shortcode first_param="first_param_value"]My shortcode content[/my_shortcode]).', 'js_composer' ); ?></span>
</<?php echo esc_attr( $custom_tag ); ?>>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_automapper-item-complex-tpl">
<div class="widget-top">
<div class="widget-title-action">
<button type="button" class="widget-action hide-if-no-js" aria-expanded="true">
<span class="screen-reader-text"><?php esc_html_e( 'Edit widget: Search', 'js_composer' ); ?></span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
</div>
<div class="widget-title"><h4>{{ name }}<span class="in-widget-title"></span></h4></div>
</div>
<div class="widget-inside">
</div>
</<?php echo esc_attr( $custom_tag ); ?>>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_automapper-form-tpl">
<input type="hidden" name="name" id="vc_atm-name" value="{{ name }}">
<div class="vc_shortcode-preview" id="vc_shortcode-preview">
{{{ shortcode_preview }}}
</div>
<div class="vc_line"></div>
<div class="vc_wrapper">
<h4 class="vc_h"><?php esc_html_e( 'General Information', 'js_composer' ); ?></h4>
<div class="vc_field vc_tag">
<label for="vc_atm-tag"><?php esc_html_e( 'Tag:', 'js_composer' ); ?></label>
<input type="text" name="tag" id="vc_atm-tag" value="{{ tag }}">
</div>
<div class="vc_field vc_description">
<label for="vc_atm-description"><?php esc_html_e( 'Description:', 'js_composer' ); ?></label>
<textarea name="description" id="vc_atm-description">{{ description }}</textarea>
</div>
<div class="vc_field vc_category">
<label for="vc_atm-category"><?php esc_html_e( 'Category:', 'js_composer' ); ?></label>
<input type="text" name="category" id="vc_atm-category" value="{{ category }}">
<span
class="description"><?php esc_html_e( 'Comma separated categories names', 'js_composer' ); ?></span>
</div>
<div class="vc_field vc_is-container">
<label for="vc_atm-is-container"><input type="checkbox" name="is_container"
id="vc_atm-is-container"
value=""> <?php esc_html_e( 'Include content param into shortcode', 'js_composer' ); ?>
</label>
</div>
</div>
<div class="vc_line"></div>
<div class="vc_wrapper">
<h4 class="vc_h"><?php esc_html_e( 'Shortcode Parameters', 'js_composer' ); ?></h4>
<a href="#" id="vc_atm-add-param"
class="button vc_add-param">+ <?php esc_html_e( 'Add Param', 'js_composer' ); ?></a>
<div class="vc_params" id="vc_atm-params-list"></div>
</div>
<div class="vc_buttons">
<a href="#" id="vc_atm-save"
class="button button-primary"><?php esc_html_e( 'Save Changes', 'js_composer' ); ?></a>
<a href="#" class="button vc_atm-cancel"><?php esc_html_e( 'Cancel', 'js_composer' ); ?></a>
<a href="#" class="button vc_atm-delete"><?php esc_html_e( 'Delete', 'js_composer' ); ?></a>
</div>
</<?php echo esc_attr( $custom_tag ); ?>>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_atm-form-param-tpl">
<div class="vc_controls vc_controls-row vc_clearfix"><a
class="vc_control column_move vc_column-move vc_move-param" href="#"
title="<?php esc_html_e( 'Drag row to reorder', 'js_composer' ); ?>" data-vc-control="move"><i
class="vc-composer-icon vc-c-icon-dragndrop"></i></a><span class="vc_row_edit_clone_delete"><a
class="vc_control column_delete vc_delete-param" href="#"
title="<?php esc_html_e( 'Delete this param', 'js_composer' ); ?>"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a></span>
</div>
<div class="wpb_element_wrapper">
<div class="vc_row vc_row-fluid wpb_row_container">
<div class="wpb_vc_column wpb_sortable vc_col-sm-12 wpb_content_holder vc_empty-column">
<div class="wpb_element_wrapper">
<div class="vc_fields vc_clearfix">
<div class="vc_param_name vc_param-field">
<label><?php esc_html_e( 'Param name', 'js_composer' ); ?></label>
<# if ( 'content' === param_name) { #>
<span class="vc_content"><?php esc_html_e( 'Content', 'js_composer' ); ?></span>
<input type="text" style="display: none;" name="param_name"
value="{{ param_name }}"
placeholder="<?php esc_attr_e( 'Required value', 'js_composer' ); ?>"
class="vc_param-name"
data-system="true">
<span class="description"
style="display: none;"><?php esc_html_e( 'Use only letters, numbers and underscore.', 'js_composer' ); ?></span>
<# } else { #>
<input type="text" name="param_name" value="{{ param_name }}"
placeholder="<?php esc_attr_e( 'Required value', 'js_composer' ); ?>"
class="vc_param-name">
<span
class="description"><?php esc_html_e( 'Please use only letters, numbers and underscore.', 'js_composer' ); ?></span>
<# } #>
</div>
<div class="vc_heading vc_param-field">
<label><?php esc_html_e( 'Heading', 'js_composer' ); ?></label>
<input type="text" name="heading" value="{{ heading }}"
placeholder="<?php esc_attr_e( 'Input heading', 'js_composer' ); ?>"
<# if ( 'hidden' === type) { #>
disabled="disabled"
<# } #>>
<span
class="description"><?php esc_html_e( 'Heading for field in shortcode edit form.', 'js_composer' ); ?></span>
</div>
<div class="vc_type vc_param-field">
<label><?php esc_html_e( 'Field type', 'js_composer' ); ?></label>
<select name="type">
<option value=""><?php esc_html_e( 'Select field type', 'js_composer' ); ?></option>
<option
value="textfield"<?php echo '<# if (type === "textfield") { #> selected<# } #>'; ?>><?php esc_html_e( 'Textfield', 'js_composer' ); ?></option>
<option
value="dropdown"<?php echo '<# if (type === "dropdown") { #> selected<# } #>'; ?>><?php esc_html_e( 'Dropdown', 'js_composer' ); ?></option>
<option
value="textarea"<?php echo '<# if(type==="textarea") { #> selected="selected"<# } #>'; ?>><?php esc_html_e( 'Textarea', 'js_composer' ); ?></option>
<# if ( 'content' === param_name ) { #>
<option
value="textarea_html"<?php echo '<# if (type === "textarea_html") { #> selected<# } #>'; ?>><?php esc_html_e( 'Textarea HTML', 'js_composer' ); ?></option>
<# } #>
<option
value="hidden"<?php echo '<# if (type === "hidden") { #> selected<# } #>'; ?>><?php esc_html_e( 'Hidden', 'js_composer' ); ?></option>
</select>
<span
class="description"><?php esc_html_e( 'Field type for shortcode edit form.', 'js_composer' ); ?></span>
</div>
<div class="vc_value vc_param-field">
<label><?php esc_html_e( 'Default value', 'js_composer' ); ?></label>
<input type="text" name="value" value="{{ value }}" class="vc_param-value">
<span
class="description"><?php esc_html_e( 'Default value or list of values for dropdown type (Note: separate by comma).', 'js_composer' ); ?></span>
</div>
<div class="description vc_param-field">
<label><?php esc_html_e( 'Description', 'js_composer' ); ?></label>
<textarea name="description" placeholder=""
<# if ( 'hidden' === type ) { #>
disabled="disabled"
<# } #> >{{ description
}}</textarea>
<span
class="description"><?php esc_html_e( 'Enter description for parameter.', 'js_composer' ); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php
}
/**
*
*/
public function renderTemplates() {
$custom_tag = 'script'; // Maybe use ajax resonse for template
?>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_automapper-item-tpl">
<label class="vc_automapper-edit-btn">{{ name }}</label>
<span class="vc_automapper-item-controls">
<a href="#" class="vc_automapper-delete-btn" title="<?php esc_html_e( 'Delete', 'js_composer' ); ?>"></a>
<a href="#" class="vc_automapper-edit-btn" title="<?php esc_html_e( 'Edit', 'js_composer' ); ?>"></a>
</span>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php
$this->renderMapFormTpl();
}
public function create() {
if ( ! vc_request_param( '_vcnonce' ) ) {
return;
}
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-automapper-tab' )->validateDie();
$data = vc_post_param( 'data' );
$shortcode = new Vc_Automap_Model( $data );
$this->result( $shortcode->save() );
}
public function update() {
if ( ! vc_request_param( '_vcnonce' ) ) {
return;
}
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-automapper-tab' )->validateDie();
$id = (int) vc_post_param( 'id' );
$data = vc_post_param( 'data' );
$shortcode = new Vc_Automap_Model( $id );
if ( ! isset( $data['params'] ) ) {
$data['params'] = array();
}
$shortcode->set( $data );
$this->result( $shortcode->save() );
}
public function delete() {
if ( ! vc_request_param( '_vcnonce' ) ) {
return;
}
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-automapper-tab' )->validateDie();
$id = vc_post_param( 'id' );
$shortcode = new Vc_Automap_Model( $id );
$this->result( $shortcode->delete() );
}
public function read() {
if ( ! vc_request_param( '_vcnonce' ) ) {
return;
}
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-automapper-tab' )->validateDie();
$this->result( Vc_Automap_Model::findAll() );
}
/**
* Ajax result output
*
* @param $data
*/
public function result( $data ) {
if ( false !== $data ) {
wp_send_json_success( $data );
} else {
wp_send_json_error( $data );
}
}
/**
* Setter/Getter for Disabling Automapper
* @static
*
* @param bool $disable
*/
public static function setDisabled( $disable = true ) {
self::$disabled = $disable;
}
/**
* @return bool
*/
public static function disabled() {
return self::$disabled;
}
/**
* Setter/Getter for Automapper title
*
* @static
*
* @param string $title
*/
public function setTitle( $title ) {
$this->title = $title;
}
/**
* @return string|void
*/
public function title() {
return $this->title;
}
/**
*
*/
public static function map() {
$shortcodes = Vc_Automap_Model::findAll();
foreach ( $shortcodes as $shortcode ) {
vc_map( array(
'name' => $shortcode->name,
'base' => $shortcode->tag,
'category' => vc_atm_build_categories_array( $shortcode->category ),
'description' => $shortcode->description,
'params' => vc_atm_build_params_array( $shortcode->params ),
'show_settings_on_create' => ! empty( $shortcode->params ),
'atm' => true,
'icon' => 'icon-wpb-atm',
) );
}
}
}
}
classes/shortcodes/vc-button.php 0000644 00000000761 15121635561 0013021 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Button extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
$icon = $this->settings( 'icon' );
return '<h4 class="wpb_element_title"><span class="vc_general vc_element-icon' . ( ! empty( $icon ) ? ' ' . esc_attr( $icon ) : '' ) . '"></span></h4>';
}
}
classes/shortcodes/vc-zigzag.php 0000644 00000000244 15121635561 0012775 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Zigzag
*/
class WPBakeryShortCode_Vc_Zigzag extends WPBakeryShortCode {
}
classes/shortcodes/vc-gitem-col.php 0000644 00000003235 15121635561 0013365 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-column.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Col
*/
class WPBakeryShortCode_Vc_Gitem_Col extends WPBakeryShortCode_Vc_Column {
public $nonDraggableClass = 'vc-non-draggable-column';
/**
* @param $width
* @param $i
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? ' wpb_sortable ' : ' ' . $this->nonDraggableClass . ' ' );
return 'data-element_type="' . $this->settings['base'] . '" data-vc-column-width="' . wpb_vc_get_column_width_indent( $width[ $i ] ) . '" class="wpb_vc_column wpb_' . $this->settings['base'] . $sortable . $this->templateWidth() . ' wpb_content_holder"' . $this->customAdminBlockParams();
}
/**
* @return string
*/
public function outputEditorControlAlign() {
$alignment = array(
array(
'name' => 'left',
'label' => esc_html__( 'Left', 'js_composer' ),
),
array(
'name' => 'center',
'label' => esc_html__( 'Center', 'js_composer' ),
),
array(
'name' => 'right',
'label' => esc_html__( 'Right', 'js_composer' ),
),
);
$output = '<span class="vc_control vc_control-align"><span class="vc_control-wrap">';
foreach ( $alignment as $data ) {
$attr = esc_attr( $data['name'] );
$output .= sprintf( '<a href="#" data-vc-control-btn="align" data-vc-align="%s" class="vc_control vc_control-align-%s" title="%s"><i class="vc_icon vc_icon-align-%s"></i></a>', esc_attr( $attr ), $attr, esc_html( $data['label'] ), $attr );
}
return $output . '</span></span>';
}
}
classes/shortcodes/vc-images-carousel.php 0000644 00000003412 15121635561 0014562 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gallery.php' );
/**
* Class WPBakeryShortCode_Vc_images_carousel
*/
class WPBakeryShortCode_Vc_Images_Carousel extends WPBakeryShortCode_Vc_Gallery {
protected static $carousel_index = 1;
/**
* WPBakeryShortCode_Vc_images_carousel constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsCssScripts();
}
public function jsCssScripts() {
wp_register_script( 'vc_transition_bootstrap_js', vc_asset_url( 'lib/vc_carousel/js/transition.min.js' ), array(), WPB_VC_VERSION, true );
wp_register_script( 'vc_carousel_js', vc_asset_url( 'lib/vc_carousel/js/vc_carousel.min.js' ), array( 'vc_transition_bootstrap_js' ), WPB_VC_VERSION, true );
wp_register_style( 'vc_carousel_css', vc_asset_url( 'lib/vc_carousel/css/vc_carousel.min.css' ), array(), WPB_VC_VERSION );
}
/**
* @return string
*/
public static function getCarouselIndex() {
return ( self::$carousel_index ++ ) . '-' . time();
}
/**
* @param $size
* @return string
*/
protected function getSliderWidth( $size ) {
global $_wp_additional_image_sizes;
$width = '100%';
if ( in_array( $size, get_intermediate_image_sizes(), true ) ) {
if ( in_array( $size, array(
'thumbnail',
'medium',
'large',
), true ) ) {
$width = get_option( $size . '_size_w' ) . 'px';
} else {
if ( isset( $_wp_additional_image_sizes ) && isset( $_wp_additional_image_sizes[ $size ] ) ) {
$width = $_wp_additional_image_sizes[ $size ]['width'] . 'px';
}
}
} else {
preg_match_all( '/\d+/', $size, $matches );
if ( count( $matches[0] ) > 1 ) {
$width = $matches[0][0] . 'px';
}
}
return $width;
}
}
classes/shortcodes/vc-gutenberg.php 0000644 00000000425 15121635561 0013465 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Gutenberg
*/
class WPBakeryShortCode_Vc_Gutenberg extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
return '';
}
}
classes/shortcodes/vc-tta-pageable.php 0000644 00000002263 15121635561 0014033 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Tabs' );
/**
* Class WPBakeryShortCode_Vc_Tta_Pageable
*/
class WPBakeryShortCode_Vc_Tta_Pageable extends WPBakeryShortCode_Vc_Tta_Tabs {
public $layout = 'tabs';
/**
* @return string
*/
public function getTtaContainerClasses() {
$classes = parent::getTtaContainerClasses();
$classes .= ' vc_tta-o-non-responsive';
return $classes;
}
/**
* @return mixed|string
*/
public function getTtaGeneralClasses() {
$classes = parent::getTtaGeneralClasses();
$classes .= ' vc_tta-pageable';
// tabs have pagination on opposite side of tabs. pageable should behave normally
if ( false !== strpos( $classes, 'vc_tta-tabs-position-top' ) ) {
$classes = str_replace( 'vc_tta-tabs-position-top', 'vc_tta-tabs-position-bottom', $classes );
} else {
$classes = str_replace( 'vc_tta-tabs-position-bottom', 'vc_tta-tabs-position-top', $classes );
}
return $classes;
}
/**
* Disable all tabs
*
* @param $atts
* @param $content
*
* @return string
*/
public function getParamTabsList( $atts, $content ) {
return '';
}
}
classes/shortcodes/vc-tta-tabs.php 0000644 00000012063 15121635561 0013223 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Accordion' );
/**
* Class WPBakeryShortCode_Vc_Tta_Tabs
*/
class WPBakeryShortCode_Vc_Tta_Tabs extends WPBakeryShortCode_Vc_Tta_Accordion {
public $layout = 'tabs';
public function enqueueTtaScript() {
wp_register_script( 'vc_tabs_script', vc_asset_url( 'lib/vc_tabs/vc-tabs.min.js' ), array( 'vc_accordion_script' ), WPB_VC_VERSION, true );
parent::enqueueTtaScript();
wp_enqueue_script( 'vc_tabs_script' );
}
/**
* @return string
*/
public function getWrapperAttributes() {
$attributes = array();
$attributes[] = 'class="' . esc_attr( $this->getTtaContainerClasses() ) . '"';
$attributes[] = 'data-vc-action="collapse"';
$autoplay = $this->atts['autoplay'];
if ( $autoplay && 'none' !== $autoplay && intval( $autoplay ) > 0 ) {
$attributes[] = 'data-vc-tta-autoplay="' . esc_attr( wp_json_encode( array(
'delay' => intval( $autoplay ) * 1000,
) ) ) . '"';
}
if ( ! empty( $this->atts['el_id'] ) ) {
$attributes[] = 'id="' . esc_attr( $this->atts['el_id'] ) . '"';
}
return implode( ' ', $attributes );
}
/**
* @return string
*/
public function getTtaGeneralClasses() {
$classes = parent::getTtaGeneralClasses();
if ( ! empty( $this->atts['no_fill_content_area'] ) ) {
$classes .= ' vc_tta-o-no-fill';
}
if ( isset( $this->atts['tab_position'] ) ) {
$classes .= ' ' . $this->getTemplateVariable( 'tab_position' );
}
$classes .= ' ' . $this->getParamAlignment( $this->atts, $this->content );
return $classes;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabPosition( $atts, $content ) {
if ( isset( $atts['tab_position'] ) && strlen( $atts['tab_position'] ) > 0 ) {
return 'vc_tta-tabs-position-' . $atts['tab_position'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabsListTop( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'top' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamTabsList( $atts, $content );
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabsListBottom( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'bottom' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamTabsList( $atts, $content );
}
/**
* Pagination is on top only if tabs are at bottom
*
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamPaginationTop( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'bottom' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamPaginationList( $atts, $content );
}
/**
* Pagination is at bottom only if tabs are on top
*
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamPaginationBottom( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'top' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamPaginationList( $atts, $content );
}
/**
* @param $atts
*
* @return string
*/
public function constructIcon( $atts ) {
vc_icon_element_fonts_enqueue( $atts['i_type'] );
$class = 'vc_tta-icon';
if ( isset( $atts[ 'i_icon_' . $atts['i_type'] ] ) ) {
$class .= ' ' . $atts[ 'i_icon_' . $atts['i_type'] ];
} else {
$class .= ' fa fa-adjust';
}
return '<i class="' . $class . '"></i>';
}
/**
* @param $atts
* @param $content
*
* @return string
*/
public function getParamTabsList( $atts, $content ) {
$isPageEditabe = vc_is_page_editable();
$html = array();
$html[] = '<div class="vc_tta-tabs-container">';
$html[] = '<ul class="vc_tta-tabs-list">';
if ( ! $isPageEditabe ) {
$active_section = $this->getActiveSection( $atts, false );
foreach ( WPBakeryShortCode_Vc_Tta_Section::$section_info as $nth => $section ) {
$classes = array( 'vc_tta-tab' );
if ( ( $nth + 1 ) === $active_section ) {
$classes[] = $this->activeClass;
}
$title = '<span class="vc_tta-title-text">' . $section['title'] . '</span>';
if ( 'true' === $section['add_icon'] ) {
$icon_html = $this->constructIcon( $section );
if ( 'left' === $section['i_position'] ) {
$title = $icon_html . $title;
} else {
$title = $title . $icon_html;
}
}
$a_html = '<a href="#' . $section['tab_id'] . '" data-vc-tabs data-vc-container=".vc_tta">' . $title . '</a>';
$html[] = '<li class="' . implode( ' ', $classes ) . '" data-vc-tab>' . $a_html . '</li>';
}
}
$html[] = '</ul>';
$html[] = '</div>';
return implode( '', apply_filters( 'vc-tta-get-params-tabs-list', $html, $atts, $content, $this ) );
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamAlignment( $atts, $content ) {
if ( isset( $atts['alignment'] ) && strlen( $atts['alignment'] ) > 0 ) {
return 'vc_tta-controls-align-' . $atts['alignment'];
}
return null;
}
}
classes/shortcodes/vc-masonry-grid.php 0000644 00000002751 15121635561 0014122 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-basic-grid.php' );
/**
* Class WPBakeryShortCode_Vc_Masonry_Grid
*/
class WPBakeryShortCode_Vc_Masonry_Grid extends WPBakeryShortCode_Vc_Basic_Grid {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_basic_grid';
}
public function shortcodeScripts() {
parent::shortcodeScripts();
wp_register_script( 'vc_masonry', vc_asset_url( 'lib/bower/masonry/dist/masonry.pkgd.min.js' ), array(), WPB_VC_VERSION, true );
}
public function enqueueScripts() {
wp_enqueue_script( 'vc_masonry' );
parent::enqueueScripts();
}
public function buildGridSettings() {
parent::buildGridSettings();
$this->grid_settings['style'] .= '-masonry';
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentAllMasonry( $grid_style, $settings, $content ) {
return parent::contentAll( $grid_style, $settings, $content );
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentLazyMasonry( $grid_style, $settings, $content ) {
return parent::contentLazy( $grid_style, $settings, $content );
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentLoadMoreMasonry( $grid_style, $settings, $content ) {
return parent::contentLoadMore( $grid_style, $settings, $content );
}
}
classes/shortcodes/vc-raw-html.php 0000644 00000003345 15121635561 0013242 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
*/
class WPBakeryShortCode_Vc_Raw_Html extends WPBakeryShortCode {
/**
* @param $param
* @param $value
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$output = '';
// Compatibility fixes
// TODO: check $old_names & &new_names. Leftover from copypasting?
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( isset( $param['holder'] ) && 'hidden' !== $param['holder'] ) {
if ( 'textarea_raw_html' === $param['type'] ) {
// @codingStandardsIgnoreLine
$output .= sprintf( '<%s class="wpb_vc_param_value %s %s %s" name="%s">%s</%s><input type="hidden" name="%s_code" class="%s_code" value="%s" />', $param['holder'], $param_name, $type, $class, $param_name, htmlentities( rawurldecode( base64_decode( wp_strip_all_tags( $value ) ) ), ENT_COMPAT, 'UTF-8' ), $param['holder'], $param_name, $param_name, wp_strip_all_tags( $value ) );
} else {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
}
return $output;
}
}
classes/shortcodes/vc-gitem-zone-a.php 0000644 00000000601 15121635561 0013773 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-zone.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Zone_A
*/
class WPBakeryShortCode_Vc_Gitem_Zone_A extends WPBakeryShortCode_Vc_Gitem_Zone {
public $zone_name = 'a';
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_zone';
}
}
classes/shortcodes/vc-accordion.php 0000644 00000004130 15121635561 0013441 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Accordion extends WPBakeryShortCode {
protected $controls_css_settings = 'out-tc vc_controls-content-widget';
/**
* @param $atts
* @param null $content
* @return mixed|string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$width = $custom_markup = '';
$shortcode_attributes = array( 'width' => '1/1' );
foreach ( $this->settings['params'] as $param ) {
if ( 'content' !== $param['param_name'] ) {
$shortcode_attributes[ $param['param_name'] ] = isset( $param['value'] ) ? $param['value'] : null;
} elseif ( 'content' === $param['param_name'] && null === $content ) {
$content = $param['value'];
}
}
extract( shortcode_atts( $shortcode_attributes, $atts ) );
$elem = $this->getElementHolder( $width );
$inner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$tmp = '';
if ( isset( $this->settings['custom_markup'] ) && '' !== $this->settings['custom_markup'] ) {
if ( '' !== $content ) {
$custom_markup = str_ireplace( '%content%', $tmp . $content, $this->settings['custom_markup'] );
} elseif ( '' === $content && isset( $this->settings['default_content_in_template'] ) && '' !== $this->settings['default_content_in_template'] ) {
$custom_markup = str_ireplace( '%content%', $this->settings['default_content_in_template'], $this->settings['custom_markup'] );
} else {
$custom_markup = str_ireplace( '%content%', '', $this->settings['custom_markup'] );
}
$inner .= do_shortcode( $custom_markup );
}
$output = str_ireplace( '%wpb_element_content%', $inner, $elem );
return $output;
}
}
classes/shortcodes/paginator/class-vc-pageable.php 0000644 00000010240 15121635561 0016326 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Pageable
*/
class WPBakeryShortCode_Vc_Pageable extends WPBakeryShortCode {
/**
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->shortcodeScripts();
}
/**
* Register scripts and styles for pager
*/
public function shortcodeScripts() {
wp_register_script( 'vc_pageable_owl-carousel', vc_asset_url( 'lib/owl-carousel2-dist/owl.carousel.min.js' ), array(
'jquery-core',
), WPB_VC_VERSION, true );
wp_register_script( 'vc_waypoints', vc_asset_url( 'lib/vc_waypoints/vc-waypoints.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_style( 'vc_pageable_owl-carousel-css', vc_asset_url( 'lib/owl-carousel2-dist/assets/owl.min.css' ), array(), WPB_VC_VERSION );
}
/**
* @param $grid_style
* @param $settings
* @param $content
*
* @return string
*/
protected function contentAll( $grid_style, $settings, $content ) {
return '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">' . $content . '</div>';
}
/**
* @param $grid_style
* @param $settings
* @param $content
*
* @return string
*/
protected function contentLoadMore( $grid_style, $settings, $content ) {
if ( ! isset( $settings['btn_data'] ) && isset( $settings['button_style'] ) && isset( $settings['button_size'] ) && isset( $settings['button_color'] ) ) {
// BC: for those who overrided
$output = sprintf( '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">%s</div><div class="vc_pageable-load-more-btn" data-vc-grid-load-more-btn="true">%s</div>', $content, do_shortcode( '[vc_button2 size="' . $settings['button_size'] . '" title="' . esc_attr__( 'Load more', 'js_composer' ) . '" style="' . $settings['button_style'] . '" color="' . $settings['button_color'] . '" el_class="vc_grid-btn-load_more"]' ) );
return $output;
} elseif ( isset( $settings['btn_data'] ) ) {
$data = $settings['btn_data'];
$data['el_class'] = 'vc_grid-btn-load_more';
$data['link'] = 'load-more-grid';
$button3 = new WPBakeryShortCode_Vc_Btn( array( 'base' => 'vc_btn' ) );
$output = sprintf( '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">%s</div><div class="vc_pageable-load-more-btn" data-vc-grid-load-more-btn="true">%s</div>', $content, apply_filters( 'vc_gitem_template_attribute_vc_btn', '', array(
'post' => new stdClass(),
'data' => str_replace( array(
'{{ vc_btn:',
'}}',
), '', $button3->output( $data ) ),
) ) );
return $output;
}
return '';
}
/**
* @param $grid_style
* @param $settings
* @param $content
*
* @return string
*/
protected function contentLazy( $grid_style, $settings, $content ) {
return '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">' . $content . '</div><div data-lazy-loading-btn="true" style="display: none;"><a href="' . esc_url( get_permalink( $settings['page_id'] ) ) . '"></a></div>';
}
/**
* @param $grid_style
* @param $settings
* @param string $content
*
* @param string $css_class
*
* @return string
*/
public function renderPagination( $grid_style, $settings, $content = '', $css_class = '' ) {
$css_class .= empty( $css_class ) ? '' : ' vc_pageable-wrapper vc_hook_hover';
$content_method = vc_camel_case( 'content-' . $grid_style );
$content = method_exists( $this, $content_method ) ? $this->$content_method( $grid_style, $settings, $content ) : $content;
$output = '<div class="' . esc_attr( $css_class ) . '" data-vc-pageable-content="true">' . $content . '</div>';
return $output;
}
public function enqueueScripts() {
wp_enqueue_script( 'vc_pageable_owl-carousel' );
wp_enqueue_style( 'vc_pageable_owl-carousel-css' );
wp_enqueue_style( 'vc_animate-css' );
}
/**
* Check is pageable
* @return bool
* @since 4.7.4
*/
public function isObjectPageable() {
return true;
}
/**
* Check can user manage post.
*
* @param int $page_id
*
* @return bool
*/
public function currentUserCanManage( $page_id ) {
return vc_user_access()->wpAny( array(
'edit_post',
(int) $page_id,
) )->get();
}
}
classes/shortcodes/vc-message.php 0000644 00000001450 15121635561 0013126 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Message
*/
class WPBakeryShortCode_Vc_Message extends WPBakeryShortCode {
/**
* @param $atts
* @return mixed
*/
public static function convertAttributesToMessageBox2( $atts ) {
if ( isset( $atts['style'] ) ) {
if ( '3d' === $atts['style'] ) {
$atts['message_box_style'] = '3d';
$atts['style'] = 'rounded';
} elseif ( 'outlined' === $atts['style'] ) {
$atts['message_box_style'] = 'outline';
$atts['style'] = 'rounded';
} elseif ( 'square_outlined' === $atts['style'] ) {
$atts['message_box_style'] = 'outline';
$atts['style'] = 'square';
}
}
return $atts;
}
/**
* @param $title
* @return string
*/
public function outputTitle( $title ) {
return '';
}
}
classes/shortcodes/vc-section.php 0000644 00000012550 15121635561 0013151 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder section
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Section extends WPBakeryShortCodesContainer {
/**
* @param $width
* @param $i
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="vc_section_container vc_container_for_children"';
}
/**
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->shortcodeScripts();
}
protected function shortcodeScripts() {
wp_register_script( 'vc_jquery_skrollr_js', vc_asset_url( 'lib/bower/skrollr/dist/skrollr.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_youtube_iframe_api_js', 'https://www.youtube.com/iframe_api', array(), WPB_VC_VERSION, true );
}
/**
* @return string
* @throws \Exception
*/
public function cssAdminClass() {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? ' wpb_sortable' : ' ' . $this->nonDraggableClass );
return 'wpb_' . $this->settings['base'] . $sortable . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $this->settings['class'] : '' );
}
/**
* @param string $controls
* @param string $extended_css
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls = 'full', $extended_css = '' ) {
$controls_start = '<div class="vc_controls vc_controls-visible controls_column' . ( ! empty( $extended_css ) ? " {$extended_css}" : '' ) . '">';
$output = '<div class="vc_controls vc_controls-row controls_row vc_clearfix">';
$controls_end = '</div>';
// Create columns
$controls_move = ' <a class="vc_control column_move vc_column-move" href="#" title="' . esc_attr__( 'Drag row to reorder', 'js_composer' ) . '" data-vc-control="move"><i class="vc-composer-icon vc-c-icon-dragndrop"></i></a>';
$moveAccess = vc_user_access()->part( 'dragndrop' )->checkStateAny( true, null )->get();
if ( ! $moveAccess ) {
$controls_move = '';
}
$controls_add = ' <a class="vc_control column_add vc_column-add" href="#" title="' . esc_attr__( 'Add column', 'js_composer' ) . '" data-vc-control="add"><i class="vc-composer-icon vc-c-icon-add"></i></a>';
$controls_delete = '<a class="vc_control column_delete vc_column-delete" href="#" title="' . esc_attr__( 'Delete this row', 'js_composer' ) . '" data-vc-control="delete"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>';
$controls_edit = ' <a class="vc_control column_edit vc_column-edit" href="#" title="' . esc_attr__( 'Edit this row', 'js_composer' ) . '" data-vc-control="edit"><i class="vc-composer-icon vc-c-icon-mode_edit"></i></a>';
$controls_clone = ' <a class="vc_control column_clone vc_column-clone" href="#" title="' . esc_attr__( 'Clone this row', 'js_composer' ) . '" data-vc-control="clone"><i class="vc-composer-icon vc-c-icon-content_copy"></i></a>';
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
$row_edit_clone_delete = '<span class="vc_row_edit_clone_delete">';
if ( 'add' === $controls ) {
return $controls_start . $controls_add . $controls_end;
}
if ( $allAccess ) {
$row_edit_clone_delete .= $controls_delete . $controls_clone . $controls_edit;
} elseif ( $editAccess ) {
$row_edit_clone_delete .= $controls_edit;
}
$row_edit_clone_delete .= '</span>';
if ( $allAccess ) {
$output .= '<div>' . $controls_move . $controls_add . '</div>' . $row_edit_clone_delete . $controls_end;
} elseif ( $editAccess ) {
$output .= $row_edit_clone_delete . $controls_end;
} else {
$output .= $row_edit_clone_delete . $controls_end;
}
return $output;
}
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$width = '';
$atts = shortcode_atts( $this->predefined_atts, $atts );
$output = '';
$column_controls = $this->getColumnControls();
$output .= '<div data-element_type="' . $this->settings['base'] . '" class="' . $this->cssAdminClass() . '">';
$output .= str_replace( '%column_size%', 1, $column_controls );
$output .= '<div class="wpb_element_wrapper">';
if ( isset( $this->settings['custom_markup'] ) && '' !== $this->settings['custom_markup'] ) {
$markup = $this->settings['custom_markup'];
$output .= $this->customMarkup( $markup );
} else {
$output .= '<div ' . $this->containerHtmlBlockParams( $width, 1 ) . '>';
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '</div>';
}
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
if ( ! isset( $param['param_name'] ) ) {
continue;
}
$param_value = isset( $atts[ $param['param_name'] ] ) ? $atts[ $param['param_name'] ] : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$output .= $inner;
}
$output .= '</div>';
if ( $this->backened_editor_prepend_controls ) {
$output .= $this->getColumnControls( 'add', 'vc_section-bottom-controls bottom-controls' );
}
$output .= '</div>';
return $output;
}
}
classes/shortcodes/vc-custom-heading.php 0000644 00000012250 15121635561 0014411 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Custom_heading
* @since 4.3
*/
class WPBakeryShortCode_Vc_Custom_Heading extends WPBakeryShortCode {
/**
* Defines fields names for google_fonts, font_container and etc
* @since 4.4
* @var array
*/
protected $fields = array(
'google_fonts' => 'google_fonts',
'font_container' => 'font_container',
'el_class' => 'el_class',
'css' => 'css',
'text' => 'text',
);
/**
* Used to get field name in vc_map function for google_fonts, font_container and etc..
*
* @param $key
*
* @return bool
* @since 4.4
*/
protected function getField( $key ) {
return isset( $this->fields[ $key ] ) ? $this->fields[ $key ] : false;
}
/**
* Get param value by providing key
*
* @param $key
*
* @return array|bool
* @throws \Exception
* @since 4.4
*/
protected function getParamData( $key ) {
return WPBMap::getParam( $this->shortcode, $this->getField( $key ) );
}
/**
* Parses shortcode attributes and set defaults based on vc_map function relative to shortcode and fields names
*
* @param $atts
*
* @return array
* @throws \Exception
* @since 4.3
*/
public function getAttributes( $atts ) {
/**
* Shortcode attributes
* @var $text
* @var $google_fonts
* @var $font_container
* @var $el_class
* @var $link
* @var $css
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
/**
* Get default values from VC_MAP.
*/
$google_fonts_field = $this->getParamData( 'google_fonts' );
$font_container_field = $this->getParamData( 'font_container' );
$el_class = $this->getExtraClass( $el_class );
$font_container_obj = new Vc_Font_Container();
$google_fonts_obj = new Vc_Google_Fonts();
$font_container_field_settings = isset( $font_container_field['settings'], $font_container_field['settings']['fields'] ) ? $font_container_field['settings']['fields'] : array();
$google_fonts_field_settings = isset( $google_fonts_field['settings'], $google_fonts_field['settings']['fields'] ) ? $google_fonts_field['settings']['fields'] : array();
$font_container_data = $font_container_obj->_vc_font_container_parse_attributes( $font_container_field_settings, $font_container );
$google_fonts_data = strlen( $google_fonts ) > 0 ? $google_fonts_obj->_vc_google_fonts_parse_attributes( $google_fonts_field_settings, $google_fonts ) : '';
return array(
'text' => isset( $text ) ? $text : '',
'google_fonts' => $google_fonts,
'font_container' => $font_container,
'el_class' => $el_class,
'css' => isset( $css ) ? $css : '',
'link' => ( 0 === strpos( $link, '|' ) ) ? false : $link,
'font_container_data' => $font_container_data,
'google_fonts_data' => $google_fonts_data,
);
}
/**
* Parses google_fonts_data and font_container_data to get needed css styles to markup
*
* @param $el_class
* @param $css
* @param $google_fonts_data
* @param $font_container_data
* @param $atts
*
* @return array
* @since 4.3
*/
public function getStyles( $el_class, $css, $google_fonts_data, $font_container_data, $atts ) {
$styles = array();
if ( ! empty( $font_container_data ) && isset( $font_container_data['values'] ) ) {
foreach ( $font_container_data['values'] as $key => $value ) {
if ( 'tag' !== $key && strlen( $value ) ) {
if ( preg_match( '/description/', $key ) ) {
continue;
}
if ( 'font_size' === $key || 'line_height' === $key ) {
$value = preg_replace( '/\s+/', '', $value );
}
if ( 'font_size' === $key ) {
$pattern = '/^(\d*(?:\.\d+)?)\s*(px|\%|in|cm|mm|em|rem|ex|pt|pc|vw|vh|vmin|vmax)?$/';
// allowed metrics: http://www.w3schools.com/cssref/css_units.asp
preg_match( $pattern, $value, $matches );
$value = isset( $matches[1] ) ? (float) $matches[1] : (float) $value;
$unit = isset( $matches[2] ) ? $matches[2] : 'px';
$value = $value . $unit;
}
if ( strlen( $value ) > 0 ) {
$styles[] = str_replace( '_', '-', $key ) . ': ' . $value;
}
}
}
}
if ( ( ! isset( $atts['use_theme_fonts'] ) || 'yes' !== $atts['use_theme_fonts'] ) && ! empty( $google_fonts_data ) && isset( $google_fonts_data['values'], $google_fonts_data['values']['font_family'], $google_fonts_data['values']['font_style'] ) ) {
$google_fonts_family = explode( ':', $google_fonts_data['values']['font_family'] );
$styles[] = 'font-family:' . $google_fonts_family[0];
$google_fonts_styles = explode( ':', $google_fonts_data['values']['font_style'] );
$styles[] = 'font-weight:' . $google_fonts_styles[1];
$styles[] = 'font-style:' . $google_fonts_styles[2];
}
/**
* Filter 'VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG' to change vc_custom_heading class
*
* @param string - filter_name
* @param string - element_class
* @param string - shortcode_name
* @param array - shortcode_attributes
*
* @since 4.3
*/
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_custom_heading ' . $el_class . vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );
return array(
'css_class' => trim( preg_replace( '/\s+/', ' ', $css_class ) ),
'styles' => $styles,
);
}
}
classes/shortcodes/vc-basic-grid.php 0000644 00000045052 15121635561 0013514 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'paginator/class-vc-pageable.php' );
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-btn.php' );
/**
* Class WPBakeryShortCode_Vc_Basic_Grid
*/
class WPBakeryShortCode_Vc_Basic_Grid extends WPBakeryShortCode_Vc_Pageable {
public $pagable_type = 'grid';
public $items = array();
public static $excluded_ids = array();
protected $element_template = '';
protected static $default_max_items = 1000;
public $post_id = false;
/** @var \Vc_Grid_Item $grid_item */
public $grid_item = false;
protected $filter_terms;
public $attributes_defaults = array(
'initial_loading_animation' => 'zoomIn',
'full_width' => '',
'layout' => '',
'element_width' => '4',
'items_per_page' => '5',
'gap' => '',
'style' => 'all',
'show_filter' => '',
'filter_default_title' => 'all',
'exclude_filter' => '',
'filter_style' => '',
'filter_size' => 'md',
'filter_align' => '',
'filter_color' => '',
'arrows_design' => '',
'arrows_position' => '',
'arrows_color' => '',
'paging_design' => '',
'paging_color' => '',
'paging_animation_in' => '',
'paging_animation_out' => '',
'loop' => '',
'autoplay' => '',
'post_type' => 'post',
'filter_source' => 'category',
'orderby' => '',
'order' => 'DESC',
// @codingStandardsIgnoreLine
'meta_key' => '',
'max_items' => '10',
'offset' => '0',
'taxonomies' => '',
'custom_query' => '',
'data_type' => 'query',
'include' => '',
'exclude' => '',
'item' => 'none',
'grid_id' => '',
// disabled, needed for-BC:
'button_style' => '',
'button_color' => '',
'button_size' => '',
// New button3:
'btn_title' => '',
'btn_style' => 'modern',
'btn_el_id' => '',
'btn_custom_background' => '#ededed',
'btn_custom_text' => '#666',
'btn_outline_custom_color' => '#666',
'btn_outline_custom_hover_background' => '#666',
'btn_outline_custom_hover_text' => '#fff',
'btn_shape' => 'rounded',
'btn_color' => 'blue',
'btn_size' => 'md',
'btn_align' => 'inline',
'btn_button_block' => '',
'btn_add_icon' => '',
'btn_i_align' => 'left',
'btn_i_type' => 'fontawesome',
'btn_i_icon_fontawesome' => 'fa fa-adjust',
'btn_i_icon_openiconic' => 'vc-oi vc-oi-dial',
'btn_i_icon_typicons' => 'typcn typcn-adjust-brightness',
'btn_i_icon_entypo' => 'entypo-icon entypo-icon-note',
'btn_i_icon_linecons' => 'vc_li vc_li-heart',
'btn_i_icon_pixelicons' => 'vc_pixel_icon vc_pixel_icon-alert',
'btn_custom_onclick' => '',
'btn_custom_onclick_code' => '',
// fix template
'page_id' => '',
);
protected $grid_settings = array();
protected $grid_id_unique_name = 'vc_gid'; // if you change this also change in hook-vc-grid.php
/**
* @var \WP_Query
*/
protected $query;
/**
* WPBakeryShortCode_Vc_Basic_Grid constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->attributes_defaults['btn_title'] = esc_html__( 'Load more', 'js_composer' );
$this->shortcodeScripts();
}
public function shortcodeScripts() {
parent::shortcodeScripts();
wp_register_script( 'vc_grid-js-imagesloaded', vc_asset_url( 'lib/bower/imagesloaded/imagesloaded.pkgd.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_grid', vc_asset_url( 'js/dist/vc_grid.min.js' ), array(
'jquery-core',
'underscore',
'vc_pageable_owl-carousel',
'vc_waypoints',
// 'isotope',
'vc_grid-js-imagesloaded',
), WPB_VC_VERSION, true );
}
public function enqueueScripts() {
parent::enqueueScripts();
wp_enqueue_script( 'vc_grid-js-imagesloaded' );
wp_enqueue_script( 'vc_grid' );
}
/**
* @param $id
*/
public static function addExcludedId( $id ) {
self::$excluded_ids[] = $id;
}
/**
* @return array
*/
public static function excludedIds() {
return self::$excluded_ids;
}
/**
* @param $atts
* @param $content
* @return false|mixed|string|void
*/
public function getId( $atts, $content ) {
if ( vc_is_page_editable() || is_preview() ) {
/*
* We are in Frontend editor
* We need to send RAW shortcode data, so hash is just json_encode of atts and content
*/
return rawurlencode( wp_json_encode( array(
'tag' => $this->shortcode,
'atts' => $atts,
'content' => $content,
) ) );
}
$id_pattern = '/' . $this->grid_id_unique_name . '\:([\w\-_]+)/';
$id_value = isset( $atts['grid_id'] ) ? $atts['grid_id'] : '';
preg_match( $id_pattern, $id_value, $id_matches );
$id_to_save = wp_json_encode( array( 'failed_to_get_id' => esc_attr( $id_value ) ) );
if ( ! empty( $id_matches ) ) {
$id_to_save = $id_matches[1];
}
return $id_to_save;
}
/**
* @param $page_id
* @param $grid_id
* @return array|mixed|object|void
*/
public function findPostShortcodeById( $page_id, $grid_id ) {
if ( $this->currentUserCanManage( $page_id ) && preg_match( '/\"tag\"\:/', urldecode( $grid_id ) ) ) {
return json_decode( urldecode( $grid_id ), true ); // if frontend, no hash exists - just RAW data
}
$post_meta = get_post_meta( (int) $page_id, '_vc_post_settings' );
$shortcode = false;
if ( is_array( $post_meta ) ) {
foreach ( $post_meta as $meta ) {
if ( isset( $meta['vc_grid_id'] ) && ! empty( $meta['vc_grid_id']['shortcodes'] ) && isset( $meta['vc_grid_id']['shortcodes'][ $grid_id ] ) ) {
$shortcode = $meta['vc_grid_id']['shortcodes'][ $grid_id ];
break;
}
}
}
return apply_filters( 'vc_basic_grid_find_post_shortcode', $shortcode, $page_id, $grid_id );
}
/**
* @return string
* @throws \Exception
*/
public function renderItems() {
$output = '';
$items = '';
$this->buildGridSettings();
$atts = $this->atts;
$settings = $this->grid_settings;
$filter_terms = $this->filter_terms;
$is_end = isset( $this->is_end ) && $this->is_end;
$css_classes = 'vc_grid vc_row' . esc_attr( $atts['gap'] > 0 ? ' vc_grid-gutter-' . (int) $atts['gap'] . 'px' : '' );
$currentScope = WPBMap::getScope();
if ( is_array( $this->items ) && ! empty( $this->items ) ) {
// Adding before vc_map
WPBMap::setScope( Vc_Grid_Item_Editor::postType() );
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$this->grid_item = new Vc_Grid_Item();
$this->grid_item->setGridAttributes( $atts );
$this->grid_item->setIsEnd( $is_end );
$this->grid_item->setTemplateById( $atts['item'] );
$output .= $this->grid_item->addShortcodesCustomCss();
ob_start();
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
wp_print_styles();
}
$output .= ob_get_clean();
$attributes = array(
'filter_terms' => $filter_terms,
'atts' => $atts,
'grid_item',
$this->grid_item,
);
$output .= apply_filters( 'vc_basic_grid_template_filter', vc_get_template( 'shortcodes/vc_basic_grid_filter.php', $attributes ), $attributes );
global $post;
$backup = $post;
foreach ( $this->items as $postItem ) {
$this->query->setup_postdata( $postItem );
// @codingStandardsIgnoreLine
$post = $postItem;
$items .= $this->grid_item->renderItem( $postItem );
}
wp_reset_postdata();
$post = $backup;
} else {
return '';
}
$items = apply_filters( $this->shortcode . '_items_list', $items );
$output .= $this->renderPagination( $atts['style'], $settings, $items, $css_classes );
WPBMap::setScope( $currentScope );
return $output;
}
public function setContentLimits() {
$atts = $this->atts;
if ( 'ids' === $this->atts['post_type'] ) {
$this->atts['max_items'] = 0;
$this->atts['offset'] = 0;
$this->atts['items_per_page'] = apply_filters( 'vc_basic_grid_max_items', self::$default_max_items );
} else {
$offset = isset( $atts['offset'] ) ? (int) $atts['offset'] : $this->attributes_defaults['offset'];
$this->atts['offset'] = $offset;
$this->atts['max_items'] = isset( $atts['max_items'] ) ? (int) $atts['max_items'] : (int) $this->attributes_defaults['max_items'];
$this->atts['items_per_page'] = ! isset( $atts['items_per_page'] ) ? (int) $this->attributes_defaults['items_per_page'] : (int) $atts['items_per_page'];
if ( $this->atts['max_items'] < 1 ) {
$this->atts['max_items'] = apply_filters( 'vc_basic_grid_max_items', self::$default_max_items );
}
}
$this->setPagingAll( $this->atts['max_items'] );
}
/**
* @param $max_items
*/
protected function setPagingAll( $max_items ) {
$atts = $this->atts;
$this->atts['query_items_per_page'] = $max_items > 0 ? $max_items : apply_filters( 'vc_basic_grid_items_per_page_all_max_items', self::$default_max_items );
$this->atts['items_per_page'] = $this->atts['query_items_per_page'];
$this->atts['query_offset'] = isset( $atts['offset'] ) ? (int) $atts['offset'] : $this->attributes_defaults['offset'];
}
/**
* @param $vc_request_param
* @return false|mixed|string|void
* @throws \Exception
*/
public function renderAjax( $vc_request_param ) {
$this->items = array(); // clear this items array (if used more than once);
$id = isset( $vc_request_param['shortcode_id'] ) ? $vc_request_param['shortcode_id'] : false;
$shortcode = false;
if ( ! isset( $vc_request_param['page_id'] ) ) {
return wp_json_encode( array( 'status' => 'Nothing found' ) );
}
if ( $id ) {
$shortcode = $this->findPostShortcodeById( $vc_request_param['page_id'], $id );
}
if ( ! is_array( $shortcode ) ) {
return wp_json_encode( array( 'status' => 'Nothing found' ) );
}
visual_composer()->registerAdminCss();
visual_composer()->registerAdminJavascript();
// Set post id
$this->post_id = (int) $vc_request_param['page_id'];
$shortcode_atts = $shortcode['atts'];
$this->shortcode_content = $shortcode['content'];
$this->buildAtts( $shortcode_atts, $shortcode['content'] );
$this->buildItems();
return $this->renderItems();
}
/**
* @return bool|false|int
*/
public function postID() {
if ( ! $this->post_id ) {
$this->post_id = get_the_ID();
}
return $this->post_id;
}
/**
* @param $atts
* @param $content
* @throws \Exception
*/
public function buildAtts( $atts, $content ) {
$this->post_id = false;
$this->grid_settings = array();
$this->filter_terms = null;
$this->items = array();
$arr_keys = array_keys( $atts );
$count = count( $atts );
for ( $i = 0; $i < $count; $i ++ ) {
$atts[ $arr_keys[ $i ] ] = html_entity_decode( $atts[ $arr_keys[ $i ] ], ENT_QUOTES, 'utf-8' );
}
if ( isset( $atts['grid_id'] ) && ! empty( $atts['grid_id'] ) ) {
$id_to_save = $this->getId( $atts, $content );
}
$atts = $this->convertButton2ToButton3( $atts );
$atts = shortcode_atts( $this->attributes_defaults, vc_map_get_attributes( $this->getShortcode(), $atts ) );
$this->atts = $atts;
if ( isset( $id_to_save ) ) {
$this->atts['shortcode_id'] = $id_to_save;
}
$this->atts['page_id'] = $this->postID();
$this->element_template = $content;
// @since 4.4.3
if ( 'custom' === $this->attr( 'post_type' ) ) {
$this->atts['style'] = 'all';
}
}
/**
* Getter attribute.
*
* @param $key
*
* @return mixed|null
*/
public function attr( $key ) {
return isset( $this->atts[ $key ] ) ? $this->atts[ $key ] : null;
}
public function buildGridSettings() {
$this->grid_settings = array(
'page_id' => $this->atts['page_id'],
// used in basic grid for initialization
'style' => $this->atts['style'],
'action' => 'vc_get_vc_grid_data',
);
// used in ajax request for items
if ( isset( $this->atts['shortcode_id'] ) && ! empty( $this->atts['shortcode_id'] ) ) {
$this->grid_settings['shortcode_id'] = $this->atts['shortcode_id'];
} elseif ( isset( $this->atts['shortcode_hash'] ) && ! empty( $this->atts['shortcode_hash'] ) ) {
// @deprecated since 4.4.3
$this->grid_settings['shortcode_hash'] = $this->atts['shortcode_hash'];
}
if ( 'load-more' === $this->atts['style'] ) {
$this->grid_settings = array_merge( $this->grid_settings, array(
// used in dispaly style load more button, lazy, pagination
'items_per_page' => $this->atts['items_per_page'],
'btn_data' => vc_map_integrate_parse_atts( $this->shortcode, 'vc_btn', $this->atts, 'btn_' ),
) );
} elseif ( 'lazy' === $this->atts['style'] ) {
$this->grid_settings = array_merge( $this->grid_settings, array(
'items_per_page' => $this->atts['items_per_page'],
) );
} elseif ( 'pagination' === $this->atts['style'] ) {
$this->grid_settings = array_merge( $this->grid_settings, array(
'items_per_page' => $this->atts['items_per_page'],
// used in pagination style
'auto_play' => $this->atts['autoplay'] > 0 ? true : false,
'gap' => (int) $this->atts['gap'],
// not used yet, but can be used in isotope..
'speed' => (int) $this->atts['autoplay'] * 1000,
'loop' => $this->atts['loop'],
'animation_in' => $this->atts['paging_animation_in'],
'animation_out' => $this->atts['paging_animation_out'],
'arrows_design' => $this->atts['arrows_design'],
'arrows_color' => $this->atts['arrows_color'],
'arrows_position' => $this->atts['arrows_position'],
'paging_design' => $this->atts['paging_design'],
'paging_color' => $this->atts['paging_color'],
) );
}
$this->grid_settings['tag'] = $this->shortcode;
}
// TODO: setter & getter to attributes
/**
* @param $atts
* @return array
*/
public function buildQuery( $atts ) {
// Set include & exclude
if ( 'ids' !== $atts['post_type'] && ! empty( $atts['exclude'] ) ) {
$atts['exclude'] .= ',' . implode( ',', $this->excludedIds() );
} else {
$atts['exclude'] = implode( ',', $this->excludedIds() );
}
if ( 'ids' !== $atts['post_type'] ) {
$settings = array(
'posts_per_page' => $atts['query_items_per_page'],
'offset' => $atts['query_offset'],
'orderby' => $atts['orderby'],
'order' => $atts['order'],
'meta_key' => in_array( $atts['orderby'], array(
'meta_value',
'meta_value_num',
), true ) ? $atts['meta_key'] : '',
'post_type' => $atts['post_type'],
'exclude' => $atts['exclude'],
);
if ( ! empty( $atts['taxonomies'] ) ) {
$vc_taxonomies_types = get_taxonomies( array( 'public' => true ) );
$terms = get_terms( array_keys( $vc_taxonomies_types ), array(
'hide_empty' => false,
'include' => $atts['taxonomies'],
) );
$settings['tax_query'] = array();
$tax_queries = array(); // List of taxnonimes
foreach ( $terms as $term ) {
if ( ! isset( $tax_queries[ $term->taxonomy ] ) ) {
$tax_queries[ $term->taxonomy ] = array(
'taxonomy' => $term->taxonomy,
'field' => 'id',
'terms' => array( $term->term_id ),
'relation' => 'IN',
);
} else {
$tax_queries[ $term->taxonomy ]['terms'][] = $term->term_id;
}
}
$settings['tax_query'] = array_values( $tax_queries );
$settings['tax_query']['relation'] = 'OR';
}
} else {
if ( empty( $atts['include'] ) ) {
$atts['include'] = - 1;
} elseif ( ! empty( $atts['exclude'] ) ) {
$include = array_map( 'trim', explode( ',', $atts['include'] ) );
$exclude = array_map( 'trim', explode( ',', $atts['exclude'] ) );
$diff = array_diff( $include, $exclude );
$atts['include'] = implode( ', ', $diff );
}
$settings = array(
'include' => $atts['include'],
'posts_per_page' => $atts['query_items_per_page'],
'offset' => $atts['query_offset'],
'post_type' => 'any',
'orderby' => 'post__in',
);
$this->atts['items_per_page'] = - 1;
}
return $settings;
}
public function buildItems() {
$this->filter_terms = $this->items = array();
$this->query = new WP_Query();
$this->setContentLimits();
$this->addExcludedId( $this->postID() );
if ( 'custom' === $this->atts['post_type'] && ! empty( $this->atts['custom_query'] ) ) {
$query = html_entity_decode( vc_value_from_safe( $this->atts['custom_query'] ), ENT_QUOTES, 'utf-8' );
$query = apply_filters( 'vc_basic_grid_filter_query_filters', $query, $this->atts, $this->shortcode );
$post_data = $this->query->query( $query );
$this->atts['items_per_page'] = - 1;
} elseif ( false !== $this->atts['query_items_per_page'] ) {
$settings = $this->filterQuerySettings( $this->buildQuery( $this->atts ) );
$post_data = $this->query->query( $settings );
} else {
return;
}
if ( $this->atts['items_per_page'] > 0 && count( $post_data ) > $this->atts['items_per_page'] ) {
$post_data = array_slice( $post_data, 0, $this->atts['items_per_page'] );
}
foreach ( $post_data as $post ) {
$post->filter_terms = wp_get_object_terms( $post->ID, $this->atts['filter_source'], array( 'fields' => 'ids' ) );
$this->filter_terms = wp_parse_args( $this->filter_terms, $post->filter_terms );
$this->items[] = $post;
}
}
/**
* @param $args
* @return array
*/
public function filterQuerySettings( $args ) {
$defaults = array(
'numberposts' => 5,
'offset' => 0,
'category' => 0,
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'suppress_filters' => apply_filters( 'vc_basic_grid_filter_query_suppress_filters', true ),
'public' => true,
);
$r = wp_parse_args( $args, $defaults );
if ( empty( $r['post_status'] ) ) {
$r['post_status'] = ( 'attachment' === $r['post_type'] ) ? 'inherit' : 'publish';
}
if ( ! empty( $r['numberposts'] ) && empty( $r['posts_per_page'] ) ) {
$r['posts_per_page'] = $r['numberposts'];
}
if ( ! empty( $r['category'] ) ) {
$r['cat'] = $r['category'];
}
if ( ! empty( $r['include'] ) ) {
$incposts = wp_parse_id_list( $r['include'] );
$r['posts_per_page'] = count( $incposts ); // only the number of posts included
$r['post__in'] = $incposts;
} elseif ( ! empty( $r['exclude'] ) ) {
$r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
}
$r['ignore_sticky_posts'] = true;
$r['no_found_rows'] = true;
return $r;
}
/**
* @param $atts
* @return mixed
*/
public static function convertButton2ToButton3( $atts ) {
if ( isset( $atts['button_style'] ) || isset( $atts['button_size'] ) || isset( $atts['button_color'] ) ) {
// we use old button 2 attributes:
$style = isset( $atts['button_style'] ) ? $atts['button_style'] : 'rounded';
$size = isset( $atts['button_size'] ) ? $atts['button_size'] : 'md';
$color = isset( $atts['button_color'] ) ? $atts['button_color'] : 'blue';
$oldData = array(
'style' => $style,
'size' => $size,
'color' => str_replace( '_', '-', $color ),
);
// remove attributes on save
$atts['button_style'] = '';
$atts['button_size'] = '';
$atts['button_color'] = '';
$newData = WPBakeryShortCode_Vc_Btn::convertAttributesToButton3( $oldData );
foreach ( $newData as $key => $value ) {
$atts[ 'btn_' . $key ] = $value;
}
}
return $atts;
}
}
classes/shortcodes/vc-hoverbox.php 0000644 00000003501 15121635561 0013335 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Hoverbox
*/
class WPBakeryShortCode_Vc_Hoverbox extends WPBakeryShortCode {
/**
* @param $tag
* @param $atts
* @param $align
* @return string
* @throws \Exception
*/
public function getHeading( $tag, $atts, $align ) {
if ( isset( $atts[ $tag ] ) && '' !== trim( $atts[ $tag ] ) ) {
if ( isset( $atts[ 'use_custom_fonts_' . $tag ] ) && 'true' === $atts[ 'use_custom_fonts_' . $tag ] ) {
$custom_heading = visual_composer()->getShortCode( 'vc_custom_heading' );
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_custom_heading', $atts, $tag . '_' );
$data['font_container'] = implode( '|', array_filter( array(
'tag:h2',
'text_align:' . esc_attr( $align ),
$data['font_container'],
) ) );
$data['text'] = $atts[ $tag ]; // provide text to shortcode
return $custom_heading->render( array_filter( $data ) );
} else {
$inline_css = array();
$inline_css_string = '';
if ( isset( $atts['style'] ) && 'custom' === $atts['style'] ) {
if ( ! empty( $atts['custom_text'] ) ) {
$inline_css[] = vc_get_css_color( 'color', $atts['custom_text'] );
}
}
if ( $align ) {
$inline_css[] = 'text-align:' . esc_attr( $align );
}
if ( ! empty( $inline_css ) ) {
$inline_css_string = ' style="' . implode( '', $inline_css ) . '"';
}
return '<h2' . $inline_css_string . '>' . $atts[ $tag ] . '</h2>';
}
}
return '';
}
/**
* @param $atts
* @return string
* @throws \Exception
*/
public function renderButton( $atts ) {
$button_atts = vc_map_integrate_parse_atts( $this->shortcode, 'vc_btn', $atts, 'hover_btn_' );
$button = visual_composer()->getShortCode( 'vc_btn' );
return $button->render( array_filter( $button_atts ) );
}
}
classes/shortcodes/vc-toggle.php 0000644 00000001457 15121635561 0012772 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Toggle
*/
class WPBakeryShortCode_Vc_Toggle extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
public function outputTitle( $title ) {
return '';
}
/**
* @param $atts
* @return string
* @throws \Exception
*/
public function getHeading( $atts ) {
if ( isset( $atts['use_custom_heading'] ) && 'true' === $atts['use_custom_heading'] ) {
$custom_heading = visual_composer()->getShortCode( 'vc_custom_heading' );
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_custom_heading', $atts, 'custom_' );
$data['text'] = $atts['title'];
return $custom_heading->render( array_filter( $data ) );
} else {
return '<h4>' . esc_html( $atts['title'] ) . '</h4>';
}
}
}
classes/shortcodes/vc-column-inner.php 0000644 00000000372 15121635561 0014112 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-column.php' );
/**
* Class WPBakeryShortCode_Vc_Column_Inner
*/
class WPBakeryShortCode_Vc_Column_Inner extends WPBakeryShortCode_Vc_Column {
}
classes/shortcodes/vc-tta-section.php 0000644 00000016425 15121635561 0013744 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Accordion' );
/**
* Class WPBakeryShortCode_Vc_Tta_Section
*/
class WPBakeryShortCode_Vc_Tta_Section extends WPBakeryShortCode_Vc_Tta_Accordion {
protected $controls_css_settings = 'tc vc_control-container';
protected $controls_list = array(
'add',
'edit',
'clone',
'delete',
);
protected $backened_editor_prepend_controls = false;
/**
* @var WPBakeryShortCode_Vc_Tta_Accordion
*/
public static $tta_base_shortcode;
public static $self_count = 0;
public static $section_info = array();
/**
* @return mixed|string
*/
public function getFileName() {
if ( isset( self::$tta_base_shortcode ) && 'vc_tta_pageable' === self::$tta_base_shortcode->getShortcode() ) {
return 'vc_tta_pageable_section';
} else {
return 'vc_tta_section';
}
}
/**
* @return string
*/
public function containerContentClass() {
return 'wpb_column_container vc_container_for_children vc_clearfix';
}
/**
* @return string
*/
public function getElementClasses() {
$classes = array();
$classes[] = 'vc_tta-panel';
$isActive = ! vc_is_page_editable() && $this->getTemplateVariable( 'section-is-active' );
if ( $isActive ) {
$classes[] = $this->activeClass;
}
/**
* @since 4.6.2
*/
if ( isset( $this->atts['el_class'] ) ) {
$classes[] = $this->atts['el_class'];
}
return implode( ' ', array_filter( $classes ) );
}
/**
* @param $atts
* @param $content
*
* @return string
*/
public function getParamContent( $atts, $content ) {
return wpb_js_remove_wpautop( $content );
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabId( $atts, $content ) {
if ( isset( $atts['tab_id'] ) && strlen( $atts['tab_id'] ) > 0 ) {
return $atts['tab_id'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTitle( $atts, $content ) {
if ( isset( $atts['title'] ) && strlen( $atts['title'] ) > 0 ) {
return $atts['title'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamIcon( $atts, $content ) {
if ( ! empty( $atts['add_icon'] ) && 'true' === $atts['add_icon'] ) {
$iconClass = '';
if ( isset( $atts[ 'i_icon_' . $atts['i_type'] ] ) ) {
$iconClass = $atts[ 'i_icon_' . $atts['i_type'] ];
}
vc_icon_element_fonts_enqueue( $atts['i_type'] );
return '<i class="vc_tta-icon ' . esc_attr( $iconClass ) . '"></i>';
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamIconLeft( $atts, $content ) {
if ( 'left' === $atts['i_position'] ) {
return $this->getParamIcon( $atts, $content );
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamIconRight( $atts, $content ) {
if ( 'right' === $atts['i_position'] ) {
return $this->getParamIcon( $atts, $content );
}
return null;
}
/**
* Section param active
* @param $atts
* @param $content
* @return bool|null
*/
public function getParamSectionIsActive( $atts, $content ) {
if ( is_object( self::$tta_base_shortcode ) ) {
if ( isset( self::$tta_base_shortcode->atts['active_section'] ) && strlen( self::$tta_base_shortcode->atts['active_section'] ) > 0 ) {
$active = (int) self::$tta_base_shortcode->atts['active_section'];
if ( $active === self::$self_count ) {
return true;
}
}
}
return null;
}
/**
* @param $atts
* @param $content
* @return string|null
*/
public function getParamControlIconPosition( $atts, $content ) {
if ( is_object( self::$tta_base_shortcode ) ) {
if ( isset( self::$tta_base_shortcode->atts['c_icon'] ) && strlen( self::$tta_base_shortcode->atts['c_icon'] ) > 0 && isset( self::$tta_base_shortcode->atts['c_position'] ) && strlen( self::$tta_base_shortcode->atts['c_position'] ) > 0 ) {
$c_position = self::$tta_base_shortcode->atts['c_position'];
return 'vc_tta-controls-icon-position-' . $c_position;
}
}
return null;
}
/**
* @param $atts
* @param $content
* @return string|null
*/
public function getParamControlIcon( $atts, $content ) {
if ( is_object( self::$tta_base_shortcode ) ) {
if ( isset( self::$tta_base_shortcode->atts['c_icon'] ) && strlen( self::$tta_base_shortcode->atts['c_icon'] ) > 0 ) {
$c_icon = self::$tta_base_shortcode->atts['c_icon'];
return '<i class="vc_tta-controls-icon vc_tta-controls-icon-' . $c_icon . '"></i>';
}
}
return null;
}
/**
* @param $atts
* @param $content
* @return string
*/
public function getParamHeading( $atts, $content ) {
$isPageEditable = vc_is_page_editable();
$headingAttributes = array();
$headingClasses = array(
'vc_tta-panel-title',
);
if ( $isPageEditable ) {
$headingAttributes[] = 'data-vc-tta-controls-icon-position=""';
} else {
$controlIconPosition = $this->getTemplateVariable( 'control-icon-position' );
if ( $controlIconPosition ) {
$headingClasses[] = $controlIconPosition;
}
}
$headingAttributes[] = 'class="' . implode( ' ', $headingClasses ) . '"';
$headingTag = apply_filters( 'vc_tta_section_param_heading_tag', 'h4', $atts );
$output = '<' . $headingTag . ' ' . implode( ' ', $headingAttributes ) . '>';
if ( $isPageEditable ) {
$output .= '<a href="javascript:;" data-vc-target=""';
$output .= ' data-vc-tta-controls-icon-wrapper';
$output .= ' data-vc-use-cache="false"';
} else {
$output .= '<a href="#' . esc_attr( $this->getTemplateVariable( 'tab_id' ) ) . '"';
}
$output .= ' data-vc-accordion';
$output .= ' data-vc-container=".vc_tta-container">';
$output .= $this->getTemplateVariable( 'icon-left' );
$output .= '<span class="vc_tta-title-text">' . $this->getTemplateVariable( 'title' ) . '</span>';
$output .= $this->getTemplateVariable( 'icon-right' );
if ( ! $isPageEditable ) {
$output .= $this->getTemplateVariable( 'control-icon' );
}
$output .= '</a>';
$output .= '</' . $headingTag . '>'; // close heading tag
return $output;
}
/**
* Get basic heading
*
* These are used in Pageable element inside content and are hidden from view
*
* @param $atts
* @param $content
*
* @return string
*/
public function getParamBasicHeading( $atts, $content ) {
$isPageEditable = vc_is_page_editable();
if ( $isPageEditable ) {
$attributes = array(
'href' => 'javascript:;',
'data-vc-container' => '.vc_tta-container',
'data-vc-accordion' => '',
'data-vc-target' => '',
'data-vc-tta-controls-icon-wrapper' => '',
'data-vc-use-cache' => 'false',
);
} else {
$attributes = array(
'data-vc-container' => '.vc_tta-container',
'data-vc-accordion' => '',
'data-vc-target' => esc_attr( '#' . $this->getTemplateVariable( 'tab_id' ) ),
);
}
$output = '
<span class="vc_tta-panel-title">
<a ' . vc_convert_atts_to_string( $attributes ) . '></a>
</span>
';
return $output;
}
/**
* Check is allowed to add another element inside current element.
*
* @return bool
* @since 4.8
*
*/
public function getAddAllowed() {
return vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'custom', null )->get();
}
}
classes/shortcodes/vc-gitem.php 0000644 00000010157 15121635561 0012613 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Gitem
*/
class WPBakeryShortCode_Vc_Gitem extends WPBakeryShortCodesContainer {
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
/**
* @var string @el_class - comes
*/
extract( shortcode_atts( $this->predefined_atts, $atts ) );
$output = '';
$column_controls = $this->getControls( $this->settings( 'controls' ) );
$output .= '<div ' . $this->mainHtmlBlockParams( '12', '' ) . '>';
$output .= $column_controls;
$output .= '<div ' . $this->containerHtmlBlockParams( '12', '' ) . '>';
$output .= $this->itemGrid();
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '</div>';
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$output .= $inner;
}
$output .= '</div>';
$output .= '</div>';
return $output;
}
/**
* @param $width
* @param $i
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
return 'data-element_type="' . $this->settings['base'] . '" class="' . $this->settings['base'] . '-shortcode ' . $sortable . ' wpb_content_holder vc_shortcodes_container"' . $this->customAdminBlockParams();
}
/**
* @return string
*/
public function itemGrid() {
$output = '<div class="vc_row"><div class="vc_col-xs-4 vc_col-xs-offset-4"><div class="vc_gitem-add-c-col" data-vc-gitem="add-c" data-vc-position="top"></div></div></div><div class="vc_row"><div class="vc_col-xs-4 vc_gitem-add-c-left"><div class="vc_gitem-add-c-col" data-vc-gitem="add-c" data-vc-position="left"></div></div><div class="vc_col-xs-4 vc_gitem-ab-zone" data-vc-gitem="add-ab"></div><div class="vc_col-xs-4 vc_gitem-add-c-right"><div class="vc_gitem-add-c-col" data-vc-gitem="add-c" data-vc-position="right"></div></div></div><div class="vc_row"><div class="vc_col-xs-4 vc_col-xs-offset-4 vc_gitem-add-c-bottom"><div class="vc_gitem-add-c-col" data-vc-gitem="add-c" data-vc-position="bottom"></div></div></div>';
return $output;
}
/**
* @param $width
* @param $i
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="vc_gitem-content"';
}
/**
* Get rendered controls
*
* @param array $controls
*
* @return string
* @throws \Exception
*/
public function getControls( $controls ) {
if ( ! is_array( $controls ) || empty( $controls ) ) {
return '';
}
$buttons = array();
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
foreach ( $controls as $control ) {
switch ( $control ) {
case 'add':
if ( $allAccess ) {
$buttons[] = '<a class="vc_control-btn vc_control-btn-add" href="#" title="' . esc_attr__( 'Add to this grid item', 'js_composer' ) . '" data-vc-control="add"><i class="vc_icon"></i></a>';
}
break;
case 'edit':
if ( $editAccess ) {
$buttons[] = '<a class="vc_control-btn vc_control-btn-edit" href="#" title="' . esc_attr__( 'Edit this grid item', 'js_composer' ) . '" data-vc-control="edit"><i class="vc_icon"></i></a>';
}
break;
case 'delete':
if ( $allAccess ) {
$buttons[] = '<a class="vc_control-btn vc_control-btn-delete" href="#" title="' . esc_attr__( 'Delete this grid item ', 'js_composer' ) . '" data-vc-control="delete"><i class="vc_icon"></i></a>';
}
break;
}
}
$html = '<div class="vc_controls vc_controls-dark vc_controls-visible">' . implode( ' ', $buttons ) . '</div>';
return $html;
}
}
classes/shortcodes/vc-gmaps.php 0000644 00000000242 15121635561 0012607 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Gmaps
*/
class WPBakeryShortCode_Vc_Gmaps extends WPBakeryShortCode {
}
classes/shortcodes/wordpress-widgets.php 0000644 00000001025 15121635561 0014566 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Wp_Text
*/
class WPBakeryShortCode_Vc_Wp_Text extends WPBakeryShortCode {
/**
* This actually fixes #1537 by converting 'text' to 'content'
* @param $atts
*
* @return mixed
* @since 4.4
*
*/
public static function convertTextAttributeToContent( $atts ) {
if ( isset( $atts['text'] ) ) {
if ( ! isset( $atts['content'] ) || empty( $atts['content'] ) ) {
$atts['content'] = $atts['text'];
}
}
return $atts;
}
}
classes/shortcodes/vc-separator.php 0000644 00000000423 15121635561 0013501 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Separator
*/
class WPBakeryShortCode_Vc_Separator extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
public function outputTitle( $title ) {
return '';
}
}
classes/shortcodes/vc-gallery.php 0000644 00000004661 15121635561 0013150 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_gallery
*/
class WPBakeryShortCode_Vc_Gallery extends WPBakeryShortCode {
/**
* WPBakeryShortCode_Vc_gallery constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->shortcodeScripts();
}
public function shortcodeScripts() {
wp_register_script( 'vc_grid-js-imagesloaded', vc_asset_url( 'lib/bower/imagesloaded/imagesloaded.pkgd.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
}
/**
* @param $param
* @param $value
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$output = '';
// Compatibility fixes
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( isset( $param['holder'] ) && 'hidden' !== $param['holder'] ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
if ( 'images' === $param_name ) {
$images_ids = empty( $value ) ? array() : explode( ',', trim( $value ) );
$output .= '<ul class="attachment-thumbnails' . ( empty( $images_ids ) ? ' image-exists' : '' ) . '" data-name="' . $param_name . '">';
foreach ( $images_ids as $image ) {
$img = wpb_getImageBySize( array(
'attach_id' => (int) $image,
'thumb_size' => 'thumbnail',
) );
$output .= ( $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . esc_url( vc_asset_url( 'vc/blank.gif' ) ) . '" class="attachment-thumbnail" alt="" title="" /></li>' );
}
$output .= '</ul>';
$output .= '<a href="#" class="column_edit_trigger' . ( ! empty( $images_ids ) ? ' image-exists' : '' ) . '">' . esc_html__( 'Add images', 'js_composer' ) . '</a>';
}
return $output;
}
}
classes/shortcodes/vc-gitem-post-categories.php 0000644 00000000615 15121635561 0015717 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Categories
*/
class WPBakeryShortCode_Vc_Gitem_Post_Categories extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_post_categories';
}
}
classes/shortcodes/vc-cta-button.php 0000644 00000000326 15121635561 0013563 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Cta_Button extends WPBakeryShortCode {
}
classes/shortcodes/core/class-wpbakeryshortcode.php 0000644 00000061474 15121635561 0016702 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode
*/
abstract class WPBakeryShortCode extends WPBakeryVisualComposerAbstract {
/**
* @var string - shortcode tag
*/
protected $shortcode;
/**
* @var
*/
protected $html_template;
/**
* @var
*/
protected $atts;
/**
* @var
*/
protected $settings;
/**
* @var array
*/
protected static $js_scripts = array();
/**
* @var array
*/
protected static $css_scripts = array();
/**
* default scripts like scripts
* @var bool
* @since 4.4.3
*/
protected static $default_scripts_enqueued = false;
/**
* @var string
*/
protected $shortcode_string = '';
/**
* @var string
*/
protected $controls_template_file = 'editors/partials/backend_controls.tpl.php';
public $nonDraggableClass = 'vc-non-draggable';
/** @noinspection PhpMissingParentConstructorInspection */
/**
* @param $settings
*/
public function __construct( $settings ) {
$this->settings = $settings;
$this->shortcode = $this->settings['base'];
}
/**
* @param $content
*
* @return string
*/
public function addInlineAnchors( $content ) {
return ( $this->isInline() || $this->isEditor() && true === $this->settings( 'is_container' ) ? '<span class="vc_container-anchor"></span>' : '' ) . $content;
}
/**
*
*/
public function enqueueAssets() {
if ( ! empty( $this->settings['admin_enqueue_js'] ) ) {
$this->registerJs( $this->settings['admin_enqueue_js'] );
}
if ( ! empty( $this->settings['admin_enqueue_css'] ) ) {
$this->registerCss( $this->settings['admin_enqueue_css'] );
}
}
/**
* Prints out the styles needed to render the element icon for the back end interface.
* Only performed if the 'icon' setting is a valid URL.
*
* @return void
* @since 4.2
* @modified 4.4
* @author Benjamin Intal
*/
public function printIconStyles() {
if ( ! filter_var( $this->settings( 'icon' ), FILTER_VALIDATE_URL ) ) {
return;
}
$first_tag = 'style';
echo '
<' . esc_attr( $first_tag ) . '>
.vc_el-container #' . esc_attr( $this->settings['base'] ) . ' .vc_element-icon,
.wpb_' . esc_attr( $this->settings['base'] ) . ' > .wpb_element_wrapper > .wpb_element_title > .vc_element-icon,
.vc_el-container > #' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon,
.vc_el-container > #' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon[data-is-container="true"],
.compose_mode .vc_helper.vc_helper-' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon,
.vc_helper.vc_helper-' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon,
.compose_mode .vc_helper.vc_helper-' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon[data-is-container="true"],
.vc_helper.vc_helper-' . esc_attr( $this->settings['base'] ) . ' > .vc_element-icon[data-is-container="true"],
.wpb_' . esc_attr( $this->settings['base'] ) . ' > .wpb_element_wrapper > .wpb_element_title > .vc_element-icon,
.wpb_' . esc_attr( $this->settings['base'] ) . ' > .wpb_element_wrapper > .wpb_element_title > .vc_element-icon[data-is-container="true"] {
background-position: 0 0;
background-image: url(' . esc_url( $this->settings['icon'] ) . ');
-webkit-background-size: contain;
-moz-background-size: contain;
-ms-background-size: contain;
-o-background-size: contain;
background-size: contain;
}
</' . esc_attr( $first_tag ) . '>';
}
/**
* @param $param
*/
protected function registerJs( $param ) {
if ( is_array( $param ) && ! empty( $param ) ) {
foreach ( $param as $value ) {
$this->registerJs( $value );
}
} elseif ( is_string( $param ) && ! empty( $param ) ) {
$name = 'admin_enqueue_js_' . md5( $param );
self::$js_scripts[] = $name;
wp_register_script( $name, $param, array( 'jquery-core' ), WPB_VC_VERSION, true );
}
}
/**
* @param $param
*/
protected function registerCss( $param ) {
if ( is_array( $param ) && ! empty( $param ) ) {
foreach ( $param as $value ) {
$this->registerCss( $value );
}
} elseif ( is_string( $param ) && ! empty( $param ) ) {
$name = 'admin_enqueue_css_' . md5( $param );
self::$css_scripts[] = $name;
wp_register_style( $name, $param, array( 'js_composer' ), WPB_VC_VERSION );
}
}
/**
*
*/
public static function enqueueCss() {
if ( ! empty( self::$css_scripts ) ) {
foreach ( self::$css_scripts as $stylesheet ) {
wp_enqueue_style( $stylesheet );
}
}
}
/**
*
*/
public static function enqueueJs() {
if ( ! empty( self::$js_scripts ) ) {
foreach ( self::$js_scripts as $script ) {
wp_enqueue_script( $script );
}
}
}
/**
* @param $shortcode
*/
public function shortcode( $shortcode ) {
}
/**
* @param $template
*
* @return string
*/
protected function setTemplate( $template ) {
return $this->html_template = apply_filters( 'vc_shortcode_set_template_' . $this->shortcode, $template );
}
/**
* @return bool
*/
protected function getTemplate() {
if ( isset( $this->html_template ) ) {
return $this->html_template;
}
return false;
}
/**
* @return mixed
*/
protected function getFileName() {
return $this->shortcode;
}
/**
* Find html template for shortcode output.
*/
protected function findShortcodeTemplate() {
// Check template path in shortcode's mapping settings
if ( ! empty( $this->settings['html_template'] ) && is_file( $this->settings( 'html_template' ) ) ) {
return $this->setTemplate( $this->settings['html_template'] );
}
// Check template in theme directory
$user_template = vc_shortcodes_theme_templates_dir( $this->getFileName() . '.php' );
if ( is_file( $user_template ) ) {
return $this->setTemplate( $user_template );
}
// Check default place
$default_dir = vc_manager()->getDefaultShortcodesTemplatesDir() . '/';
if ( is_file( $default_dir . $this->getFileName() . '.php' ) ) {
return $this->setTemplate( $default_dir . $this->getFileName() . '.php' );
}
$template = apply_filters( 'vc_shortcode_set_template_' . $this->shortcode, '' );
if ( ! empty( $template ) ? $template : '' ) {
return $this->setTemplate( $template );
}
return '';
}
/**
* @param $atts
* @param null $content
*
* @return mixed
* @throws \Exception
*/
protected function content( $atts, $content = null ) {
return $this->loadTemplate( $atts, $content );
}
/**
* @param $atts
* @param null $content
*
* vc_filter: vc_shortcode_content_filter - hook to edit template content
* vc_filter: vc_shortcode_content_filter_after - hook after template is loaded to override output
*
* @return mixed
* @throws \Exception
*/
protected function loadTemplate( $atts, $content = null ) {
$output = '';
if ( ! is_null( $content ) ) {
/** @var string $content */
$content = apply_filters( 'vc_shortcode_content_filter', $content, $this->shortcode );
}
$this->findShortcodeTemplate();
if ( $this->html_template && file_exists( $this->html_template ) ) {
if ( strpos( $this->html_template, WPB_PLUGIN_DIR ) === false ) {
// Modified or new
Vc_Modifications::$modified = true;
}
ob_start();
/** @var string $content - used inside template */
$output = require $this->html_template;
// Allow return in template files
if ( 1 === $output ) {
$output = ob_get_contents();
}
ob_end_clean();
}
return apply_filters( 'vc_shortcode_content_filter_after', $output, $this->shortcode, $atts, $content );
}
/**
* @param $atts
* @param $content
*
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$output = $custom_markup = $width = $el_position = '';
if ( null !== $content ) {
$content = wpautop( stripslashes( $content ) );
}
$shortcode_attributes = array( 'width' => '1/1' );
$atts = vc_map_get_attributes( $this->getShortcode(), $atts ) + $shortcode_attributes;
$this->atts = $atts;
$elem = $this->getElementHolder( $width );
if ( isset( $this->settings['custom_markup'] ) && '' !== $this->settings['custom_markup'] ) {
$markup = $this->settings['custom_markup'];
$elem = str_ireplace( '%wpb_element_content%', $this->customMarkup( $markup, $content ), $elem );
$output .= $elem;
} else {
$inner = $this->outputTitle( $this->settings['name'] );
$inner .= $this->paramsHtmlHolders( $atts );
$elem = str_ireplace( '%wpb_element_content%', $inner, $elem );
$output .= $elem;
}
return $output;
}
/**
* @return bool
*/
public function isAdmin() {
return apply_filters( 'vc_shortcodes_is_admin', is_admin() );
}
/**
* @return bool
*/
public function isInline() {
return vc_is_inline();
}
/**
* @return bool
*/
public function isEditor() {
return vc_is_editor();
}
/**
* @param $atts
* @param null $content
* @param string $base
*
* vc_filter: vc_shortcode_output - hook to override output of shortcode
*
* @return string
* @throws \Exception
*/
public function output( $atts, $content = null, $base = '' ) {
$this->atts = $prepared_atts = $this->prepareAtts( $atts );
$this->shortcode_content = $content;
$output = '';
$content = empty( $content ) && ! empty( $atts['content'] ) ? $atts['content'] : $content;
if ( ( $this->isInline() || vc_is_page_editable() ) && method_exists( $this, 'contentInline' ) ) {
$output .= $this->contentInline( $this->atts, $content );
} else {
$this->enqueueDefaultScripts();
$custom_output = VC_SHORTCODE_CUSTOMIZE_PREFIX . $this->shortcode;
$custom_output_before = VC_SHORTCODE_BEFORE_CUSTOMIZE_PREFIX . $this->shortcode; // before shortcode function hook
$custom_output_after = VC_SHORTCODE_AFTER_CUSTOMIZE_PREFIX . $this->shortcode; // after shortcode function hook
// Before shortcode
if ( function_exists( $custom_output_before ) ) {
$output .= $custom_output_before( $this->atts, $content );
} else {
$output .= $this->beforeShortcode( $this->atts, $content );
}
// Shortcode content
if ( function_exists( $custom_output ) ) {
$output .= $custom_output( $this->atts, $content );
} else {
$output .= $this->content( $this->atts, $content );
}
// After shortcode
if ( function_exists( $custom_output_after ) ) {
$output .= $custom_output_after( $this->atts, $content );
} else {
$output .= $this->afterShortcode( $this->atts, $content );
}
}
// Filter for overriding outputs
$output = apply_filters( 'vc_shortcode_output', $output, $this, $prepared_atts, $this->shortcode );
return $output;
}
public function enqueueDefaultScripts() {
if ( false === self::$default_scripts_enqueued ) {
wp_enqueue_script( 'wpb_composer_front_js' );
wp_enqueue_style( 'js_composer_front' );
self::$default_scripts_enqueued = true;
}
}
/**
* Return shortcode attributes, see \WPBakeryShortCode::output
* @return array
* @since 4.4
*/
public function getAtts() {
return $this->atts;
}
/**
* Creates html before shortcode html.
*
* @param $atts - shortcode attributes list
* @param $content - shortcode content
*
* @return string - html which will be displayed before shortcode html.
*/
public function beforeShortcode( $atts, $content ) {
return '';
}
/**
* Creates html before shortcode html.
*
* @param $atts - shortcode attributes list
* @param $content - shortcode content
*
* @return string - html which will be displayed after shortcode html.
*/
public function afterShortcode( $atts, $content ) {
return '';
}
/**
* @param $el_class
*
* @return string
*/
public function getExtraClass( $el_class ) {
$output = '';
if ( '' !== $el_class ) {
$output = ' ' . str_replace( '.', '', $el_class );
}
return $output;
}
/**
* @param $css_animation
*
* @return string
*/
public function getCSSAnimation( $css_animation ) {
$output = '';
if ( '' !== $css_animation && 'none' !== $css_animation ) {
wp_enqueue_script( 'vc_waypoints' );
wp_enqueue_style( 'vc_animate-css' );
$output = ' wpb_animate_when_almost_visible wpb_' . $css_animation . ' ' . $css_animation;
}
return $output;
}
/**
* Create HTML comment for blocks only if wpb_debug=true
*
* @param $string
*
* @return string
* @deprecated 4.7 For debug type html comments use more generic debugComment function.
*
*/
public function endBlockComment( $string ) {
return '';
}
/**
* if wpb_debug=true return HTML comment
*
* @param string $comment
*
* @return string
* @since 4.7
* @deprecated 5.5 no need for extra info in output, use xdebug
*/
public function debugComment( $comment ) {
return '';
}
/**
* @param $name
*
* @return null
*/
public function settings( $name ) {
return isset( $this->settings[ $name ] ) ? $this->settings[ $name ] : null;
}
/**
* @param $name
* @param $value
*/
public function setSettings( $name, $value ) {
$this->settings[ $name ] = $value;
}
/**
* @return mixed
* @since 5.5
*/
public function getSettings() {
return $this->settings;
}
/**
* @param $width
*
* @return string
* @throws \Exception
*/
public function getElementHolder( $width ) {
$output = '';
$column_controls = $this->getColumnControlsModular();
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
$css_class = 'wpb_' . $this->settings['base'] . ' wpb_content_element ' . $sortable . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $this->settings['class'] : '' );
$output .= '<div data-element_type="' . $this->settings['base'] . '" class="' . $css_class . '">';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width ), $column_controls );
$output .= $this->getCallbacks( $this->shortcode );
$output .= '<div class="wpb_element_wrapper ' . $this->settings( 'wrapper_class' ) . '">';
$output .= '%wpb_element_content%';
$output .= '</div>';
$output .= '</div>';
return $output;
}
// Return block controls
/**
* @param $controls
* @param string $extended_css
*
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls, $extended_css = '' ) {
$controls_start = '<div class="vc_controls controls_element' . ( ! empty( $extended_css ) ? " {$extended_css}" : '' ) . '">';
$controls_end = '</div>';
$controls_add = '';
$controls_edit = ' <a class="vc_control column_edit" href="javascript:;" title="' . sprintf( esc_attr__( 'Edit %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><span class="vc_icon"></span></a>';
$controls_delete = ' <a class="vc_control column_clone" href="javascript:;" title="' . sprintf( esc_attr__( 'Clone %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><span class="vc_icon"></span></a> <a class="column_delete" href="javascript:;" title="' . sprintf( esc_attr__( 'Delete %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><span class="vc_icon"></span></a>';
$column_controls_full = $controls_start . $controls_add . $controls_edit . $controls_delete . $controls_end;
$column_controls_size_delete = $controls_start . $controls_delete . $controls_end;
$column_controls_popup_delete = $controls_start . $controls_delete . $controls_end;
$column_controls_edit_popup_delete = $controls_start . $controls_edit . $controls_delete . $controls_end;
$column_controls_edit = $controls_start . $controls_edit . $controls_end;
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
if ( 'popup_delete' === $controls ) {
return $allAccess ? $column_controls_popup_delete : '';
} elseif ( 'edit_popup_delete' === $controls ) {
return $allAccess ? $column_controls_edit_popup_delete : ( $editAccess ? $column_controls_edit : '' );
} elseif ( 'size_delete' === $controls ) {
return $allAccess ? $column_controls_size_delete : '';
} elseif ( 'add' === $controls ) {
return $allAccess ? ( $controls_start . $controls_add . $controls_end ) : '';
} else {
return $allAccess ? $column_controls_full : ( $editAccess ? $column_controls_edit : '' );
}
}
/**
* Return list of controls
* @return array
* @throws \Exception
*/
public function getControlsList() {
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
if ( $allAccess ) {
return apply_filters( 'vc_wpbakery_shortcode_get_controls_list', $this->controls_list, $this->shortcode );
} else {
$controls = apply_filters( 'vc_wpbakery_shortcode_get_controls_list', $this->controls_list, $this->shortcode );
if ( $editAccess ) {
foreach ( $controls as $key => $value ) {
if ( 'edit' !== $value && 'add' !== $value ) {
unset( $controls[ $key ] );
}
}
return $controls;
} else {
return in_array( 'add', $controls, true ) ? array( 'add' ) : array();
}
}
}
/**
* Build new modern controls for shortcode.
*
* @param string $extended_css
*
* @return string
* @throws \Exception
*/
public function getColumnControlsModular( $extended_css = '' ) {
ob_start();
vc_include_template( apply_filters( 'vc_wpbakery_shortcode_get_column_controls_modular_template', $this->controls_template_file ), array(
'shortcode' => $this->shortcode,
'position' => $this->controls_css_settings,
'extended_css' => $extended_css,
'name' => $this->settings( 'name' ),
'controls' => $this->getControlsList(),
'name_css_class' => $this->getBackendEditorControlsElementCssClass(),
'add_allowed' => $this->getAddAllowed(),
) );
return ob_get_clean();
}
/**
* @return string
* @throws \Exception
*/
public function getBackendEditorControlsElementCssClass() {
$moveAccess = vc_user_access()->part( 'dragndrop' )->checkStateAny( true, null )->get();
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) && $moveAccess ? ' vc_element-move' : ' ' . $this->nonDraggableClass );
return 'vc_control-btn vc_element-name' . $sortable;
}
/**
* This will fire callbacks if they are defined in map.php
*
* @param $id
*
* @return string
*/
public function getCallbacks( $id ) {
$output = '';
if ( isset( $this->settings['js_callback'] ) ) {
foreach ( $this->settings['js_callback'] as $text_val => $val ) {
// TODO: name explain
$output .= '<input type="hidden" class="wpb_vc_callback wpb_vc_' . esc_attr( $text_val ) . '_callback " name="' . esc_attr( $text_val ) . '" value="' . $val . '" />';
}
}
return $output;
}
/**
* @param $param
* @param $value
*
* vc_filter: vc_wpbakeryshortcode_single_param_html_holder_value - hook to override param value (param type and etc is available in args)
*
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$value = apply_filters( 'vc_wpbakeryshortcode_single_param_html_holder_value', $value, $param, $this->settings, $this->atts );
$output = '';
// Compatibility fixes
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( ! empty( $param['holder'] ) ) {
if ( 'input' === $param['holder'] ) {
$output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
} elseif ( in_array( $param['holder'], array(
'img',
'iframe',
), true ) ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . esc_url( $value ) . '">';
} elseif ( 'hidden' !== $param['holder'] ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
}
if ( ! empty( $param['admin_label'] ) && true === $param['admin_label'] ) {
$output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . ( empty( $value ) ? ' hidden-label' : '' ) . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
}
return $output;
}
/**
* @param $params
*
* @return string
*/
protected function getIcon( $params ) {
$data = '';
if ( isset( $params['is_container'] ) && true === $params['is_container'] ) {
$data = ' data-is-container="true"';
}
$title = '';
if ( isset( $params['title'] ) ) {
$title = 'title="' . esc_attr( $params['title'] ) . '" ';
}
return '<i ' . $title . 'class="vc_general vc_element-icon' . ( ! empty( $params['icon'] ) ? ' ' . sanitize_text_field( $params['icon'] ) : '' ) . '"' . $data . '></i> ';
}
/**
* @param $title
*
* @return string
*/
protected function outputTitle( $title ) {
$icon = $this->settings( 'icon' );
if ( filter_var( $icon, FILTER_VALIDATE_URL ) ) {
$icon = '';
}
$params = array(
'icon' => $icon,
'is_container' => $this->settings( 'is_container' ),
);
return '<h4 class="wpb_element_title"> ' . $this->getIcon( $params ) . esc_attr( $title ) . '</h4>';
}
/**
* @param string $content
*
* @return string
* @throws \Exception
*/
public function template( $content = '' ) {
return $this->contentAdmin( $this->atts, $content );
}
/**
* This functions prepares attributes to use in template
* Converts back escaped characters
*
* @param $atts
*
* @return array
*/
protected function prepareAtts( $atts ) {
$returnAttributes = array();
if ( is_array( $atts ) ) {
foreach ( $atts as $key => $val ) {
$returnAttributes[ $key ] = str_replace( array(
'`{`',
'`}`',
'``',
), array(
'[',
']',
'"',
), $val );
}
}
return apply_filters( 'vc_shortcode_prepare_atts', $returnAttributes, $this->shortcode, $this->settings );
}
/**
* @return string
*/
public function getShortcode() {
return $this->shortcode;
}
/**
* Since 4.5
* Possible placeholders:
* {{ content }}
* {{ title }}
* {{ container-class }}
*
* Possible keys:
* {{
* <%
* %
* @param $markup
* @param string $content
*
* @return string
* @throws \Exception
* @since 4.5
*/
protected function customMarkup( $markup, $content = '' ) {
$pattern = '/\{\{([\s\S][^\n]+?)\}\}|<%([\s\S][^\n]+?)%>|%([\s\S][^\n]+?)%/';
preg_match_all( $pattern, $markup, $matches, PREG_SET_ORDER );
if ( is_array( $matches ) && ! empty( $matches ) ) {
foreach ( $matches as $match ) {
switch ( strtolower( trim( $match[1] ) ) ) {
case 'content':
if ( '' !== $content ) {
$markup = str_replace( $match[0], $content, $markup );
} elseif ( isset( $this->settings['default_content_in_template'] ) && '' !== $this->settings['default_content_in_template'] ) {
$markup = str_replace( $match[0], $this->settings['default_content_in_template'], $markup );
} else {
$markup = str_replace( $match[0], '', $markup );
}
break;
case 'title':
$markup = str_replace( $match[0], $this->outputTitle( $this->settings['name'] ), $markup );
break;
case 'container-class':
if ( method_exists( $this, 'containerContentClass' ) ) {
$markup = str_replace( $match[0], $this->containerContentClass(), $markup );
} else {
$markup = str_replace( $match[0], '', $markup );
}
break;
case 'editor_controls':
$markup = str_replace( $match[0], $this->getColumnControls( $this->settings( 'controls' ) ), $markup );
break;
case 'editor_controls_bottom_add':
$markup = str_replace( $match[0], $this->getColumnControls( 'add', 'bottom-controls' ), $markup );
break;
}
}
}
return do_shortcode( $markup );
}
/**
* @param $atts
*
* @return string
*/
protected function paramsHtmlHolders( $atts ) {
$inner = '';
if ( isset( $this->settings['params'] ) && is_array( $this->settings['params'] ) ) {
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( $atts[ $param['param_name'] ] ) ? $atts[ $param['param_name'] ] : '';
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
}
return $inner;
}
/**
* Check is allowed to add another element inside current element.
*
* @return bool
* @since 4.8
*
*/
public function getAddAllowed() {
return true;
}
}
classes/shortcodes/core/class-vc-shortcodes-manager.php 0000644 00000011757 15121635561 0017335 0 ustar 00 <?php
/**
* @package WPBakery
* @noinspection PhpIncludeInspection
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
*
*/
define( 'VC_SHORTCODE_CUSTOMIZE_PREFIX', 'vc_theme_' );
/**
*
*/
define( 'VC_SHORTCODE_BEFORE_CUSTOMIZE_PREFIX', 'vc_theme_before_' );
/**
*
*/
define( 'VC_SHORTCODE_AFTER_CUSTOMIZE_PREFIX', 'vc_theme_after_' );
/**
*
*/
define( 'VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG', 'vc_shortcodes_css_class' );
require_once $this->path( 'SHORTCODES_DIR', 'core/class-wpbakery-visualcomposer-abstract.php' );
require_once $this->path( 'SHORTCODES_DIR', 'core/class-wpbakeryshortcode.php' );
require_once $this->path( 'SHORTCODES_DIR', 'core/class-wbpakeryshortcodefishbones.php' );
require_once $this->path( 'SHORTCODES_DIR', 'core/class-wpbakeryshortcodescontainer.php' );
/**
* @since 4.9
*
* Class Vc_Shortcodes_Manager
*/
class Vc_Shortcodes_Manager {
private $shortcode_classes = array(
'default' => array(),
);
private $tag;
/**
* Core singleton class
* @var self - pattern realization
*/
private static $instance;
/**
* Get the instance of Vc_Shortcodes_Manager
*
* @return self
*/
public static function getInstance() {
if ( ! ( self::$instance instanceof self ) ) {
self::$instance = new self();
}
return self::$instance;
}
public function getTag() {
return $this->tag;
}
/**
* @param $tag
* @return $this
*/
/**
* @param $tag
* @return $this
*/
public function setTag( $tag ) {
$this->tag = $tag;
return $this;
}
/**
* @param $tag
* @return \WPBakeryShortCodeFishBones
* @throws \Exception
*/
/**
* @param $tag
* @return \WPBakeryShortCodeFishBones
* @throws \Exception
*/
public function getElementClass( $tag ) {
$currentScope = WPBMap::getScope();
if ( isset( $this->shortcode_classes[ $currentScope ], $this->shortcode_classes[ $currentScope ][ $tag ] ) ) {
return $this->shortcode_classes[ $currentScope ][ $tag ];
}
if ( ! isset( $this->shortcode_classes[ $currentScope ] ) ) {
$this->shortcode_classes[ $currentScope ] = array();
}
$settings = WPBMap::getShortCode( $tag );
if ( empty( $settings ) ) {
throw new Exception( 'Element must be mapped in system' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'wordpress-widgets.php' );
$class_name = ! empty( $settings['php_class_name'] ) ? $settings['php_class_name'] : 'WPBakeryShortCode_' . $settings['base'];
$autoloaded_dependencies = VcShortcodeAutoloader::includeClass( $class_name );
if ( ! $autoloaded_dependencies ) {
$file = vc_path_dir( 'SHORTCODES_DIR', str_replace( '_', '-', $settings['base'] ) . '.php' );
if ( is_file( $file ) ) {
require_once $file;
}
}
if ( class_exists( $class_name ) && is_subclass_of( $class_name, 'WPBakeryShortCode' ) ) {
$shortcode_class = new $class_name( $settings );
} else {
$shortcode_class = new WPBakeryShortCodeFishBones( $settings );
}
$this->shortcode_classes[ $currentScope ][ $tag ] = $shortcode_class;
return $shortcode_class;
}
/**
* @return \WPBakeryShortCodeFishBones
* @throws \Exception
*/
/**
* @return \WPBakeryShortCodeFishBones
* @throws \Exception
*/
public function shortcodeClass() {
return $this->getElementClass( $this->tag );
}
/**
* @param string $content
*
* @return string
* @throws \Exception
*/
public function template( $content = '' ) {
return $this->getElementClass( $this->tag )->contentAdmin( array(), $content );
}
/**
* @param $name
*
* @return null
* @throws \Exception
*/
public function settings( $name ) {
$settings = WPBMap::getShortCode( $this->tag );
return isset( $settings[ $name ] ) ? $settings[ $name ] : null;
}
/**
* @param $atts
* @param null $content
* @param null $tag
*
* @return string
* @throws \Exception
*/
public function render( $atts, $content = null, $tag = null ) {
return $this->getElementClass( $this->tag )->output( $atts, $content );
}
public function buildShortcodesAssets() {
$elements = WPBMap::getAllShortCodes();
foreach ( $elements as $tag => $settings ) {
$element_class = $this->getElementClass( $tag );
$element_class->enqueueAssets();
$element_class->printIconStyles();
}
}
public function buildShortcodesAssetsForEditable() {
$elements = WPBMap::getAllShortCodes(); // @todo create pull to use only where it is set inside function. BC problem
foreach ( $elements as $tag => $settings ) {
$element_class = $this->getElementClass( $tag );
$element_class->printIconStyles();
}
}
/**
* @param $tag
* @return bool
*/
/**
* @param $tag
* @return bool
*/
public function isShortcodeClassInitialized( $tag ) {
$currentScope = WPBMap::getScope();
return isset( $this->shortcode_classes[ $currentScope ], $this->shortcode_classes[ $currentScope ][ $tag ] );
}
/**
* @param $tag
* @return bool
*/
/**
* @param $tag
* @return bool
*/
public function unsetElementClass( $tag ) {
$currentScope = WPBMap::getScope();
unset( $this->shortcode_classes[ $currentScope ][ $tag ] );
return true;
}
}
classes/shortcodes/core/class-wpbakery-visualcomposer-abstract.php 0000644 00000006525 15121635561 0021635 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/* abstract VisualComposer class to create structural object of any type */
/**
* Class WPBakeryVisualComposerAbstract
*/
abstract class WPBakeryVisualComposerAbstract {
/**
* @var
*/
public static $config;
/**
* @var string
*/
protected $controls_css_settings = 'cc';
/**
* @var array
*/
protected $controls_list = array(
'edit',
'clone',
'delete',
);
/**
* @var string
*/
protected $shortcode_content = '';
/**
*
*/
public function __construct() {
}
/**
* @param $settings
* @deprecated not used
*/
public function init( $settings ) {
self::$config = (array) $settings;
}
/**
* @param $action
* @param $method
* @param int $priority
* @return true|void
* @deprecated 6.0 use native WordPress actions
*/
public function addAction( $action, $method, $priority = 10 ) {
return add_action( $action, array(
$this,
$method,
), $priority );
}
/**
* @param $action
* @param $method
* @param int $priority
*
* @return bool
* @deprecated 6.0 use native WordPress actions
*
*/
public function removeAction( $action, $method, $priority = 10 ) {
return remove_action( $action, array(
$this,
$method,
), $priority );
}
/**
* @param $filter
* @param $method
* @param int $priority
*
* @return bool|void
* @deprecated 6.0 use native WordPress actions
*
*/
public function addFilter( $filter, $method, $priority = 10 ) {
return add_filter( $filter, array(
$this,
$method,
), $priority );
}
/**
* @param $filter
* @param $method
* @param int $priority
* @return bool
* @deprecated 6.0 use native WordPress
*
*/
public function removeFilter( $filter, $method, $priority = 10 ) {
return remove_filter( $filter, array(
$this,
$method,
), $priority );
}
/**
* @param $tag
* @param $func
* @deprecated 6.0 not used
*
*/
public function addShortCode( $tag, $func ) {
// this function is deprecated since 6.0
}
/**
* @param $content
* @deprecated 6.0 not used
*
*/
public function doShortCode( $content ) {
// this function is deprecated since 6.0
}
/**
* @param $tag
* @deprecated 6.0 not used
*
*/
public function removeShortCode( $tag ) {
// this function is deprecated since 6.0
}
/**
* @param $param
*
* @return null
* @deprecated 6.0 not used, use vc_post_param
*
*/
public function post( $param ) {
// this function is deprecated since 6.0
return vc_post_param( $param );
}
/**
* @param $param
*
* @return null
* @deprecated 6.0 not used, use vc_get_param
*
*/
public function get( $param ) {
// this function is deprecated since 6.0
return vc_get_param( $param );
}
/**
* @param $asset
*
* @return string
* @deprecated 4.5 use vc_asset_url
*
*/
public function assetURL( $asset ) {
// this function is deprecated since 4.5
return vc_asset_url( $asset );
}
/**
* @param $asset
*
* @return string
* @deprecated 6.0 not used
*/
public function assetPath( $asset ) {
// this function is deprecated since 6.0
return self::$config['APP_ROOT'] . self::$config['ASSETS_DIR'] . $asset;
}
/**
* @param $name
*
* @return null
* @deprecated 6.0 not used
*/
public static function config( $name ) {
return isset( self::$config[ $name ] ) ? self::$config[ $name ] : null;
}
}
classes/shortcodes/core/class-wbpakeryshortcodefishbones.php 0000644 00000007222 15121635561 0020572 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCodeFishBones
*/
class WPBakeryShortCodeFishBones extends WPBakeryShortCode {
/**
* @var bool
*/
protected $shortcode_class = false;
/**
* @param $settings
* @throws \Exception
*/
public function __construct( $settings ) {
if ( ! $settings ) {
throw new Exception( 'Element must have settings to register' );
}
$this->settings = $settings;
$this->shortcode = $this->settings['base'];
add_action( 'admin_init', array(
$this,
'hookAdmin',
) );
if ( ! shortcode_exists( $this->shortcode ) ) {
add_shortcode( $this->shortcode, array(
$this,
'render',
) );
}
}
public function hookAdmin() {
$this->enqueueAssets();
add_action( 'admin_init', array(
$this,
'enqueueAssets',
) );
if ( vc_is_page_editable() ) {
// fix for page editable
add_action( 'wp_head', array(
$this,
'printIconStyles',
) );
}
add_action( 'admin_head', array(
$this,
'printIconStyles',
) ); // fe+be
add_action( 'admin_print_scripts-post.php', array(
$this,
'enqueueAssets',
) );
add_action( 'admin_print_scripts-post-new.php', array(
$this,
'enqueueAssets',
) );
}
/**
* @return WPBakeryShortCodeFishBones
* @throws \Exception
*/
public function shortcodeClass() {
if ( false !== $this->shortcode_class ) {
return $this->shortcode_class;
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'wordpress-widgets.php' );
$class_name = $this->settings( 'php_class_name' ) ? $this->settings( 'php_class_name' ) : 'WPBakeryShortCode_' . $this->settings( 'base' );
$autoloaded_dependencies = VcShortcodeAutoloader::includeClass( $class_name );
if ( ! $autoloaded_dependencies ) {
$file = vc_path_dir( 'SHORTCODES_DIR', str_replace( '_', '-', $this->settings( 'base' ) ) . '.php' );
if ( is_file( $file ) ) {
require_once $file;
}
}
if ( class_exists( $class_name ) && is_subclass_of( $class_name, 'WPBakeryShortCode' ) ) {
$this->shortcode_class = new $class_name( $this->settings );
} else {
$this->shortcode_class = new WPBakeryShortCodeFishBones( $this->settings );
}
return $this->shortcode_class;
}
/**
*
*
* @param $tag
*
* @return \WPBakeryShortCodeFishBones
* @throws \Exception
* @since 4.9
*
*/
public static function getElementClass( $tag ) {
$settings = WPBMap::getShortCode( $tag );
if ( empty( $settings ) ) {
throw new Exception( 'Element must be mapped in system' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'wordpress-widgets.php' );
$class_name = ! empty( $settings['php_class_name'] ) ? $settings['php_class_name'] : 'WPBakeryShortCode_' . $settings['base'];
$autoloaded_dependencies = VcShortcodeAutoloader::includeClass( $class_name );
if ( ! $autoloaded_dependencies ) {
$file = vc_path_dir( 'SHORTCODES_DIR', str_replace( '_', '-', $settings['base'] ) . '.php' );
if ( is_file( $file ) ) {
require_once $file;
}
}
if ( class_exists( $class_name ) && is_subclass_of( $class_name, 'WPBakeryShortCode' ) ) {
$shortcode_class = new $class_name( $settings );
} else {
$shortcode_class = new WPBakeryShortCodeFishBones( $settings );
}
return $shortcode_class;
}
/**
* @param $atts
* @param null $content
* @param null $tag
*
* @return string
* @throws \Exception
*/
public function render( $atts, $content = null, $tag = null ) {
return self::getElementClass( $tag )->output( $atts, $content );
}
/**
* @param string $content
*
* @return string
* @throws \Exception
*/
public function template( $content = '' ) {
return $this->shortcodeClass()->contentAdmin( array(), $content );
}
}
classes/shortcodes/core/class-wpbakeryshortcodescontainer.php 0000644 00000014313 15121635561 0020756 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCodesContainer
*/
abstract class WPBakeryShortCodesContainer extends WPBakeryShortCode {
/**
* @var array
*/
protected $predefined_atts = array();
protected $backened_editor_prepend_controls = true;
/**
* @return string
*/
public function customAdminBlockParams() {
return '';
}
/**
* @param $width
* @param $i
*
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
return 'data-element_type="' . esc_attr( $this->settings['base'] ) . '" class="wpb_' . esc_attr( $this->settings['base'] ) . ' ' . esc_attr( $sortable ) . '' . ( ! empty( $this->settings['class'] ) ? ' ' . esc_attr( $this->settings['class'] ) : '' ) . ' wpb_content_holder vc_shortcodes_container"' . $this->customAdminBlockParams();
}
/**
* @param $width
* @param $i
*
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="' . $this->containerContentClass() . '"';
}
/**
*
* @return string
*/
public function containerContentClass() {
return 'wpb_column_container vc_container_for_children vc_clearfix';
}/** @noinspection PhpMissingParentCallCommonInspection */
/**
* @param string $controls
* @param string $extended_css
*
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls = 'full', $extended_css = '' ) {
$controls_html = array();
$controls_html['start'] = '<div class="vc_controls vc_controls-visible controls_column' . ( ! empty( $extended_css ) ? " {$extended_css}" : '' ) . '">';
$controls_html['end'] = '</div>';
if ( 'bottom-controls' === $extended_css ) {
$controls_html['title'] = sprintf( esc_attr__( 'Append to this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) );
} else {
$controls_html['title'] = sprintf( esc_attr__( 'Prepend to this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) );
}
$controls_html['move'] = '<a class="vc_control column_move vc_column-move" data-vc-control="move" href="#" title="' . sprintf( esc_attr__( 'Move this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><i class="vc-composer-icon vc-c-icon-dragndrop"></i></a>';
$moveAccess = vc_user_access()->part( 'dragndrop' )->checkStateAny( true, null )->get();
if ( ! $moveAccess ) {
$controls_html['move'] = '';
}
$controls_html['add'] = '<a class="vc_control column_add" data-vc-control="add" href="#" title="' . $controls_html['title'] . '"><i class="vc-composer-icon vc-c-icon-add"></i></a>';
$controls_html['edit'] = '<a class="vc_control column_edit" data-vc-control="edit" href="#" title="' . sprintf( esc_html__( 'Edit this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><i class="vc-composer-icon vc-c-icon-mode_edit"></i></a>';
$controls_html['clone'] = '<a class="vc_control column_clone" data-vc-control="clone" href="#" title="' . sprintf( esc_html__( 'Clone this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><i class="vc-composer-icon vc-c-icon-content_copy"></i></a>';
$controls_html['delete'] = '<a class="vc_control column_delete" data-vc-control="delete" href="#" title="' . sprintf( esc_html__( 'Delete this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ) . '"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>';
$controls_html['full'] = $controls_html['move'] . $controls_html['add'] . $controls_html['edit'] . $controls_html['clone'] . $controls_html['delete'];
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
if ( ! empty( $controls ) ) {
if ( is_string( $controls ) ) {
$controls = array( $controls );
}
$controls_string = $controls_html['start'];
foreach ( $controls as $control ) {
if ( ( $editAccess && 'edit' === $control ) || $allAccess ) {
if ( isset( $controls_html[ $control ] ) ) {
$controls_string .= $controls_html[ $control ];
}
}
}
return $controls_string . $controls_html['end'];
}
if ( $allAccess ) {
return $controls_html['start'] . $controls_html['full'] . $controls_html['end'];
} elseif ( $editAccess ) {
return $controls_html['start'] . $controls_html['edit'] . $controls_html['end'];
}
return $controls_html['start'] . $controls_html['end'];
}
/**
* @param $atts
* @param null $content
*
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$width = '';
$atts = shortcode_atts( $this->predefined_atts, $atts );
extract( $atts );
$this->atts = $atts;
$output = '';
$output .= '<div ' . $this->mainHtmlBlockParams( $width, 1 ) . '>';
if ( $this->backened_editor_prepend_controls ) {
$output .= $this->getColumnControls( $this->settings( 'controls' ) );
}
$output .= '<div class="wpb_element_wrapper">';
if ( isset( $this->settings['custom_markup'] ) && '' !== $this->settings['custom_markup'] ) {
$markup = $this->settings['custom_markup'];
$output .= $this->customMarkup( $markup );
} else {
$output .= $this->outputTitle( $this->settings['name'] );
$output .= '<div ' . $this->containerHtmlBlockParams( $width, 1 ) . '>';
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '</div>';
$output .= $this->paramsHtmlHolders( $atts );
}
$output .= '</div>';
if ( $this->backened_editor_prepend_controls ) {
$output .= $this->getColumnControls( 'add', 'bottom-controls' );
}
$output .= '</div>';
return $output;
}
/**
* @param $title
*
* @return string
*/
protected function outputTitle( $title ) {
$icon = $this->settings( 'icon' );
if ( filter_var( $icon, FILTER_VALIDATE_URL ) ) {
$icon = '';
}
$params = array(
'icon' => $icon,
'is_container' => $this->settings( 'is_container' ),
'title' => $title,
);
return '<h4 class="wpb_element_title"> ' . $this->getIcon( $params ) . '</h4>';
}
/**
* @return string
*/
/**
* @return string
*/
public function getBackendEditorChildControlsElementCssClass() {
return 'vc_element-name';
}
}
classes/shortcodes/vc-text-separator.php 0000644 00000001337 15121635561 0014470 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Text_separator
*/
class WPBakeryShortCode_Vc_Text_Separator extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
public function outputTitle( $title ) {
return '';
}
/**
* @param $atts
* @return string
* @throws \Exception
*/
public function getVcIcon( $atts ) {
if ( empty( $atts['i_type'] ) ) {
$atts['i_type'] = 'fontawesome';
}
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_icon', $atts, 'i_' );
if ( $data ) {
$icon = visual_composer()->getShortCode( 'vc_icon' );
if ( is_object( $icon ) ) {
return $icon->render( array_filter( $data ) );
}
}
return '';
}
}
classes/shortcodes/vc-gitem-row.php 0000644 00000001427 15121635561 0013420 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-row.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Row
*/
class WPBakeryShortCode_Vc_Gitem_Row extends WPBakeryShortCode_Vc_Row {
/**
* @return string
*/
public function getLayoutsControl() {
global $vc_row_layouts;
$controls_layout = '<span class="vc_row_layouts vc_control">';
foreach ( array_slice( $vc_row_layouts, 0, 4 ) as $layout ) {
$controls_layout .= '<a class="vc_control-set-column set_columns" data-cells="' . $layout['cells'] . '" data-cells-mask="' . $layout['mask'] . '" title="' . $layout['title'] . '"><i class="vc-composer-icon vc-c-icon-' . $layout['icon_class'] . '"></i></a> ';
}
$controls_layout .= '</span>';
return $controls_layout;
}
}
classes/shortcodes/vc-pinterest.php 0000644 00000002363 15121635561 0013523 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Pinterest
*/
class WPBakeryShortCode_Vc_Pinterest extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
protected function contentInline( $atts, $content = null ) {
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $annotation // TODO: check why annotation doesn't set before
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Pinterest $this
*/
$type = $annotation = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$css = isset( $atts['css'] ) ? $atts['css'] : '';
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
$class_to_filter = 'wpb_googleplus vc_social-placeholder wpb_content_element vc_socialtype-' . $type;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
return '<div class="' . esc_attr( $css_class ) . '"></div>';
}
}
classes/shortcodes/rev-slider-vc.php 0000644 00000000254 15121635561 0013557 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Rev_Slider_Vc
*/
class WPBakeryShortCode_Rev_Slider_Vc extends WPBakeryShortCode {
}
classes/shortcodes/layerslider-vc.php 0000644 00000000256 15121635561 0014024 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Layerslider_Vc
*/
class WPBakeryShortCode_Layerslider_Vc extends WPBakeryShortCode {
}
classes/shortcodes/vc-column.php 0000644 00000021617 15121635561 0013006 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_VC_Column extends WPBakeryShortCode {
/**
* @var string
*/
public $nonDraggableClass = 'vc-non-draggable-column';
/**
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->shortcodeScripts();
}
/**
*
*/
protected function shortcodeScripts() {
wp_register_script( 'vc_jquery_skrollr_js', vc_asset_url( 'lib/bower/skrollr/dist/skrollr.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_youtube_iframe_api_js', 'https://www.youtube.com/iframe_api', array(), WPB_VC_VERSION, true );
}
/**
* @param $controls
* @param string $extended_css
*
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls, $extended_css = '' ) {
$output = '<div class="vc_controls vc_control-column vc_controls-visible' . ( ! empty( $extended_css ) ? " {$extended_css}" : '' ) . '">';
$controls_end = '</div>';
if ( ' bottom-controls' === $extended_css ) {
$control_title = __( 'Append to this column', 'js_composer' );
} else {
$control_title = __( 'Prepend to this column', 'js_composer' );
}
if ( vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'custom', null )->get() ) {
$controls_add = '<a class="vc_control column_add vc_column-add" data-vc-control="add" href="#" title="' . $control_title . '"><i class="vc-composer-icon vc-c-icon-add"></i></a>';
} else {
$controls_add = '';
}
$controls_edit = '<a class="vc_control column_edit vc_column-edit" data-vc-control="edit" href="#" title="' . __( 'Edit this column', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-mode_edit"></i></a>';
$controls_delete = '<a class="vc_control column_delete vc_column-delete" data-vc-control="delete" href="#" title="' . __( 'Delete this column', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>';
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
if ( is_array( $controls ) && ! empty( $controls ) ) {
foreach ( $controls as $control ) {
if ( 'add' === $control || ( $editAccess && 'edit' === $control ) || $allAccess ) {
$method_name = vc_camel_case( 'output-editor-control-' . $control );
if ( method_exists( $this, $method_name ) ) {
$output .= $this->$method_name();
} else {
$control_var = 'controls_' . $control;
if ( isset( ${$control_var} ) ) {
$output .= ${$control_var};
}
}
}
}
return $output . $controls_end;
} elseif ( is_string( $controls ) && 'full' === $controls ) {
if ( $allAccess ) {
return $output . $controls_add . $controls_edit . $controls_delete . $controls_end;
} elseif ( $editAccess ) {
return $output . $controls_add . $controls_edit . $controls_end;
}
return $output . $controls_add . $controls_end;
} elseif ( is_string( $controls ) ) {
$control_var = 'controls_' . $controls;
if ( 'add' === $controls || ( $editAccess && 'edit' === $controls || $allAccess ) && isset( ${$control_var} ) ) {
return $output . ${$control_var} . $controls_end;
}
return $output . $controls_end;
}
if ( $allAccess ) {
return $output . $controls_add . $controls_edit . $controls_delete . $controls_end;
} elseif ( $editAccess ) {
return $output . $controls_add . $controls_edit . $controls_end;
}
return $output . $controls_add . $controls_end;
}
/**
* @param $param
* @param $value
*
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$output = '';
// Compatibility fixes.
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( isset( $param['holder'] ) && 'hidden' !== $param['holder'] ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
return $output;
}
/**
* @param $atts
* @param null $content
*
* @return string
*/
public function contentAdmin( $atts, $content = null ) {
$width = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
// @codingStandardsIgnoreLine
extract( $atts );
$this->atts = $atts;
$output = '';
$column_controls = $this->getColumnControls( $this->settings( 'controls' ) );
$column_controls_bottom = $this->getColumnControls( 'add', 'bottom-controls' );
if ( 'column_14' === $width || '1/4' === $width ) {
$width = array( 'vc_col-sm-3' );
} elseif ( 'column_14-14-14-14' === $width ) {
$width = array(
'vc_col-sm-3',
'vc_col-sm-3',
'vc_col-sm-3',
'vc_col-sm-3',
);
} elseif ( 'column_13' === $width || '1/3' === $width ) {
$width = array( 'vc_col-sm-4' );
} elseif ( 'column_13-23' === $width ) {
$width = array(
'vc_col-sm-4',
'vc_col-sm-8',
);
} elseif ( 'column_13-13-13' === $width ) {
$width = array(
'vc_col-sm-4',
'vc_col-sm-4',
'vc_col-sm-4',
);
} elseif ( 'column_12' === $width || '1/2' === $width ) {
$width = array( 'vc_col-sm-6' );
} elseif ( 'column_12-12' === $width ) {
$width = array(
'vc_col-sm-6',
'vc_col-sm-6',
);
} elseif ( 'column_23' === $width || '2/3' === $width ) {
$width = array( 'vc_col-sm-8' );
} elseif ( 'column_34' === $width || '3/4' === $width ) {
$width = array( 'vc_col-sm-9' );
} elseif ( 'column_16' === $width || '1/6' === $width ) {
$width = array( 'vc_col-sm-2' );
} elseif ( ' column_56' === $width || ' 5/6' === $width ) {
$width = array( 'vc_col-sm-10' );
} else {
$width = array( '' );
}
$count = count( $width );
for ( $i = 0; $i < $count; $i ++ ) {
$output .= '<div ' . $this->mainHtmlBlockParams( $width, $i ) . '>';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls );
$output .= '<div class="wpb_element_wrapper">';
$output .= '<div ' . $this->containerHtmlBlockParams( $width, $i ) . '>';
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '</div>';
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$output .= $inner;
}
$output .= '</div>';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls_bottom );
$output .= '</div>';
}
return $output;
}
/**
* @return string
*/
public function customAdminBlockParams() {
return '';
}
/**
* @param $width
* @param $i
*
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
return 'data-element_type="' . $this->settings['base'] . '" data-vc-column-width="' . wpb_vc_get_column_width_indent( $width[ $i ] ) . '" class="wpb_' . $this->settings['base'] . ' ' . $sortable . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $this->settings['class'] : '' ) . ' ' . $this->templateWidth() . ' wpb_content_holder"' . $this->customAdminBlockParams();
}
/**
* @param $width
* @param $i
*
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="wpb_column_container vc_container_for_children"';
}
/**
* @param string $content
*
* @return string
*/
public function template( $content = '' ) {
return $this->contentAdmin( $this->atts );
}
/**
* @return string
*/
protected function templateWidth() {
return '<%= window.vc_convert_column_size(params.width) %>';
}
/**
* @param string $font_color
*
* @return string
*/
public function buildStyle( $font_color = '' ) {
$style = '';
if ( ! empty( $font_color ) ) {
$style .= vc_get_css_color( 'color', $font_color );
}
return empty( $style ) ? $style : ' style="' . esc_attr( $style ) . '"';
}
}
classes/shortcodes/vc-gitem-post-data.php 0000644 00000002316 15121635561 0014503 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-custom-heading.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Data
*/
class WPBakeryShortCode_Vc_Gitem_Post_Data extends WPBakeryShortCode_Vc_Custom_heading {
/**
* Get data_source attribute value
*
* @param array $atts - list of shortcode attributes
*
* @return string
*/
public function getDataSource( array $atts ) {
return isset( $atts['data_source'] ) ? $atts['data_source'] : 'post_title';
}
/**
* @param $atts
* @return array
* @throws \Exception
*/
public function getAttributes( $atts ) {
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
if ( isset( $atts['block_container'] ) && strlen( $atts['block_container'] ) > 0 ) {
if ( ! isset( $atts['font_container'] ) ) {
$atts['font_container'] = $atts['block_container'];
} else {
// merging two params into font_container
$atts['font_container'] .= '|' . $atts['block_container'];
}
}
$atts = parent::getAttributes( $atts );
if ( ! isset( $this->atts['use_custom_fonts'] ) || 'yes' !== $this->atts['use_custom_fonts'] ) {
$atts['google_fonts_data'] = array();
}
return $atts;
}
}
classes/shortcodes/vc-posts-slider.php 0000644 00000000260 15121635561 0014130 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Posts_slider
*/
class WPBakeryShortCode_Vc_Posts_Slider extends WPBakeryShortCode {
}
classes/shortcodes/vc-tta-tour.php 0000644 00000003461 15121635561 0013265 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Tabs' );
/**
* Class WPBakeryShortCode_Vc_Tta_Tour
*/
class WPBakeryShortCode_Vc_Tta_Tour extends WPBakeryShortCode_Vc_Tta_Tabs {
public $layout = 'tabs';
/**
* @return string
*/
public function getTtaGeneralClasses() {
$classes = parent::getTtaGeneralClasses();
if ( isset( $this->atts['controls_size'] ) ) {
$classes .= ' ' . $this->getTemplateVariable( 'controls_size' );
}
return $classes;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamControlsSize( $atts, $content ) {
if ( isset( $atts['controls_size'] ) && strlen( $atts['controls_size'] ) > 0 ) {
return 'vc_tta-controls-size-' . $atts['controls_size'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabsListLeft( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'left' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamTabsList( $atts, $content );
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTabsListRight( $atts, $content ) {
if ( empty( $atts['tab_position'] ) || 'right' !== $atts['tab_position'] ) {
return null;
}
return $this->getParamTabsList( $atts, $content );
}
/**
* Never on top
*
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamPaginationTop( $atts, $content ) {
return null;
}
/**
* Always on bottom
*
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamPaginationBottom( $atts, $content ) {
return $this->getParamPaginationList( $atts, $content );
}
}
classes/shortcodes/vc-gitem-zone-b.php 0000644 00000000601 15121635561 0013774 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-zone.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Zone_B
*/
class WPBakeryShortCode_Vc_Gitem_Zone_B extends WPBakeryShortCode_Vc_Gitem_Zone {
public $zone_name = 'b';
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_zone';
}
}
classes/shortcodes/vc-facebook.php 0000644 00000002340 15121635561 0013252 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Facebook
*/
class WPBakeryShortCode_Vc_Facebook extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
protected function contentInline( $atts, $content = null ) {
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $el_class
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_Facebook $this
*/
$type = $css = $el_class = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$url = get_permalink();
$css = isset( $atts['css'] ) ? $atts['css'] : '';
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
$class_to_filter = 'wpb_googleplus vc_social-placeholder wpb_content_element vc_socialtype-' . $type;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
return '<a href="' . esc_url( $url ) . '" class="' . esc_attr( $css_class ) . '"></a>';
}
}
classes/shortcodes/vc-column-text.php 0000644 00000000431 15121635561 0013757 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Column_Text
*/
class WPBakeryShortCode_Vc_Column_Text extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
return '';
}
}
classes/shortcodes/vc-custom-field.php 0000644 00000000330 15121635561 0014071 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Custom_Field extends WPBakeryShortCode {
}
classes/shortcodes/vc-single-image.php 0000644 00000011456 15121635561 0014052 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Single_image
*/
class WPBakeryShortCode_Vc_Single_Image extends WPBakeryShortCode {
/**
* WPBakeryShortCode_Vc_Single_image constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsScripts();
}
public function jsScripts() {
wp_register_script( 'zoom', vc_asset_url( 'lib/bower/zoom/jquery.zoom.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_image_zoom', vc_asset_url( 'lib/vc_image_zoom/vc_image_zoom.min.js' ), array(
'jquery-core',
'zoom',
), WPB_VC_VERSION, true );
}
/**
* @param $param
* @param $value
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$output = '';
// Compatibility fixes
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( 'attach_image' === $param['type'] && 'image' === $param_name ) {
$output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
$element_icon = $this->settings( 'icon' );
$img = wpb_getImageBySize( array(
'attach_id' => (int) preg_replace( '/[^\d]/', '', $value ),
'thumb_size' => 'thumbnail',
) );
$this->setSettings( 'logo', ( $img ? $img['thumbnail'] : '<img width="150" height="150" src="' . esc_url( vc_asset_url( 'vc/blank.gif' ) ) . '" class="attachment-thumbnail vc_general vc_element-icon" data-name="' . $param_name . '" alt="" title="" style="display: none;" />' ) . '<span class="no_image_image vc_element-icon' . ( ! empty( $element_icon ) ? ' ' . $element_icon : '' ) . ( $img && ! empty( $img['p_img_large'][0] ) ? ' image-exists' : '' ) . '"></span><a href="#" class="column_edit_trigger' . ( $img && ! empty( $img['p_img_large'][0] ) ? ' image-exists' : '' ) . '">' . esc_html__( 'Add image', 'js_composer' ) . '</a>' );
$output .= $this->outputTitleTrue( $this->settings['name'] );
} elseif ( ! empty( $param['holder'] ) ) {
if ( 'input' === $param['holder'] ) {
$output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
} elseif ( in_array( $param['holder'], array(
'img',
'iframe',
), true ) ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . esc_url( $value ) . '">';
} elseif ( 'hidden' !== $param['holder'] ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
}
if ( ! empty( $param['admin_label'] ) && true === $param['admin_label'] ) {
$output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . ( empty( $value ) ? ' hidden-label' : '' ) . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
}
return $output;
}
/**
* @param $img_id
* @param $img_size
* @return string
*/
public function getImageSquareSize( $img_id, $img_size ) {
if ( preg_match_all( '/(\d+)x(\d+)/', $img_size, $sizes ) ) {
$exact_size = array(
'width' => isset( $sizes[1][0] ) ? $sizes[1][0] : '0',
'height' => isset( $sizes[2][0] ) ? $sizes[2][0] : '0',
);
} else {
$image_downsize = image_downsize( $img_id, $img_size );
$exact_size = array(
'width' => $image_downsize[1],
'height' => $image_downsize[2],
);
}
$exact_size_int_w = (int) $exact_size['width'];
$exact_size_int_h = (int) $exact_size['height'];
if ( isset( $exact_size['width'] ) && $exact_size_int_w !== $exact_size_int_h ) {
$img_size = $exact_size_int_w > $exact_size_int_h ? $exact_size['height'] . 'x' . $exact_size['height'] : $exact_size['width'] . 'x' . $exact_size['width'];
}
return $img_size;
}
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
return '';
}
/**
* @param $title
* @return string
*/
protected function outputTitleTrue( $title ) {
return '<h4 class="wpb_element_title">' . $title . ' ' . $this->settings( 'logo' ) . '</h4>';
}
}
classes/shortcodes/vc-widget-sidebar.php 0000644 00000000264 15121635561 0014376 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Widget_sidebar
*/
class WPBakeryShortCode_Vc_Widget_Sidebar extends WPBakeryShortCode {
}
classes/shortcodes/vc-gitem-post-meta.php 0000644 00000000266 15121635561 0014522 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Meta
*/
class WPBakeryShortCode_Vc_Gitem_Post_Meta extends WPBakeryShortCode {
}
classes/shortcodes/vc-video.php 0000644 00000000242 15121635561 0012606 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Video
*/
class WPBakeryShortCode_Vc_Video extends WPBakeryShortCode {
}
classes/shortcodes/vc-button2.php 0000644 00000000762 15121635561 0013104 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Button2 extends WPBakeryShortCode {
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
$icon = $this->settings( 'icon' );
return '<h4 class="wpb_element_title"><span class="vc_general vc_element-icon' . ( ! empty( $icon ) ? ' ' . esc_attr( $icon ) : '' ) . '"></span></h4>';
}
}
classes/shortcodes/vc-raw-js.php 0000644 00000002240 15121635561 0012703 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-raw-html.php' );
/**
* Class WPBakeryShortCode_Vc_Raw_Js
*/
class WPBakeryShortCode_Vc_Raw_Js extends WPBakeryShortCode_Vc_Raw_html {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_raw_html';
}
/**
* @param $atts
* @param null $content
* @return string
*/
protected function contentInline( $atts, $content = null ) {
$el_class = $width = $el_position = '';
extract( shortcode_atts( array(
'el_class' => '',
'el_position' => '',
'width' => '1/2',
), $atts ) );
$el_class = $this->getExtraClass( $el_class );
$el_class .= ' wpb_raw_js';
// @codingStandardsIgnoreLine
$content = rawurldecode( base64_decode( wp_strip_all_tags( $content ) ) );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_raw_code' . $el_class, $this->settings['base'], $atts );
$output = '
<div class="' . $css_class . '">
<div class="wpb_wrapper">
<textarea style="display: none;" class="vc_js_inline_holder">' . esc_attr( $content ) . '</textarea>
</div>
</div>
';
return $output;
}
}
classes/shortcodes/vc-btn.php 0000644 00000005040 15121635561 0012264 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
/**
* Class WPBakeryShortCode_Vc_Btn
* @since 4.5
*/
class WPBakeryShortCode_Vc_Btn extends WPBakeryShortCode {
/**
* @param $atts
* @return mixed
*/
public static function convertAttributesToButton3( $atts ) {
// size btn1 to size btn2
$btn1_sizes = array(
'wpb_regularsize',
'btn-large',
'btn-small',
'btn-mini',
);
if ( isset( $atts['size'] ) && in_array( $atts['size'], $btn1_sizes, true ) ) {
$atts['size'] = str_replace( $btn1_sizes, array(
'md',
'lg',
'sm',
'xs',
), $atts['size'] );
}
// Convert Btn1 href+target attributes to Btn2 `link` attribute
if ( ! isset( $atts['link'] ) && isset( $atts['href'] ) && strlen( $atts['href'] ) > 0 ) {
$link = $atts['href'];
$target = isset( $atts['target'] ) ? $atts['target'] : '';
$title = isset( $atts['title'] ) ? $atts['title'] : $link;
$atts['link'] = 'url:' . rawurlencode( $link ) . '|title:' . $title . ( strlen( $target ) > 0 ? '|target:' . rawurlencode( $target ) : '' );
}
if ( ( ! isset( $atts['add_icon'] ) || 'true' !== $atts['add_icon'] ) && isset( $atts['icon'] ) && strlen( $atts['icon'] ) > 0 && 'none' !== $atts['icon'] ) {
// old icon from btn1 is set, let's convert it to new btn
$atts['add_icon'] = 'true';
$atts['icon_type'] = 'pixelicons';
$atts['icon_align'] = 'right';
$atts['icon_pixelicons'] = 'vc_pixel_icon vc_pixel_icon-' . str_replace( 'wpb_', '', $atts['icon'] );
}
$haystack = array(
'rounded',
'square',
'round',
'outlined',
'square_outlined',
);
if ( isset( $atts['style'] ) && in_array( $atts['style'], $haystack, true ) ) {
switch ( $atts['style'] ) {
case 'rounded':
$atts['style'] = 'flat';
$atts['shape'] = 'rounded';
break;
case 'square':
$atts['style'] = 'flat';
$atts['shape'] = 'square';
break;
case 'round':
$atts['style'] = 'flat';
$atts['shape'] = 'round';
break;
case 'outlined':
$atts['style'] = 'outline';
break;
case 'square_outlined':
$atts['style'] = 'outline';
$atts['shape'] = 'square';
break;
}
}
return $atts;
}
/**
* @param $title
*
* @return string
* @since 4.5
*/
protected function outputTitle( $title ) {
$icon = $this->settings( 'icon' );
return '<h4 class="wpb_element_title"><span class="vc_general vc_element-icon vc_btn3-icon' . ( ! empty( $icon ) ? ' ' . $icon : '' ) . '"></span></h4>';
}
}
classes/shortcodes/vc-gitem-post-author.php 0000644 00000000601 15121635561 0015067 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Author
*/
class WPBakeryShortCode_Vc_Gitem_Post_Author extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_post_author';
}
}
classes/shortcodes/vc-pie.php 0000644 00000003032 15121635561 0012255 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Pie
*/
class WPBakeryShortCode_Vc_Pie extends WPBakeryShortCode {
/**
* WPBakeryShortCode_Vc_Pie constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsScripts();
}
public function jsScripts() {
wp_register_script( 'vc_waypoints', vc_asset_url( 'lib/vc_waypoints/vc-waypoints.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'progressCircle', vc_asset_url( 'lib/bower/progress-circle/ProgressCircle.min.js' ), array(), WPB_VC_VERSION, true );
wp_register_script( 'vc_pie', vc_asset_url( 'lib/vc_chart/jquery.vc_chart.min.js' ), array(
'jquery-core',
'vc_waypoints',
'progressCircle',
), WPB_VC_VERSION, true );
}
/**
* Convert old color names to new ones for BC
*
* @param array $atts
*
* @return array
*/
public static function convertOldColorsToNew( $atts ) {
$map = array(
'btn-primary' => '#0088cc',
'btn-success' => '#6ab165',
'btn-warning' => '#ff9900',
'btn-inverse' => '#555555',
'btn-danger' => '#ff675b',
'btn-info' => '#58b9da',
'primary' => '#0088cc',
'success' => '#6ab165',
'warning' => '#ff9900',
'inverse' => '#555555',
'danger' => '#ff675b',
'info' => '#58b9da',
'default' => '#f7f7f7',
);
if ( isset( $atts['color'] ) && isset( $map[ $atts['color'] ] ) ) {
$atts['custom_color'] = $map[ $atts['color'] ];
$atts['color'] = 'custom';
}
return $atts;
}
}
classes/shortcodes/vc-tweetmeme.php 0000644 00000002034 15121635561 0013475 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_TweetMeMe
*/
class WPBakeryShortCode_Vc_TweetMeMe extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
protected function contentInline( $atts, $content = null ) {
/**
* Shortcode attributes
* @var $atts
* Shortcode class
* @var WPBakeryShortCode_Vc_TweetMeMe $this
*/
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
$css = isset( $atts['css'] ) ? $atts['css'] : '';
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
$class_to_filter = 'wpb_googleplus vc_social-placeholder wpb_content_element';
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $atts['css_animation'] );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
return '<div class="' . esc_attr( $css_class ) . '"></div>';
}
}
classes/shortcodes/vc-round-chart.php 0000644 00000001510 15121635561 0013725 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Round_Chart
*/
class WPBakeryShortCode_Vc_Round_Chart extends WPBakeryShortCode {
/**
* WPBakeryShortCode_Vc_Round_Chart constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsScripts();
}
public function jsScripts() {
wp_register_script( 'vc_waypoints', vc_asset_url( 'lib/vc_waypoints/vc-waypoints.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'ChartJS', vc_asset_url( 'lib/bower/chartjs/Chart.min.js' ), array(), WPB_VC_VERSION, true );
wp_register_script( 'vc_round_chart', vc_asset_url( 'lib/vc_round_chart/vc_round_chart.min.js' ), array(
'jquery-core',
'vc_waypoints',
'ChartJS',
), WPB_VC_VERSION, true );
}
}
classes/shortcodes/vc-tour.php 0000644 00000001040 15121635561 0012466 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-tabs.php' );
/**
* Class WPBakeryShortCode_Vc_Tour
*/
class WPBakeryShortCode_Vc_Tour extends WPBakeryShortCode_Vc_Tabs {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_tabs';
}
/**
* @return string
*/
public function getTabTemplate() {
return '<div class="wpb_template">' . do_shortcode( '[vc_tab title="' . esc_attr__( 'Slide', 'js_composer' ) . '" tab_id=""][/vc_tab]' ) . '</div>';
}
}
classes/shortcodes/vc-cta.php 0000644 00000012052 15121635561 0012251 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
* @since 4.5
*/
/**
* @since 4.5
* Class WPBakeryShortCode_Vc_Cta
*/
class WPBakeryShortCode_Vc_Cta extends WPBakeryShortCode {
protected $template_vars = array();
/**
* @param $atts
* @param $content
* @throws \Exception
*/
public function buildTemplate( $atts, $content ) {
$output = array();
$inline_css = array();
$main_wrapper_classes = array( 'vc_cta3' );
$container_classes = array();
if ( ! empty( $atts['el_class'] ) ) {
$main_wrapper_classes[] = $atts['el_class'];
}
if ( ! empty( $atts['style'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-style-' . $atts['style'];
}
if ( ! empty( $atts['shape'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-shape-' . $atts['shape'];
}
if ( ! empty( $atts['txt_align'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-align-' . $atts['txt_align'];
}
if ( ! empty( $atts['color'] ) && ! ( isset( $atts['style'] ) && 'custom' === $atts['style'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-color-' . $atts['color'];
}
if ( isset( $atts['style'] ) && 'custom' === $atts['style'] ) {
if ( ! empty( $atts['custom_background'] ) ) {
$inline_css[] = vc_get_css_color( 'background-color', $atts['custom_background'] );
}
}
if ( ! empty( $atts['i_on_border'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-icons-on-border';
}
if ( ! empty( $atts['i_size'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-icon-size-' . $atts['i_size'];
}
if ( ! empty( $atts['i_background_style'] ) ) {
$main_wrapper_classes[] = 'vc_cta3-icons-in-box';
}
if ( ! empty( $atts['el_width'] ) ) {
$container_classes[] = 'vc_cta3-size-' . $atts['el_width'];
}
if ( ! empty( $atts['add_icon'] ) ) {
$output[ 'icons-' . $atts['add_icon'] ] = $this->getVcIcon( $atts );
$main_wrapper_classes[] = 'vc_cta3-icons-' . $atts['add_icon'];
}
if ( ! empty( $atts['add_button'] ) ) {
$output[ 'actions-' . $atts['add_button'] ] = $this->getButton( $atts );
$main_wrapper_classes[] = 'vc_cta3-actions-' . $atts['add_button'];
}
if ( ! empty( $atts['css_animation'] ) ) {
$main_wrapper_classes[] = $this->getCSSAnimation( $atts['css_animation'] );
}
if ( ! empty( $atts['css'] ) ) {
$main_wrapper_classes[] = vc_shortcode_custom_css_class( $atts['css'] );
}
$output['content'] = wpb_js_remove_wpautop( $content, true );
$output['heading1'] = $this->getHeading( 'h2', $atts );
$output['heading2'] = $this->getHeading( 'h4', $atts );
$output['css-class'] = $main_wrapper_classes;
$output['container-class'] = $container_classes;
$output['inline-css'] = $inline_css;
$this->template_vars = $output;
}
/**
* @param $tag
* @param $atts
* @return string
* @throws \Exception
*/
public function getHeading( $tag, $atts ) {
if ( isset( $atts[ $tag ] ) && '' !== trim( $atts[ $tag ] ) ) {
if ( isset( $atts[ 'use_custom_fonts_' . $tag ] ) && 'true' === $atts[ 'use_custom_fonts_' . $tag ] ) {
$custom_heading = visual_composer()->getShortCode( 'vc_custom_heading' );
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_custom_heading', $atts, $tag . '_' );
$data['font_container'] = implode( '|', array_filter( array(
'tag:' . $tag,
$data['font_container'],
) ) );
$data['text'] = $atts[ $tag ]; // provide text to shortcode
return $custom_heading->render( array_filter( $data ) );
} else {
$inline_css = array();
$inline_css_string = '';
if ( isset( $atts['style'] ) && 'custom' === $atts['style'] ) {
if ( ! empty( $atts['custom_text'] ) ) {
$inline_css[] = vc_get_css_color( 'color', $atts['custom_text'] );
}
}
if ( ! empty( $inline_css ) ) {
$inline_css_string = ' style="' . implode( '', $inline_css ) . '"';
}
return '<' . $tag . $inline_css_string . '>' . $atts[ $tag ] . '</' . $tag . '>';
}
}
return '';
}
/**
* @param $atts
* @return string
* @throws \Exception
*/
public function getButton( $atts ) {
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_btn', $atts, 'btn_' );
if ( $data ) {
$btn = visual_composer()->getShortCode( 'vc_btn' );
if ( is_object( $btn ) ) {
return '<div class="vc_cta3-actions">' . $btn->render( array_filter( $data ) ) . '</div>';
}
}
return '';
}
/**
* @param $atts
* @return string
* @throws \Exception
*/
public function getVcIcon( $atts ) {
if ( empty( $atts['i_type'] ) ) {
$atts['i_type'] = 'fontawesome';
}
$data = vc_map_integrate_parse_atts( $this->shortcode, 'vc_icon', $atts, 'i_' );
if ( $data ) {
$icon = visual_composer()->getShortCode( 'vc_icon' );
if ( is_object( $icon ) ) {
return '<div class="vc_cta3-icons">' . $icon->render( array_filter( $data ) ) . '</div>';
}
}
return '';
}
/**
* @param $string
* @return mixed|string
*/
public function getTemplateVariable( $string ) {
if ( is_array( $this->template_vars ) && isset( $this->template_vars[ $string ] ) ) {
return $this->template_vars[ $string ];
}
return '';
}
}
classes/shortcodes/vc-masonry-media-grid.php 0000644 00000002622 15121635561 0015174 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-media-grid.php' );
/**
* Class WPBakeryShortCode_Vc_Masonry_Media_Grid
*/
class WPBakeryShortCode_Vc_Masonry_Media_Grid extends WPBakeryShortCode_Vc_Media_Grid {
public function shortcodeScripts() {
parent::shortcodeScripts();
wp_register_script( 'vc_masonry', vc_asset_url( 'lib/bower/masonry/dist/masonry.pkgd.min.js' ), array(), WPB_VC_VERSION, true );
}
public function enqueueScripts() {
wp_enqueue_script( 'vc_masonry' );
parent::enqueueScripts();
}
public function buildGridSettings() {
parent::buildGridSettings();
$this->grid_settings['style'] .= '-masonry';
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentAllMasonry( $grid_style, $settings, $content ) {
return parent::contentAll( $grid_style, $settings, $content );
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentLazyMasonry( $grid_style, $settings, $content ) {
return parent::contentLazy( $grid_style, $settings, $content );
}
/**
* @param $grid_style
* @param $settings
* @param $content
* @return string
*/
protected function contentLoadMoreMasonry( $grid_style, $settings, $content ) {
return parent::contentLoadMore( $grid_style, $settings, $content );
}
}
classes/shortcodes/vc-line-chart.php 0000644 00000001502 15121635561 0013526 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Line_Chart
*/
class WPBakeryShortCode_Vc_Line_Chart extends WPBakeryShortCode {
/**
* WPBakeryShortCode_Vc_Line_Chart constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->jsScripts();
}
public function jsScripts() {
wp_register_script( 'vc_waypoints', vc_asset_url( 'lib/vc_waypoints/vc-waypoints.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'ChartJS', vc_asset_url( 'lib/bower/chartjs/Chart.min.js' ), array(), WPB_VC_VERSION, true );
wp_register_script( 'vc_line_chart', vc_asset_url( 'lib/vc_line_chart/vc_line_chart.min.js' ), array(
'jquery-core',
'vc_waypoints',
'ChartJS',
), WPB_VC_VERSION, true );
}
}
classes/shortcodes/vc-gitem-zone-c.php 0000644 00000000434 15121635561 0014001 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-zone.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Zone_C
*/
class WPBakeryShortCode_Vc_Gitem_Zone_C extends WPBakeryShortCode_Vc_Gitem_Zone {
public $zone_name = 'c';
}
classes/shortcodes/vc-row-inner.php 0000644 00000000633 15121635561 0013424 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-row.php' );
/**
* Class WPBakeryShortCode_Vc_Row_Inner
*/
class WPBakeryShortCode_Vc_Row_Inner extends WPBakeryShortCode_Vc_Row {
/**
* @param string $content
* @return string
* @throws \Exception
*/
public function template( $content = '' ) {
return $this->contentAdmin( $this->atts );
}
}
classes/shortcodes/vc-empty-space.php 0000644 00000000256 15121635561 0013734 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Empty_space
*/
class WPBakeryShortCode_Vc_Empty_Space extends WPBakeryShortCode {
}
classes/shortcodes/vc-gitem-post-title.php 0000644 00000001107 15121635561 0014710 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_title
*/
class WPBakeryShortCode_Vc_Gitem_Post_Title extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_post_data';
}
/**
* Get data_source attribute value
*
* @param array $atts - list of shortcode attributes
*
* @return string
*/
public function getDataSource( array $atts ) {
return 'post_title';
}
}
classes/shortcodes/vc-twitter.php 0000644 00000000246 15121635561 0013206 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Twitter
*/
class WPBakeryShortCode_Vc_Twitter extends WPBakeryShortCode {
}
classes/shortcodes/vc-flickr.php 0000644 00000000244 15121635561 0012754 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_flickr
*/
class WPBakeryShortCode_Vc_Flickr extends WPBakeryShortCode {
}
classes/shortcodes/vc-accordion-tab.php 0000644 00000010154 15121635561 0014210 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-tab.php' );
/**
* Class WPBakeryShortCode_VC_Accordion_tab
*/
class WPBakeryShortCode_VC_Accordion_Tab extends WPBakeryShortCode_VC_Tab {
/**
* @var string
*/
protected $controls_css_settings = 'tc vc_control-container';
/**
* @var array
*/
protected $controls_list = array(
'add',
'edit',
'clone',
'delete',
);
/**
* @var string
*/
public $nonDraggableClass = 'vc-non-draggable-container';
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$width = '';
// @codingStandardsIgnoreLine
extract( vc_map_get_attributes( $this->getShortcode(), $atts ) );
$output = '';
$column_controls = $this->getColumnControls( $this->settings( 'controls' ) );
$column_controls_bottom = $this->getColumnControls( 'add', 'bottom-controls' );
if ( 'column_14' === $width || '1/4' === $width ) {
$width = array( 'vc_col-sm-3' );
} elseif ( 'column_14-14-14-14' === $width ) {
$width = array(
'vc_col-sm-3',
'vc_col-sm-3',
'vc_col-sm-3',
'vc_col-sm-3',
);
} elseif ( 'column_13' === $width || '1/3' === $width ) {
$width = array( 'vc_col-sm-4' );
} elseif ( 'column_13-23' === $width ) {
$width = array(
'vc_col-sm-4',
'vc_col-sm-8',
);
} elseif ( 'column_13-13-13' === $width ) {
$width = array(
'vc_col-sm-4',
'vc_col-sm-4',
'vc_col-sm-4',
);
} elseif ( 'column_12' === $width || '1/2' === $width ) {
$width = array( 'vc_col-sm-6' );
} elseif ( 'column_12-12' === $width ) {
$width = array(
'vc_col-sm-6',
'vc_col-sm-6',
);
} elseif ( 'column_23' === $width || '2/3' === $width ) {
$width = array( 'vc_col-sm-8' );
} elseif ( 'column_34' === $width || '3/4' === $width ) {
$width = array( 'vc_col-sm-9' );
} elseif ( 'column_16' === $width || '1/6' === $width ) {
$width = array( 'vc_col-sm-2' );
} else {
$width = array( '' );
}
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
$count = count( $width );
for ( $i = 0; $i < $count; $i ++ ) {
$output .= '<div class="group ' . $sortable . '">';
$output .= '<h3><span class="tab-label"><%= params.title %></span></h3>';
$output .= '<div ' . $this->mainHtmlBlockParams( $width, $i ) . '>';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls );
$output .= '<div class="wpb_element_wrapper">';
$output .= '<div ' . $this->containerHtmlBlockParams( $width, $i ) . '>';
$output .= do_shortcode( shortcode_unautop( $content ) );
$output .= '</div>';
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$output .= $inner;
}
$output .= '</div>';
$output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls_bottom );
$output .= '</div>';
$output .= '</div>';
}
return $output;
}
/**
* @param $width
* @param $i
* @return string
*/
public function mainHtmlBlockParams( $width, $i ) {
return 'data-element_type="' . esc_attr( $this->settings['base'] ) . '" class=" wpb_' . esc_attr( $this->settings['base'] ) . '"' . $this->customAdminBlockParams();
}
/**
* @param $width
* @param $i
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="wpb_column_container vc_container_for_children"';
}
/**
* @param $title
* @return string
*/
protected function outputTitle( $title ) {
return '';
}
/**
* @return string
*/
public function customAdminBlockParams() {
return '';
}
}
classes/shortcodes/vc-gitem-post-date.php 0000644 00000001212 15121635561 0014501 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Date
*/
class WPBakeryShortCode_Vc_Gitem_Post_Date extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_post_data';
}
/**
* Get data_source attribute value
*
* @param array $atts - list of shortcode attributes
*
* @return string
*/
public function getDataSource( array $atts ) {
return isset( $atts['time'] ) && 'yes' === $atts['time'] ? 'post_datetime' : 'post_date';
}
}
classes/shortcodes/vc-gitem-post-excerpt.php 0000644 00000001115 15121635561 0015240 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Post_Excerpt
*/
class WPBakeryShortCode_Vc_Gitem_Post_Excerpt extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_gitem_post_data';
}
/**
* Get data_source attribute value
*
* @param array $atts - list of shortcode attributes
*
* @return string
*/
public function getDataSource( array $atts ) {
return 'post_excerpt';
}
}
classes/shortcodes/vc-tab.php 0000644 00000003673 15121635561 0012261 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
define( 'TAB_TITLE', esc_attr__( 'Tab', 'js_composer' ) );
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-column.php' );
/**
* Class WPBakeryShortCode_Vc_Tab
*/
class WPBakeryShortCode_Vc_Tab extends WPBakeryShortCode_Vc_Column {
protected $controls_css_settings = 'tc vc_control-container';
protected $controls_list = array(
'add',
'edit',
'clone',
'delete',
);
protected $controls_template_file = 'editors/partials/backend_controls_tab.tpl.php';
/**
* @return string
*/
public function customAdminBlockParams() {
return ' id="tab-' . $this->atts['tab_id'] . '"';
}
/**
* @param $width
* @param $i
* @return string
* @throws \Exception
*/
public function mainHtmlBlockParams( $width, $i ) {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass );
return 'data-element_type="' . $this->settings['base'] . '" class="wpb_' . $this->settings['base'] . ' ' . $sortable . ' wpb_content_holder"' . $this->customAdminBlockParams();
}
/**
* @param $width
* @param $i
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="wpb_column_container vc_container_for_children"';
}
/**
* @param $controls
* @param string $extended_css
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls, $extended_css = '' ) {
return $this->getColumnControlsModular( $extended_css );
}
}
/**
* @param $settings
* @param $value
*
* @return string
* @since 4.4
*/
function vc_tab_id_settings_field( $settings, $value ) {
return sprintf( '<div class="vc_tab_id_block"><input name="%s" class="wpb_vc_param_value wpb-textinput %s %s_field" type="hidden" value="%s" /><label>%s</label></div>', $settings['param_name'], $settings['param_name'], $settings['type'], $value, $value );
}
vc_add_shortcode_param( 'tab_id', 'vc_tab_id_settings_field' );
classes/shortcodes/vc-icon.php 0000644 00000000256 15121635561 0012435 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Icon
* @since 4.4
*/
class WPBakeryShortCode_Vc_Icon extends WPBakeryShortCode {
}
classes/shortcodes/vc-row.php 0000644 00000021064 15121635561 0012314 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder row
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Row extends WPBakeryShortCode {
protected $predefined_atts = array(
'el_class' => '',
);
public $nonDraggableClass = 'vc-non-draggable-row';
/**
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
$this->shortcodeScripts();
}
protected function shortcodeScripts() {
wp_register_script( 'vc_jquery_skrollr_js', vc_asset_url( 'lib/bower/skrollr/dist/skrollr.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_youtube_iframe_api_js', 'https://www.youtube.com/iframe_api', array(), WPB_VC_VERSION, true );
}
/**
* @param $atts
* @param null $content
* @return mixed|string
*/
protected function content( $atts, $content = null ) {
$prefix = '';
return $prefix . $this->loadTemplate( $atts, $content );
}
/**
* This returs block controls
*/
public function getLayoutsControl() {
global $vc_row_layouts;
$controls_layout = '<span class="vc_row_layouts vc_control">';
foreach ( $vc_row_layouts as $layout ) {
$controls_layout .= '<a class="vc_control-set-column set_columns" data-cells="' . $layout['cells'] . '" data-cells-mask="' . $layout['mask'] . '" title="' . $layout['title'] . '"><i class="vc-composer-icon vc-c-icon-' . $layout['icon_class'] . '"></i></a> ';
}
$controls_layout .= '<br/><a class="vc_control-set-column set_columns custom_columns" data-cells="custom" data-cells-mask="custom" title="' . esc_attr__( 'Custom layout', 'js_composer' ) . '">' . esc_html__( 'Custom', 'js_composer' ) . '</a> ';
$controls_layout .= '</span>';
return $controls_layout;
}
/**
* @param $controls
* @param string $extended_css
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls, $extended_css = '' ) {
$output = '<div class="vc_controls vc_controls-row controls_row vc_clearfix">';
$controls_end = '</div>';
// Create columns
$controls_layout = $this->getLayoutsControl();
$controls_move = ' <a class="vc_control column_move vc_column-move" href="#" title="' . esc_attr__( 'Drag row to reorder', 'js_composer' ) . '" data-vc-control="move"><i class="vc-composer-icon vc-c-icon-dragndrop"></i></a>';
$moveAccess = vc_user_access()->part( 'dragndrop' )->checkStateAny( true, null )->get();
if ( ! $moveAccess ) {
$controls_move = '';
}
$controls_add = ' <a class="vc_control column_add vc_column-add" href="#" title="' . esc_attr__( 'Add column', 'js_composer' ) . '" data-vc-control="add"><i class="vc-composer-icon vc-c-icon-add"></i></a>';
$controls_delete = '<a class="vc_control column_delete vc_column-delete" href="#" title="' . esc_attr__( 'Delete this row', 'js_composer' ) . '" data-vc-control="delete"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>';
$controls_edit = ' <a class="vc_control column_edit vc_column-edit" href="#" title="' . esc_attr__( 'Edit this row', 'js_composer' ) . '" data-vc-control="edit"><i class="vc-composer-icon vc-c-icon-mode_edit"></i></a>';
$controls_clone = ' <a class="vc_control column_clone vc_column-clone" href="#" title="' . esc_attr__( 'Clone this row', 'js_composer' ) . '" data-vc-control="clone"><i class="vc-composer-icon vc-c-icon-content_copy"></i></a>';
$controls_toggle = ' <a class="vc_control column_toggle vc_column-toggle" href="#" title="' . esc_attr__( 'Toggle row', 'js_composer' ) . '" data-vc-control="toggle"><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></a>';
$editAccess = vc_user_access_check_shortcode_edit( $this->shortcode );
$allAccess = vc_user_access_check_shortcode_all( $this->shortcode );
if ( is_array( $controls ) && ! empty( $controls ) ) {
foreach ( $controls as $control ) {
$control_var = 'controls_' . $control;
if ( ( $editAccess && 'edit' === $control ) || $allAccess ) {
if ( isset( ${$control_var} ) ) {
$output .= ${$control_var};
}
}
}
$output .= $controls_end;
} elseif ( is_string( $controls ) ) {
$control_var = 'controls_' . $controls;
if ( ( $editAccess && 'edit' === $controls ) || $allAccess ) {
if ( isset( ${$control_var} ) ) {
$output .= ${$control_var} . $controls_end;
}
}
} else {
$row_edit_clone_delete = '<span class="vc_row_edit_clone_delete">';
if ( $allAccess ) {
$row_edit_clone_delete .= $controls_delete . $controls_clone . $controls_edit;
} elseif ( $editAccess ) {
$row_edit_clone_delete .= $controls_edit;
}
$row_edit_clone_delete .= $controls_toggle;
$row_edit_clone_delete .= '</span>';
if ( $allAccess ) {
$output .= '<div>' . $controls_move . $controls_layout . $controls_add . '</div>' . $row_edit_clone_delete . $controls_end;
} elseif ( $editAccess ) {
$output .= $row_edit_clone_delete . $controls_end;
} else {
$output .= $row_edit_clone_delete . $controls_end;
}
}
return $output;
}
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$atts = shortcode_atts( $this->predefined_atts, $atts );
$output = '';
$column_controls = $this->getColumnControls( $this->settings( 'controls' ) );
$output .= '<div data-element_type="' . $this->settings['base'] . '" class="' . $this->cssAdminClass() . '">';
$output .= str_replace( '%column_size%', 1, $column_controls );
$output .= '<div class="wpb_element_wrapper">';
$output .= '<div class="vc_row vc_row-fluid wpb_row_container vc_container_for_children">';
if ( '' === $content && ! empty( $this->settings['default_content_in_template'] ) ) {
$output .= do_shortcode( shortcode_unautop( $this->settings['default_content_in_template'] ) );
} else {
$output .= do_shortcode( shortcode_unautop( $content ) );
}
$output .= '</div>';
if ( isset( $this->settings['params'] ) ) {
$inner = '';
foreach ( $this->settings['params'] as $param ) {
if ( ! isset( $param['param_name'] ) ) {
continue;
}
$param_value = isset( $atts[ $param['param_name'] ] ) ? $atts[ $param['param_name'] ] : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$inner .= $this->singleParamHtmlHolder( $param, $param_value );
}
$output .= $inner;
}
$output .= '</div>';
$output .= '</div>';
return $output;
}
/**
* @return string
* @throws \Exception
*/
public function cssAdminClass() {
$sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? ' wpb_sortable' : ' ' . $this->nonDraggableClass );
return 'wpb_' . $this->settings['base'] . $sortable . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $this->settings['class'] : '' );
}
/**
* @return string
* @deprecated 4.5 - due to it is not used anywhere? 4.5
* @typo Bock - Block
*/
public function customAdminBockParams() {
// this function is depreacted
return '';
}
/**
* @param string $bg_image
* @param string $bg_color
* @param string $bg_image_repeat
* @param string $font_color
* @param string $padding
* @param string $margin_bottom
*
* @return string
* @deprecated 4.5
*
*/
public function buildStyle( $bg_image = '', $bg_color = '', $bg_image_repeat = '', $font_color = '', $padding = '', $margin_bottom = '' ) {
// this function is deprecated
$has_image = false;
$style = '';
$image_url = wp_get_attachment_url( $bg_image );
if ( $image_url ) {
$has_image = true;
$style .= 'background-image: url(' . $image_url . ');';
}
if ( ! empty( $bg_color ) ) {
$style .= vc_get_css_color( 'background-color', $bg_color );
}
if ( ! empty( $bg_image_repeat ) && $has_image ) {
if ( 'cover' === $bg_image_repeat ) {
$style .= 'background-repeat:no-repeat;background-size: cover;';
} elseif ( 'contain' === $bg_image_repeat ) {
$style .= 'background-repeat:no-repeat;background-size: contain;';
} elseif ( 'no-repeat' === $bg_image_repeat ) {
$style .= 'background-repeat: no-repeat;';
}
}
if ( ! empty( $font_color ) ) {
$style .= vc_get_css_color( 'color', $font_color );
}
if ( '' !== $padding ) {
$style .= 'padding: ' . ( preg_match( '/(px|em|\%|pt|cm)$/', $padding ) ? $padding : $padding . 'px' ) . ';';
}
if ( '' !== $margin_bottom ) {
$style .= 'margin-bottom: ' . ( preg_match( '/(px|em|\%|pt|cm)$/', $margin_bottom ) ? $margin_bottom : $margin_bottom . 'px' ) . ';';
}
return empty( $style ) ? '' : ' style="' . esc_attr( $style ) . '"';
}
}
classes/shortcodes/vc-googleplus.php 0000644 00000002557 15121635561 0013673 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_GooglePlus
*/
class WPBakeryShortCode_Vc_GooglePlus extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
* @return string
* @throws \Exception
*/
protected function contentInline( $atts, $content = null ) {
/**
* Shortcode attributes
* @var $atts
* @var $type
* @var $annotation
* @var $widget_width
* @var $css
* @var $css_animation
* Shortcode class
* @var WPBakeryShortCode_Vc_GooglePlus $this
*/
$type = $annotation = $widget_width = $css = $css_animation = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
if ( strlen( $type ) === 0 ) {
$type = 'standard';
}
if ( strlen( $annotation ) === 0 ) {
$annotation = 'bubble';
}
$css = isset( $atts['css'] ) ? $atts['css'] : '';
$el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
$class_to_filter = 'wpb_googleplus vc_social-placeholder wpb_content_element vc_socialtype-' . $type;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
return '<div class="' . esc_attr( $css_class ) . '"></div>';
}
}
classes/shortcodes/vc-tabs.php 0000644 00000007063 15121635561 0012441 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Tabs
*/
class WPBakeryShortCode_Vc_Tabs extends WPBakeryShortCode {
public static $filter_added = false;
protected $controls_css_settings = 'out-tc vc_controls-content-widget';
protected $controls_list = array(
'edit',
'clone',
'delete',
);
/**
* WPBakeryShortCode_Vc_Tabs constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
if ( ! self::$filter_added ) {
add_filter( 'vc_inline_template_content', array(
$this,
'setCustomTabId',
) );
self::$filter_added = true;
}
}
/**
* @param $atts
* @param null $content
* @return mixed|string
* @throws \Exception
*/
public function contentAdmin( $atts, $content = null ) {
$width = $custom_markup = '';
$shortcode_attributes = array( 'width' => '1/1' );
foreach ( $this->settings['params'] as $param ) {
if ( 'content' !== $param['param_name'] ) {
$shortcode_attributes[ $param['param_name'] ] = isset( $param['value'] ) ? $param['value'] : null;
} elseif ( 'content' === $param['param_name'] && null === $content ) {
$content = $param['value'];
}
}
extract( shortcode_atts( $shortcode_attributes, $atts ) );
// Extract tab titles
preg_match_all( '/vc_tab title="([^\"]+)"(\stab_id\=\"([^\"]+)\"){0,1}/i', $content, $matches, PREG_OFFSET_CAPTURE );
$tab_titles = array();
if ( isset( $matches[0] ) ) {
$tab_titles = $matches[0];
}
$tmp = '';
if ( count( $tab_titles ) ) {
$tmp .= '<ul class="clearfix tabs_controls">';
foreach ( $tab_titles as $tab ) {
preg_match( '/title="([^\"]+)"(\stab_id\=\"([^\"]+)\"){0,1}/i', $tab[0], $tab_matches, PREG_OFFSET_CAPTURE );
if ( isset( $tab_matches[1][0] ) ) {
$tmp .= '<li><a href="#tab-' . ( isset( $tab_matches[3][0] ) ? $tab_matches[3][0] : sanitize_title( $tab_matches[1][0] ) ) . '">' . $tab_matches[1][0] . '</a></li>';
}
}
$tmp .= '</ul>' . "\n";
}
$elem = $this->getElementHolder( $width );
$iner = '';
foreach ( $this->settings['params'] as $param ) {
$param_value = isset( ${$param['param_name']} ) ? ${$param['param_name']} : '';
if ( is_array( $param_value ) ) {
// Get first element from the array
reset( $param_value );
$first_key = key( $param_value );
$param_value = $param_value[ $first_key ];
}
$iner .= $this->singleParamHtmlHolder( $param, $param_value );
}
if ( isset( $this->settings['custom_markup'] ) && '' !== $this->settings['custom_markup'] ) {
if ( '' !== $content ) {
$custom_markup = str_ireplace( '%content%', $tmp . $content, $this->settings['custom_markup'] );
} elseif ( '' === $content && isset( $this->settings['default_content_in_template'] ) && '' !== $this->settings['default_content_in_template'] ) {
$custom_markup = str_ireplace( '%content%', $this->settings['default_content_in_template'], $this->settings['custom_markup'] );
} else {
$custom_markup = str_ireplace( '%content%', '', $this->settings['custom_markup'] );
}
$iner .= do_shortcode( $custom_markup );
}
$elem = str_ireplace( '%wpb_element_content%', $iner, $elem );
$output = $elem;
return $output;
}
/**
* @return string
*/
public function getTabTemplate() {
return '<div class="wpb_template">' . do_shortcode( '[vc_tab title="Tab" tab_id=""][/vc_tab]' ) . '</div>';
}
/**
* @param $content
* @return string|string[]|null
*/
public function setCustomTabId( $content ) {
return preg_replace( '/tab\_id\=\"([^\"]+)\"/', 'tab_id="$1-' . time() . '"', $content );
}
}
classes/shortcodes/vc-tta-accordion.php 0000644 00000026774 15121635561 0014251 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Tta_Accordion
*/
class WPBakeryShortCode_Vc_Tta_Accordion extends WPBakeryShortCodesContainer {
protected $controls_css_settings = 'out-tc vc_controls-content-widget';
protected $controls_list = array(
'add',
'edit',
'clone',
'delete',
);
protected $template_vars = array();
public $layout = 'accordion';
protected $content;
public $activeClass = 'vc_active';
/**
* @var WPBakeryShortCode_Vc_Tta_Section
*/
protected $sectionClass;
public $nonDraggableClass = 'vc-non-draggable-container';
/**
* @return mixed|string
*/
public function getFileName() {
return 'vc_tta_global';
}
/**
* @return string
*/
public function containerContentClass() {
return 'vc_container_for_children vc_clearfix';
}
/**
* @param $atts
* @param $content
*
*/
public function resetVariables( $atts, $content ) {
$this->atts = $atts;
$this->content = $content;
$this->template_vars = array();
}
/**
* @return bool
* @throws \Exception
*/
public function setGlobalTtaInfo() {
$sectionClass = visual_composer()->getShortCode( 'vc_tta_section' )->shortcodeClass();
$this->sectionClass = $sectionClass;
/** @var WPBakeryShortCode_Vc_Tta_Section $sectionClass */
if ( is_object( $sectionClass ) ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Section' );
WPBakeryShortCode_Vc_Tta_Section::$tta_base_shortcode = $this;
WPBakeryShortCode_Vc_Tta_Section::$self_count = 0;
WPBakeryShortCode_Vc_Tta_Section::$section_info = array();
return true;
}
return false;
}
/**
* Override default getColumnControls to make it "simple"(blue), as single element has
*
* @param string $controls
* @param string $extended_css
*
* @return string
* @throws \Exception
*/
public function getColumnControls( $controls = 'full', $extended_css = '' ) {
// we don't need containers bottom-controls for tabs
if ( 'bottom-controls' === $extended_css ) {
return '';
}
$column_controls = $this->getColumnControlsModular();
return $output = $column_controls;
}
/**
* @return string
*/
public function getTtaContainerClasses() {
$classes = array();
$classes[] = 'vc_tta-container';
return implode( ' ', apply_filters( 'vc_tta_container_classes', array_filter( $classes ), $this->getAtts() ) );
}
/**
* @return string
*/
public function getTtaGeneralClasses() {
$classes = array();
$classes[] = 'vc_general';
$classes[] = 'vc_tta';
$classes[] = 'vc_tta-' . $this->layout;
$classes[] = $this->getTemplateVariable( 'color' );
$classes[] = $this->getTemplateVariable( 'style' );
$classes[] = $this->getTemplateVariable( 'shape' );
$classes[] = $this->getTemplateVariable( 'spacing' );
$classes[] = $this->getTemplateVariable( 'gap' );
$classes[] = $this->getTemplateVariable( 'c_align' );
$classes[] = $this->getTemplateVariable( 'no_fill' );
if ( isset( $this->atts['collapsible_all'] ) && 'true' === $this->atts['collapsible_all'] ) {
$classes[] = 'vc_tta-o-all-clickable';
}
$pagination = isset( $this->atts['pagination_style'] ) ? trim( $this->atts['pagination_style'] ) : false;
if ( $pagination && 'none' !== $pagination && strlen( $pagination ) > 0 ) {
$classes[] = 'vc_tta-has-pagination';
}
/**
* @since 4.6.2
*/
if ( isset( $this->atts['el_class'] ) ) {
$classes[] = $this->getExtraClass( $this->atts['el_class'] );
}
return implode( ' ', apply_filters( 'vc_tta_accordion_general_classes', array_filter( $classes ), $this->getAtts() ) );
}
/**
* @return string
*/
public function getTtaPaginationClasses() {
$classes = array();
$classes[] = 'vc_general';
$classes[] = 'vc_pagination';
if ( isset( $this->atts['pagination_style'] ) && strlen( $this->atts['pagination_style'] ) > 0 ) {
$chunks = explode( '-', $this->atts['pagination_style'] );
$classes[] = 'vc_pagination-style-' . $chunks[0];
$classes[] = 'vc_pagination-shape-' . $chunks[1];
}
if ( isset( $this->atts['pagination_color'] ) && strlen( $this->atts['pagination_color'] ) > 0 ) {
$classes[] = 'vc_pagination-color-' . $this->atts['pagination_color'];
}
return implode( ' ', $classes );
}
/**
* @return string
*/
public function getWrapperAttributes() {
$attributes = array();
$attributes[] = 'class="' . esc_attr( $this->getTtaContainerClasses() ) . '"';
$attributes[] = 'data-vc-action="' . ( 'true' === $this->atts['collapsible_all'] ? 'collapseAll' : 'collapse' ) . '"';
$autoplay = isset( $this->atts['autoplay'] ) ? trim( $this->atts['autoplay'] ) : false;
if ( $autoplay && 'none' !== $autoplay && intval( $autoplay ) > 0 ) {
$autoplayAttr = wp_json_encode( array(
'delay' => intval( $autoplay ) * 1000,
) );
$attributes[] = 'data-vc-tta-autoplay="' . esc_attr( $autoplayAttr ) . '"';
}
if ( ! empty( $this->atts['el_id'] ) ) {
$attributes[] = 'id="' . esc_attr( $this->atts['el_id'] ) . '"';
}
return implode( ' ', $attributes );
}
/**
* @param $string
* @return mixed|string
*/
public function getTemplateVariable( $string ) {
if ( isset( $this->template_vars[ $string ] ) ) {
return $this->template_vars[ $string ];
} elseif ( method_exists( $this, 'getParam' . vc_studly( $string ) ) ) {
$this->template_vars[ $string ] = $this->{'getParam' . vc_studly( $string )}( $this->atts, $this->content );
return $this->template_vars[ $string ];
}
return '';
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamColor( $atts, $content ) {
if ( isset( $atts['color'] ) && strlen( $atts['color'] ) > 0 ) {
return 'vc_tta-color-' . esc_attr( $atts['color'] );
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamStyle( $atts, $content ) {
if ( isset( $atts['style'] ) && strlen( $atts['style'] ) > 0 ) {
return 'vc_tta-style-' . esc_attr( $atts['style'] );
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamTitle( $atts, $content ) {
if ( isset( $atts['title'] ) && strlen( $atts['title'] ) > 0 ) {
return '<h2>' . $atts['title'] . '</h2>';
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamContent( $atts, $content ) {
$panelsContent = wpb_js_remove_wpautop( $content );
if ( isset( $atts['c_icon'] ) && strlen( $atts['c_icon'] ) > 0 ) {
$isPageEditable = vc_is_page_editable();
if ( ! $isPageEditable ) {
$panelsContent = str_replace( '{{{ control-icon }}}', '<i class="vc_tta-controls-icon vc_tta-controls-icon-' . $atts['c_icon'] . '"></i>', $panelsContent );
} else {
$panelsContent = str_replace( '{{{ control-icon }}}', '<i class="vc_tta-controls-icon" data-vc-tta-controls-icon="' . $atts['c_icon'] . '"></i>', $panelsContent );
}
} else {
$panelsContent = str_replace( '{{{ control-icon }}}', '', $panelsContent );
}
return $panelsContent;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamShape( $atts, $content ) {
if ( isset( $atts['shape'] ) && strlen( $atts['shape'] ) > 0 ) {
return 'vc_tta-shape-' . $atts['shape'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string
*/
public function getParamSpacing( $atts, $content ) {
if ( isset( $atts['spacing'] ) && strlen( $atts['spacing'] ) > 0 ) {
return 'vc_tta-spacing-' . $atts['spacing'];
}
// In case if no spacing set we need to append extra class
return 'vc_tta-o-shape-group';
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamGap( $atts, $content ) {
if ( isset( $atts['gap'] ) && strlen( $atts['gap'] ) > 0 ) {
return 'vc_tta-gap-' . $atts['gap'];
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamNoFill( $atts, $content ) {
if ( isset( $atts['no_fill'] ) && 'true' === $atts['no_fill'] ) {
return 'vc_tta-o-no-fill';
}
return null;
}
/**
* @param $atts
* @param $content
*
* @return string|null
*/
public function getParamCAlign( $atts, $content ) {
if ( isset( $atts['c_align'] ) && strlen( $atts['c_align'] ) > 0 ) {
return 'vc_tta-controls-align-' . $atts['c_align'];
}
return null;
}
/**
* Accordion doesn't have pagination
*
* @param $atts
* @param $content
*
* @return null
*/
public function getParamPaginationTop( $atts, $content ) {
return null;
}
/**
* Accordion doesn't have pagination
*
* @param $atts
* @param $content
*
* @return null
*/
public function getParamPaginationBottom( $atts, $content ) {
return null;
}
/**
* Get currently active section (from $atts)
*
* @param $atts
* @param bool $strict_bounds If true, check for min/max bounds
*
* @return int nth position (one-based) of active section
*/
public function getActiveSection( $atts, $strict_bounds = false ) {
$active_section = intval( $atts['active_section'] );
if ( $strict_bounds ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Section' );
if ( $active_section < 1 ) {
$active_section = 1;
} elseif ( $active_section > WPBakeryShortCode_Vc_Tta_Section::$self_count ) {
$active_section = WPBakeryShortCode_Vc_Tta_Section::$self_count;
}
}
return $active_section;
}
/**
* @param $atts
* @param $content
*
* @return string
*/
public function getParamPaginationList( $atts, $content ) {
if ( empty( $atts['pagination_style'] ) ) {
return null;
}
$isPageEditabe = vc_is_page_editable();
$html = array();
$html[] = '<ul class="' . $this->getTtaPaginationClasses() . '">';
if ( ! $isPageEditabe ) {
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Tta_Section' );
foreach ( WPBakeryShortCode_Vc_Tta_Section::$section_info as $nth => $section ) {
$active_section = $this->getActiveSection( $atts, false );
$classes = array( 'vc_pagination-item' );
if ( ( $nth + 1 ) === $active_section ) {
$classes[] = $this->activeClass;
}
$a_html = '<a href="#' . $section['tab_id'] . '" class="vc_pagination-trigger" data-vc-tabs data-vc-container=".vc_tta"></a>';
$html[] = '<li class="' . implode( ' ', $classes ) . '" data-vc-tab>' . $a_html . '</li>';
}
}
$html[] = '</ul>';
return implode( '', $html );
}
public function enqueueTtaStyles() {
wp_register_style( 'vc_tta_style', vc_asset_url( 'css/js_composer_tta.min.css' ), false, WPB_VC_VERSION );
wp_enqueue_style( 'vc_tta_style' );
}
public function enqueueTtaScript() {
wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_tta_autoplay_script', vc_asset_url( 'lib/vc-tta-autoplay/vc-tta-autoplay.min.js' ), array( 'vc_accordion_script' ), WPB_VC_VERSION, true );
wp_enqueue_script( 'vc_accordion_script' );
if ( ! vc_is_page_editable() ) {
wp_enqueue_script( 'vc_tta_autoplay_script' );
}
}
/**
* Override default outputTitle (also Icon). To remove anything, also Icon.
*
* @param $title - just for strict standards
*
* @return string
*/
protected function outputTitle( $title ) {
return '';
}
/**
* Check is allowed to add another element inside current element.
*
* @return bool
* @throws \Exception
* @since 4.8
*/
public function getAddAllowed() {
return vc_user_access_check_shortcode_all( 'vc_tta_section' );
}
}
classes/shortcodes/vc-gitem-image.php 0000644 00000000722 15121635561 0013670 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-custom-heading.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Image
*/
class WPBakeryShortCode_Vc_Gitem_Image extends WPBakeryShortCode_Vc_Gitem_Post_Data {
/**
* Get data_source attribute value
*
* @param array $atts - list of shortcode attributes
*
* @return string
*/
public function getDataSource( array $atts ) {
return 'post_image';
}
}
classes/shortcodes/vc-gitem-animated-block.php 0000644 00000004000 15121635561 0015451 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem.php' );
/**
* Class WPBakeryShortCode_Vc_Gitem_Animated_Block
*/
class WPBakeryShortCode_Vc_Gitem_Animated_Block extends WPBakeryShortCode_Vc_Gitem {
protected static $animations = array();
/**
* @return string
*/
public function itemGrid() {
$output = '';
$output .= '<div class="vc_gitem-animated-block-content-controls">' . '<ul class="vc_gitem-tabs vc_clearfix" data-vc-gitem-animated-block="tabs">' . '</ul>' . '</div>';
$output .= '' . '<div class="vc_gitem-zone-tab vc_clearfix" data-vc-gitem-animated-block="add-a"></div>' . '<div class="vc_gitem-zone-tab vc_clearfix" data-vc-gitem-animated-block="add-b"></div>';
return $output;
}
/**
* @param $width
* @param $i
* @return string
*/
public function containerHtmlBlockParams( $width, $i ) {
return 'class="vc_gitem-animated-block-content"';
}
/**
* @return array
*/
public static function animations() {
return array(
esc_html__( 'Single block (no animation)', 'js_composer' ) => '',
esc_html__( 'Double block (no animation)', 'js_composer' ) => 'none',
esc_html__( 'Fade in', 'js_composer' ) => 'fadeIn',
esc_html__( 'Scale in', 'js_composer' ) => 'scaleIn',
esc_html__( 'Scale in with rotation', 'js_composer' ) => 'scaleRotateIn',
esc_html__( 'Blur out', 'js_composer' ) => 'blurOut',
esc_html__( 'Blur scale out', 'js_composer' ) => 'blurScaleOut',
esc_html__( 'Slide in from left', 'js_composer' ) => 'slideInRight',
esc_html__( 'Slide in from right', 'js_composer' ) => 'slideInLeft',
esc_html__( 'Slide bottom', 'js_composer' ) => 'slideBottom',
esc_html__( 'Slide top', 'js_composer' ) => 'slideTop',
esc_html__( 'Vertical flip in with fade', 'js_composer' ) => 'flipFadeIn',
esc_html__( 'Horizontal flip in with fade', 'js_composer' ) => 'flipHorizontalFadeIn',
esc_html__( 'Go top', 'js_composer' ) => 'goTop20',
esc_html__( 'Go bottom', 'js_composer' ) => 'goBottom20',
);
}
}
classes/shortcodes/vc-progress-bar.php 0000644 00000002325 15121635561 0014112 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Progress_Bar
*/
class WPBakeryShortCode_Vc_Progress_Bar extends WPBakeryShortCode {
/**
* @param $atts
* @return mixed
*/
public static function convertAttributesToNewProgressBar( $atts ) {
if ( isset( $atts['values'] ) && strlen( $atts['values'] ) > 0 ) {
$values = vc_param_group_parse_atts( $atts['values'] );
if ( ! is_array( $values ) ) {
$temp = explode( ',', $atts['values'] );
$paramValues = array();
foreach ( $temp as $value ) {
$data = explode( '|', $value );
$colorIndex = 2;
$newLine = array();
$newLine['value'] = isset( $data[0] ) ? $data[0] : 0;
$newLine['label'] = isset( $data[1] ) ? $data[1] : '';
if ( isset( $data[1] ) && preg_match( '/^\d{1,3}\%$/', $data[1] ) ) {
$colorIndex ++;
$newLine['value'] = (float) str_replace( '%', '', $data[1] );
$newLine['label'] = isset( $data[2] ) ? $data[2] : '';
}
if ( isset( $data[ $colorIndex ] ) ) {
$newLine['customcolor'] = $data[ $colorIndex ];
}
$paramValues[] = $newLine;
}
$atts['values'] = rawurlencode( wp_json_encode( $paramValues ) );
}
}
return $atts;
}
}
classes/shortcodes/vc-gitem-zone.php 0000644 00000000317 15121635561 0013561 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Gitem_Zone
*/
class WPBakeryShortCode_Vc_Gitem_Zone extends WPBakeryShortCodesContainer {
public $zone_name = '';
}
classes/shortcodes/vc-cta-button2.php 0000644 00000000327 15121635561 0013646 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcodes
*
* @package WPBakeryPageBuilder
*
*/
class WPBakeryShortCode_Vc_Cta_Button2 extends WPBakeryShortCode {
}
classes/shortcodes/vc-media-grid.php 0000644 00000007366 15121635561 0013520 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-basic-grid.php' );
/**
* Class WPBakeryShortCode_Vc_Media_Grid
*/
class WPBakeryShortCode_Vc_Media_Grid extends WPBakeryShortCode_Vc_Basic_Grid {
/**
* WPBakeryShortCode_Vc_Media_Grid constructor.
* @param $settings
*/
public function __construct( $settings ) {
parent::__construct( $settings );
add_filter( $this->shortcode . '_items_list', array(
$this,
'setItemsIfEmpty',
) );
}
/**
* @return mixed|string
*/
protected function getFileName() {
return 'vc_basic_grid';
}
/**
* @param $max_items
*/
protected function setPagingAll( $max_items ) {
$this->atts['items_per_page'] = $this->atts['query_items_per_page'] = apply_filters( 'vc_basic_grid_items_per_page_all_max_items', self::$default_max_items );
}
/**
* @param $atts
* @return array
*/
public function buildQuery( $atts ) {
if ( empty( $atts['include'] ) ) {
$atts['include'] = - 1;
}
$settings = array(
'include' => $atts['include'],
'posts_per_page' => apply_filters( 'vc_basic_grid_max_items', self::$default_max_items ),
'offset' => 0,
'post_type' => 'attachment',
'orderby' => 'post__in',
);
return $settings;
}
/**
* @param $items
* @return string
*/
public function setItemsIfEmpty( $items ) {
if ( empty( $items ) ) {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php' );
$grid_item = new Vc_Grid_Item();
$grid_item->setGridAttributes( $this->atts );
$grid_item->shortcodes();
$item = '[vc_gitem]<img src="' . esc_url( vc_asset_url( 'vc/vc_gitem_image.png' ) ) . '">[/vc_gitem]';
$grid_item->parseTemplate( $item );
$items = str_repeat( $grid_item->renderItem( get_post( (int) vc_request_param( 'vc_post_id' ) ) ), 3 );
}
return $items;
}
/**
* @param $param
* @param $value
* @return string
*/
public function singleParamHtmlHolder( $param, $value ) {
$output = '';
// Compatibility fixes
// TODO: check $old_names & &new_names. Leftover from copypasting?
$old_names = array(
'yellow_message',
'blue_message',
'green_message',
'button_green',
'button_grey',
'button_yellow',
'button_blue',
'button_red',
'button_orange',
);
$new_names = array(
'alert-block',
'alert-info',
'alert-success',
'btn-success',
'btn',
'btn-info',
'btn-primary',
'btn-danger',
'btn-warning',
);
$value = str_ireplace( $old_names, $new_names, $value );
$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';
$type = isset( $param['type'] ) ? $param['type'] : '';
$class = isset( $param['class'] ) ? $param['class'] : '';
if ( isset( $param['holder'] ) && 'hidden' !== $param['holder'] ) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
if ( 'include' === $param_name ) {
$images_ids = empty( $value ) ? array() : explode( ',', trim( $value ) );
$output .= '<ul class="attachment-thumbnails' . ( empty( $images_ids ) ? ' image-exists' : '' ) . '" data-name="' . $param_name . '">';
foreach ( $images_ids as $image ) {
$img = wpb_getImageBySize( array(
'attach_id' => (int) $image,
'thumb_size' => 'thumbnail',
) );
$output .= ( $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" src="' . esc_url( vc_asset_url( 'vc/blank.gif' ) ) . '" class="attachment-thumbnail" alt="" title="" /></li>' );
}
$output .= '</ul>';
$output .= '<a href="#" class="column_edit_trigger' . ( ! empty( $images_ids ) ? ' image-exists' : '' ) . '">' . esc_html__( 'Add images', 'js_composer' ) . '</a>';
}
return $output;
}
}
classes/updaters/class-vc-updating-manager.php 0000644 00000012374 15121635561 0015511 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Manage update messages and Plugins info for VC in default WordPress plugins list.
*/
class Vc_Updating_Manager {
/**
* The plugin current version
*
* @var string
*/
public $current_version;
/**
* The plugin remote update path
*
* @var string
*/
public $update_path;
/**
* Plugin Slug (plugin_directory/plugin_file.php)
*
* @var string
*/
public $plugin_slug;
/**
* Plugin name (plugin_file)
*
* @var string
*/
public $slug;
/**
* Link to download VC.
* @var string
*/
protected $url = 'https://go.wpbakery.com/wpb-buy';
/**
* Initialize a new instance of the WordPress Auto-Update class
*
* @param string $current_version
* @param string $update_path
* @param string $plugin_slug
*/
public function __construct( $current_version, $update_path, $plugin_slug ) {
// Set the class public variables
$this->current_version = $current_version;
$this->update_path = $update_path;
$this->plugin_slug = $plugin_slug;
$t = explode( '/', $plugin_slug );
$this->slug = str_replace( '.php', '', $t[1] );
// define the alternative API for updating checking
add_filter( 'pre_set_site_transient_update_plugins', array(
$this,
'check_update',
) );
// Define the alternative response for information checking
add_filter( 'plugins_api', array(
$this,
'check_info',
), 10, 3 );
add_action( 'in_plugin_update_message-' . vc_plugin_name(), array(
$this,
'addUpgradeMessageLink',
) );
}
/**
* Add our self-hosted autoupdate plugin to the filter transient
*
* @param $transient
*
* @return object $ transient
*/
public function check_update( $transient ) {
// Extra check for 3rd plugins
if ( isset( $transient->response[ $this->plugin_slug ] ) ) {
return $transient;
}
// Get the remote version
$remote_version = $this->getRemote_version();
// If a newer version is available, add the update
if ( version_compare( $this->current_version, $remote_version, '<' ) ) {
$obj = new stdClass();
$obj->slug = $this->slug;
$obj->new_version = $remote_version;
$obj->plugin = $this->plugin_slug;
$obj->url = '';
$obj->package = vc_license()->isActivated();
$obj->name = 'WPBakery Page Builder';
$transient->response[ $this->plugin_slug ] = $obj;
}
return $transient;
}
/**
* Add our self-hosted description to the filter
*
* @param bool $false
* @param array $action
* @param object $arg
*
* @return bool|object
*/
public function check_info( $false, $action, $arg ) {
if ( isset( $arg->slug ) && $arg->slug === $this->slug ) {
$information = $this->getRemote_information();
$array_pattern = array(
'/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
'/^\n+|^[\t\s]*\n+/m',
'/\n/',
);
$array_replace = array(
'<h4>$2</h4>',
'</div><div>',
'</div><div>',
);
$information->name = 'WPBakery Page Builder';
$information->sections = (array) $information->sections;
$information->sections['changelog'] = '<div>' . preg_replace( $array_pattern, $array_replace, $information->sections['changelog'] ) . '</div>';
return $information;
}
return $false;
}
/**
* Return the remote version
*
* @return string $remote_version
*/
public function getRemote_version() {
// FIX SSL SNI
$filter_add = true;
if ( function_exists( 'curl_version' ) ) {
$version = curl_version();
if ( version_compare( $version['version'], '7.18', '>=' ) ) {
$filter_add = false;
}
}
if ( $filter_add ) {
add_filter( 'https_ssl_verify', '__return_false' );
}
$request = wp_remote_get( $this->update_path, array( 'timeout' => 30 ) );
if ( $filter_add ) {
remove_filter( 'https_ssl_verify', '__return_false' );
}
if ( ! is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
return $request['body'];
}
return false;
}
/**
* Get information about the remote version
*
* @return bool|object
*/
public function getRemote_information() {
// FIX SSL SNI
$filter_add = true;
if ( function_exists( 'curl_version' ) ) {
$version = curl_version();
if ( version_compare( $version['version'], '7.18', '>=' ) ) {
$filter_add = false;
}
}
if ( $filter_add ) {
add_filter( 'https_ssl_verify', '__return_false' );
}
$request = wp_remote_get( $this->update_path . 'information.json', array( 'timeout' => 30 ) );
if ( $filter_add ) {
remove_filter( 'https_ssl_verify', '__return_false' );
}
if ( ! is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {
return json_decode( $request['body'] );
}
return false;
}
/**
* Shows message on Wp plugins page with a link for updating from envato.
*/
public function addUpgradeMessageLink() {
$is_activated = vc_license()->isActivated();
if ( ! $is_activated ) {
$url = vc_updater()->getUpdaterUrl();
echo sprintf( ' ' . esc_html__( 'To receive automatic updates license activation is required. Please visit %ssettings%s to activate your WPBakery Page Builder.', 'js_composer' ), '<a href="' . esc_url( $url ) . '" target="_blank">', '</a>' ) . sprintf( ' <a href="https://go.wpbakery.com/faq-update-in-theme" target="_blank">%s</a>', esc_html__( 'Got WPBakery Page Builder in theme?', 'js_composer' ) );
}
}
}
classes/updaters/class-vc-updater.php 0000644 00000011540 15121635561 0013724 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder updater
*
* @package WPBakeryPageBuilder
*
*/
/**
* Vc updating manager.
*/
class Vc_Updater {
/**
* @var string
*/
protected $version_url = 'https://updates.wpbakery.com/';
/**
* Proxy URL that returns real download link
*
* @var string
*/
protected $download_link_url = 'https://support.wpbakery.com/updates/download-link';
/**
* @var bool
*/
protected $auto_updater;
public function init() {
add_filter( 'upgrader_pre_download', array(
$this,
'preUpgradeFilter',
), 10, 4 );
}
/**
* Setter for manager updater.
*
* @param Vc_Updating_Manager $updater
*/
public function setUpdateManager( Vc_Updating_Manager $updater ) {
$this->auto_updater = $updater;
}
/**
* Getter for manager updater.
*
* @return Vc_Updating_Manager|bool
*/
public function updateManager() {
return $this->auto_updater;
}
/**
* Get url for version validation
* @return string
*/
public function versionUrl() {
return $this->version_url;
}
/**
* Get unique, short-lived download link
*
* @return array|boolean JSON response or false if request failed
*/
public function getDownloadUrl() {
$url = $this->getUrl();
// FIX SSL SNI
$filter_add = true;
if ( function_exists( 'curl_version' ) ) {
$version = curl_version();
if ( version_compare( $version['version'], '7.18', '>=' ) ) {
$filter_add = false;
}
}
if ( $filter_add ) {
add_filter( 'https_ssl_verify', '__return_false' );
}
$response = wp_remote_get( $url, array( 'timeout' => 30 ) );
if ( $filter_add ) {
remove_filter( 'https_ssl_verify', '__return_false' );
}
if ( is_wp_error( $response ) ) {
return false;
}
return json_decode( $response['body'], true );
}
/**
* @return string
*/
protected function getUrl() {
$host = esc_url( vc_license()->getSiteUrl() );
$key = rawurlencode( vc_license()->getLicenseKey() );
$url = $this->download_link_url . '?product=vc&url=' . $host . '&key=' . $key . '&version=' . WPB_VC_VERSION;
return $url;
}
/**
* @return string|void
*/
public static function getUpdaterUrl() {
return vc_is_network_plugin() ? network_admin_url( 'admin.php?page=vc-updater' ) : admin_url( 'admin.php?page=vc-updater' );
}
/**
* Get link to newest VC
*
* @param $reply
* @param $package
* @param WP_Upgrader $updater
*
* @return mixed|string|WP_Error
*/
public function preUpgradeFilter( $reply, $package, $updater ) {
$condition1 = isset( $updater->skin->plugin ) && vc_plugin_name() === $updater->skin->plugin;
// Must use I18N otherwise France or other languages will not work
$condition2 = isset( $updater->skin->plugin_info ) && __( 'WPBakery Page Builder', 'js_composer' ) === $updater->skin->plugin_info['Name'];
if ( ! $condition1 && ! $condition2 ) {
return $reply;
}
$res = $updater->fs_connect( array( WP_CONTENT_DIR ) );
if ( ! $res ) {
return new WP_Error( 'no_credentials', esc_html__( "Error! Can't connect to filesystem", 'js_composer' ) );
}
if ( ! vc_license()->isActivated() ) {
if ( vc_is_as_theme() && vc_get_param( 'action' ) !== 'update-selected' ) {
return false;
}
$url = self::getUpdaterUrl();
return new WP_Error( 'no_credentials', sprintf( esc_html__( 'To receive automatic updates license activation is required. Please visit %sSettings%s to activate your WPBakery Page Builder.', 'js_composer' ), '<a href="' . esc_url( $url ) . '" target="_blank">', '</a>' ) . ' ' . sprintf( ' <a href="https://go.wpbakery.com/faq-update-in-theme" target="_blank">%s</a>', esc_html__( 'Got WPBakery Page Builder in theme?', 'js_composer' ) ) );
}
$updater->strings['downloading_package_url'] = esc_html__( 'Getting download link...', 'js_composer' );
$updater->skin->feedback( 'downloading_package_url' );
$response = $this->getDownloadUrl();
if ( ! $response ) {
return new WP_Error( 'no_credentials', esc_html__( 'Download link could not be retrieved', 'js_composer' ) );
}
if ( ! $response['status'] ) {
return new WP_Error( 'no_credentials', $response['error'] );
}
$updater->strings['downloading_package'] = esc_html__( 'Downloading package...', 'js_composer' );
$updater->skin->feedback( 'downloading_package' );
$downloaded_archive = download_url( $response['url'] );
if ( is_wp_error( $downloaded_archive ) ) {
return $downloaded_archive;
}
$plugin_directory_name = dirname( vc_plugin_name() );
// WP will use same name for plugin directory as archive name, so we have to rename it
if ( basename( $downloaded_archive, '.zip' ) !== $plugin_directory_name ) {
$new_archive_name = dirname( $downloaded_archive ) . '/' . $plugin_directory_name . time() . '.zip';
if ( rename( $downloaded_archive, $new_archive_name ) ) {
$downloaded_archive = $new_archive_name;
}
}
return $downloaded_archive;
}
}
classes/vendors/plugins/class-vc-vendor-layerslider.php 0000644 00000010460 15121635561 0017404 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* LayerSlider loader.
* Adds layerSlider shortcode to WPBakery Page Builder and fixes issue in frontend editor
*
* @since 4.3
*/
class Vc_Vendor_Layerslider {
/**
* @var int - used to detect id for layerslider in frontend
* @deprecated
*/
protected static $instanceIndex = 1;
/**
* Add layerslayer shortcode to WPBakery Page Builder, and add fix for ID in frontend editor
* @since 4.3
*/
public function load() {
add_action( 'vc_after_mapping', array(
$this,
'buildShortcode',
) );
}
/**
* Add shortcode and filters for layerslider id
* @since 4.3
*/
public function buildShortcode() {
vc_lean_map( 'layerslider_vc', array(
$this,
'addShortcodeSettings',
) );
if ( vc_is_page_editable() ) {
add_filter( 'layerslider_slider_init', array(
$this,
'setMarkupId',
), 10, 3 );
add_filter( 'layerslider_slider_markup', array(
$this,
'setMarkupId',
), 10, 3 );
}
}
/**
* @param $output
*
* @return string
* @since 4.3
*
*/
public function setId( $output ) {
return preg_replace( '/(layerslider_\d+)/', '$1_' . $_SERVER['REQUEST_TIME'], $output );
}
/**
* @param $markup
* @param $slider
* @param $id
* @return string
* @deprecated 5.2
* @since 4.3
*/
public function setMarkupId( $markup, $slider, $id ) {
return str_replace( $id, $id . '_' . $_SERVER['REQUEST_TIME'], $markup );
}
/**
* Mapping settings for lean method.
*
* @param $tag
*
* @return array
* @since 4.9
*
*/
public function addShortcodeSettings( $tag ) {
$use_old = class_exists( 'LS_Sliders' );
if ( ! class_exists( 'LS_Sliders' ) && defined( 'LS_ROOT_PATH' ) && false === strpos( LS_ROOT_PATH, '.php' ) ) {
include_once LS_ROOT_PATH . '/classes/class.ls.sliders.php';
$use_old = false;
}
if ( ! class_exists( 'LS_Sliders' ) ) {
// again check is needed if some problem inside file "class.ls.sliders.php
$use_old = true;
}
/**
* Filter to use old type of layerslider vendor.
* @since 4.4.2
*/
$use_old = apply_filters( 'vc_vendor_layerslider_old', $use_old ); // @since 4.4.2 hook to use old style return true.
if ( $use_old ) {
global $wpdb;
$ls = wp_cache_get( 'vc_vendor_layerslider_list' );
if ( empty( $ls ) ) {
// @codingStandardsIgnoreLine
$ls = $wpdb->get_results( '
SELECT id, name, date_c
FROM ' . $wpdb->prefix . "layerslider
WHERE flag_hidden = '0' AND flag_deleted = '0'
ORDER BY date_c ASC LIMIT 999
" );
wp_cache_add( 'vc_vendor_layerslider_list', $ls );
}
$layer_sliders = array();
if ( ! empty( $ls ) ) {
foreach ( $ls as $slider ) {
$layer_sliders[ $slider->name ] = $slider->id;
}
} else {
$layer_sliders[ esc_html__( 'No sliders found', 'js_composer' ) ] = 0;
}
} else {
/** @noinspection PhpUndefinedClassInspection */
$ls = LS_Sliders::find( array(
'limit' => 999,
'order' => 'ASC',
) );
$layer_sliders = array();
if ( ! empty( $ls ) ) {
foreach ( $ls as $slider ) {
$layer_sliders[ $slider['name'] ] = $slider['id'];
}
} else {
$layer_sliders[ esc_html__( 'No sliders found', 'js_composer' ) ] = 0;
}
}
return array(
'base' => $tag,
'name' => esc_html__( 'Layer Slider', 'js_composer' ),
'icon' => 'icon-wpb-layerslider',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place LayerSlider', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Widget title', 'js_composer' ),
'param_name' => 'title',
'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'LayerSlider ID', 'js_composer' ),
'param_name' => 'id',
'admin_label' => true,
'value' => $layer_sliders,
'save_always' => true,
'description' => esc_html__( 'Select your LayerSlider.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
);
}
}
classes/vendors/plugins/class-vc-vendor-woocommerce.php 0000644 00000156327 15121635561 0017421 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Vendor_Woocommerce
*
* @since 4.4
* @todo move to separate file and dir.
*/
class Vc_Vendor_Woocommerce {
protected static $product_fields_list = false;
protected static $order_fields_list = false;
/**
* @since 4.4
*/
public function load() {
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'vc_after_mapping', array(
$this,
'mapShortcodes',
) );
add_action( 'vc_backend_editor_render', array(
$this,
'enqueueJsBackend',
) );
add_action( 'vc_frontend_editor_render', array(
$this,
'enqueueJsFrontend',
) );
add_filter( 'vc_grid_item_shortcodes', array(
$this,
'mapGridItemShortcodes',
) );
add_action( 'vc_vendor_yoastseo_filter_results', array(
$this,
'yoastSeoCompatibility',
) );
add_filter( 'woocommerce_product_tabs', array(
$this,
'addContentTabPageEditable',
) );
add_filter( 'woocommerce_shop_manager_editable_roles', array(
$this,
'addShopManagerRoleToEditable',
) );
}
}
/**
* @param $rules
* @return array
*/
public function addShopManagerRoleToEditable( $rules ) {
$rules[] = 'shop_manager';
return array_unique( $rules );
}
/**
* @param $tabs
* @return mixed
*/
public function addContentTabPageEditable( $tabs ) {
if ( vc_is_page_editable() ) {
// Description tab - shows product content
$tabs['description'] = array(
'title' => esc_html__( 'Description', 'woocommerce' ),
'priority' => 10,
'callback' => 'woocommerce_product_description_tab',
);
}
return $tabs;
}
/**
* @since 4.4
*/
public function enqueueJsBackend() {
wp_enqueue_script( 'vc_vendor_woocommerce_backend', vc_asset_url( 'js/vendors/woocommerce.js' ), array( 'vc-backend-min-js' ), '1.0', true );
}
/**
* @since 4.4
*/
public function enqueueJsFrontend() {
wp_enqueue_script( 'vc_vendor_woocommerce_frontend', vc_asset_url( 'js/vendors/woocommerce.js' ), array( 'vc-frontend-editor-min-js' ), '1.0', true );
}
/**
* Add settings for shortcodes
*
* @param $tag
*
* @return array
* @since 4.9
*
*/
public function addShortcodeSettings( $tag ) {
$args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => false,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'taxonomy' => 'product_cat',
'pad_counts' => false,
);
$order_by_values = array(
'',
esc_html__( 'Date', 'js_composer' ) => 'date',
esc_html__( 'ID', 'js_composer' ) => 'ID',
esc_html__( 'Author', 'js_composer' ) => 'author',
esc_html__( 'Title', 'js_composer' ) => 'title',
esc_html__( 'Modified', 'js_composer' ) => 'modified',
esc_html__( 'Random', 'js_composer' ) => 'rand',
esc_html__( 'Comment count', 'js_composer' ) => 'comment_count',
esc_html__( 'Menu order', 'js_composer' ) => 'menu_order',
esc_html__( 'Menu order & title', 'js_composer' ) => 'menu_order title',
esc_html__( 'Include', 'js_composer' ) => 'include',
esc_html__( 'Custom post__in', 'js_composer' ) => 'post__in',
);
$order_way_values = array(
'',
esc_html__( 'Descending', 'js_composer' ) => 'DESC',
esc_html__( 'Ascending', 'js_composer' ) => 'ASC',
);
$settings = array();
switch ( $tag ) {
case 'woocommerce_cart':
$settings = array(
'name' => esc_html__( 'Cart', 'js_composer' ),
'base' => 'woocommerce_cart',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Displays the cart contents', 'js_composer' ),
'show_settings_on_create' => false,
'php_class_name' => 'Vc_WooCommerce_NotEditable',
);
break;
case 'woocommerce_checkout':
/**
* @shortcode woocommerce_checkout
* @description Used on the checkout page, the checkout shortcode displays the checkout process.
* @no_params
* @not_editable
*/ $settings = array(
'name' => esc_html__( 'Checkout', 'js_composer' ),
'base' => 'woocommerce_checkout',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Displays the checkout', 'js_composer' ),
'show_settings_on_create' => false,
'php_class_name' => 'Vc_WooCommerce_NotEditable',
);
break;
case 'woocommerce_order_tracking':
/**
* @shortcode woocommerce_order_tracking
* @description Lets a user see the status of an order by entering their order details.
* @no_params
* @not_editable
*/ $settings = array(
'name' => esc_html__( 'Order Tracking Form', 'js_composer' ),
'base' => 'woocommerce_order_tracking',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Lets a user see the status of an order', 'js_composer' ),
'show_settings_on_create' => false,
'php_class_name' => 'Vc_WooCommerce_NotEditable',
);
break;
case 'woocommerce_my_account':
/**
* @shortcode woocommerce_my_account
* @description Shows the ‘my account’ section where the customer can view past orders and update their information.
* You can specify the number or order to show, it’s set by default to 15 (use -1 to display all orders.)
*
* @param order_count integer
* Current user argument is automatically set using get_user_by( ‘id’, get_current_user_id() ).
*/ $settings = array(
'name' => esc_html__( 'My Account', 'js_composer' ),
'base' => 'woocommerce_my_account',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Shows the "my account" section', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Order count', 'js_composer' ),
'value' => 15,
'save_always' => true,
'param_name' => 'order_count',
'description' => esc_html__( 'You can specify the number or order to show, it\'s set by default to 15 (use -1 to display all orders.)', 'js_composer' ),
),
),
);
break;
case 'recent_products':
/**
* @shortcode recent_products
* @description Lists recent products – useful on the homepage. The ‘per_page’ shortcode determines how many products
* to show on the page and the columns attribute controls how many columns wide the products should be before wrapping.
* To learn more about the default ‘orderby’ parameters please reference the WordPress Codex: http://codex.wordpress.org/Class_Reference/WP_Query
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
*/ $settings = array(
'name' => esc_html__( 'Recent products', 'js_composer' ),
'base' => 'recent_products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Lists recent products', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Per page', 'js_composer' ),
'value' => 12,
'save_always' => true,
'param_name' => 'per_page',
'description' => esc_html__( 'The "per_page" shortcode determines how many products to show on the page', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'The columns attribute controls how many columns wide the products should be before wrapping.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'date',
// default WC value for recent_products
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'DESC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
),
);
break;
case 'featured_products':
/**
* @shortcode featured_products
* @description Works exactly the same as recent products but displays products which have been set as “featured”.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
*/ $settings = array(
'name' => esc_html__( 'Featured products', 'js_composer' ),
'base' => 'featured_products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Display products set as "featured"', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Per page', 'js_composer' ),
'value' => 12,
'param_name' => 'per_page',
'save_always' => true,
'description' => esc_html__( 'The "per_page" shortcode determines how many products to show on the page', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'The columns attribute controls how many columns wide the products should be before wrapping.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'date',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'DESC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="s://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
),
);
break;
case 'product':
/**
* @shortcode product
* @description Show a single product by ID or SKU.
*
* @param id integer
* @param sku string
* If the product isn’t showing, make sure it isn’t set to Hidden in the Catalog Visibility.
* To find the Product ID, go to the Product > Edit screen and look in the URL for the postid= .
*/ $settings = array(
'name' => esc_html__( 'Product', 'js_composer' ),
'base' => 'product',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show a single product by ID or SKU', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Select identificator', 'js_composer' ),
'param_name' => 'id',
'description' => esc_html__( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ),
),
array(
'type' => 'hidden',
// This will not show on render, but will be used when defining value for autocomplete
'param_name' => 'sku',
),
),
);
break;
case 'products':
$settings = array(
'name' => esc_html__( 'Products', 'js_composer' ),
'base' => 'products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show multiple products by ID or SKU.', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'title',
// Default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s. Default by Title', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s. Default by ASC', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Products', 'js_composer' ),
'param_name' => 'ids',
'settings' => array(
'multiple' => true,
'sortable' => true,
'unique_values' => true,
// In UI show results except selected. NB! You should manually check values in backend
),
'save_always' => true,
'description' => esc_html__( 'Enter List of Products', 'js_composer' ),
),
array(
'type' => 'hidden',
'param_name' => 'skus',
),
),
);
break;
case 'add_to_cart':
/**
* @shortcode add_to_cart
* @description Show the price and add to cart button of a single product by ID (or SKU).
*
* @param id integer
* @param sku string
* @param style string
* If the product isn’t showing, make sure it isn’t set to Hidden in the Catalog Visibility.
*/ $settings = array(
'name' => esc_html__( 'Add to cart', 'js_composer' ),
'base' => 'add_to_cart',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show multiple products by ID or SKU', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Select identificator', 'js_composer' ),
'param_name' => 'id',
'description' => esc_html__( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ),
),
array(
'type' => 'hidden',
'param_name' => 'sku',
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Wrapper inline style', 'js_composer' ),
'param_name' => 'style',
),
),
);
break;
case 'add_to_cart_url':
/**
* @shortcode add_to_cart_url
* @description Print the URL on the add to cart button of a single product by ID.
*
* @param id integer
* @param sku string
*/ $settings = array(
'name' => esc_html__( 'Add to cart URL', 'js_composer' ),
'base' => 'add_to_cart_url',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show URL on the add to cart button', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Select identificator', 'js_composer' ),
'param_name' => 'id',
'description' => esc_html__( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ),
),
array(
'type' => 'hidden',
'param_name' => 'sku',
),
),
);
break;
case 'product_page':
/**
* @shortcode product_page
* @description Show a full single product page by ID or SKU.
*
* @param id integer
* @param sku string
*/ $settings = array(
'name' => esc_html__( 'Product page', 'js_composer' ),
'base' => 'product_page',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show single product by ID or SKU', 'js_composer' ),
'params' => array(
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Select identificator', 'js_composer' ),
'param_name' => 'id',
'description' => esc_html__( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ),
),
array(
'type' => 'hidden',
'param_name' => 'sku',
),
),
);
break;
case 'product_category':
/**
* @shortcode product_category
* @description Show multiple products in a category by slug.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
* @param category string
* Go to: WooCommerce > Products > Categories to find the slug column.
*/ // All this move to product
$categories = get_categories( $args );
$product_categories_dropdown = array();
$this->getCategoryChildsFull( 0, $categories, 0, $product_categories_dropdown );
$settings = array(
'name' => esc_html__( 'Product category', 'js_composer' ),
'base' => 'product_category',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Show multiple products in a category', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Limit', 'js_composer' ),
'value' => 12,
'save_always' => true,
'param_name' => 'per_page',
'description' => esc_html__( 'How much items to show', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'save_always' => true,
'param_name' => 'columns',
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'menu_order title',
// Default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="s://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Category', 'js_composer' ),
'value' => $product_categories_dropdown,
'param_name' => 'category',
'save_always' => true,
'description' => esc_html__( 'Product category list', 'js_composer' ),
),
),
);
break;
case 'product_categories':
$settings = array(
'name' => esc_html__( 'Product categories', 'js_composer' ),
'base' => 'product_categories',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'Display product categories loop', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Number', 'js_composer' ),
'param_name' => 'number',
'description' => esc_html__( 'The `number` field is used to display the number of products.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'name',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Number', 'js_composer' ),
'param_name' => 'hide_empty',
'description' => esc_html__( 'Hide empty', 'js_composer' ),
),
array(
'type' => 'autocomplete',
'heading' => esc_html__( 'Categories', 'js_composer' ),
'param_name' => 'ids',
'settings' => array(
'multiple' => true,
'sortable' => true,
),
'save_always' => true,
'description' => esc_html__( 'List of product categories', 'js_composer' ),
),
),
);
break;
case 'sale_products':
/**
* @shortcode sale_products
* @description List all products on sale.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
*/ $settings = array(
'name' => esc_html__( 'Sale products', 'js_composer' ),
'base' => 'sale_products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'List all products on sale', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Limit', 'js_composer' ),
'value' => 12,
'save_always' => true,
'param_name' => 'per_page',
'description' => esc_html__( 'How much items to show', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'save_always' => true,
'param_name' => 'columns',
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'title',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
),
);
break;
case 'best_selling_products':
/**
* @shortcode best_selling_products
* @description List best selling products on sale.
*
* @param per_page integer
* @param columns integer
*/ $settings = array(
'name' => esc_html__( 'Best Selling Products', 'js_composer' ),
'base' => 'best_selling_products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'List best selling products on sale', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Limit', 'js_composer' ),
'value' => 12,
'param_name' => 'per_page',
'save_always' => true,
'description' => esc_html__( 'How much items to show', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
),
);
break;
case 'top_rated_products':
/**
* @shortcode top_rated_products
* @description List top rated products on sale.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
*/ $settings = array(
'name' => esc_html__( 'Top Rated Products', 'js_composer' ),
'base' => 'top_rated_products',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'List all products on sale', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Limit', 'js_composer' ),
'value' => 12,
'param_name' => 'per_page',
'save_always' => true,
'description' => esc_html__( 'How much items to show', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'title',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// Default WP Value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
),
);
break;
case 'product_attribute':
/**
* @shortcode product_attribute
* @description List products with an attribute shortcode.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
* @param attribute string
* @param filter string
*/ $attributes_tax = wc_get_attribute_taxonomies();
$attributes = array();
foreach ( $attributes_tax as $attribute ) {
$attributes[ $attribute->attribute_label ] = $attribute->attribute_name;
}
$settings = array(
'name' => esc_html__( 'Product Attribute', 'js_composer' ),
'base' => 'product_attribute',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'List products with an attribute shortcode', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Limit', 'js_composer' ),
'value' => 12,
'param_name' => 'per_page',
'save_always' => true,
'description' => esc_html__( 'How much items to show', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'param_name' => 'columns',
'save_always' => true,
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'title',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'ASC',
// Default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Attribute', 'js_composer' ),
'param_name' => 'attribute',
'value' => $attributes,
'save_always' => true,
'description' => esc_html__( 'List of product taxonomy attribute', 'js_composer' ),
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Filter', 'js_composer' ),
'param_name' => 'filter',
'value' => array( 'empty' => 'empty' ),
'save_always' => true,
'description' => esc_html__( 'Taxonomy values', 'js_composer' ),
'dependency' => array(
'callback' => 'vcWoocommerceProductAttributeFilterDependencyCallback',
),
),
),
);
break;
case 'related_products':
/**
* @shortcode related_products
* @description List related products.
*
* @param per_page integer
* @param columns integer
* @param orderby array
* @param order array
*/ /* we need to detect post type to show this shortcode */ global $post, $typenow, $current_screen;
$post_type = '';
if ( $post && $post->post_type ) {
//we have a post so we can just get the post type from that
$post_type = $post->post_type;
} elseif ( $typenow ) {
//check the global $typenow - set in admin.php
$post_type = $typenow;
} elseif ( $current_screen && $current_screen->post_type ) {
//check the global $current_screen object - set in sceen.php
$post_type = $current_screen->post_type;
} elseif ( isset( $_REQUEST['post_type'] ) ) {
//lastly check the post_type querystring
$post_type = sanitize_key( $_REQUEST['post_type'] );
//we do not know the post type!
}
$settings = array(
'name' => esc_html__( 'Related Products', 'js_composer' ),
'base' => 'related_products',
'icon' => 'icon-wpb-woocommerce',
'content_element' => 'product' === $post_type,
// disable showing if not product type
'category' => esc_html__( 'WooCommerce', 'js_composer' ),
'description' => esc_html__( 'List related products', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Per page', 'js_composer' ),
'value' => 12,
'save_always' => true,
'param_name' => 'per_page',
'description' => esc_html__( 'Please note: the "per_page" shortcode argument will determine how many products are shown on a page. This will not add pagination to the shortcode. ', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Columns', 'js_composer' ),
'value' => 4,
'save_always' => true,
'param_name' => 'columns',
'description' => esc_html__( 'How much columns grid', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order by', 'js_composer' ),
'param_name' => 'orderby',
'value' => $order_by_values,
'std' => 'rand',
// default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Sort order', 'js_composer' ),
'param_name' => 'order',
'value' => $order_way_values,
'std' => 'DESC',
// Default WC value
'save_always' => true,
'description' => sprintf( esc_html__( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">WordPress codex page</a>' ),
),
),
);
break;
}
return $settings;
}
/**
* Add woocommerce shortcodes and hooks/filters for it.
* @since 4.4
*/
public function mapShortcodes() {
add_action( 'wp_ajax_vc_woocommerce_get_attribute_terms', array(
$this,
'getAttributeTermsAjax',
) );
$tags = array(
'woocommerce_cart',
'woocommerce_checkout',
'woocommerce_order_tracking',
'woocommerce_my_account',
'recent_products',
'featured_products',
'product',
'products',
'add_to_cart',
'add_to_cart_url',
'product_page',
'product_category',
'product_categories',
'sale_products',
'best_selling_products',
'top_rated_products',
'product_attribute',
'related_products',
);
while ( $tag = current( $tags ) ) {
vc_lean_map( $tag, array(
$this,
'addShortcodeSettings',
) );
next( $tags );
}
//Filters For autocomplete param:
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_product_id_callback', array(
$this,
'productIdAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_product_id_render', array(
$this,
'productIdAutocompleteRender',
), 10, 1 ); // Render exact product. Must return an array (label,value)
//For param: ID default value filter
add_filter( 'vc_form_fields_render_field_product_id_param_value', array(
$this,
'productIdDefaultValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
//Filters For autocomplete param:
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_products_ids_callback', array(
$this,
'productIdAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_products_ids_render', array(
$this,
'productIdAutocompleteRender',
), 10, 1 ); // Render exact product. Must return an array (label,value)
//For param: ID default value filter
add_filter( 'vc_form_fields_render_field_products_ids_param_value', array(
$this,
'productsIdsDefaultValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
//Filters For autocomplete param: Exactly Same as "product" shortcode
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_add_to_cart_id_callback', array(
$this,
'productIdAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_add_to_cart_id_render', array(
$this,
'productIdAutocompleteRender',
), 10, 1 ); // Render exact product. Must return an array (label,value)
//For param: ID default value filter
add_filter( 'vc_form_fields_render_field_add_to_cart_id_param_value', array(
$this,
'productIdDefaultValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
//Filters For autocomplete param: Exactly Same as "product" shortcode
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_add_to_cart_url_id_callback', array(
$this,
'productIdAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_add_to_cart_url_id_render', array(
$this,
'productIdAutocompleteRender',
), 10, 1 ); // Render exact product. Must return an array (label,value)
//For param: ID default value filter
add_filter( 'vc_form_fields_render_field_add_to_cart_url_id_param_value', array(
$this,
'productIdDefaultValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
//Filters For autocomplete param: Exactly Same as "product" shortcode
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_product_page_id_callback', array(
$this,
'productIdAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_product_page_id_render', array(
$this,
'productIdAutocompleteRender',
), 10, 1 ); // Render exact product. Must return an array (label,value)
//For param: ID default value filter
add_filter( 'vc_form_fields_render_field_product_page_id_param_value', array(
$this,
'productIdDefaultValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
//Filters For autocomplete param:
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_product_category_category_callback', array(
$this,
'productCategoryCategoryAutocompleteSuggesterBySlug',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_product_category_category_render', array(
$this,
'productCategoryCategoryRenderBySlugExact',
), 10, 1 ); // Render exact category by Slug. Must return an array (label,value)
//Filters For autocomplete param:
//For suggestion: vc_autocomplete_[shortcode_name]_[param_name]_callback
add_filter( 'vc_autocomplete_product_categories_ids_callback', array(
$this,
'productCategoryCategoryAutocompleteSuggester',
), 10, 1 ); // Get suggestion(find). Must return an array
add_filter( 'vc_autocomplete_product_categories_ids_render', array(
$this,
'productCategoryCategoryRenderByIdExact',
), 10, 1 ); // Render exact category by id. Must return an array (label,value)
//For param: "filter" param value
//vc_form_fields_render_field_{shortcode_name}_{param_name}_param
add_filter( 'vc_form_fields_render_field_product_attribute_filter_param', array(
$this,
'productAttributeFilterParamValue',
), 10, 4 ); // Defines default value for param if not provided. Takes from other param value.
}
/**
* @param array $shortcodes
* @return array|mixed
*/
/**
* @param array $shortcodes
* @return array|mixed
*/
public function mapGridItemShortcodes( array $shortcodes ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/woocommerce/class-vc-gitem-woocommerce-shortcode.php' );
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/woocommerce/grid-item-attributes.php' );
$wc_shortcodes = include vc_path_dir( 'VENDORS_DIR', 'plugins/woocommerce/grid-item-shortcodes.php' );
return $shortcodes + $wc_shortcodes;
}
/**
* Defines default value for param if not provided. Takes from other param value.
* @param array $param_settings
* @param $current_value
* @param $map_settings
* @param $atts
*
* @return array
* @since 4.4
*
*/
public function productAttributeFilterParamValue( $param_settings, $current_value, $map_settings, $atts ) {
if ( isset( $atts['attribute'] ) ) {
$value = $this->getAttributeTerms( $atts['attribute'] );
if ( is_array( $value ) && ! empty( $value ) ) {
$param_settings['value'] = $value;
}
}
return $param_settings;
}
/**
* Get attribute terms hooks from ajax request
* @since 4.4
*/
public function getAttributeTermsAjax() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie();
$attribute = vc_post_param( 'attribute' );
$values = $this->getAttributeTerms( $attribute );
$param = array(
'param_name' => 'filter',
'type' => 'checkbox',
);
$param_line = '';
foreach ( $values as $label => $v ) {
$param_line .= ' <label class="vc_checkbox-label"><input id="' . $param['param_name'] . '-' . $v . '" value="' . $v . '" class="wpb_vc_param_value ' . $param['param_name'] . ' ' . $param['type'] . '" type="checkbox" name="' . $param['param_name'] . '"' . '> ' . $label . '</label>';
}
die( wp_json_encode( $param_line ) );
}
/**
* Get attribute terms suggester
* @param $attribute
*
* @return array
* @since 4.4
*
*/
public function getAttributeTerms( $attribute ) {
$terms = get_terms( 'pa_' . $attribute ); // return array. take slug
$data = array();
if ( ! empty( $terms ) && empty( $terms->errors ) ) {
foreach ( $terms as $term ) {
$data[ $term->name ] = $term->slug;
}
}
return $data;
}
/**
* Get lists of categories.
* @param $parent_id
* @param array $array
* @param $level
* @param array $dropdown - passed by reference
* @return array
* @since 4.5.3
*
*/
protected function getCategoryChildsFull( $parent_id, $array, $level, &$dropdown ) {
$keys = array_keys( $array );
$i = 0;
while ( $i < count( $array ) ) {
$key = $keys[ $i ];
$item = $array[ $key ];
$i ++;
if ( $item->category_parent == $parent_id ) {
$name = str_repeat( '- ', $level ) . $item->name;
$value = $item->slug;
$dropdown[] = array(
'label' => $name . '(' . $item->term_id . ')',
'value' => $value,
);
unset( $array[ $key ] );
$array = $this->getCategoryChildsFull( $item->term_id, $array, $level + 1, $dropdown );
$keys = array_keys( $array );
$i = 0;
}
}
return $array;
}
/**
* Replace single product sku to id.
* @param $current_value
* @param $param_settings
* @param $map_settings
* @param $atts
*
* @return bool|string
* @since 4.4
*
*/
public function productIdDefaultValue( $current_value, $param_settings, $map_settings, $atts ) {
$value = trim( $current_value );
if ( strlen( trim( $current_value ) ) === 0 && isset( $atts['sku'] ) && strlen( $atts['sku'] ) > 0 ) {
$value = $this->productIdDefaultValueFromSkuToId( $atts['sku'] );
}
return $value;
}
/**
* Replaces product skus to id's.
* @param $current_value
* @param $param_settings
* @param $map_settings
* @param $atts
*
* @return string
* @since 4.4
*
*/
public function productsIdsDefaultValue( $current_value, $param_settings, $map_settings, $atts ) {
$value = trim( $current_value );
if ( strlen( trim( $value ) ) === 0 && isset( $atts['skus'] ) && strlen( $atts['skus'] ) > 0 ) {
$data = array();
$skus = $atts['skus'];
$skus_array = explode( ',', $skus );
foreach ( $skus_array as $sku ) {
$id = $this->productIdDefaultValueFromSkuToId( trim( $sku ) );
if ( is_numeric( $id ) ) {
$data[] = $id;
}
}
if ( ! empty( $data ) ) {
$values = explode( ',', $value );
$values = array_merge( $values, $data );
$value = implode( ',', $values );
}
}
return $value;
}
/**
* Suggester for autocomplete by id/name/title/sku
* @param $query
*
* @return array - id's from products with title/sku.
* @since 4.4
*
*/
public function productIdAutocompleteSuggester( $query ) {
global $wpdb;
$product_id = (int) $query;
$post_meta_infos = $wpdb->get_results( $wpdb->prepare( "SELECT a.ID AS id, a.post_title AS title, b.meta_value AS sku
FROM {$wpdb->posts} AS a
LEFT JOIN ( SELECT meta_value, post_id FROM {$wpdb->postmeta} WHERE `meta_key` = '_sku' ) AS b ON b.post_id = a.ID
WHERE a.post_type = 'product' AND ( a.ID = '%d' OR b.meta_value LIKE '%%%s%%' OR a.post_title LIKE '%%%s%%' )", $product_id > 0 ? $product_id : - 1, stripslashes( $query ), stripslashes( $query ) ), ARRAY_A );
$results = array();
if ( is_array( $post_meta_infos ) && ! empty( $post_meta_infos ) ) {
foreach ( $post_meta_infos as $value ) {
$data = array();
$data['value'] = $value['id'];
$data['label'] = esc_html__( 'Id', 'js_composer' ) . ': ' . $value['id'] . ( ( strlen( $value['title'] ) > 0 ) ? ' - ' . esc_html__( 'Title', 'js_composer' ) . ': ' . $value['title'] : '' ) . ( ( strlen( $value['sku'] ) > 0 ) ? ' - ' . esc_html__( 'Sku', 'js_composer' ) . ': ' . $value['sku'] : '' );
$results[] = $data;
}
}
return $results;
}
/**
* Find product by id
* @param $query
*
* @return bool|array
* @since 4.4
*
*/
public function productIdAutocompleteRender( $query ) {
$query = trim( $query['value'] ); // get value from requested
if ( ! empty( $query ) ) {
// get product
$product_object = wc_get_product( (int) $query );
if ( is_object( $product_object ) ) {
$product_sku = $product_object->get_sku();
$product_title = $product_object->get_title();
$product_id = $product_object->get_id();
$product_sku_display = '';
if ( ! empty( $product_sku ) ) {
$product_sku_display = ' - ' . esc_html__( 'Sku', 'js_composer' ) . ': ' . $product_sku;
}
$product_title_display = '';
if ( ! empty( $product_title ) ) {
$product_title_display = ' - ' . esc_html__( 'Title', 'js_composer' ) . ': ' . $product_title;
}
$product_id_display = esc_html__( 'Id', 'js_composer' ) . ': ' . $product_id;
$data = array();
$data['value'] = $product_id;
$data['label'] = $product_id_display . $product_title_display . $product_sku_display;
return ! empty( $data ) ? $data : false;
}
return false;
}
return false;
}
/**
* Return ID of product by provided SKU of product.
* @param $query
*
* @return bool
* @since 4.4
*
*/
public function productIdDefaultValueFromSkuToId( $query ) {
$result = $this->productIdAutocompleteSuggesterExactSku( $query );
return isset( $result['value'] ) ? $result['value'] : false;
}
/**
* Find product by SKU
* @param $query
*
* @return bool|array
* @since 4.4
*
*/
public function productIdAutocompleteSuggesterExactSku( $query ) {
global $wpdb;
$query = trim( $query );
$product_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_sku' AND meta_value='%s' LIMIT 1", stripslashes( $query ) ) );
$product_data = get_post( $product_id );
if ( 'product' !== $product_data->post_type ) {
return '';
}
$product_object = wc_get_product( $product_data );
if ( is_object( $product_object ) ) {
$product_sku = $product_object->get_sku();
$product_title = $product_object->get_title();
$product_id = $product_object->get_id();
$product_sku_display = '';
if ( ! empty( $product_sku ) ) {
$product_sku_display = ' - ' . esc_html__( 'Sku', 'js_composer' ) . ': ' . $product_sku;
}
$product_title_display = '';
if ( ! empty( $product_title ) ) {
$product_title_display = ' - ' . esc_html__( 'Title', 'js_composer' ) . ': ' . $product_title;
}
$product_id_display = esc_html__( 'Id', 'js_composer' ) . ': ' . $product_id;
$data = array();
$data['value'] = $product_id;
$data['label'] = $product_id_display . $product_title_display . $product_sku_display;
return ! empty( $data ) ? $data : false;
}
return false;
}
/**
* Autocomplete suggester to search product category by name/slug or id.
* @param $query
* @param bool $slug - determines what output is needed
* default false - return id of product category
* true - return slug of product category
*
* @return array
* @since 4.4
*
*/
public function productCategoryCategoryAutocompleteSuggester( $query, $slug = false ) {
global $wpdb;
$cat_id = (int) $query;
$query = trim( $query );
$post_meta_infos = $wpdb->get_results( $wpdb->prepare( "SELECT a.term_id AS id, b.name as name, b.slug AS slug
FROM {$wpdb->term_taxonomy} AS a
INNER JOIN {$wpdb->terms} AS b ON b.term_id = a.term_id
WHERE a.taxonomy = 'product_cat' AND (a.term_id = '%d' OR b.slug LIKE '%%%s%%' OR b.name LIKE '%%%s%%' )", $cat_id > 0 ? $cat_id : - 1, stripslashes( $query ), stripslashes( $query ) ), ARRAY_A );
$result = array();
if ( is_array( $post_meta_infos ) && ! empty( $post_meta_infos ) ) {
foreach ( $post_meta_infos as $value ) {
$data = array();
$data['value'] = $slug ? $value['slug'] : $value['id'];
$data['label'] = esc_html__( 'Id', 'js_composer' ) . ': ' . $value['id'] . ( ( strlen( $value['name'] ) > 0 ) ? ' - ' . esc_html__( 'Name', 'js_composer' ) . ': ' . $value['name'] : '' ) . ( ( strlen( $value['slug'] ) > 0 ) ? ' - ' . esc_html__( 'Slug', 'js_composer' ) . ': ' . $value['slug'] : '' );
$result[] = $data;
}
}
return $result;
}
/**
* Search product category by id
* @param $query
*
* @return bool|array
* @since 4.4
*
*/
public function productCategoryCategoryRenderByIdExact( $query ) {
$query = $query['value'];
$cat_id = (int) $query;
$term = get_term( $cat_id, 'product_cat' );
return $this->productCategoryTermOutput( $term );
}
/**
* Suggester for autocomplete to find product category by id/name/slug but return found product category SLUG
* @param $query
*
* @return array - slug of products categories.
* @since 4.4
*
*/
public function productCategoryCategoryAutocompleteSuggesterBySlug( $query ) {
$result = $this->productCategoryCategoryAutocompleteSuggester( $query, true );
return $result;
}
/**
* Search product category by slug.
* @param $query
*
* @return bool|array
* @since 4.4
*
*/
public function productCategoryCategoryRenderBySlugExact( $query ) {
$query = $query['value'];
$query = trim( $query );
$term = get_term_by( 'slug', $query, 'product_cat' );
return $this->productCategoryTermOutput( $term );
}
/**
* Return product category value|label array
*
* @param $term
*
* @return array|bool
* @since 4.4
*/
protected function productCategoryTermOutput( $term ) {
$term_slug = $term->slug;
$term_title = $term->name;
$term_id = $term->term_id;
$term_slug_display = '';
if ( ! empty( $term_slug ) ) {
$term_slug_display = ' - ' . esc_html__( 'Sku', 'js_composer' ) . ': ' . $term_slug;
}
$term_title_display = '';
if ( ! empty( $term_title ) ) {
$term_title_display = ' - ' . esc_html__( 'Title', 'js_composer' ) . ': ' . $term_title;
}
$term_id_display = esc_html__( 'Id', 'js_composer' ) . ': ' . $term_id;
$data = array();
$data['value'] = $term_id;
$data['label'] = $term_id_display . $term_title_display . $term_slug_display;
return ! empty( $data ) ? $data : false;
}
/**
* @return array
*/
/**
* @return array
*/
public static function getProductsFieldsList() {
return array(
esc_html__( 'SKU', 'js_composer' ) => 'sku',
esc_html__( 'ID', 'js_composer' ) => 'id',
esc_html__( 'Price', 'js_composer' ) => 'price',
esc_html__( 'Regular Price', 'js_composer' ) => 'regular_price',
esc_html__( 'Sale Price', 'js_composer' ) => 'sale_price',
esc_html__( 'Price html', 'js_composer' ) => 'price_html',
esc_html__( 'Reviews count', 'js_composer' ) => 'reviews_count',
esc_html__( 'Short description', 'js_composer' ) => 'short_description',
esc_html__( 'Dimensions', 'js_composer' ) => 'dimensions',
esc_html__( 'Rating count', 'js_composer' ) => 'rating_count',
esc_html__( 'Weight', 'js_composer' ) => 'weight',
esc_html__( 'Is on sale', 'js_composer' ) => 'on_sale',
esc_html__( 'Custom field', 'js_composer' ) => '_custom_',
);
}
/**
* @param $key
* @return string
*/
/**
* @param $key
* @return string
*/
public static function getProductFieldLabel( $key ) {
if ( false === self::$product_fields_list ) {
self::$product_fields_list = array_flip( self::getProductsFieldsList() );
}
return isset( self::$product_fields_list[ $key ] ) ? self::$product_fields_list[ $key ] : '';
}
/**
* @return array
*/
/**
* @return array
*/
public static function getOrderFieldsList() {
return array(
esc_html__( 'ID', 'js_composer' ) => 'id',
esc_html__( 'Order number', 'js_composer' ) => 'order_number',
esc_html__( 'Currency', 'js_composer' ) => 'order_currency',
esc_html__( 'Total', 'js_composer' ) => 'total',
esc_html__( 'Status', 'js_composer' ) => 'status',
esc_html__( 'Payment method', 'js_composer' ) => 'payment_method',
esc_html__( 'Billing address city', 'js_composer' ) => 'billing_address_city',
esc_html__( 'Billing address country', 'js_composer' ) => 'billing_address_country',
esc_html__( 'Shipping address city', 'js_composer' ) => 'shipping_address_city',
esc_html__( 'Shipping address country', 'js_composer' ) => 'shipping_address_country',
esc_html__( 'Customer Note', 'js_composer' ) => 'customer_note',
esc_html__( 'Customer API', 'js_composer' ) => 'customer_api',
esc_html__( 'Custom field', 'js_composer' ) => '_custom_',
);
}
/**
* @param $key
* @return string
*/
/**
* @param $key
* @return string
*/
public static function getOrderFieldLabel( $key ) {
if ( false === self::$order_fields_list ) {
self::$order_fields_list = array_flip( self::getOrderFieldsList() );
}
return isset( self::$order_fields_list[ $key ] ) ? self::$order_fields_list[ $key ] : '';
}
public function yoastSeoCompatibility() {
if ( function_exists( 'WC' ) ) {
// WC()->frontend_includes();
include_once( WC()->plugin_path() . '/includes/wc-template-functions.php' );
// include_once WC()->plugin_path() . '';
}
}
}
/**
* Removes EDIT button in backend and frontend editor
* Class Vc_WooCommerce_NotEditable
* @since 4.4
*/
class Vc_WooCommerce_NotEditable extends WPBakeryShortCode {
/**
* @since 4.4
* @var array
*/
protected $controls_list = array(
'clone',
'delete',
);
}
classes/vendors/plugins/class-vc-vendor-advanced-custom-fields.php 0000644 00000004147 15121635561 0021413 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Vendor class for plugin advanced custom fields,
* Needed to apply extra js when backend/frontend editor rendered.
* Class Vc_Vendor_AdvancedCustomFields
* @since 4.3.3
*/
class Vc_Vendor_AdvancedCustomFields {
/**
* Initializing actions when backend/frontend editor renders to enqueue fix-js file
* @since 4.3.3
*/
public function load() {
if ( did_action( 'vc-vendor-acf-load' ) ) {
return;
}
/**
* Action when backend editor is rendering
* @see Vc_Backend_Editor::renderEditor wp-content/plugins/js_composer/include/classes/editors/class-vc-backend-editor.php
*/
add_action( 'vc_backend_editor_render', array(
$this,
'enqueueJs',
) );
/**
* Action when frontend editor is rendering
* @see Vc_Frontend_Editor::renderEditor wp-content/plugins/js_composer/include/classes/editors/class-vc-frontend-editor.php
*/
add_action( 'vc_frontend_editor_render', array(
$this,
'enqueueJs',
) );
add_filter( 'vc_grid_item_shortcodes', array(
$this,
'mapGridItemShortcodes',
) );
add_action( 'vc_after_mapping', array(
$this,
'mapEditorsShortcodes',
) );
do_action( 'vc-vendor-acf-load', $this );
}
/**
* Small fix for editor when try to change field
* @since 4.3.3
*/
public function enqueueJs() {
wp_enqueue_script( 'vc_vendor_acf', vc_asset_url( 'js/vendors/advanced_custom_fields.js' ), array( 'jquery-core' ), '1.0', true );
}
/**
* @param array $shortcodes
* @return array|mixed
*/
public function mapGridItemShortcodes( array $shortcodes ) {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/acf/class-vc-gitem-acf-shortcode.php' );
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/acf/grid-item-attributes.php' );
$wc_shortcodes = include vc_path_dir( 'VENDORS_DIR', 'plugins/acf/grid-item-shortcodes.php' );
return $shortcodes + $wc_shortcodes;
}
public function mapEditorsShortcodes() {
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/acf/class-vc-acf-shortcode.php' );
vc_lean_map( 'vc_acf', null, vc_path_dir( 'VENDORS_DIR', 'plugins/acf/shortcode.php' ) );
}
}
classes/vendors/plugins/class-vc-vendor-mqtranslate.php 0000644 00000001322 15121635561 0017415 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'VENDORS_DIR', 'plugins/class-vc-vendor-qtranslate.php' );
/**
* Class Vc_Vendor_Mqtranslate extends class Vc_Vendor_Qtranslate::__construct
* @since 4.3
*/
class Vc_Vendor_Mqtranslate extends Vc_Vendor_Qtranslate {
/**
* @since 4.3
*/
public function setLanguages() {
global $q_config;
$languages = get_option( 'mqtranslate_enabled_languages' );
if ( ! is_array( $languages ) ) {
$languages = $q_config['enabled_languages'];
}
$this->languages = $languages;
}
/**
* @since 4.3
*/
public function qtransSwitch() {
global $q_config;
$q_config['js']['qtrans_save'] .= '
var mqtranslate = true;
';
}
}
classes/vendors/plugins/woocommerce/grid-item-filters.php 0000644 00000006117 15121635561 0017733 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Append 'add to card' link to the list of Add link for grid element shortcodes.
*
* @param $param
*
* @return array
* @since 4.5
*
*/
function vc_gitem_add_link_param_woocommerce( $param ) {
$param['value'][ esc_html__( 'WooCommerce add to card link', 'js_composer' ) ] = 'woo_add_to_card';
return $param;
}
/**
* Add WooCommerce link attributes to enable add to cart functionality
*
* @param $link
* @param $atts
* @param string $css_class
*
* @return string
* @since 4.5
*
*/
function vc_gitem_post_data_get_link_link_woocommerce( $link, $atts, $css_class = '' ) {
if ( isset( $atts['link'] ) && 'woo_add_to_card' === $atts['link'] ) {
$css_class .= ' add_to_cart_button vc-gitem-link-ajax product_type_simple';
return 'a href="{{ woocommerce_product_link }}" class="' . esc_attr( $css_class ) . '" data-product_id="{{ woocommerce_product:id }}"' . ' data-product_sku="{{ woocommerce_product:sku }}" data-product-quantity="1"';
}
return $link;
}
/**¬
* Remove target as useless for add to cart link.
*
* @param $link
* @param $atts
*
* @return string
* @since 4.5
*
*/
function vc_gitem_post_data_get_link_target_woocommerce( $link, $atts ) {
if ( isset( $atts['link'] ) && 'woo_add_to_card' === $atts['link'] ) {
return '';
}
return $link;
}
/**
* Add WooCommerce link attributes to enable add to cart functionality. Not using item element templates vars.
*
* @param $link
* @param $atts
* @param $post
* @param string $css_class
* @return string
* @since 4.5
*
*/
function vc_gitem_post_data_get_link_real_link_woocommerce( $link, $atts, $post, $css_class = '' ) {
if ( isset( $atts['link'] ) && 'woo_add_to_card' === $atts['link'] ) {
$css_class .= ' add_to_cart_button vc-gitem-link-ajax product_type_simple';
$link = 'a href="' . esc_url( do_shortcode( '[add_to_cart_url id="' . $post->ID . '"]' ) ) . '" class="' . esc_attr( $css_class ) . '" data-product_id="' . esc_attr( vc_gitem_template_attribute_woocommerce_product( '', array(
'post' => $post,
'data' => 'id',
) ) ) . '"' . ' data-product_sku="' . esc_attr( vc_gitem_template_attribute_woocommerce_product( '', array(
'post' => $post,
'data' => 'sku',
) ) ) . '" data-product-quantity="1"';
}
return $link;
}
/**¬
* Remove target as useless for add to cart link.
*
* @param $link
* @param $atts
* @param $post
*
* @return string
* @since 4.5
*
*/
function vc_gitem_post_data_get_link_real_target_woocommerce( $link, $atts, $post ) {
return 'woo_add_to_card' === $link ? '' : $link;
}
/**
* @param $image_block
* @param $link
* @param $css_class
* @return string
*/
function vc_gitem_zone_image_block_link_woocommerce( $image_block, $link, $css_class ) {
if ( 'woo_add_to_card' === $link ) {
$css_class .= ' add_to_cart_button vc-gitem-link-ajax product_type_simple';
return '<a href="{{ woocommerce_product_link }}" class="' . esc_attr( $css_class ) . '" data-product_id="{{ woocommerce_product:id }}"' . ' data-product_sku="{{ woocommerce_product:sku }}" data-product-quantity="1"></a>';
}
return $image_block;
}
classes/vendors/plugins/woocommerce/grid-item-shortcodes.php 0000644 00000006605 15121635561 0020442 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return array(
'vc_gitem_wocommerce' => array(
'name' => esc_html__( 'WooCommerce field', 'js_composer' ),
'base' => 'vc_gitem_wocommerce',
'icon' => 'icon-wpb-woocommerce',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Woocommerce', 'js_composer' ),
'php_class_name' => 'Vc_Gitem_Woocommerce_Shortcode',
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Content type', 'js_composer' ),
'param_name' => 'post_type',
'value' => array(
esc_html__( 'Product', 'js_composer' ) => 'product',
esc_html__( 'Order', 'js_composer' ) => 'order',
),
'save_always' => true,
'description' => esc_html__( 'Select Woo Commerce post type.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Product field name', 'js_composer' ),
'param_name' => 'product_field_key',
'value' => Vc_Vendor_Woocommerce::getProductsFieldsList(),
'dependency' => array(
'element' => 'post_type',
'value' => array( 'product' ),
),
'save_always' => true,
'description' => esc_html__( 'Choose field from product.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Product custom key', 'js_composer' ),
'param_name' => 'product_custom_key',
'description' => esc_html__( 'Enter custom key.', 'js_composer' ),
'dependency' => array(
'element' => 'product_field_key',
'value' => array( '_custom_' ),
),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Order fields', 'js_composer' ),
'param_name' => 'order_field_key',
'value' => Vc_Vendor_Woocommerce::getOrderFieldsList(),
'dependency' => array(
'element' => 'post_type',
'value' => array( 'order' ),
),
'save_always' => true,
'description' => esc_html__( 'Choose field from order.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Order custom key', 'js_composer' ),
'param_name' => 'order_custom_key',
'dependency' => array(
'element' => 'order_field_key',
'value' => array( '_custom_' ),
),
'description' => esc_html__( 'Enter custom key.', 'js_composer' ),
),
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Show label', 'js_composer' ),
'param_name' => 'show_label',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'save_always' => true,
'description' => esc_html__( 'Enter label to display before key value.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Align', 'js_composer' ),
'param_name' => 'align',
'value' => array(
esc_attr__( 'left', 'js_composer' ) => 'left',
esc_attr__( 'right', 'js_composer' ) => 'right',
esc_attr__( 'center', 'js_composer' ) => 'center',
esc_attr__( 'justify', 'js_composer' ) => 'justify',
),
'save_always' => true,
'description' => esc_html__( 'Select alignment.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
);
classes/vendors/plugins/woocommerce/grid-item-attributes.php 0000644 00000011425 15121635561 0020447 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Get woocommerce data for product
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_woocommerce_product( $value, $data ) {
$label = '';
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
require_once WC()->plugin_path() . '/includes/abstracts/abstract-wc-product.php';
/** @noinspection PhpUndefinedClassInspection */
/** @var WC_Product $product */
$product = new WC_Product( $post );
if ( preg_match( '/_labeled$/', $data ) ) {
$data = preg_replace( '/_labeled$/', '', $data );
$label = apply_filters( 'vc_gitem_template_attribute_woocommerce_product_' . $data . '_label', Vc_Vendor_Woocommerce::getProductFieldLabel( $data ) . ': ' );
}
switch ( $data ) {
case 'id':
$value = $product->get_id();
break;
case 'sku':
$value = $product->get_sku();
break;
case 'price':
$value = wc_price( $product->get_price() );
break;
case 'regular_price':
$value = wc_price( $product->get_regular_price() );
break;
case 'sale_price':
$value = wc_price( $product->get_sale_price() );
break;
case 'price_html':
$value = $product->get_price_html();
break;
case 'reviews_count':
$value = count( get_comments( array(
'post_id' => $post->ID,
'approve' => 'approve',
) ) );
break;
case 'short_description':
$value = apply_filters( 'woocommerce_short_description', get_post( $product->get_id() )->post_excerpt );
break;
case 'dimensions':
$units = get_option( 'woocommerce_dimension_unit' );
$value = $product->get_length() . $units . 'x' . $product->get_width() . $units . 'x' . $product->get_height() . $units;
break;
case 'rating_count':
$value = $product->get_rating_count();
break;
case 'weight':
$value = $product->get_weight() ? wc_format_decimal( $product->get_weight(), 2 ) : '';
break;
case 'on_sale':
$value = $product->is_on_sale() ? 'yes' : 'no'; // TODO: change
break;
default:
$value = method_exists( $product, 'get_' . $data ) ? $product->{'get_' . $data}() : $product->$data;
}
return strlen( $value ) > 0 ? $label . apply_filters( 'vc_gitem_template_attribute_woocommerce_product_' . $data . '_value', $value ) : '';
}
/**
* Gte woocommerce data for order
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_woocommerce_order( $value, $data ) {
$label = '';
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
require_once WC()->plugin_path() . '/includes/class-wc-order.php';
/** @noinspection PhpUndefinedClassInspection */
$order = new WC_Order( $post->ID );
if ( preg_match( '/_labeled$/', $data ) ) {
$data = preg_replace( '/_labeled$/', '', $data );
$label = apply_filters( 'vc_gitem_template_attribute_woocommerce_order_' . $data . '_label', Vc_Vendor_Woocommerce::getOrderFieldLabel( $data ) . ': ' );
}
switch ( $data ) {
case 'id':
$value = $order->get_id();
break;
case 'order_number':
$value = $order->get_order_number();
break;
case 'total':
$value = sprintf( get_woocommerce_price_format(), wc_format_decimal( $order->get_total(), 2 ), $order->get_currency() );
break;
case 'payment_method':
$value = $order->get_payment_method_title();
break;
case 'billing_address_city':
$value = $order->get_billing_city();
break;
case 'billing_address_country':
$value = $order->get_billing_country();
break;
case 'shipping_address_city':
$value = $order->get_shipping_city();
break;
case 'shipping_address_country':
$value = $order->get_shipping_country();
break;
default:
$value = $order->{$data};
}
return strlen( $value ) > 0 ? $label . apply_filters( 'vc_gitem_template_attribute_woocommerce_order_' . $data . '_value', $value ) : '';
}
/**
* Get woocommerce product add to cart url.
*
* @param $value
* @param $data
*
* @return string
* @since 4.5
*
*/
function vc_gitem_template_attribute_woocommerce_product_link( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
$link = do_shortcode( '[add_to_cart_url id="' . $post->ID . '"]' );
return apply_filters( 'vc_gitem_template_attribute_woocommerce_product_link_value', $link );
}
add_filter( 'vc_gitem_template_attribute_woocommerce_product', 'vc_gitem_template_attribute_woocommerce_product', 10, 2 );
add_filter( 'vc_gitem_template_attribute_woocommerce_order', 'vc_gitem_template_attribute_woocommerce_order', 10, 2 );
add_filter( 'vc_gitem_template_attribute_woocommerce_product_link', 'vc_gitem_template_attribute_woocommerce_product_link', 10, 2 );
classes/vendors/plugins/woocommerce/class-vc-gitem-woocommerce-shortcode.php 0000644 00000002730 15121635561 0023524 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Gitem_Woocommerce_Shortcode
*/
class Vc_Gitem_Woocommerce_Shortcode extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
*
* @return mixed
*/
protected function content( $atts, $content = null ) {
$key = '';
/**
* @var string $el_class
* @var string $post_type
* @var string $product_field_key
* @var string $order_field_key
* @var string $product_custom_key
* @var string $order_custom_key
* @var string $show_label
* @var string $align
*/
$atts = shortcode_atts( array(
'el_class' => '',
'post_type' => 'product',
'product_field_key' => 'sku',
'product_custom_key' => '',
'order_field_key' => 'order_number',
'order_custom_key' => '',
'show_label' => '',
'align' => '',
), $atts );
extract( $atts );
if ( 'product' === $post_type ) {
$key = '_custom_' === $product_field_key ? $product_custom_key : $product_field_key;
} elseif ( 'order' === $post_type ) {
$key = '_custom_' === $order_field_key ? $order_custom_key : $order_field_key;
}
if ( 'yes' === $show_label ) {
$key .= '_labeled';
}
$css_class = 'vc_gitem-woocommerce vc_gitem-woocommerce-' . $post_type . '-' . $key . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ( strlen( $align ) ? ' vc_gitem-align-' . $align : '' );
return '<div class="' . esc_attr( $css_class ) . '">' . '{{ woocommerce_' . $post_type . ':' . $key . ' }}' . '</div>';
}
}
classes/vendors/plugins/class-vc-vendor-qtranslate-x.php 0000644 00000005021 15121635561 0017505 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Vendor_QtranslateX
* @since 4.12
*/
class Vc_Vendor_QtranslateX {
public function load() {
add_action( 'vc_backend_editor_render', array(
$this,
'enqueueJsBackend',
) );
add_action( 'vc_frontend_editor_render', array(
$this,
'enqueueJsFrontend',
) );
add_filter( 'vc_frontend_editor_iframe_url', array(
$this,
'appendLangToUrl',
) );
add_filter( 'vc_nav_front_controls', array(
$this,
'vcNavControlsFrontend',
) );
if ( ! vc_is_frontend_editor() ) {
add_filter( 'vc_get_inline_url', array(
$this,
'vcRenderEditButtonLink',
) );
}
}
public function enqueueJsBackend() {
wp_enqueue_script( 'vc_vendor_qtranslatex_backend', vc_asset_url( 'js/vendors/qtranslatex_backend.js' ), array(
'vc-backend-min-js',
'jquery-core',
), '1.0', true );
}
/**
* @param $link
* @return string
*/
public function appendLangToUrl( $link ) {
global $q_config;
if ( $q_config && isset( $q_config['language'] ) ) {
return add_query_arg( array( 'lang' => ( $q_config['language'] ) ), $link );
}
return $link;
}
public function enqueueJsFrontend() {
wp_enqueue_script( 'vc_vendor_qtranslatex_frontend', vc_asset_url( 'js/vendors/qtranslatex_frontend.js' ), array(
'vc-frontend-editor-min-js',
'jquery-core',
), '1.0', true );
}
/**
* @return string
*/
public function generateSelectFrontend() {
global $q_config;
$output = '';
$output .= '<select id="vc_vendor_qtranslatex_langs_front" class="vc_select vc_select-navbar">';
$inline_url = vc_frontend_editor()->getInlineUrl();
$activeLanguage = $q_config['language'];
$availableLanguages = $q_config['enabled_languages'];
foreach ( $availableLanguages as $lang ) {
$output .= '<option value="' . add_query_arg( array( 'lang' => $lang ), $inline_url ) . '"' . ( $activeLanguage == $lang ? ' selected' : '' ) . ' > ' . qtranxf_getLanguageNameNative( $lang ) . '</option > ';
}
$output .= '</select > ';
return $output;
}
/**
* @param $list
*
* @return array
*/
public function vcNavControlsFrontend( $list ) {
if ( is_array( $list ) ) {
$list[] = array(
'qtranslatex',
'<li class="vc_pull-right" > ' . $this->generateSelectFrontend() . '</li > ',
);
}
return $list;
}
/**
* @param $link
*
* @return string
*/
public function vcRenderEditButtonLink( $link ) {
global $q_config;
$activeLanguage = $q_config['language'];
return add_query_arg( array( 'lang' => $activeLanguage ), $link );
}
}
classes/vendors/plugins/class-vc-vendor-jwplayer.php 0000644 00000004132 15121635561 0016721 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* JWPLayer loader.
* @since 4.3
*/
class Vc_Vendor_Jwplayer {
/**
* Dublicate jwplayer logic for editor, when used in frontend editor mode.
*
* @since 4.3
*/
public function load() {
add_action( 'wp_enqueue_scripts', array(
$this,
'vc_load_iframe_jscss',
) );
add_filter( 'vc_front_render_shortcodes', array(
$this,
'renderShortcodes',
) );
add_filter( 'vc_frontend_template_the_content', array(
$this,
'wrapPlaceholder',
) );
// fix for #1065
add_filter( 'vc_shortcode_content_filter_after', array(
$this,
'renderShortcodesPreview',
) );
}
/**
* @param $output
*
* @return mixed|string
* @since 4.3
*
*/
public function renderShortcodes( $output ) {
$output = str_replace( '][jwplayer', '] [jwplayer', $output ); // fixes jwplayer shortcode regex..
/** @noinspection PhpUndefinedClassInspection */
$data = JWP6_Shortcode::the_content_filter( $output );
preg_match_all( '/(jwplayer-\d+)/', $data, $matches );
$pairs = array_unique( $matches[0] );
if ( count( $pairs ) > 0 ) {
$id_zero = time();
foreach ( $pairs as $pair ) {
$data = str_replace( $pair, 'jwplayer-' . $id_zero ++, $data );
}
}
return $data;
}
/**
* @param $content
* @return mixed
*/
public function wrapPlaceholder( $content ) {
add_shortcode( 'jwplayer', array(
$this,
'renderPlaceholder',
) );
return $content;
}
/**
* @return string
*/
public function renderPlaceholder() {
return '<div class="vc_placeholder-jwplayer"></div>';
}
/**
* @param $output
*
* @return string
* @since 4.3, due to #1065
*
*/
public function renderShortcodesPreview( $output ) {
$output = str_replace( '][jwplayer', '] [jwplayer', $output ); // fixes jwplayer shortcode regex..
return $output;
}
/**
* @since 4.3
* @todo check it for preview mode (check is it needed)
*/
public function vc_load_iframe_jscss() {
wp_enqueue_script( 'vc_vendor_jwplayer', vc_asset_url( 'js/frontend_editor/vendors/plugins/jwplayer.js' ), array( 'jquery-core' ), '1.0', true );
}
}
classes/vendors/plugins/acf/grid-item-shortcodes.php 0000644 00000005500 15121635561 0016645 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() );
$groups_param_values = $fields_params = array();
foreach ( $groups as $group ) {
$id = isset( $group['id'] ) ? 'id' : ( isset( $group['ID'] ) ? 'ID' : 'id' );
$groups_param_values[ $group['title'] ] = $group[ $id ];
$fields = function_exists( 'acf_get_fields' ) ? acf_get_fields( $group[ $id ] ) : apply_filters( 'acf/field_group/get_fields', array(), $group[ $id ] );
$fields_param_value = array();
foreach ( (array) $fields as $field ) {
$fields_param_value[ $field['label'] ] = (string) $field['key'];
}
$fields_params[] = array(
'type' => 'dropdown',
'heading' => esc_html__( 'Field name', 'js_composer' ),
'param_name' => 'field_from_' . $group[ $id ],
'value' => $fields_param_value,
'save_always' => true,
'description' => esc_html__( 'Choose field from group.', 'js_composer' ),
'dependency' => array(
'element' => 'field_group',
'value' => array( (string) $group[ $id ] ),
),
);
}
return array(
'vc_gitem_acf' => array(
'name' => esc_html__( 'Advanced Custom Field', 'js_composer' ),
'base' => 'vc_gitem_acf',
'icon' => 'vc_icon-acf',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Advanced Custom Field', 'js_composer' ),
'php_class_name' => 'Vc_Gitem_Acf_Shortcode',
'params' => array_merge( array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Field group', 'js_composer' ),
'param_name' => 'field_group',
'value' => $groups_param_values,
'save_always' => true,
'description' => esc_html__( 'Select field group.', 'js_composer' ),
),
), $fields_params, array(
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Show label', 'js_composer' ),
'param_name' => 'show_label',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Enter label to display before key value.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Align', 'js_composer' ),
'param_name' => 'align',
'value' => array(
esc_attr__( 'left', 'js_composer' ) => 'left',
esc_attr__( 'right', 'js_composer' ) => 'right',
esc_attr__( 'center', 'js_composer' ) => 'center',
esc_attr__( 'justify', 'js_composer' ) => 'justify',
),
'description' => esc_html__( 'Select alignment.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
'post_type' => Vc_Grid_Item_Editor::postType(),
),
);
classes/vendors/plugins/acf/class-vc-acf-shortcode.php 0000644 00000003332 15121635561 0017044 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class WPBakeryShortCode_Vc_Acf
*/
class WPBakeryShortCode_Vc_Acf extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
*
* @return mixed
* @throws \Exception
*/
protected function content( $atts, $content = null ) {
$atts = $atts + vc_map_get_attributes( $this->getShortcode(), $atts );
$field_group = $atts['field_group'];
$field_key = '';
if ( 0 === strlen( $atts['field_group'] ) ) {
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() );
if ( is_array( $groups ) && isset( $groups[0] ) ) {
$key = isset( $groups[0]['id'] ) ? 'id' : ( isset( $groups[0]['ID'] ) ? 'ID' : 'id' );
$field_group = $groups[0][ $key ];
}
}
if ( $field_group ) {
$field_key = ! empty( $atts[ 'field_from_' . $field_group ] ) ? $atts[ 'field_from_' . $field_group ] : 'field_from_group_' . $field_group;
}
$css_class = array();
$css_class[] = 'vc_acf';
if ( $atts['el_class'] ) {
$css_class[] = $atts['el_class'];
}
if ( $atts['align'] ) {
$css_class[] = 'vc_txt_align_' . $atts['align'];
}
$value = '';
if ( $field_key ) {
$css_class[] = $field_key;
$value = do_shortcode( '[acf field="' . $field_key . '" post_id="' . get_the_ID() . '"]' );
if ( $atts['show_label'] ) {
$field = get_field_object( $field_key );
$label = is_array( $field ) && isset( $field['label'] ) ? '<span class="vc_acf-label">' . $field['label'] . ':</span> ' : '';
$value = $label . $value;
}
}
$css_string = implode( ' ', $css_class );
$output = '<div class="' . esc_attr( $css_string ) . '">' . $value . '</div>';
return $output;
}
}
classes/vendors/plugins/acf/class-vc-gitem-acf-shortcode.php 0000644 00000003015 15121635561 0020145 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Gitem_Acf_Shortcode
*/
class Vc_Gitem_Acf_Shortcode extends WPBakeryShortCode {
/**
* @param $atts
* @param null $content
*
* @return mixed
*/
protected function content( $atts, $content = null ) {
$field_key = $label = '';
/**
* @var string $el_class
* @var string $show_label
* @var string $align
* @var string $field_group
*/
extract( shortcode_atts( array(
'el_class' => '',
'field_group' => '',
'show_label' => '',
'align' => '',
), $atts ) );
if ( 0 === strlen( $field_group ) ) {
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() );
if ( is_array( $groups ) && isset( $groups[0] ) ) {
$key = isset( $groups[0]['id'] ) ? 'id' : ( isset( $groups[0]['ID'] ) ? 'ID' : 'id' );
$field_group = $groups[0][ $key ];
}
}
if ( ! empty( $field_group ) ) {
$field_key = ! empty( $atts[ 'field_from_' . $field_group ] ) ? $atts[ 'field_from_' . $field_group ] : 'field_from_group_' . $field_group;
}
if ( 'yes' === $show_label && $field_key ) {
$field_key .= '_labeled';
}
$css_class = 'vc_gitem-acf' . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ( strlen( $align ) ? ' vc_gitem-align-' . $align : '' ) . ( strlen( $field_key ) ? ' ' . $field_key : '' );
return '<div ' . $field_key . ' class="' . esc_attr( $css_class ) . '">' . '{{ acf' . ( ! empty( $field_key ) ? ':' . $field_key : '' ) . ' }}' . '</div>';
}
}
classes/vendors/plugins/acf/grid-item-attributes.php 0000644 00000002604 15121635561 0016660 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Get ACF data
*
* @param $value
* @param $data
*
* @return string
*/
function vc_gitem_template_attribute_acf( $value, $data ) {
/**
* @var null|Wp_Post $post ;
* @var string $data ;
*/
extract( array_merge( array(
'post' => null,
'data' => '',
), $data ) );
if ( strstr( $data, 'field_from_group_' ) ) {
$group_id = preg_replace( '/(^field_from_group_|_labeled$)/', '', $data );
$fields = function_exists( 'acf_get_fields' ) ? acf_get_fields( $group_id ) : apply_filters( 'acf/field_group/get_fields', array(), $group_id );
$field = is_array( $fields ) && isset( $fields[0] ) ? $fields[0] : false;
if ( is_array( $field ) && isset( $field['key'] ) ) {
$data = $field['key'] . ( strstr( $data, '_labeled' ) ? '_labeled' : '' );
}
}
$label = '';
if ( preg_match( '/_labeled$/', $data ) ) {
$data = preg_replace( '/_labeled$/', '', $data );
$field = get_field_object( $data );
$label = is_array( $field ) && isset( $field['label'] ) ? '<span class="vc_gitem-acf-label">' . $field['label'] . ':</span> ' : '';
}
$value = '';
if ( $data ) {
$value = do_shortcode( '[acf field="' . $data . '" post_id="' . $post->ID . '"]' );
}
return $label . apply_filters( 'vc_gitem_template_attribute_acf_value', $value );
}
add_filter( 'vc_gitem_template_attribute_acf', 'vc_gitem_template_attribute_acf', 10, 2 );
classes/vendors/plugins/acf/shortcode.php 0000644 00000005231 15121635561 0014604 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$groups = function_exists( 'acf_get_field_groups' ) ? acf_get_field_groups() : apply_filters( 'acf/get_field_groups', array() );
$groups_param_values = $fields_params = array();
foreach ( (array) $groups as $group ) {
$id = isset( $group['id'] ) ? 'id' : ( isset( $group['ID'] ) ? 'ID' : 'id' );
$groups_param_values[ $group['title'] ] = $group[ $id ];
$fields = function_exists( 'acf_get_fields' ) ? acf_get_fields( $group[ $id ] ) : apply_filters( 'acf/field_group/get_fields', array(), $group[ $id ] );
$fields_param_value = array();
foreach ( (array) $fields as $field ) {
$fields_param_value[ $field['label'] ] = (string) $field['key'];
}
$fields_params[] = array(
'type' => 'dropdown',
'heading' => esc_html__( 'Field name', 'js_composer' ),
'param_name' => 'field_from_' . $group[ $id ],
'value' => $fields_param_value,
'save_always' => true,
'description' => esc_html__( 'Choose field from group.', 'js_composer' ),
'dependency' => array(
'element' => 'field_group',
'value' => array( (string) $group[ $id ] ),
),
);
}
return array(
'name' => esc_html__( 'Advanced Custom Field', 'js_composer' ),
'base' => 'vc_acf',
'icon' => 'vc_icon-acf',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Advanced Custom Field', 'js_composer' ),
'params' => array_merge( array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Field group', 'js_composer' ),
'param_name' => 'field_group',
'value' => $groups_param_values,
'save_always' => true,
'description' => esc_html__( 'Select field group.', 'js_composer' ),
),
), $fields_params, array(
array(
'type' => 'checkbox',
'heading' => esc_html__( 'Show label', 'js_composer' ),
'param_name' => 'show_label',
'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
'description' => esc_html__( 'Enter label to display before key value.', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Align', 'js_composer' ),
'param_name' => 'align',
'value' => array(
esc_attr__( 'left', 'js_composer' ) => 'left',
esc_attr__( 'right', 'js_composer' ) => 'right',
esc_attr__( 'center', 'js_composer' ) => 'center',
esc_attr__( 'justify', 'js_composer' ) => 'justify',
),
'description' => esc_html__( 'Select alignment.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
) ),
);
classes/vendors/plugins/class-vc-vendor-qtranslate.php 0000644 00000021567 15121635561 0017255 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Vendor_Qtranslate
* @since 4.3
*/
class Vc_Vendor_Qtranslate {
/**
* @since 4.3
* @var array
*/
protected $languages = array();
/**
* @since 4.3
*/
public function setLanguages() {
global $q_config;
$languages = get_option( 'qtranslate_enabled_languages' );
if ( ! is_array( $languages ) ) {
$languages = $q_config['enabled_languages'];
}
$this->languages = $languages;
}
/**
* @return bool
*/
public function isValidPostType() {
return in_array( get_post_type(), vc_editor_post_types(), true );
}
/**
* @since 4.3
*/
public function load() {
$this->setLanguages();
global $q_config;
add_filter( 'vc_frontend_get_page_shortcodes_post_content', array(
$this,
'filterPostContent',
) );
add_action( 'vc_backend_editor_render', array(
$this,
'enqueueJsBackend',
) );
add_action( 'vc_frontend_editor_render', array(
$this,
'enqueueJsFrontend',
) );
add_action( 'vc_frontend_editor_render_template', array(
$this,
'vcFrontEndEditorRender',
) );
add_filter( 'vc_nav_controls', array(
$this,
'vcNavControls',
) );
add_filter( 'vc_nav_front_controls', array(
$this,
'vcNavControlsFrontend',
) );
add_filter( 'vc_frontend_editor_iframe_url', array(
$this,
'vcRenderEditButtonLink',
) );
if ( ! vc_is_frontend_editor() ) {
add_filter( 'vc_get_inline_url', array(
$this,
'vcRenderEditButtonLink',
) );
}
$q_lang = vc_get_param( 'qlang' );
if ( is_string( $q_lang ) ) {
$q_config['language'] = $q_lang;
}
add_action( 'init', array(
$this,
'qtransPostInit',
), 1000 );
}
/**
* @since 4.3
*/
public function qtransPostInit() {
global $q_config;
$q_config['js']['qtrans_switch'] = "
var swtg= jQuery.extend(true, {}, switchEditors);
switchEditors.go = function(id, lang) {
if ('content' !== id && 'qtrans_textarea_content' !== id && -1 === id.indexOf('qtrans')) {
return swtg.go(id,lang);
}
id = id || 'qtrans_textarea_content';
lang = lang || 'toggle';
if ( 'toggle' === lang ) {
if ( ed && !ed.isHidden() )
lang = 'html';
else
lang = 'tmce';
} else if ( 'tinymce' === lang )
lang = 'tmce';
var inst = tinyMCE.get('qtrans_textarea_' + id);
var vta = document.getElementById('qtrans_textarea_' + id);
var ta = document.getElementById(id);
var dom = tinymce.DOM;
var wrap_id = 'wp-'+id+'-wrap';
var wrap_id2 = 'wp-qtrans_textarea_content-wrap';
// update merged content
if (inst && ! inst.isHidden()) {
tinyMCE.triggerSave();
} else {
qtrans_save(vta.value);
}
// check if language is already active
if (lang !== 'tmce' && lang !== 'html' && document.getElementById('qtrans_select_'+lang).className === 'wp-switch-editor switch-tmce switch-html') {
return;
}
if (lang !== 'tmce' && lang !== 'html') {
document.getElementById('qtrans_select_'+qtrans_get_active_language()).className='wp-switch-editor';
document.getElementById('qtrans_select_'+lang).className='wp-switch-editor switch-tmce switch-html';
}
if (lang === 'html') {
if ( inst && inst.isHidden() )
return false;
if ( inst ) {
vta.style.height = inst.getContentAreaContainer().offsetHeight + 20 + 'px';
inst.hide();
}
dom.removeClass(wrap_id, 'tmce-active');
dom.addClass(wrap_id, 'html-active');
dom.removeClass(wrap_id2, 'tmce-active');
dom.addClass(wrap_id2, 'html-active');
setUserSetting( 'editor', 'html' );
} else if (lang === 'tmce') {
if (inst && ! inst.isHidden())
return false;
if ( 'undefined' !== typeof(QTags) )
QTags.closeAllTags('qtrans_textarea_' + id);
if ( tinyMCEPreInit.mceInit['qtrans_textarea_'+id] && tinyMCEPreInit.mceInit['qtrans_textarea_'+id].wpautop )
vta.value = this.wpautop(qtrans_use(qtrans_get_active_language(),ta.value));
if (inst) {
inst.show();
} else {
qtrans_hook_on_tinyMCE('qtrans_textarea_'+id, true);
}
dom.removeClass(wrap_id, 'html-active');
dom.addClass(wrap_id, 'tmce-active');
dom.removeClass(wrap_id2, 'html-active');
dom.addClass(wrap_id2, 'tmce-active');
setUserSetting('editor', 'tinymce');
} else {
// switch content
qtrans_assign('qtrans_textarea_'+id,qtrans_use(lang,ta.value));
}
}
";
$this->qtransSwitch();
}
/**
* @since 4.3
*/
public function qtransSwitch() {
global $q_config;
$q_config['js']['qtrans_switch'] .= '
jQuery(document).ready(function(){ switchEditors.switchto(document.getElementById("content-html")); });
';
}
/**
* @since 4.3
*/
public function enqueueJsBackend() {
if ( $this->isValidPostType() || apply_filters( 'vc_vendor_qtranslate_enqueue_js_backend', false ) ) {
wp_enqueue_script( 'vc_vendor_qtranslate_backend', vc_asset_url( 'js/vendors/qtranslate_backend.js' ), array( 'vc-backend-min-js' ), '1.0', true );
}
}
/**
* @since 4.3
*/
public function enqueueJsFrontend() {
if ( $this->isValidPostType() ) {
wp_enqueue_script( 'vc_vendor_qtranslate_frontend', vc_asset_url( 'js/vendors/qtranslate_frontend.js' ), array( 'vc-frontend-editor-min-js' ), '1.0', true );
global $q_config;
$q_config['js']['qtrans_save'] = '';
$q_config['js']['qtrans_integrate_category'] = '';
$q_config['js']['qtrans_integrate_title'] = '';
$q_config['js']['qtrans_assign'] = '';
$q_config['js']['qtrans_tinyMCEOverload'] = '';
$q_config['js']['qtrans_wpActiveEditorOverload'] = '';
$q_config['js']['qtrans_updateTinyMCE'] = '';
$q_config['js']['qtrans_wpOnload'] = '';
$q_config['js']['qtrans_editorInit'] = '';
$q_config['js']['qtrans_hook_on_tinyMCE'] = '';
$q_config['js']['qtrans_switch_postbox'] = '';
$q_config['js']['qtrans_switch'] = '';
}
}
/**
* @return string
* @since 4.3
*/
public function generateSelect() {
$output = '';
if ( is_array( $this->languages ) && ! empty( $this->languages ) ) {
$output .= '<select id="vc_vendor_qtranslate_langs" class="vc_select vc_select-navbar" style="display:none;">';
$inline_url = vc_frontend_editor()->getInlineUrl();
foreach ( $this->languages as $lang ) {
$output .= '<option value="' . $lang . '" link="' . add_query_arg( array( 'qlang' => $lang ), $inline_url ) . '">' . qtrans_getLanguageName( $lang ) . '</option>';
}
$output .= '</select>';
}
return $output;
}
/**
* @return string
* @since 4.3
*/
public function generateSelectFrontend() {
$output = '';
if ( is_array( $this->languages ) && ! empty( $this->languages ) ) {
$output .= '<select id="vc_vendor_qtranslate_langs_front" class="vc_select vc_select-navbar">';
$q_lang = vc_get_param( 'qlang' );
$inline_url = vc_frontend_editor()->getInlineUrl();
foreach ( $this->languages as $lang ) {
$output .= '<option value="' . add_query_arg( array( 'qlang' => $lang ), $inline_url ) . '"' . ( $q_lang == $lang ? ' selected' : '' ) . ' > ' . qtrans_getLanguageName( $lang ) . '</option > ';
}
$output .= '</select > ';
}
return $output;
}
/**
* @param $list
*
* @return array
* @since 4.3
*
*/
public function vcNavControls( $list ) {
if ( $this->isValidPostType() ) {
if ( is_array( $list ) ) {
$list[] = array(
'qtranslate',
$this->getControlSelectDropdown(),
);
}
}
return $list;
}
/**
* @param $list
*
* @return array
* @since 4.3
*
*/
public function vcNavControlsFrontend( $list ) {
if ( $this->isValidPostType() ) {
if ( is_array( $list ) ) {
$list[] = array(
'qtranslate',
$this->getControlSelectDropdownFrontend(),
);
}
}
return $list;
}
/**
* @return string
* @since 4.3
*/
public function getControlSelectDropdown() {
return '<li class="vc_pull-right" > ' . $this->generateSelect() . '</li > ';
}
/**
* @return string
*/
public function getControlSelectDropdownFrontend() {
return '<li class="vc_pull-right" > ' . $this->generateSelectFrontend() . '</li > ';
}
/**
* @param $link
*
* @return string
* @since 4.3
*
*/
public function vcRenderEditButtonLink( $link ) {
return add_query_arg( array( 'qlang' => qtrans_getLanguage() ), $link );
}
/**
* @since 4.3
*/
public function vcFrontendEditorRender() {
global $q_config;
$output = '';
$q_lang = vc_get_param( 'qlang' );
if ( ! is_string( $q_lang ) ) {
$q_lang = $q_config['language'];
}
$output .= '<input type="hidden" id="vc_vendor_qtranslate_postcontent" value="' . esc_attr( vc_frontend_editor()->post()->post_content ) . '" data-lang="' . $q_lang . '"/>';
$output .= '<input type="hidden" id="vc_vendor_qtranslate_posttitle" value="' . esc_attr( vc_frontend_editor()->post()->post_title ) . '" data-lang="' . $q_lang . '"/>';
echo $output;
}
/**
* @param $content
*
* @return string
* @since 4.3
*
*/
public function filterPostContent( $content ) {
return qtrans_useCurrentLanguageIfNotFoundShowAvailable( $content );
}
}
classes/vendors/plugins/class-vc-vendor-revslider.php 0000644 00000010235 15121635561 0017064 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* RevSlider loader.
* @since 4.3
*/
class Vc_Vendor_Revslider {
/**
* @since 4.3
* @var int - index of revslider
*/
protected static $instanceIndex = 1;
/**
* Add shortcode to WPBakery Page Builder also add fix for frontend to regenerate id of revslider.
* @since 4.3
*/
public function load() {
add_action( 'vc_after_mapping', array(
$this,
'buildShortcode',
) );
}
/**
* @since 4.3
*/
public function buildShortcode() {
if ( class_exists( 'RevSlider' ) ) {
vc_lean_map( 'rev_slider_vc', array(
$this,
'addShortcodeSettings',
) );
if ( vc_is_frontend_ajax() || vc_is_frontend_editor() ) {
add_filter( 'vc_revslider_shortcode', array(
$this,
'setId',
) );
}
}
}
/**
* @param array $revsliders
*
* @since 4.4
*
* @deprecated 4.9
*/
public function mapShortcode( $revsliders = array() ) {
vc_map( array(
'base' => 'rev_slider_vc',
'name' => esc_html__( 'Revolution Slider', 'js_composer' ),
'icon' => 'icon-wpb-revslider',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place Revolution slider', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Widget title', 'js_composer' ),
'param_name' => 'title',
'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Revolution Slider', 'js_composer' ),
'param_name' => 'alias',
'admin_label' => true,
'value' => $revsliders,
'save_always' => true,
'description' => esc_html__( 'Select your Revolution Slider.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
) );
}
/**
* Replaces id of revslider for frontend editor.
* @param $output
*
* @return string
* @since 4.3
*
*/
public function setId( $output ) {
return preg_replace( '/rev_slider_(\d+)_(\d+)/', 'rev_slider_$1_$2' . time() . '_' . self::$instanceIndex ++, $output );
}
/**
* Mapping settings for lean method.
*
* @param $tag
*
* @return array
* @since 4.9
*
*/
public function addShortcodeSettings( $tag ) {
/** @noinspection PhpUndefinedClassInspection */
$slider = new RevSlider();
$arrSliders = $slider->getArrSliders();
$revsliders = array();
if ( $arrSliders ) {
foreach ( $arrSliders as $slider ) {
/** @noinspection PhpUndefinedClassInspection */
/** @var RevSlider $slider */
$revsliders[ $slider->getTitle() ] = $slider->getAlias();
}
} else {
$revsliders[ esc_html__( 'No sliders found', 'js_composer' ) ] = 0;
}
// Add fixes for frontend editor to regenerate id
return array(
'base' => $tag,
'name' => esc_html__( 'Revolution Slider', 'js_composer' ),
'icon' => 'icon-wpb-revslider',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place Revolution slider', 'js_composer' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => esc_html__( 'Widget title', 'js_composer' ),
'param_name' => 'title',
'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Revolution Slider', 'js_composer' ),
'param_name' => 'alias',
'admin_label' => true,
'value' => $revsliders,
'save_always' => true,
'description' => esc_html__( 'Select your Revolution Slider.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Extra class name', 'js_composer' ),
'param_name' => 'el_class',
'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
),
),
);
}
}
classes/vendors/plugins/class-vc-vendor-contact-form7.php 0000644 00000003552 15121635561 0017554 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Contact form7 vendor
* =======
* Plugin Contact form 7 vendor
* To fix issues when shortcode doesn't exists in frontend editor. #1053, #1054 etc.
* @since 4.3
*/
class Vc_Vendor_ContactForm7 {
/**
* Add action when contact form 7 is initialized to add shortcode.
* @since 4.3
*/
public function load() {
vc_lean_map( 'contact-form-7', array(
$this,
'addShortcodeSettings',
) );
}
/**
* Mapping settings for lean method.
*
* @param $tag
*
* @return array
* @since 4.9
*
*/
public function addShortcodeSettings( $tag ) {
/**
* Add Shortcode To WPBakery Page Builder
*/
$cf7 = get_posts( 'post_type="wpcf7_contact_form"&numberposts=-1' );
$contact_forms = array();
if ( $cf7 ) {
foreach ( $cf7 as $cform ) {
$contact_forms[ $cform->post_title ] = $cform->ID;
}
} else {
$contact_forms[ esc_html__( 'No contact forms found', 'js_composer' ) ] = 0;
}
return array(
'base' => $tag,
'name' => esc_html__( 'Contact Form 7', 'js_composer' ),
'icon' => 'icon-wpb-contactform7',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place Contact Form7', 'js_composer' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Select contact form', 'js_composer' ),
'param_name' => 'id',
'value' => $contact_forms,
'save_always' => true,
'description' => esc_html__( 'Choose previously created contact form from the drop down list.', 'js_composer' ),
),
array(
'type' => 'textfield',
'heading' => esc_html__( 'Search title', 'js_composer' ),
'param_name' => 'title',
'admin_label' => true,
'description' => esc_html__( 'Enter optional title to search if no ID selected or cannot find by ID.', 'js_composer' ),
),
),
);
}
}
classes/vendors/plugins/class-vc-vendor-yoast_seo.php 0000644 00000007056 15121635561 0017101 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Vendor_YoastSeo
* @since 4.4
*/
class Vc_Vendor_YoastSeo {
/**
* Created to improve yoast multiply calling wpseo_pre_analysis_post_content filter.
* @since 4.5.3
* @var string - parsed post content
*/
protected $parsedContent;
function __construct() {
add_action( 'vc_backend_editor_render', array(
$this,
'enqueueJs',
) );
add_filter( 'wpseo_sitemap_urlimages', array(
$this,
'filterSitemapUrlImages',
), 10, 2 );
}
/**
* Add filter for yoast.
* @since 4.4
*/
public function load() {
if ( class_exists( 'WPSEO_Metabox' ) && ( 'admin_page' === vc_mode() || 'admin_frontend_editor' === vc_mode() ) ) {
add_filter( 'wpseo_pre_analysis_post_content', array(
$this,
'filterResults',
) );
}
}
/**
* Properly parse content to detect images/text keywords.
* @param $content
*
* @return string
* @since 4.4
*
*/
public function filterResults( $content ) {
if ( empty( $this->parsedContent ) ) {
global $post, $wp_the_query;
$wp_the_query->post = $post; // since 4.5.3 to avoid the_post replaces
/**
* @since 4.4.3
* vc_filter: vc_vendor_yoastseo_filter_results
*/
do_action( 'vc_vendor_yoastseo_filter_results' );
$this->parsedContent = do_shortcode( shortcode_unautop( $content ) );
wp_reset_query();
}
return $this->parsedContent;
}
/**
* @since 4.4
*/
public function enqueueJs() {
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php' );
if ( get_post_type() === Vc_Grid_Item_Editor::postType() ) {
return;
}
wp_enqueue_script( 'yoast-seo-post-scraper' );
wp_enqueue_script( 'yoast-seo-admin-global-script' );
wp_enqueue_script( 'vc_vendor_seo_js', vc_asset_url( 'js/vendors/seo.js' ), array(
'underscore',
), WPB_VC_VERSION, true );
}
public function frontendEditorBuild() {
$vc_yoast_meta_box = $GLOBALS['wpseo_metabox'];
remove_action( 'admin_init', array(
$GLOBALS['wpseo_meta_columns'],
'setup_hooks',
) );
apply_filters( 'wpseo_use_page_analysis', false );
remove_action( 'add_meta_boxes', array(
$vc_yoast_meta_box,
'add_meta_box',
) );
remove_action( 'admin_enqueue_scripts', array(
$vc_yoast_meta_box,
'enqueue',
) );
remove_action( 'wp_insert_post', array(
$vc_yoast_meta_box,
'save_postdata',
) );
remove_action( 'edit_attachment', array(
$vc_yoast_meta_box,
'save_postdata',
) );
remove_action( 'add_attachment', array(
$vc_yoast_meta_box,
'save_postdata',
) );
remove_action( 'post_submitbox_start', array(
$vc_yoast_meta_box,
'publish_box',
) );
remove_action( 'admin_init', array(
$vc_yoast_meta_box,
'setup_page_analysis',
) );
remove_action( 'admin_init', array(
$vc_yoast_meta_box,
'translate_meta_boxes',
) );
remove_action( 'admin_footer', array(
$vc_yoast_meta_box,
'template_keyword_tab',
) );
}
/**
* @param $images
* @param $id
* @return array
*/
public function filterSitemapUrlImages( $images, $id ) {
if ( empty( $images ) ) {
$post = get_post( $id );
if ( $post && strpos( $post->post_content, '[vc_row' ) !== false ) {
preg_match_all( '/(?:image|images|ids|include)\=\"([^\"]+)\"/', $post->post_content, $matches );
foreach ( $matches[1] as $m ) {
$ids = explode( ',', $m );
foreach ( $ids as $id ) {
if ( (int) $id ) {
$images[] = array(
'src' => wp_get_attachment_url( $id ),
'title' => get_the_title( $id ),
);
}
}
}
}
}
return $images;
}
}
classes/vendors/plugins/class-vc-vendor-ninja-forms.php 0000644 00000005752 15121635561 0017320 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Ninja Forms vendor
* @since 4.4
*/
class Vc_Vendor_NinjaForms {
private static $ninjaCount;
/**
* Implement interface, map ninja forms shortcode
* @since 4.4
*/
public function load() {
vc_lean_map( 'ninja_form', array(
$this,
'addShortcodeSettings',
) );
add_filter( 'vc_frontend_editor_load_shortcode_ajax_output', array(
$this,
'replaceIds',
) );
}
/**
* Mapping settings for lean method.
*
* @param $tag
*
* @return array
* @since 4.9
*
*/
public function addShortcodeSettings( $tag ) {
$ninja_forms = $this->get_forms();
return array(
'base' => $tag,
'name' => esc_html__( 'Ninja Forms', 'js_composer' ),
'icon' => 'icon-wpb-ninjaforms',
'category' => esc_html__( 'Content', 'js_composer' ),
'description' => esc_html__( 'Place Ninja Form', 'js_composer' ),
'params' => array(
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Select ninja form', 'js_composer' ),
'param_name' => 'id',
'value' => $ninja_forms,
'save_always' => true,
'description' => esc_html__( 'Choose previously created ninja form from the drop down list.', 'js_composer' ),
),
),
);
}
/**
* @return array
*/
private function get_forms() {
$ninja_forms = array();
if ( $this->is_ninja_forms_three() ) {
$ninja_forms_data = ninja_forms_get_all_forms();
if ( ! empty( $ninja_forms_data ) ) {
// Fill array with Name=>Value(ID)
foreach ( $ninja_forms_data as $key => $value ) {
if ( is_array( $value ) ) {
$ninja_forms[ $value['name'] ] = $value['id'];
}
}
}
} else {
$ninja_forms_data = Ninja_Forms()->form()->get_forms();
if ( ! empty( $ninja_forms_data ) ) {
// Fill array with Name=>Value(ID)
foreach ( $ninja_forms_data as $form ) {
$ninja_forms[ $form->get_setting( 'title' ) ] = $form->get_id();
}
}
}
return $ninja_forms;
}
/**
* @return bool
*/
private function is_ninja_forms_three() {
return ( version_compare( get_option( 'ninja_forms_version', '0.0.0' ), '3.0', '<' ) || get_option( 'ninja_forms_load_deprecated', false ) );
}
/**
* @param $output
* @return mixed
*/
public function replaceIds( $output ) {
if ( is_null( self::$ninjaCount ) ) {
self::$ninjaCount = 1;
} else {
self::$ninjaCount ++;
}
$patterns = array(
'(nf-form-)(\d+)(-cont)',
'(nf-form-title-)(\d+)()',
'(nf-form-errors-)(\d+)()',
'(form.id\s*=\s*\')(\d+)(\')',
);
$time = time() . self::$ninjaCount . rand( 100, 999 );
foreach ( $patterns as $pattern ) {
$output = preg_replace( '/' . $pattern . '/', '${1}' . $time . '${3}', $output );
}
$replaceTo = <<<JS
if (typeof nfForms !== 'undefined') {
nfForms = nfForms.filter( function(item) {
if (item && item.id) {
return document.querySelector('#nf-form-' + item.id + '-cont')
}
})
}
JS;
$response = str_replace( 'var nfForms', $replaceTo . ';var nfForms', $output );
return $response;
}
}
classes/vendors/plugins/class-vc-vendor-wpml.php 0000644 00000002412 15121635561 0016042 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Vendor_WPML
* @since 4.9
*/
class Vc_Vendor_WPML {
public function load() {
add_filter( 'vc_object_id', array(
$this,
'filterMediaId',
) );
add_filter( 'vc_basic_grid_filter_query_suppress_filters', '__return_false' );
add_filter( 'vc_grid_request_url', array(
$this,
'appendLangToUrlGrid',
) );
global $sitepress;
$action = vc_post_param( 'action' );
if ( vc_is_page_editable() && 'vc_frontend_load_template' === $action ) {
// Fix Issue with loading template #135512264670405
remove_action( 'wp_loaded', array(
$sitepress,
'maybe_set_this_lang',
) );
}
}
/**
* @param $link
* @return string
*/
public function appendLangToUrlGrid( $link ) {
global $sitepress;
if ( is_object( $sitepress ) ) {
if ( is_string( $link ) && strpos( $link, 'lang' ) === false ) {
// add langs for vc_inline/vc_editable requests
if ( strpos( $link, 'admin-ajax' ) !== false ) {
return add_query_arg( array( 'lang' => $sitepress->get_current_language() ), $link );
}
}
}
return $link;
}
/**
* @param $id
* @return mixed|void
*/
public function filterMediaId( $id ) {
return apply_filters( 'wpml_object_id', $id, 'post', true );
}
}
classes/editors/navbar/class-vc-navbar-undoredo.php 0000644 00000001670 15121635561 0016444 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Navbar_Undoredo
*/
class Vc_Navbar_Undoredo {
public function __construct() {
// Backend
add_filter( 'vc_nav_controls', array(
$this,
'addControls',
) );
// Frontend
add_filter( 'vc_nav_front_controls', array(
$this,
'addControls',
) );
}
/**
* @param $controls
* @return array
*/
public function addControls( $controls ) {
$controls[] = array(
'redo',
'<li class="vc_pull-right"><a id="vc_navbar-redo" href="javascript:;" class="vc_icon-btn" disabled title="' . esc_attr__( 'Redo', 'js_composer' ) . '"><i class="vc_navbar-icon fa fa-repeat"></i></a></li>',
);
$controls[] = array(
'undo',
'<li class="vc_pull-right"><a id="vc_navbar-undo" href="javascript:;" class="vc_icon-btn" disabled title="' . esc_attr__( 'Undo', 'js_composer' ) . '"><i class="vc_navbar-icon fa fa-undo"></i></a></li>',
);
return $controls;
}
}
classes/editors/navbar/class-vc-navbar.php 0000644 00000012553 15121635561 0014631 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Renders navigation bar for Editors.
*/
class Vc_Navbar {
/**
* @var array
*/
protected $controls = array(
'add_element',
'templates',
'save_backend',
'preview',
'frontend',
'custom_css',
'fullscreen',
'windowed',
);
/**
* @var string
*/
protected $brand_url = 'https://wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=backend_editor';
/**
* @var string
*/
protected $css_class = 'vc_navbar';
/**
* @var string
*/
protected $controls_filter_name = 'vc_nav_controls';
/**
* @var bool|WP_Post
*/
protected $post = false;
/**
* @param WP_Post $post
*/
public function __construct( WP_Post $post ) {
$this->post = $post;
}
/**
* Generate array of controls by iterating property $controls list.
* vc_filter: vc_nav_controls - hook to override list of controls
* @return array - list of arrays witch contains key name and html output for button.
*/
public function getControls() {
$control_list = array();
foreach ( $this->controls as $control ) {
$method = vc_camel_case( 'get_control_' . $control );
if ( method_exists( $this, $method ) ) {
$control_list[] = array(
$control,
$this->$method(),
);
}
}
return apply_filters( $this->controls_filter_name, $control_list );
}
/**
* Get current post.
* @return null|WP_Post
*/
public function post() {
if ( $this->post ) {
return $this->post;
} else {
$this->post = get_post();
}
return $this->post;
}
/**
* Render template.
*/
public function render() {
vc_include_template( 'editors/navbar/navbar.tpl.php', array(
'css_class' => $this->css_class,
'controls' => $this->getControls(),
'nav_bar' => $this,
'post' => $this->post(),
) );
}
/**
* vc_filter: vc_nav_front_logo - hook to override WPBakery Page Builder logo
* @return string
*/
public function getLogo() {
$output = '<a id="vc_logo" class="vc_navbar-brand" title="' . esc_attr__( 'WPBakery Page Builder', 'js_composer' ) . '" href="' . esc_url( $this->brand_url ) . '" target="_blank">' . esc_attr__( 'WPBakery Page Builder', 'js_composer' ) . '</a>';
return apply_filters( 'vc_nav_front_logo', $output );
}
/**
* @return string
* @throws \Exception
*/
public function getControlCustomCss() {
if ( ! vc_user_access()->part( 'post_settings' )->can()->get() ) {
return '';
}
return '<li class="vc_pull-right"><a id="vc_post-settings-button" href="javascript:;" class="vc_icon-btn vc_post-settings" title="' . esc_attr__( 'Page settings', 'js_composer' ) . '">' . '<span id="vc_post-css-badge" class="vc_badge vc_badge-custom-css" style="display: none;">' . esc_attr__( 'CSS', 'js_composer' ) . '</span><i class="vc-composer-icon vc-c-icon-cog"></i></a>' . '</li>';
}
/**
* @return string
*/
public function getControlFullscreen() {
return '<li class="vc_show-mobile vc_pull-right">' . '<a id="vc_fullscreen-button" class="vc_icon-btn vc_fullscreen-button" title="' . esc_attr__( 'Full screen', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-fullscreen"></i></a>' . '</li>';
}
/**
* @return string
*/
public function getControlWindowed() {
return '<li class="vc_show-mobile vc_pull-right">' . '<a id="vc_windowed-button" class="vc_icon-btn vc_windowed-button" title="' . esc_attr__( 'Exit full screen', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-fullscreen_exit"></i></a>' . '</li>';
}
/**
* @return string
* @throws \Exception
*/
public function getControlAddElement() {
if ( vc_user_access()->part( 'shortcodes' )->checkStateAny( true, 'custom', null )
->get() && vc_user_access_check_shortcode_all( 'vc_row' ) && vc_user_access_check_shortcode_all( 'vc_column' ) ) {
return '<li class="vc_show-mobile">' . ' <a href="javascript:;" class="vc_icon-btn vc_element-button" data-model-id="vc_element" id="vc_add-new-element" title="' . '' . esc_attr__( 'Add new element', 'js_composer' ) . '">' . ' <i class="vc-composer-icon vc-c-icon-add_element"></i>' . ' </a>' . '</li>';
}
return '';
}
/**
* @return string
* @throws \Exception
*/
public function getControlTemplates() {
if ( ! vc_user_access()->part( 'templates' )->can()->get() ) {
return '';
}
return '<li><a href="javascript:;" class="vc_icon-btn vc_templates-button" id="vc_templates-editor-button" title="' . esc_attr__( 'Templates', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-add_template"></i></a></li>';
}
/**
* @return string
* @throws \Exception
*/
public function getControlFrontend() {
if ( ! vc_enabled_frontend() ) {
return '';
}
return '<li class="vc_pull-right" style="display: none;">' . '<a href="' . esc_url( vc_frontend_editor()->getInlineUrl() ) . '" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn" id="wpb-edit-inline">' . esc_html__( 'Frontend', 'js_composer' ) . '</a>' . '</li>';
}
/**
* @return string
*/
public function getControlPreview() {
return '';
}
/**
* @return string
*/
public function getControlSaveBackend() {
return '<li class="vc_pull-right vc_save-backend">' . '<a href="javascript:;" class="vc_btn vc_btn-grey vc_btn-sm vc_navbar-btn vc_control-preview">' . esc_attr__( 'Preview', 'js_composer' ) . '</a>' . '<a class="vc_btn vc_btn-sm vc_navbar-btn vc_btn-primary vc_control-save" id="wpb-save-post">' . esc_attr__( 'Update', 'js_composer' ) . '</a>' . '</li>';
}
}
classes/editors/navbar/class-vc-navbar-frontend.php 0000644 00000012713 15121635561 0016444 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'EDITORS_DIR', 'navbar/class-vc-navbar.php' );
/**
*
*/
class Vc_Navbar_Frontend extends Vc_Navbar {
/**
* @var array
*/
protected $controls = array(
'add_element',
'templates',
'view_post',
'save_update',
'screen_size',
'custom_css',
);
/**
* @var string
*/
protected $controls_filter_name = 'vc_nav_front_controls';
/**
* @var string
*/
protected $brand_url = 'https://wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=frontend_editor';
/**
* @var string
*/
protected $css_class = 'vc_navbar vc_navbar-frontend';
/**
* @return string
*/
public function getControlScreenSize() {
$disable_responsive = vc_settings()->get( 'not_responsive_css' );
if ( '1' !== $disable_responsive ) {
$screen_sizes = apply_filters( 'wpb_navbar_getControlScreenSize', array(
array(
'title' => esc_html__( 'Desktop', 'js_composer' ),
'size' => '100%',
'key' => 'default',
'active' => true,
),
array(
'title' => esc_html__( 'Tablet landscape mode', 'js_composer' ),
'size' => '1024px',
'key' => 'landscape-tablets',
),
array(
'title' => esc_html__( 'Tablet portrait mode', 'js_composer' ),
'size' => '768px',
'key' => 'portrait-tablets',
),
array(
'title' => esc_html__( 'Smartphone landscape mode', 'js_composer' ),
'size' => '480px',
'key' => 'landscape-smartphones',
),
array(
'title' => esc_html__( 'Smartphone portrait mode', 'js_composer' ),
'size' => '320px',
'key' => 'portrait-smartphones',
),
) );
$output = '<li class="vc_pull-right">' . '<div class="vc_dropdown" id="vc_screen-size-control">' . '<a href="#" class="vc_dropdown-toggle"' . ' title="' . esc_attr__( 'Responsive preview', 'js_composer' ) . '"><i class="vc-composer-icon vc_current-layout-icon vc-c-icon-layout_default"' . ' id="vc_screen-size-current"></i><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></a>' . '<ul class="vc_dropdown-list">';
$screen = current( $screen_sizes );
while ( $screen ) {
$output .= '<li><a href="#" title="' . esc_attr( $screen['title'] ) . '"' . ' class="vc_screen-width vc-composer-icon vc-c-icon-layout_' . esc_attr( $screen['key'] ) . ( isset( $screen['active'] ) && $screen['active'] ? ' active' : '' ) . '" data-size="' . esc_attr( $screen['size'] ) . '"></a></li>';
next( $screen_sizes );
$screen = current( $screen_sizes );
}
$output .= '</ul></div></li>';
return $output;
}
return '';
}
/**
* @return string
* @throws \Exception
*/
public function getControlSaveUpdate() {
$post = $this->post();
$post_type = get_post_type_object( $this->post->post_type );
$can_publish = current_user_can( $post_type->cap->publish_posts );
ob_start();
?>
<li class="vc_show-mobile vc_pull-right">
<button data-url="<?php echo esc_attr( get_edit_post_link( $post->ID ) . '&wpb_vc_js_status=true&classic-editor' ); ?>"
class="vc_btn vc_btn-default vc_btn-sm vc_navbar-btn vc_btn-backend-editor" id="vc_button-cancel"
title="<?php esc_attr_e( 'Cancel all changes and return to WP dashboard', 'js_composer' ); ?>">
<?php
echo vc_user_access()->part( 'backend_editor' )->can()->get() ? esc_html__( 'Backend Editor', 'js_composer' ) : esc_html__( 'Edit', 'js_composer' );
?>
</button>
<?php
if ( ! in_array( $post->post_status, array(
'publish',
'future',
'private',
), true ) ) :
?>
<?php if ( 'draft' === $post->post_status ) : ?>
<button type="button" class="vc_btn vc_btn-default vc_btn-sm vc_navbar-btn vc_btn-save-draft"
id="vc_button-save-draft"
title="<?php esc_attr_e( 'Save Draft', 'js_composer' ); ?>"><?php esc_html_e( 'Save Draft', 'js_composer' ); ?></button>
<?php elseif ( 'pending' === $post->post_status && $can_publish ) : ?>
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
id="vc_button-save-as-pending"
title="<?php esc_attr_e( 'Save as Pending', 'js_composer' ); ?>"><?php esc_html_e( 'Save as Pending', 'js_composer' ); ?></button>
<?php endif ?>
<?php if ( $can_publish ) : ?>
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
id="vc_button-update" title="<?php esc_attr_e( 'Publish', 'js_composer' ); ?>"
data-change-status="publish"><?php esc_html_e( 'Publish', 'js_composer' ); ?></button>
<?php else : ?>
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
id="vc_button-update" title="<?php esc_attr_e( 'Submit for Review', 'js_composer' ); ?>"
data-change-status="pending"><?php esc_html_e( 'Submit for Review', 'js_composer' ); ?></button>
<?php endif ?>
<?php else : ?>
<button type="button" class="vc_btn vc_btn-primary vc_btn-sm vc_navbar-btn vc_btn-save"
id="vc_button-update"
title="<?php esc_attr_e( 'Update', 'js_composer' ); ?>"><?php esc_html_e( 'Update', 'js_composer' ); ?></button>
<?php endif ?>
</li>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
/**
* @return string
*/
public function getControlViewPost() {
return '<li class="vc_pull-right">' . '<a href="' . esc_url( get_permalink( $this->post() ) ) . '" class="vc_icon-btn vc_back-button"' . ' title="' . esc_attr__( 'Exit WPBakery Page Builder edit mode', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-close"></i></a>' . '</li>';
}
}
classes/editors/class-vc-frontend-editor.php 0000644 00000071071 15121635561 0015212 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder front end editor
*
* @package WPBakeryPageBuilder
*
*/
/**
* Vc front end editor.
*
* Introduce principles ‘What You See Is What You Get’ into your page building process with our amazing frontend editor.
* See how your content will look on the frontend instantly with no additional clicks or switches.
*
* @since 4.0
*/
class Vc_Frontend_Editor {
/**
* @var
*/
protected $dir;
/**
* @var int
*/
protected $tag_index = 1;
/**
* @var array
*/
public $post_shortcodes = array();
/**
* @var string
*/
protected $template_content = '';
/**
* @var bool
*/
protected static $enabled_inline = true;
/**
* @var
*/
public $current_user;
/**
* @var
*/
public $post;
/**
* @var
*/
public $post_id;
/**
* @var
*/
public $post_url;
/**
* @var
*/
public $url;
/**
* @var
*/
public $post_type;
/**
* @var array
*/
protected $settings = array(
'assets_dir' => 'assets',
'templates_dir' => 'templates',
'template_extension' => 'tpl.php',
'plugin_path' => 'js_composer/inline',
);
/**
* @var string
*/
protected static $content_editor_id = 'content';
/**
* @var array
*/
protected static $content_editor_settings = array(
'dfw' => true,
'tabfocus_elements' => 'insert-media-button',
'editor_height' => 360,
);
/**
* @var string
*/
protected static $brand_url = 'https://wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=frontend_editor';
public $post_custom_css;
/**
* @var string
*/
protected $vc_post_content = '';
/**
*
*/
public function init() {
$this->addHooks();
/**
* If current mode of VC is frontend editor load it.
*/
if ( vc_is_frontend_editor() ) {
$this->hookLoadEdit();
} elseif ( vc_is_page_editable() ) {
/**
* if page loaded inside frontend editor iframe it has page_editable mode.
* It required to some some js/css elements and add few helpers for editor to be used.
*/
$this->buildEditablePage();
} else {
// Is it is simple page just enable buttons and controls
$this->buildPage();
}
}
/**
*
*/
public function addHooks() {
add_action( 'template_redirect', array(
$this,
'loadShortcodes',
) );
add_filter( 'page_row_actions', array(
$this,
'renderRowAction',
) );
add_filter( 'post_row_actions', array(
$this,
'renderRowAction',
) );
add_shortcode( 'vc_container_anchor', 'vc_container_anchor' );
}
/**
*
*/
public function hookLoadEdit() {
add_action( 'current_screen', array(
$this,
'adminInit',
) );
do_action( 'vc_frontend_editor_hook_load_edit' );
add_action( 'admin_head', array(
$this,
'disableBlockEditor',
) );
}
public function disableBlockEditor() {
global $current_screen;
$current_screen->is_block_editor( false );
}
/**
*
*/
public function adminInit() {
if ( Vc_Frontend_Editor::frontendEditorEnabled() ) {
$this->setPost();
if ( vc_check_post_type() ) {
$this->renderEditor();
}
}
}
/**
*
*/
public function buildEditablePage() {
if ( 'vc_load_shortcode' === vc_request_param( 'action' ) ) {
return;
}
visual_composer()->shared_templates->init();
add_filter( 'the_title', array(
$this,
'setEmptyTitlePlaceholder',
) );
add_action( 'the_post', array(
$this,
'parseEditableContent',
), 9999 ); // after all the_post actions ended
do_action( 'vc_inline_editor_page_view' );
add_filter( 'wp_enqueue_scripts', array(
$this,
'loadIFrameJsCss',
) );
add_action( 'wp_footer', array(
$this,
'printPostShortcodes',
) );
}
/**
*
*/
public function buildPage() {
add_action( 'admin_bar_menu', array(
$this,
'adminBarEditLink',
), 1000 );
add_filter( 'edit_post_link', array(
$this,
'renderEditButton',
) );
}
/**
* @return bool
*/
public static function inlineEnabled() {
return true === self::$enabled_inline;
}
/**
* @return bool
* @throws \Exception
*/
public static function frontendEditorEnabled() {
return self::inlineEnabled() && vc_user_access()->part( 'frontend_editor' )->can()->get();
}
/**
* @param bool $disable
*/
public static function disableInline( $disable = true ) {
self::$enabled_inline = ! $disable;
}
/**
* Main purpose of this function is to
* 1) Parse post content to get ALL shortcodes in to array
* 2) Wrap all shortcodes into editable-wrapper
* 3) Return "iframe" editable content in extra-script wrapper
*
* @param Wp_Post $post
* @throws \Exception
*/
public function parseEditableContent( $post ) {
if ( ! vc_is_page_editable() || vc_action() || vc_post_param( 'action' ) ) {
return;
}
$post_id = (int) vc_get_param( 'vc_post_id' );
if ( $post_id > 0 && $post->ID === $post_id && ! defined( 'VC_LOADING_EDITABLE_CONTENT' ) ) {
$post_content = '';
define( 'VC_LOADING_EDITABLE_CONTENT', true );
remove_filter( 'the_content', 'wpautop' );
do_action( 'vc_load_shortcode' );
$post_content .= $this->getPageShortcodesByContent( $post->post_content );
ob_start();
vc_include_template( 'editors/partials/vc_welcome_block.tpl.php' );
$post_content .= ob_get_clean();
ob_start();
vc_include_template( 'editors/partials/post_shortcodes.tpl.php', array( 'editor' => $this ) );
$post_shortcodes = ob_get_clean();
$custom_tag = 'script';
$this->vc_post_content = '<' . $custom_tag . ' type="template/html" id="vc_template-post-content" style="display:none">' . rawurlencode( apply_filters( 'the_content', $post_content ) ) . '</' . $custom_tag . '>' . $post_shortcodes;
// We already used the_content filter, we need to remove it to avoid double-using
remove_all_filters( 'the_content' );
// Used for just returning $post->post_content
add_filter( 'the_content', array(
$this,
'editableContent',
) );
}
}
/**
* @since 4.4
* Used to print rendered post content, wrapped with frontend editors "div" and etc.
*/
public function printPostShortcodes() {
// @codingStandardsIgnoreLine
print $this->vc_post_content;
}
/**
* @param $content
*
* @return string
*/
public function editableContent( $content ) {
// same addContentAnchor
do_shortcode( $content ); // this will not be outputted, but this is needed to enqueue needed js/styles.
return '<span id="vc_inline-anchor" style="display:none !important;"></span>';
}
/**
* @param string $url
* @param string $id
*
* vc_filter: vc_get_inline_url - filter to edit frontend editor url (can be used for example in vendors like
* qtranslate do)
*
* @return mixed
*/
public static function getInlineUrl( $url = '', $id = '' ) {
$the_ID = ( strlen( $id ) > 0 ? $id : get_the_ID() );
return apply_filters( 'vc_get_inline_url', admin_url() . 'post.php?vc_action=vc_inline&post_id=' . $the_ID . '&post_type=' . get_post_type( $the_ID ) . ( strlen( $url ) > 0 ? '&url=' . rawurlencode( $url ) : '' ) );
}
/**
* @return string
*/
public function wrapperStart() {
return '';
}
/**
* @return string
*/
public function wrapperEnd() {
return '';
}
/**
* @param $url
*/
public static function setBrandUrl( $url ) {
self::$brand_url = $url;
}
/**
* @return string
*/
public static function getBrandUrl() {
return self::$brand_url;
}
/**
* @return string
*/
public static function shortcodesRegexp() {
$tagnames = array_keys( WPBMap::getShortCodes() );
$tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) );
// WARNING from shortcodes.php! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
// Also, see shortcode_unautop() and shortcode.js.
return '\\[' // Opening bracket
. '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
. "($tagregexp)" // 2: Shortcode name
. '(?![\\w\-])' // Not followed by word character or hyphen
. '(' // 3: Unroll the loop: Inside the opening shortcode tag
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket
. '[^\\]\\/]*' // Not a closing bracket or forward slash
. ')*?' . ')' . '(?:' . '(\\/)' // 4: Self closing tag ...
. '\\]' // ... and closing bracket
. '|' . '\\]' // Closing bracket
. '(?:' . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
. '[^\\[]*+' // Not an opening bracket
. '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
. '[^\\[]*+' // Not an opening bracket
. ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag
. ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]]
}
/**
*
*/
public function setPost() {
global $post, $wp_query;
$this->post = get_post(); // fixes #1342 if no get/post params set
$this->post_id = vc_get_param( 'post_id' );
if ( vc_post_param( 'post_id' ) ) {
$this->post_id = vc_post_param( 'post_id' );
}
if ( $this->post_id ) {
$this->post = get_post( $this->post_id );
}
do_action_ref_array( 'the_post', array( $this->post, $wp_query ) );
$post = $this->post;
$this->post_id = $this->post->ID;
}
/**
* @return mixed
*/
public function post() {
! isset( $this->post ) && $this->setPost();
return $this->post;
}
/**
* Used for wp filter 'wp_insert_post_empty_content' to allow empty post insertion.
*
* @param $allow_empty
*
* @return bool
*/
public function allowInsertEmptyPost( $allow_empty ) {
return false;
}
/**
* vc_filter: vc_frontend_editor_iframe_url - hook to edit iframe url, can be used in vendors like qtranslate do.
*/
public function renderEditor() {
global $current_user;
wp_get_current_user();
$this->current_user = $current_user;
$this->post_url = set_url_scheme( get_permalink( $this->post_id ) );
$array = array(
'edit_post',
$this->post_id,
);
if ( ! self::inlineEnabled() || ! vc_user_access()->wpAny( $array )->get() ) {
header( 'Location: ' . $this->post_url );
}
$this->registerJs();
$this->registerCss();
visual_composer()->registerAdminCss(); // bc
visual_composer()->registerAdminJavascript(); // bc
if ( $this->post && 'auto-draft' === $this->post->post_status ) {
$post_data = array(
'ID' => $this->post_id,
'post_status' => 'draft',
'post_title' => '',
);
add_filter( 'wp_insert_post_empty_content', array(
$this,
'allowInsertEmptyPost',
) );
wp_update_post( $post_data, true );
$this->post->post_status = 'draft';
$this->post->post_title = '';
}
add_filter( 'admin_body_class', array(
$this,
'filterAdminBodyClass',
) );
$this->post_type = get_post_type_object( $this->post->post_type );
$this->url = $this->post_url . ( preg_match( '/\?/', $this->post_url ) ? '&' : '?' ) . 'vc_editable=true&vc_post_id=' . $this->post->ID . '&_vcnonce=' . vc_generate_nonce( 'vc-admin-nonce' );
$this->url = apply_filters( 'vc_frontend_editor_iframe_url', $this->url );
$this->enqueueAdmin();
$this->enqueueMappedShortcode();
wp_enqueue_media( array( 'post' => $this->post_id ) );
remove_all_actions( 'admin_notices', 3 );
remove_all_actions( 'network_admin_notices', 3 );
$post_custom_css = wp_strip_all_tags( get_post_meta( $this->post_id, '_wpb_post_custom_css', true ) );
$this->post_custom_css = $post_custom_css;
if ( ! defined( 'IFRAME_REQUEST' ) ) {
define( 'IFRAME_REQUEST', true );
}
/**
* @deprecated vc_admin_inline_editor action hook
*/
do_action( 'vc_admin_inline_editor' );
/**
* new one
*/
do_action( 'vc_frontend_editor_render' );
add_filter( 'admin_title', array(
$this,
'setEditorTitle',
) );
$this->render( 'editor' );
die();
}
/**
* @return string
*/
public function setEditorTitle() {
return sprintf( esc_html__( 'Edit %s with WPBakery Page Builder', 'js_composer' ), $this->post_type->labels->singular_name );
}
/**
* @param $title
*
* @return string
*/
public function setEmptyTitlePlaceholder( $title ) {
return ! is_string( $title ) || strlen( $title ) === 0 ? esc_attr__( '(no title)', 'js_composer' ) : $title;
}
/**
* @param $template
*/
public function render( $template ) {
vc_include_template( 'editors/frontend_' . $template . '.tpl.php', array( 'editor' => $this ) );
}
/**
* @param $link
*
* @return string
* @throws \Exception
*/
public function renderEditButton( $link ) {
if ( $this->showButton( get_the_ID() ) ) {
return $link . ' <a href="' . esc_url( self::getInlineUrl() ) . '" id="vc_load-inline-editor" class="vc_inline-link">' . esc_html__( 'Edit with WPBakery Page Builder', 'js_composer' ) . '</a>';
}
return $link;
}
/**
* @param $actions
*
* @return mixed
* @throws \Exception
*/
public function renderRowAction( $actions ) {
$post = get_post();
if ( $this->showButton( $post->ID ) ) {
$actions['edit_vc'] = '<a
href="' . esc_url( $this->getInlineUrl( '', $post->ID ) ) . '">' . esc_html__( 'Edit with WPBakery Page Builder', 'js_composer' ) . '</a>';
}
return $actions;
}
/**
* @param null $post_id
*
* @return bool
* @throws \Exception
*/
public function showButton( $post_id = null ) {
$type = get_post_type();
$post_status = array(
'private',
'trash',
);
$post_types = array(
'templatera',
'vc_grid_item',
);
$cap_edit_post = array(
'edit_post',
$post_id,
);
$result = self::inlineEnabled() && ! in_array( get_post_status(), $post_status, true ) && ! in_array( $type, $post_types, true ) && vc_user_access()->wpAny( $cap_edit_post )
->get() && vc_check_post_type( $type );
return apply_filters( 'vc_show_button_fe', $result, $post_id, $type );
}
/**
* @param WP_Admin_Bar $wp_admin_bar
* @throws \Exception
*/
public function adminBarEditLink( $wp_admin_bar ) {
if ( ! is_object( $wp_admin_bar ) ) {
global $wp_admin_bar;
}
if ( is_singular() ) {
if ( $this->showButton( get_the_ID() ) ) {
$wp_admin_bar->add_menu( array(
'id' => 'vc_inline-admin-bar-link',
'title' => esc_html__( 'Edit with WPBakery Page Builder', 'js_composer' ),
'href' => self::getInlineUrl(),
'meta' => array( 'class' => 'vc_inline-link' ),
) );
}
}
}
/**
* @param $content
*/
public function setTemplateContent( $content ) {
$this->template_content = $content;
}
/**
* vc_filter: vc_inline_template_content - filter to override template content
* @return mixed
*/
public function getTemplateContent() {
return apply_filters( 'vc_inline_template_content', $this->template_content );
}
/**
*
*/
public function renderTemplates() {
$this->render( 'templates' );
die;
}
/**
*
*/
public function loadTinyMceSettings() {
if ( ! class_exists( '_WP_Editors' ) ) {
require ABSPATH . WPINC . '/class-wp-editor.php';
}
$set = _WP_Editors::parse_settings( self::$content_editor_id, self::$content_editor_settings );
_WP_Editors::editor_settings( self::$content_editor_id, $set );
}
/**
*
*/
public function loadIFrameJsCss() {
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'jquery-ui-droppable' );
wp_enqueue_script( 'jquery-ui-draggable' );
wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-autocomplete' );
wp_enqueue_script( 'wpb_composer_front_js' );
wp_enqueue_style( 'js_composer_front' );
wp_enqueue_style( 'vc_inline_css', vc_asset_url( 'css/js_composer_frontend_editor_iframe.min.css' ), array(), WPB_VC_VERSION );
wp_enqueue_script( 'vc_waypoints' );
wp_enqueue_script( 'wpb_scrollTo_js', vc_asset_url( 'lib/bower/scrollTo/jquery.scrollTo.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_enqueue_style( 'js_composer_custom_css' );
wp_enqueue_script( 'wpb_php_js', vc_asset_url( 'lib/php.default/php.default.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_enqueue_script( 'vc_inline_iframe_js', vc_asset_url( 'js/dist/page_editable.min.js' ), array(
'jquery-core',
'underscore',
), WPB_VC_VERSION, true );
do_action( 'vc_load_iframe_jscss' );
}
/**
*
* @throws \Exception
*/
public function loadShortcodes() {
if ( vc_is_page_editable() && vc_enabled_frontend() ) {
$action = vc_post_param( 'action' );
if ( 'vc_load_shortcode' === $action ) {
$output = '';
ob_start();
$this->setPost();
$shortcodes = (array) vc_post_param( 'shortcodes' );
do_action( 'vc_load_shortcode', $shortcodes );
$output .= ob_get_clean();
$output .= $this->renderShortcodes( $shortcodes );
$output .= '<div data-type="files">';
ob_start();
_print_styles();
print_head_scripts();
wp_footer();
$output .= ob_get_clean();
$output .= '</div>';
// @codingStandardsIgnoreLine
print apply_filters( 'vc_frontend_editor_load_shortcode_ajax_output', $output );
} elseif ( 'vc_frontend_load_template' === $action ) {
$this->setPost();
visual_composer()->templatesPanelEditor()->renderFrontendTemplate();
} elseif ( '' !== $action ) {
do_action( 'vc_front_load_page_' . esc_attr( vc_post_param( 'action' ) ) );
}
}
}
/**
* @param $s
*
* @return string
*/
public function fullUrl( $s ) {
$ssl = ( ! empty( $s['HTTPS'] ) && 'on' === $s['HTTPS'] ) ? true : false;
$sp = strtolower( $s['SERVER_PROTOCOL'] );
$protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . ( ( $ssl ) ? 's' : '' );
$port = $s['SERVER_PORT'];
$port = ( ( ! $ssl && '80' === $port ) || ( $ssl && '443' === $port ) ) ? '' : ':' . $port;
if ( isset( $s['HTTP_X_FORWARDED_HOST'] ) ) {
$host = $s['HTTP_X_FORWARDED_HOST'];
} else {
$host = ( isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : $s['SERVER_NAME'] );
}
return $protocol . '://' . $host . $port . $s['REQUEST_URI'];
}
/**
* @return string
*/
public static function cleanStyle() {
return '';
}
/**
*
*/
public function enqueueRequired() {
do_action( 'wp_enqueue_scripts' );
visual_composer()->frontCss();
visual_composer()->frontJsRegister();
}
/**
* @param array $shortcodes
*
* vc_filter: vc_front_render_shortcodes - hook to override shortcode rendered output
* @return mixed|void
* @throws \Exception
*/
public function renderShortcodes( array $shortcodes ) {
$this->enqueueRequired();
$output = '';
foreach ( $shortcodes as $shortcode ) {
if ( isset( $shortcode['id'] ) && isset( $shortcode['string'] ) ) {
if ( isset( $shortcode['tag'] ) ) {
$shortcode_obj = visual_composer()->getShortCode( $shortcode['tag'] );
if ( is_object( $shortcode_obj ) ) {
$output .= '<div data-type="element" data-model-id="' . $shortcode['id'] . '">';
$is_container = $shortcode_obj->settings( 'is_container' ) || ( null !== $shortcode_obj->settings( 'as_parent' ) && false !== $shortcode_obj->settings( 'as_parent' ) );
if ( $is_container ) {
$shortcode['string'] = preg_replace( '/\]/', '][vc_container_anchor]', $shortcode['string'], 1 );
}
$output .= '<div class="vc_element" data-shortcode-controls="' . esc_attr( wp_json_encode( $shortcode_obj->shortcodeClass()
->getControlsList() ) ) . '" data-container="' . esc_attr( $is_container ) . '" data-model-id="' . $shortcode['id'] . '">' . $this->wrapperStart() . do_shortcode( stripslashes( $shortcode['string'] ) ) . $this->wrapperEnd() . '</div>';
$output .= '</div>';
}
}
}
}
return apply_filters( 'vc_front_render_shortcodes', $output );
}
/**
* @param $string
*
* @return string
*/
public function filterAdminBodyClass( $string ) {
// @todo check vc_inline-shortcode-edit-form class looks like incorrect place
$string .= ( strlen( $string ) > 0 ? ' ' : '' ) . 'vc_editor vc_inline-shortcode-edit-form';
if ( '1' === vc_settings()->get( 'not_responsive_css' ) ) {
$string .= ' vc_responsive_disabled';
}
return $string;
}
/**
* @param $path
*
* @return string
*/
public function adminFile( $path ) {
return ABSPATH . 'wp-admin/' . $path;
}
public function registerJs() {
wp_register_script( 'vc_bootstrap_js', vc_asset_url( 'lib/bower/bootstrap3/dist/js/bootstrap.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'wpb_php_js', vc_asset_url( 'lib/php.default/php.default.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
// used as polyfill for JSON.stringify and etc
wp_register_script( 'wpb_json-js', vc_asset_url( 'lib/bower/json-js/json2.min.js' ), array(), WPB_VC_VERSION, true );
// used in post settings editor
wp_register_script( 'ace-editor', vc_asset_url( 'lib/bower/ace-builds/src-min-noconflict/ace.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), WPB_VC_VERSION, true ); // Google Web Font CDN
wp_register_script( 'wpb_scrollTo_js', vc_asset_url( 'lib/bower/scrollTo/jquery.scrollTo.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'vc-frontend-editor-min-js', vc_asset_url( 'js/dist/frontend-editor.min.js' ), array(), WPB_VC_VERSION, true );
wp_localize_script( 'vc-frontend-editor-min-js', 'i18nLocale', visual_composer()->getEditorsLocale() );
}
/**
*
*/
public function enqueueJs() {
$wp_dependencies = array(
'jquery-core',
'underscore',
'backbone',
'media-views',
'media-editor',
'wp-pointer',
'mce-view',
'wp-color-picker',
'jquery-ui-sortable',
'jquery-ui-droppable',
'jquery-ui-draggable',
'jquery-ui-resizable',
'jquery-ui-accordion',
'jquery-ui-autocomplete',
// used in @deprecated tabs
'jquery-ui-tabs',
'wp-color-picker',
'farbtastic',
);
$dependencies = array(
'vc_bootstrap_js',
'vc_accordion_script',
'wpb_php_js',
'wpb_json-js',
'ace-editor',
'webfont',
'vc_accordion_script',
'vc-frontend-editor-min-js',
);
// This workaround will allow to disable any of dependency on-the-fly
foreach ( $wp_dependencies as $dependency ) {
wp_enqueue_script( $dependency );
}
foreach ( $dependencies as $dependency ) {
wp_enqueue_script( $dependency );
}
}
public function registerCss() {
wp_register_style( 'ui-custom-theme', vc_asset_url( 'css/ui-custom-theme/jquery-ui-less.custom.min.css' ), false, WPB_VC_VERSION );
wp_register_style( 'vc_animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), false, WPB_VC_VERSION, 'screen' );
wp_register_style( 'vc_font_awesome_5_shims', vc_asset_url( 'lib/bower/font-awesome/css/v4-shims.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_font_awesome_5', vc_asset_url( 'lib/bower/font-awesome/css/all.min.css' ), array( 'vc_font_awesome_5_shims' ), WPB_VC_VERSION );
wp_register_style( 'vc_inline_css', vc_asset_url( 'css/js_composer_frontend_editor.min.css' ), array(), WPB_VC_VERSION );
}
public function enqueueCss() {
$wp_dependencies = array(
'wp-color-picker',
'farbtastic',
);
$dependencies = array(
'ui-custom-theme',
'vc_animate-css',
'vc_font_awesome_5',
// 'wpb_jscomposer_autosuggest',
'vc_inline_css',
);
// This workaround will allow to disable any of dependency on-the-fly
foreach ( $wp_dependencies as $dependency ) {
wp_enqueue_style( $dependency );
}
foreach ( $dependencies as $dependency ) {
wp_enqueue_style( $dependency );
}
}
/**
*
*/
public function enqueueAdmin() {
$this->enqueueJs();
$this->enqueueCss();
do_action( 'vc_frontend_editor_enqueue_js_css' );
}
/**
* Enqueue js/css files from mapped shortcodes.
*
* To add js/css files to this enqueue please add front_enqueue_js/front_enqueue_css setting in vc_map array.
* @since 4.3
*
*/
public function enqueueMappedShortcode() {
$userShortCodes = WPBMap::getUserShortCodes();
if ( is_array( $userShortCodes ) ) {
foreach ( $userShortCodes as $shortcode ) {
$param = isset( $shortcode['front_enqueue_js'] ) ? $shortcode['front_enqueue_js'] : null;
if ( is_array( $param ) && ! empty( $param ) ) {
foreach ( $param as $value ) {
$this->enqueueMappedShortcodeJs( $value );
}
} elseif ( is_string( $param ) && ! empty( $param ) ) {
$this->enqueueMappedShortcodeJs( $param );
}
$param = isset( $shortcode['front_enqueue_css'] ) ? $shortcode['front_enqueue_css'] : null;
if ( is_array( $param ) && ! empty( $param ) ) {
foreach ( $param as $value ) {
$this->enqueueMappedShortcodeCss( $value );
}
} elseif ( is_string( $param ) && ! empty( $param ) ) {
$this->enqueueMappedShortcodeCss( $param );
}
}
}
}
/**
* @param $value
*/
/**
* @param $value
*/
/**
* @param $value
*/
/**
* @param $value
*/
public function enqueueMappedShortcodeJs( $value ) {
wp_enqueue_script( 'front_enqueue_js_' . md5( $value ), $value, array( 'vc-frontend-editor-min-js' ), WPB_VC_VERSION, true );
}
/**
* @param $value
*/
/**
* @param $value
*/
/**
* @param $value
*/
public function enqueueMappedShortcodeCss( $value ) {
wp_enqueue_style( 'front_enqueue_css_' . md5( $value ), $value, array( 'vc_inline_css' ), WPB_VC_VERSION );
}
/**
* @param $content
*
* @return string|void
* @throws \Exception
* @since 4.4
*/
public function getPageShortcodesByContent( $content ) {
if ( ! empty( $this->post_shortcodes ) ) {
return;
}
$content = shortcode_unautop( trim( $content ) ); // @todo this seems not working fine.
$not_shortcodes = preg_split( '/' . self::shortcodesRegexp() . '/', $content );
foreach ( $not_shortcodes as $string ) {
$temp = str_replace( array(
'<p>',
'</p>',
), '', $string ); // just to avoid autop @todo maybe do it better like vc_wpnop in js.
if ( strlen( trim( $temp ) ) > 0 ) {
$content = preg_replace( '/(' . preg_quote( $string, '/' ) . '(?!\[\/))/', '[vc_row][vc_column width="1/1"][vc_column_text]$1[/vc_column_text][/vc_column][/vc_row]', $content );
}
}
return $this->parseShortcodesString( $content );
}
/**
* @param $content
* @param bool $is_container
* @param bool $parent_id
*
* @return string
* @throws \Exception
* @since 4.2
*/
public function parseShortcodesString( $content, $is_container = false, $parent_id = false ) {
$string = '';
preg_match_all( '/' . self::shortcodesRegexp() . '/', trim( $content ), $found );
WPBMap::addAllMappedShortcodes();
add_shortcode( 'vc_container_anchor', 'vc_container_anchor' );
if ( count( $found[2] ) === 0 ) {
return $is_container && strlen( $content ) > 0 ? $this->parseShortcodesString( '[vc_column_text]' . $content . '[/vc_column_text]', false, $parent_id ) : $content;
}
foreach ( $found[2] as $index => $s ) {
$id = md5( time() . '-' . $this->tag_index ++ );
$content = $found[5][ $index ];
$attrs = shortcode_parse_atts( $found[3][ $index ] );
if ( empty( $attrs ) ) {
$attrs = array();
} elseif ( ! is_array( $attrs ) ) {
$attrs = (array) $attrs;
}
$shortcode = array(
'tag' => $s,
'attrs_query' => $found[3][ $index ],
'attrs' => $attrs,
'id' => $id,
'parent_id' => $parent_id,
);
if ( false !== WPBMap::getParam( $s, 'content' ) ) {
$shortcode['attrs']['content'] = $content;
}
$this->post_shortcodes[] = rawurlencode( wp_json_encode( $shortcode ) );
$string .= $this->toString( $shortcode, $content );
}
return $string;
}
/**
* @param $shortcode
* @param $content
*
* @return string
* @throws \Exception
* @since 4.2
*/
public function toString( $shortcode, $content ) {
$shortcode_obj = visual_composer()->getShortCode( $shortcode['tag'] );
$is_container = $shortcode_obj->settings( 'is_container' ) || ( null !== $shortcode_obj->settings( 'as_parent' ) && false !== $shortcode_obj->settings( 'as_parent' ) );
$shortcode = apply_filters( 'vc_frontend_editor_to_string', $shortcode, $shortcode_obj );
$output = sprintf( '<div class="vc_element" data-tag="%s" data-shortcode-controls="%s" data-model-id="%s">%s[%s %s]%s[/%s]%s</div>', esc_attr( $shortcode['tag'] ), esc_attr( wp_json_encode( $shortcode_obj->shortcodeClass()
->getControlsList() ) ), esc_attr( $shortcode['id'] ), $this->wrapperStart(), $shortcode['tag'], $shortcode['attrs_query'], $is_container ? '[vc_container_anchor]' . $this->parseShortcodesString( $content, $is_container, $shortcode['id'] ) : do_shortcode( $content ), $shortcode['tag'], $this->wrapperEnd() );
return $output;
}
}
if ( ! function_exists( 'vc_container_anchor' ) ) {
/**
* @return string
* @since 4.2
*/
function vc_container_anchor() {
return '<span class="vc_container-anchor" style="display: none;"></span>';
}
}
classes/editors/popups/class-vc-add-element-box.php 0000644 00000011024 15121635561 0016372 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Add element for VC editors with a list of mapped shortcodes.
*
* @since 4.3
*/
class Vc_Add_Element_Box {
/**
* Enable show empty message
*
* @since 4.8
* @var bool
*/
protected $show_empty_message = false;
/**
* @param $params
*
* @return string
*/
protected function getIcon( $params ) {
$data = '';
if ( isset( $params['is_container'] ) && true === $params['is_container'] ) {
$data = ' data-is-container="true"';
}
return '<i class="vc_general vc_element-icon' . ( ! empty( $params['icon'] ) ? ' ' . esc_attr( sanitize_text_field( $params['icon'] ) ) : '' ) . '" ' . $data . '></i> ';
}
/**
* Single button html template
*
* @param $params
*
* @return string
*/
public function renderButton( $params ) {
if ( ! is_array( $params ) || empty( $params ) ) {
return '';
}
$output = $class = $class_out = $data = $category_css_classes = '';
if ( ! empty( $params['class'] ) ) {
$class_ar = $class_at_out = explode( ' ', $params['class'] );
$count = count( $class_ar );
for ( $n = 0; $n < $count; $n ++ ) {
$class_ar[ $n ] .= '_nav';
$class_at_out[ $n ] .= '_o';
}
$class = ' ' . implode( ' ', $class_ar );
$class_out = ' ' . implode( ' ', $class_at_out );
}
if ( isset( $params['_category_ids'] ) ) {
foreach ( $params['_category_ids'] as $id ) {
$category_css_classes .= ' js-category-' . $id;
}
}
if ( isset( $params['is_container'] ) && true === $params['is_container'] ) {
$data .= ' data-is-container="true"';
}
$data .= ' data-vc-ui-element="add-element-button"';
$description = ! empty( $params['description'] ) ? '<span class="vc_element-description">' . esc_html( $params['description'] ) . '</span>' : '';
$name = '<span data-vc-shortcode-name>' . esc_html( stripslashes( $params['name'] ) ) . '</span>';
$output .= '<li data-element="' . esc_attr( $params['base'] ) . '" ' . ( isset( $params['presetId'] ) ? 'data-preset="' . esc_attr( $params['presetId'] ) . '"' : '' ) . ' class="wpb-layout-element-button vc_col-xs-12 vc_col-sm-4 vc_col-md-3 vc_col-lg-2' . ( isset( $params['deprecated'] ) ? ' vc_element-deprecated' : '' ) . esc_attr( $category_css_classes ) . esc_attr( $class_out ) . '" ' . $data . '><div class="vc_el-container"><a id="' . esc_attr( $params['base'] ) . '" data-tag="' . esc_attr( $params['base'] ) . '" class="dropable_el vc_shortcode-link' . esc_attr( $class ) . '" href="javascript:;" data-vc-clickable>' . $this->getIcon( $params ) . $name . $description . '</a></div></li>';
return $output;
}
/**
* Get mapped shortcodes list.
*
* @return array
* @throws \Exception
* @since 4.4
*/
public function shortcodes() {
return apply_filters( 'vc_add_new_elements_to_box', WPBMap::getSortedUserShortCodes() );
}
/**
* Render list of buttons for each mapped and allowed VC shortcodes.
* vc_filter: vc_add_element_box_buttons - hook to override output of getControls method
* @return mixed
* @throws \Exception
* @see WPBMap::getSortedUserShortCodes
*/
public function getControls() {
$output = '<ul class="wpb-content-layouts">';
/** @var array $element */
$buttons_count = 0;
$shortcodes = $this->shortcodes();
foreach ( $shortcodes as $element ) {
if ( isset( $element['content_element'] ) && false === $element['content_element'] ) {
continue;
}
$button = $this->renderButton( $element );
if ( ! empty( $button ) ) {
$buttons_count ++;
}
$output .= $button;
}
$output .= '</ul>';
if ( 0 === $buttons_count ) {
$this->show_empty_message = true;
}
return apply_filters( 'vc_add_element_box_buttons', $output );
}
/**
* Get categories list from mapping data.
* @return array
* @throws \Exception
* @since 4.5
*/
public function getCategories() {
return apply_filters( 'vc_add_new_category_filter', WPBMap::getUserCategories() );
}
/**
*
*/
public function render() {
vc_include_template( 'editors/popups/vc_ui-panel-add-element.tpl.php', array(
'box' => $this,
'template_variables' => array(
'categories' => $this->getCategories(),
),
) );
}
/**
* Render icon for shortcode
*
* @param $params
*
* @return string
* @since 4.8
*/
public function renderIcon( $params ) {
return $this->getIcon( $params );
}
/**
* @return boolean
*/
public function isShowEmptyMessage() {
return $this->show_empty_message;
}
/**
* @return mixed
* @throws \Exception
*/
public function getPartState() {
return vc_user_access()->part( 'shortcodes' )->getState();
}
}
classes/editors/popups/class-vc-templates-panel-editor.php 0000644 00000070142 15121635561 0020012 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Templates_Panel_Editor
* @since 4.4
*/
class Vc_Templates_Panel_Editor {
/**
* @since 4.4
* @var string
*/
protected $option_name = 'wpb_js_templates';
/**
* @since 4.4
* @var bool
*/
protected $default_templates = false;
/**
* @since 4.4
* @var bool
*/
protected $initialized = false;
/**
* @since 4.4
* Add ajax hooks, filters.
*/
public function init() {
if ( $this->initialized ) {
return;
}
$this->initialized = true;
add_filter( 'vc_load_default_templates_welcome_block', array(
$this,
'loadDefaultTemplatesLimit',
) );
add_filter( 'vc_templates_render_category', array(
$this,
'renderTemplateBlock',
), 10 );
add_filter( 'vc_templates_render_template', array(
$this,
'renderTemplateWindow',
), 10, 2 );
/**
* Ajax methods
* 'vc_save_template' -> saving content as template
* 'vc_backend_load_template' -> loading template content for backend
* 'vc_frontend_load_template' -> loading template content for frontend
* 'vc_delete_template' -> deleting template by index
*/
add_action( 'wp_ajax_vc_save_template', array(
$this,
'save',
) );
add_action( 'wp_ajax_vc_backend_load_template', array(
$this,
'renderBackendTemplate',
) );
add_action( 'wp_ajax_vc_frontend_load_template', array(
$this,
'renderFrontendTemplate',
) );
add_action( 'wp_ajax_vc_load_template_preview', array(
$this,
'renderTemplatePreview',
) );
add_action( 'wp_ajax_vc_delete_template', array(
$this,
'delete',
) );
}
/**
* @return string
*/
public function addBodyClassTemplatePreview() {
return 'vc_general-template-preview';
}
/**
* @param $category
* @return mixed
*/
public function renderTemplateBlock( $category ) {
if ( 'my_templates' === $category['category'] ) {
$category['output'] = '';
if ( vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) {
$category['output'] .= '
<div class="vc_column vc_col-sm-12" data-vc-hide-on-search="true">
<div class="vc_element_label">' . esc_html__( 'Save current layout as a template', 'js_composer' ) . '</div>
<div class="vc_input-group">
<input name="padding" data-js-element="vc-templates-input" class="vc_form-control wpb-textinput vc_panel-templates-name" type="text" value="" placeholder="' . esc_attr__( 'Template name', 'js_composer' ) . '" data-vc-disable-empty="#vc_ui-save-template-btn">
<span class="vc_input-group-btn">
<button class="vc_general vc_ui-button vc_ui-button-size-sm vc_ui-button-action vc_ui-button-shape-rounded vc_template-save-btn" id="vc_ui-save-template-btn" disabled data-vc-ui-element="button-save">' . esc_html__( 'Save Template', 'js_composer' ) . '</button>
</span>
</div>
<span class="vc_description">' . esc_html__( 'Save layout and reuse it on different sections of this site.', 'js_composer' ) . '</span>
</div>';
}
$category['output'] .= '<div class="vc_column vc_col-sm-12">';
if ( isset( $category['category_name'] ) ) {
$category['output'] .= '<h3>' . esc_html( $category['category_name'] ) . '</h3>';
}
if ( isset( $category['category_description'] ) ) {
$category['output'] .= '<p class="vc_description">' . esc_html( $category['category_description'] ) . '</p>';
}
$category['output'] .= '</div>';
$category['output'] .= '
<div class="vc_column vc_col-sm-12">
<div class="vc_ui-template-list vc_templates-list-my_templates vc_ui-list-bar" data-vc-action="collapseAll">';
if ( ! empty( $category['templates'] ) ) {
foreach ( $category['templates'] as $template ) {
$category['output'] .= $this->renderTemplateListItem( $template );
}
}
$category['output'] .= '
</div>
</div>';
} else {
if ( 'default_templates' === $category['category'] ) {
$category['output'] = '<div class="vc_col-md-12">';
if ( isset( $category['category_name'] ) ) {
$category['output'] .= '<h3>' . esc_html( $category['category_name'] ) . '</h3>';
}
if ( isset( $category['category_description'] ) ) {
$category['output'] .= '<p class="vc_description">' . esc_html( $category['category_description'] ) . '</p>';
}
$category['output'] .= '</div>';
$category['output'] .= '
<div class="vc_column vc_col-sm-12">
<div class="vc_ui-template-list vc_templates-list-default_templates vc_ui-list-bar" data-vc-action="collapseAll">';
if ( ! empty( $category['templates'] ) ) {
foreach ( $category['templates'] as $template ) {
$category['output'] .= $this->renderTemplateListItem( $template );
}
}
$category['output'] .= '
</div>
</div>';
}
}
return $category;
}
/** Output rendered template in new panel dialog
* @param $template_name
* @param $template_data
*
* @return string
* @since 4.4
*
*/
public function renderTemplateWindow( $template_name, $template_data ) {
if ( 'my_templates' === $template_data['type'] ) {
return $this->renderTemplateWindowMyTemplates( $template_name, $template_data );
} else {
if ( 'default_templates' === $template_data['type'] ) {
return $this->renderTemplateWindowDefaultTemplates( $template_name, $template_data );
}
}
return $template_name;
}
/**
* @param $template_name
* @param $template_data
*
* @return string
* @since 4.4
*
*/
public function renderTemplateWindowMyTemplates( $template_name, $template_data ) {
ob_start();
$template_id = esc_attr( $template_data['unique_id'] );
$template_id_hash = md5( $template_id ); // needed for jquery target for TTA
$template_name = esc_html( $template_name );
$preview_template_title = esc_attr__( 'Preview template', 'js_composer' );
$add_template_title = esc_attr__( 'Add template', 'js_composer' );
echo '<button type="button" class="vc_ui-list-bar-item-trigger" title="' . esc_attr( $add_template_title ) . '" data-template-handler="" data-vc-ui-element="template-title">' . esc_html( $template_name ) . '</button><div class="vc_ui-list-bar-item-actions"><button type="button" class="vc_general vc_ui-control-button" title="' . esc_attr( $add_template_title ) . '" data-template-handler=""><i class="vc-composer-icon vc-c-icon-add"></i></button>';
if ( vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) {
$delete_template_title = esc_attr__( 'Delete template', 'js_composer' );
echo '<button type="button" class="vc_general vc_ui-control-button" data-vc-ui-delete="template-title" title="' . esc_attr( $delete_template_title ) . '"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></button>';
}
echo '<button type="button" class="vc_general vc_ui-control-button" title="' . esc_attr( $preview_template_title ) . '" data-vc-container=".vc_ui-list-bar" data-vc-preview-handler data-vc-target="[data-template_id_hash=' . esc_attr( $template_id_hash ) . ']"><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></button></div>';
return ob_get_clean();
}
/**
* @param $template_name
* @param $template_data
*
* @return string
* @since 4.4
*
*/
public function renderTemplateWindowDefaultTemplates( $template_name, $template_data ) {
ob_start();
$template_id = esc_attr( $template_data['unique_id'] );
$template_id_hash = md5( $template_id ); // needed for jquery target for TTA
$template_name = esc_html( $template_name );
$preview_template_title = esc_attr__( 'Preview template', 'js_composer' );
$add_template_title = esc_attr__( 'Add template', 'js_composer' );
echo sprintf( '<button type="button" class="vc_ui-list-bar-item-trigger" title="%s"
data-template-handler=""
data-vc-ui-element="template-title">%s</button>
<div class="vc_ui-list-bar-item-actions">
<button type="button" class="vc_general vc_ui-control-button" title="%s"
data-template-handler="">
<i class="vc-composer-icon vc-c-icon-add"></i>
</button>
<button type="button" class="vc_general vc_ui-control-button" title="%s"
data-vc-container=".vc_ui-list-bar" data-vc-preview-handler data-vc-target="[data-template_id_hash=%s]">
<i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i>
</button>
</div>', esc_attr( $add_template_title ), esc_html( $template_name ), esc_attr( $add_template_title ), esc_attr( $preview_template_title ), esc_attr( $template_id_hash ) );
return ob_get_clean();
}
/**
* @since 4.4
* vc_filter: vc_templates_render_frontend_template - called when unknown template received to render in frontend.
*/
public function renderFrontendTemplate() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'templates' )->can()->validateDie();
add_filter( 'vc_frontend_template_the_content', array(
$this,
'frontendDoTemplatesShortcodes',
) );
$template_id = vc_post_param( 'template_unique_id' );
$template_type = vc_post_param( 'template_type' );
add_action( 'wp_print_scripts', array(
$this,
'addFrontendTemplatesShortcodesCustomCss',
) );
if ( '' === $template_id ) {
die( 'Error: Vc_Templates_Panel_Editor::renderFrontendTemplate:1' );
}
WPBMap::addAllMappedShortcodes();
if ( 'my_templates' === $template_type ) {
$saved_templates = get_option( $this->option_name );
vc_frontend_editor()->setTemplateContent( $saved_templates[ $template_id ]['template'] );
vc_frontend_editor()->enqueueRequired();
vc_include_template( 'editors/frontend_template.tpl.php', array(
'editor' => vc_frontend_editor(),
) );
die();
} else {
if ( 'default_templates' === $template_type ) {
$this->renderFrontendDefaultTemplate();
} else {
// @codingStandardsIgnoreLine
print apply_filters( 'vc_templates_render_frontend_template', $template_id, $template_type );
}
}
die; // no needs to do anything more. optimization.
}
/**
* Load frontend default template content by index
* @since 4.4
*/
public function renderFrontendDefaultTemplate() {
$template_index = (int) vc_post_param( 'template_unique_id' );
$data = $this->getDefaultTemplate( $template_index );
if ( ! $data ) {
die( 'Error: Vc_Templates_Panel_Editor::renderFrontendDefaultTemplate:1' );
}
vc_frontend_editor()->setTemplateContent( trim( $data['content'] ) );
vc_frontend_editor()->enqueueRequired();
vc_include_template( 'editors/frontend_template.tpl.php', array(
'editor' => vc_frontend_editor(),
) );
die();
}
/**
* @since 4.7
*/
public function renderUITemplate() {
vc_include_template( 'editors/popups/vc_ui-panel-templates.tpl.php', array(
'box' => $this,
) );
return '';
}
/**
* @since 4.4
*/
public function save() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'templates' )->checkStateAny( true, null )->validateDie();
$template_name = vc_post_param( 'template_name' );
$template = vc_post_param( 'template' );
if ( ! isset( $template_name ) || '' === trim( $template_name ) || ! isset( $template ) || '' === trim( $template ) ) {
header( ':', true, 500 );
throw new Exception( 'Error: Vc_Templates_Panel_Editor::save:1' );
}
$template_arr = array(
'name' => stripslashes( $template_name ),
'template' => stripslashes( $template ),
);
$saved_templates = get_option( $this->option_name );
$template_id = sanitize_title( $template_name ) . '_' . wp_rand();
if ( false === $saved_templates ) {
$autoload = 'no';
$new_template = array();
$new_template[ $template_id ] = $template_arr;
add_option( $this->option_name, $new_template, '', $autoload );
} else {
$saved_templates[ $template_id ] = $template_arr;
update_option( $this->option_name, $saved_templates );
}
$template = array(
'name' => $template_arr['name'],
'type' => 'my_templates',
'unique_id' => $template_id,
);
// @codingStandardsIgnoreLine
print $this->renderTemplateListItem( $template );
die;
}
/**
* Loading Any templates Shortcodes for backend by string $template_id from AJAX
* @since 4.4
* vc_filter: vc_templates_render_backend_template - called when unknown template requested to render in backend
*/
public function renderBackendTemplate() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'templates' )->can()->validateDie();
$template_id = vc_post_param( 'template_unique_id' );
$template_type = vc_post_param( 'template_type' );
if ( ! isset( $template_id, $template_type ) || '' === $template_id || '' === $template_type ) {
die( 'Error: Vc_Templates_Panel_Editor::renderBackendTemplate:1' );
}
WPBMap::addAllMappedShortcodes();
if ( 'my_templates' === $template_type ) {
$saved_templates = get_option( $this->option_name );
$content = trim( $saved_templates[ $template_id ]['template'] );
$content = str_replace( '\"', '"', $content );
$pattern = get_shortcode_regex();
$content = preg_replace_callback( "/{$pattern}/s", 'vc_convert_shortcode', $content );
// @codingStandardsIgnoreLine
print $content;
die();
} else {
if ( 'default_templates' === $template_type ) {
$this->getBackendDefaultTemplate();
die();
} else {
// @codingStandardsIgnoreLine
print apply_filters( 'vc_templates_render_backend_template', $template_id, $template_type );
die();
}
}
}
/**
* Render new template view as backened editor content.
*
* @since 4.8
*/
public function renderTemplatePreview() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( array(
'edit_post',
(int) vc_request_param( 'post_id' ),
) )->validateDie()->part( 'templates' )->can()->validateDie();
$template_id = vc_request_param( 'template_unique_id' );
$template_type = vc_request_param( 'template_type' );
global $current_user;
wp_get_current_user();
if ( ! isset( $template_id, $template_type ) || '' === $template_id || '' === $template_type ) {
die( esc_html__( 'Error: wrong template id.', 'js_composer' ) );
}
WPBMap::addAllMappedShortcodes();
if ( 'my_templates' === $template_type ) {
$saved_templates = get_option( $this->option_name );
$content = trim( $saved_templates[ $template_id ]['template'] );
$content = str_replace( '\"', '"', $content );
$pattern = get_shortcode_regex();
$content = preg_replace_callback( "/{$pattern}/s", 'vc_convert_shortcode', $content );
} else {
if ( 'default_templates' === $template_type ) {
$content = $this->getBackendDefaultTemplate( true );
} else {
$content = apply_filters( 'vc_templates_render_backend_template_preview', $template_id, $template_type );
}
}
vc_include_template( apply_filters( 'vc_render_template_preview_include_template', 'editors/vc_ui-template-preview.tpl.php' ), array(
'content' => $content,
'editorPost' => get_post( vc_request_param( 'post_id' ) ),
'current_user' => $current_user,
) );
die();
}
public function registerPreviewScripts() {
visual_composer()->registerAdminJavascript();
visual_composer()->registerAdminCss();
vc_backend_editor()->registerBackendJavascript();
vc_backend_editor()->registerBackendCss();
wp_register_script( 'vc_editors-templates-preview-js', vc_asset_url( 'js/editors/templates-preview.js' ), array(
'vc-backend-min-js',
), WPB_VC_VERSION, true );
}
/**
* Enqueue required scripts for template preview
* @since 4.8
*/
public function enqueuePreviewScripts() {
vc_backend_editor()->enqueueCss();
vc_backend_editor()->enqueueJs();
wp_enqueue_script( 'vc_editors-templates-preview-js' );
}
/**
* @since 4.4
*/
public function delete() {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'templates' )->checkStateAny( true, null )->validateDie();
$template_id = vc_post_param( 'template_id' );
$template_type = vc_post_param( 'template_type' );
if ( ! isset( $template_id ) || '' === $template_id ) {
die( 'Error: Vc_Templates_Panel_Editor::delete:1' );
}
if ( 'my_templates' === $template_type ) {
$saved_templates = get_option( $this->option_name );
unset( $saved_templates[ $template_id ] );
if ( count( $saved_templates ) > 0 ) {
update_option( $this->option_name, $saved_templates );
} else {
delete_option( $this->option_name );
}
wp_send_json_success();
} else {
do_action( 'vc_templates_delete_templates', $template_id, $template_type );
}
wp_send_json_error();
}
/**
* @param $templates
*
* vc_filter: vc_load_default_templates_limit_total - total items to show
*
* @return array
* @since 4.4
*
*/
public function loadDefaultTemplatesLimit( $templates ) {
$start_index = 0;
$total_templates_to_show = apply_filters( 'vc_load_default_templates_limit_total', 6 );
return array_slice( $templates, $start_index, $total_templates_to_show );
}
/**
* Get user templates
*
* @return mixed
* @since 4.12
*/
public function getUserTemplates() {
return apply_filters( 'vc_get_user_templates', get_option( $this->option_name ) );
}
/**
* Function to get all templates for display
* - with image (optional preview image)
* - with unique_id (required for do something for rendering.. )
* - with name (required for display? )
* - with type (required for requesting data in server)
* - with category key (optional/required for filtering), if no category provided it will be displayed only in
* "All" category type vc_filter: vc_get_user_templates - hook to override "user My Templates" vc_filter:
* vc_get_all_templates - hook for override return array(all templates), hook to add/modify/remove more templates,
* - this depends only to displaying in panel window (more layouts)
* @return array - all templates with name/unique_id/category_key(optional)/image
* @since 4.4
*/
public function getAllTemplates() {
$data = array();
// Here we go..
if ( apply_filters( 'vc_show_user_templates', true ) ) {
// We need to get all "My Templates"
$user_templates = $this->getUserTemplates();
// this has only 'name' and 'template' key and index 'key' is template id.
$arr_category = array(
'category' => 'my_templates',
'category_name' => esc_html__( 'My Templates', 'js_composer' ),
'category_description' => esc_html__( 'Append previously saved template to the current layout.', 'js_composer' ),
'category_weight' => 10,
);
$category_templates = array();
if ( ! empty( $user_templates ) ) {
foreach ( $user_templates as $template_id => $template_data ) {
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_data['name'],
'type' => 'my_templates',
// for rendering in backend/frontend with ajax
);
}
}
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
// To get all "Default Templates"
$default_templates = $this->getDefaultTemplates();
if ( ! empty( $default_templates ) ) {
$arr_category = array(
'category' => 'default_templates',
'category_name' => esc_html__( 'Default Templates', 'js_composer' ),
'category_description' => esc_html__( 'Append default template to the current layout.', 'js_composer' ),
'category_weight' => 11,
);
$category_templates = array();
foreach ( $default_templates as $template_id => $template_data ) {
if ( isset( $template_data['disabled'] ) && $template_data['disabled'] ) {
continue;
}
$category_templates[] = array(
'unique_id' => $template_id,
'name' => $template_data['name'],
'type' => 'default_templates',
// for rendering in backend/frontend with ajax
'image' => isset( $template_data['image_path'] ) ? $template_data['image_path'] : false,
// preview image
'custom_class' => isset( $template_data['custom_class'] ) ? $template_data['custom_class'] : false,
);
}
if ( ! empty( $category_templates ) ) {
$arr_category['templates'] = $category_templates;
$data[] = $arr_category;
}
}
// To get any other 3rd "Custom template" - do this by hook filter 'vc_get_all_templates'
return apply_filters( 'vc_get_all_templates', $data );
}
/**
* Load default templates list and initialize variable
* To modify you should use add_filter('vc_load_default_templates','your_custom_function');
* Argument is array of templates data like:
* array(
* array(
* 'name'=>esc_html__('My custom template','my_plugin'),
* 'image_path'=> preg_replace( '/\s/', '%20', plugins_url( 'images/my_image.png', __FILE__ ) ), //
* always use preg replace to be sure that "space" will not break logic
* 'custom_class'=>'my_custom_class', // if needed
* 'content'=>'[my_shortcode]yeah[/my_shortcode]', // Use HEREDoc better to escape all single-quotes
* and double quotes
* ),
* ...
* );
* Also see filters 'vc_load_default_templates_panels' and 'vc_load_default_templates_welcome_block' to modify
* templates in panels tab and/or in welcome block. vc_filter: vc_load_default_templates - filter to override
* default templates array
* @return array
* @since 4.4
*/
public function loadDefaultTemplates() {
if ( ! $this->initialized ) {
$this->init(); // add hooks if not added already (fix for in frontend)
}
if ( ! is_array( $this->default_templates ) ) {
require_once vc_path_dir( 'CONFIG_DIR', 'templates.php' );
$templates = apply_filters( 'vc_load_default_templates', $this->default_templates );
$this->default_templates = $templates;
do_action( 'vc_load_default_templates_action' );
}
return $this->default_templates;
}
/**
* Alias for loadDefaultTemplates
* @return array - list of default templates
* @since 4.4
*/
public function getDefaultTemplates() {
return $this->loadDefaultTemplates();
}
/**
* Get default template data by template index in array.
* @param number $template_index
*
* @return array|bool
* @since 4.4
*
*/
public function getDefaultTemplate( $template_index ) {
$this->loadDefaultTemplates();
if ( ! is_numeric( $template_index ) || ! is_array( $this->default_templates ) || ! isset( $this->default_templates[ $template_index ] ) ) {
return false;
}
return $this->default_templates[ $template_index ];
}
/**
* Add custom template to default templates list ( at end of list )
* $data = array( 'name'=>'', 'image'=>'', 'content'=>'' )
* @param $data
*
* @return bool true if added, false if failed
* @since 4.4
*
*/
public function addDefaultTemplates( $data ) {
if ( is_array( $data ) && ! empty( $data ) && isset( $data['name'], $data['content'] ) ) {
if ( ! is_array( $this->default_templates ) ) {
$this->default_templates = array();
}
$this->default_templates[] = $data;
return true;
}
return false;
}
/**
* Load default template content by index from ajax
* @param bool $return | should function return data or not
*
* @return string
* @since 4.4
*
*/
public function getBackendDefaultTemplate( $return = false ) {
$template_index = (int) vc_request_param( 'template_unique_id' );
$data = $this->getDefaultTemplate( $template_index );
if ( ! $data ) {
die( 'Error: Vc_Templates_Panel_Editor::getBackendDefaultTemplate:1' );
}
if ( $return ) {
return trim( $data['content'] );
} else {
print trim( $data['content'] );
die;
}
}
/**
* @param array $data
*
* @return array
* @since 4.4
*
*/
public function sortTemplatesByCategories( array $data ) {
$buffer = $data;
uasort( $buffer, array(
$this,
'cmpCategory',
) );
return $buffer;
}
/**
* @param array $data
*
* @return array
* @since 4.4
*
*/
public function sortTemplatesByNameWeight( array $data ) {
$buffer = $data;
uasort( $buffer, array(
$this,
'cmpNameWeight',
) );
return $buffer;
}
/**
* Function should return array of templates categories
* @param array $categories
*
* @return array - associative array of category key => and visible Name
* @since 4.4
*
*/
public function getAllCategoriesNames( array $categories ) {
$categories_names = array();
foreach ( $categories as $category ) {
if ( isset( $category['category'] ) ) {
$categories_names[ $category['category'] ] = isset( $category['category_name'] ) ? $category['category_name'] : $category['category'];
}
}
return $categories_names;
}
/**
* @return array
* @since 4.4
*/
public function getAllTemplatesSorted() {
$data = $this->getAllTemplates();
// firstly we need to sort by categories
$data = $this->sortTemplatesByCategories( $data );
// secondly we need to sort templates by their weight or name
foreach ( $data as $key => $category ) {
$data[ $key ]['templates'] = $this->sortTemplatesByNameWeight( $category['templates'] );
}
return $data;
}
/**
* Used to compare two templates by category, category_weight
* If category weight is less template will appear in first positions
* @param array $a - template one
* @param array $b - second template to compare
*
* @return int
* @since 4.4
*
*/
protected function cmpCategory( $a, $b ) {
$a_k = isset( $a['category'] ) ? $a['category'] : '*';
$b_k = isset( $b['category'] ) ? $b['category'] : '*';
$a_category_weight = isset( $a['category_weight'] ) ? $a['category_weight'] : 0;
$b_category_weight = isset( $b['category_weight'] ) ? $b['category_weight'] : 0;
return $a_category_weight === $b_category_weight ? strcmp( $a_k, $b_k ) : $a_category_weight - $b_category_weight;
}
/**
* @param $a
* @param $b
*
* @return int
* @since 4.4
*
*/
protected function cmpNameWeight( $a, $b ) {
$a_k = isset( $a['name'] ) ? $a['name'] : '*';
$b_k = isset( $b['name'] ) ? $b['name'] : '*';
$a_weight = isset( $a['weight'] ) ? $a['weight'] : 0;
$b_weight = isset( $b['weight'] ) ? $b['weight'] : 0;
return $a_weight === $b_weight ? strcmp( $a_k, $b_k ) : $a_weight - $b_weight;
}
/**
* Calls do_shortcode for templates.
*
* @param $content
*
* @return string
*/
public function frontendDoTemplatesShortcodes( $content ) {
return do_shortcode( $content );
}
/**
* Add custom css from shortcodes from template for template editor.
*
* Used by action 'wp_print_scripts'.
*
* @todo move to autoload or else some where.
* @since 4.4.3
*
*/
public function addFrontendTemplatesShortcodesCustomCss() {
$output = $shortcodes_custom_css = '';
$shortcodes_custom_css = visual_composer()->parseShortcodesCustomCss( vc_frontend_editor()->getTemplateContent() );
if ( ! empty( $shortcodes_custom_css ) ) {
$shortcodes_custom_css = wp_strip_all_tags( $shortcodes_custom_css );
$first_tag = 'style';
$output .= '<' . $first_tag . ' data-type="vc_shortcodes-custom-css">';
$output .= $shortcodes_custom_css;
$output .= '</' . $first_tag . '>';
}
// @todo Check for wp_add_inline_style posibility
// @codingStandardsIgnoreLine
print $output;
}
public function addScriptsToTemplatePreview() {
}
/**
* @param $template
* @return string
*/
public function renderTemplateListItem( $template ) {
$name = isset( $template['name'] ) ? esc_html( $template['name'] ) : esc_html__( 'No title', 'js_composer' );
$template_id = esc_attr( $template['unique_id'] );
$template_id_hash = md5( $template_id ); // needed for jquery target for TTA
$template_name = esc_html( $name );
$template_name_lower = esc_attr( vc_slugify( $template_name ) );
$template_type = esc_attr( isset( $template['type'] ) ? $template['type'] : 'custom' );
$custom_class = esc_attr( isset( $template['custom_class'] ) ? $template['custom_class'] : '' );
$output = <<<HTML
<div class="vc_ui-template vc_templates-template-type-$template_type $custom_class"
data-template_id="$template_id"
data-template_id_hash="$template_id_hash"
data-category="$template_type"
data-template_unique_id="$template_id"
data-template_name="$template_name_lower"
data-template_type="$template_type"
data-vc-content=".vc_ui-template-content">
<div class="vc_ui-list-bar-item">
HTML;
$output .= apply_filters( 'vc_templates_render_template', $name, $template );
$output .= <<<HTML
</div>
<div class="vc_ui-template-content" data-js-content>
</div>
</div>
HTML;
return $output;
}
/**
* @return string
*/
/**
* @return string
*/
public function getOptionName() {
return $this->option_name;
}
}
classes/editors/popups/class-vc-preset-panel-editor.php 0000644 00000005603 15121635561 0017316 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Class Vc_Preset_Panel_Editor
* @since 5.2
*/
class Vc_Preset_Panel_Editor {
/**
* @since 5.2
* @var bool
*/
protected $initialized = false;
/**
* @since 5.2
* Add ajax hooks, filters.
*/
public function init() {
if ( $this->initialized ) {
return;
}
$this->initialized = true;
}
/**
* @since 5.2
*/
public function renderUIPreset() {
vc_include_template( 'editors/popups/vc_ui-panel-preset.tpl.php', array(
'box' => $this,
) );
return '';
}
/**
* Get list of all presets for specific shortcode
*
* @return array E.g. array(id1 => title1, id2 => title2, ...)
* @since 5.2
*
*
*/
public function listPresets() {
$list = array();
$args = array(
'post_type' => 'vc_settings_preset',
'orderby' => array( 'post_date' => 'DESC' ),
'posts_per_page' => - 1,
);
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$presetParentName = self::constructPresetParent( $post->post_mime_type );
$list[ $post->ID ] = array(
'title' => $post->post_title,
'parent' => $presetParentName,
);
}
return $list;
}
/**
* Single preset html
*
* @return string
* @since 5.2
*
*
*/
public function getPresets() {
$listPresets = $this->listPresets();
$output = '';
foreach ( $listPresets as $presetId => $preset ) {
$output .= '<div class="vc_ui-template">';
$output .= '<div class="vc_ui-list-bar-item">';
$output .= '<button type="button" class="vc_ui-list-bar-item-trigger" title="' . esc_attr( $preset['title'] ) . '"
data-vc-ui-element="template-title">' . esc_html( $preset['title'] ) . '</button>';
$output .= '<div class="vc_ui-list-bar-item-actions">';
$output .= '<button id="' . esc_attr( $preset['parent'] ) . '" type="button" class="vc_general vc_ui-control-button" title="' . esc_attr( 'Add element', 'js_composer' ) . '" data-template-handler="" data-preset="' . esc_attr( $presetId ) . '" data-tag="' . esc_attr( $preset['parent'] ) . '" data-vc-ui-add-preset>';
$output .= '<i class="vc-composer-icon vc-c-icon-add"></i>';
$output .= '</button>';
$output .= '<button type="button" class="vc_general vc_ui-control-button" data-vc-ui-delete="preset-title" data-preset="' . esc_attr( $presetId ) . '" data-preset-parent="' . esc_attr( $preset['parent'] ) . '" title="' . esc_attr( 'Delete element', 'js_composer' ) . '">';
$output .= '<i class="vc-composer-icon vc-c-icon-delete_empty"></i>';
$output .= '</button>';
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
}
return $output;
}
/**
* Get preset parent shortcode name from post mime type
*
* @param $presetMimeType
*
* @return string
* @since 5.2
*
*/
public static function constructPresetParent( $presetMimeType ) {
return str_replace( '-', '_', str_replace( 'vc-settings-preset/', '', $presetMimeType ) );
}
}
classes/editors/popups/class-vc-post-settings.php 0000644 00000000761 15121635561 0016256 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Post settings like custom css for page are displayed here.
*
* @since 4.3
*/
class Vc_Post_Settings {
protected $editor;
/**
* @param $editor
*/
public function __construct( $editor ) {
$this->editor = $editor;
}
public function editor() {
return $this->editor;
}
public function renderUITemplate() {
vc_include_template( 'editors/popups/vc_ui-panel-post-settings.tpl.php', array(
'box' => $this,
) );
}
}
classes/editors/popups/class-vc-edit-layout.php 0000644 00000000477 15121635561 0015677 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Edit row layout
*
* @since 4.3
*/
class Vc_Edit_Layout {
public function renderUITemplate() {
global $vc_row_layouts;
vc_include_template( 'editors/popups/vc_ui-panel-row-layout.tpl.php', array(
'vc_row_layouts' => $vc_row_layouts,
) );
}
}
classes/editors/popups/class-vc-shortcode-edit-form.php 0000644 00000004405 15121635561 0017310 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder main class.
*
* @package WPBakeryPageBuilder
* @since 4.2
*/
/**
* Edit form for shortcodes with ability to manage shortcode attributes in more convenient way.
*
* @since 4.2
*/
class Vc_Shortcode_Edit_Form {
protected $initialized;
/**
*
*/
public function init() {
if ( $this->initialized ) {
return;
}
$this->initialized = true;
add_action( 'wp_ajax_vc_edit_form', array(
$this,
'renderFields',
) );
add_filter( 'vc_single_param_edit', array(
$this,
'changeEditFormFieldParams',
) );
add_filter( 'vc_edit_form_class', array(
$this,
'changeEditFormParams',
) );
}
/**
*
*/
public function render() {
vc_include_template( 'editors/popups/vc_ui-panel-edit-element.tpl.php', array(
'box' => $this,
) );
}
/**
* Build edit form fields.
*
* @since 4.4
*/
public function renderFields() {
$tag = vc_post_param( 'tag' );
vc_user_access()->checkAdminNonce()->validateDie( esc_html__( 'Access denied', 'js_composer' ) )->wpAny( array(
'edit_post',
(int) vc_request_param( 'post_id' ),
) )->validateDie( esc_html__( 'Access denied', 'js_composer' ) )->check( 'vc_user_access_check_shortcode_edit', $tag )->validateDie( esc_html__( 'Access denied', 'js_composer' ) );
$params = (array) stripslashes_deep( vc_post_param( 'params' ) );
$params = array_map( 'vc_htmlspecialchars_decode_deep', $params );
require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-edit-form-fields.php' );
$fields = new Vc_Edit_Form_Fields( $tag, $params );
$output = $fields->render();
// @codingStandardsIgnoreLine
wp_die( $output );
}
/**
* @param $param
*
* @return mixed
*/
public function changeEditFormFieldParams( $param ) {
$css = $param['vc_single_param_edit_holder_class'];
if ( isset( $param['edit_field_class'] ) ) {
$new_css = $param['edit_field_class'];
} else {
$new_css = 'vc_col-xs-12';
}
array_unshift( $css, $new_css );
$param['vc_single_param_edit_holder_class'] = $css;
return $param;
}
/**
* @param $css_classes
*
* @return mixed
*/
public function changeEditFormParams( $css_classes ) {
$css = '';
array_unshift( $css_classes, $css );
return $css_classes;
}
}
classes/editors/class-vc-backend-editor.php 0000644 00000021000 15121635561 0014745 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder admin editor
*
* @package WPBakeryPageBuilder
*
*/
/**
* VC backend editor.
*
* This editor is available on default Wp post/page admin edit page. ON admin_init callback adds meta box to
* edit page.
*
* @since 4.2
*/
class Vc_Backend_Editor {
/**
* @var
*/
protected $layout;
/**
* @var
*/
public $post_custom_css;
/**
* @var bool|string $post - stores data about post.
*/
public $post = false;
/**
* This method is called by Vc_Manager to register required action hooks for VC backend editor.
*
* @since 4.2
* @access public
*/
public function addHooksSettings() {
// @todo - fix_roles do this only if be editor is enabled.
// load backend editor
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' ); // @todo check is it needed?
}
add_action( 'add_meta_boxes', array(
$this,
'render',
), 5 );
add_action( 'admin_print_scripts-post.php', array(
$this,
'registerScripts',
) );
add_action( 'admin_print_scripts-post-new.php', array(
$this,
'registerScripts',
) );
add_action( 'admin_print_scripts-post.php', array(
$this,
'printScriptsMessages',
) );
add_action( 'admin_print_scripts-post-new.php', array(
$this,
'printScriptsMessages',
) );
}
public function registerScripts() {
$this->registerBackendJavascript();
$this->registerBackendCss();
// B.C:
visual_composer()->registerAdminCss();
visual_composer()->registerAdminJavascript();
}
/**
* Calls add_meta_box to create Editor block. Block is rendered by WPBakeryVisualComposerLayout.
*
* @param $post_type
* @throws \Exception
* @since 4.2
* @access public
*
* @see WPBakeryVisualComposerLayout
*/
public function render( $post_type ) {
if ( $this->isValidPostType( $post_type ) ) {
// meta box to render
add_meta_box( 'wpb_visual_composer', esc_html__( 'WPBakery Page Builder', 'js_composer' ), array(
$this,
'renderEditor',
), $post_type, 'normal', 'high' );
}
}
/**
* Output html for backend editor meta box.
*
* @param null|Wp_Post $post
*
* @return bool
*/
public function renderEditor( $post = null ) {
/**
* TODO: setter/getter for $post
*/
if ( ! is_object( $post ) || 'WP_Post' !== get_class( $post ) || ! isset( $post->ID ) ) {
return false;
}
$this->post = $post;
$post_custom_css = wp_strip_all_tags( get_post_meta( $post->ID, '_wpb_post_custom_css', true ) );
$this->post_custom_css = $post_custom_css;
vc_include_template( 'editors/backend_editor.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
add_action( 'admin_footer', array(
$this,
'renderEditorFooter',
) );
do_action( 'vc_backend_editor_render' );
return true;
}
/**
* Output required html and js content for VC editor.
*
* Here comes panels, modals and js objects with data for mapped shortcodes.
*/
public function renderEditorFooter() {
vc_include_template( 'editors/partials/backend_editor_footer.tpl.php', array(
'editor' => $this,
'post' => $this->post,
) );
do_action( 'vc_backend_editor_footer_render' );
}
/**
* Check is post type is valid for rendering VC backend editor.
*
* @param string $type
*
* @return bool
* @throws \Exception
*/
public function isValidPostType( $type = '' ) {
$type = ! empty( $type ) ? $type : get_post_type();
if ( 'vc_grid_item' === $type ) {
return false;
}
return apply_filters( 'vc_is_valid_post_type_be', vc_check_post_type( $type ), $type );
}
/**
* Enqueue required javascript libraries and css files.
*
* This method also setups reminder about license activation.
*
* @since 4.2
* @access public
*/
public function printScriptsMessages() {
if ( ! vc_is_frontend_editor() && $this->isValidPostType( get_post_type() ) ) {
$this->enqueueEditorScripts();
}
}
/**
* Enqueue required javascript libraries and css files.
*
* @since 4.8
* @access public
*/
public function enqueueEditorScripts() {
if ( $this->editorEnabled() ) {
$this->enqueueJs();
$this->enqueueCss();
WPBakeryShortCodeFishBones::enqueueCss();
WPBakeryShortCodeFishBones::enqueueJs();
} else {
wp_enqueue_script( 'vc-backend-actions-js' );
$this->enqueueCss(); // needed for navbar @todo split
}
do_action( 'vc_backend_editor_enqueue_js_css' );
}
public function registerBackendJavascript() {
// editor can be disabled but fe can be enabled. so we currently need this file. @todo maybe make backend-disabled.min.js
wp_register_script( 'vc-backend-actions-js', vc_asset_url( 'js/dist/backend-actions.min.js' ), array(
'jquery-core',
'backbone',
'underscore',
), WPB_VC_VERSION, true );
wp_register_script( 'vc-backend-min-js', vc_asset_url( 'js/dist/backend.min.js' ), array( 'vc-backend-actions-js' ), WPB_VC_VERSION, true );
// used in tta shortcodes, and panels.
wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'wpb_php_js', vc_asset_url( 'lib/php.default/php.default.min.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
// used as polyfill for JSON.stringify and etc
wp_register_script( 'wpb_json-js', vc_asset_url( 'lib/bower/json-js/json2.min.js' ), array(), WPB_VC_VERSION, true );
// used in post settings editor
wp_register_script( 'ace-editor', vc_asset_url( 'lib/bower/ace-builds/src-min-noconflict/ace.js' ), array( 'jquery-core' ), WPB_VC_VERSION, true );
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js', array(), WPB_VC_VERSION, true ); // Google Web Font CDN
wp_localize_script( 'vc-backend-actions-js', 'i18nLocale', visual_composer()->getEditorsLocale() );
}
public function registerBackendCss() {
wp_register_style( 'js_composer', vc_asset_url( 'css/js_composer_backend_editor.min.css' ), array(), WPB_VC_VERSION, false );
if ( $this->editorEnabled() ) {
/**
* @deprecated, used for accordions/tabs/tours
*/
wp_register_style( 'ui-custom-theme', vc_asset_url( 'css/ui-custom-theme/jquery-ui-less.custom.min.css' ), array(), WPB_VC_VERSION );
/**
* @todo check vc_add-element-deprecated-warning for fa icon usage ( set to our font )
* also used in vc_icon shortcode
*/
wp_register_style( 'vc_font_awesome_5_shims', vc_asset_url( 'lib/bower/font-awesome/css/v4-shims.min.css' ), array(), WPB_VC_VERSION );
wp_register_style( 'vc_font_awesome_5', vc_asset_url( 'lib/bower/font-awesome/css/all.min.css' ), array( 'vc_font_awesome_5_shims' ), WPB_VC_VERSION );
/**
* @todo check for usages
* definetelly used in edit form param: css_animation, but curreny vc_add_shortcode_param doesn't accept css [ @todo refactor that ]
*/
wp_register_style( 'vc_animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION );
}
}
public function enqueueJs() {
$wp_dependencies = array(
'jquery-core',
'underscore',
'backbone',
'media-views',
'media-editor',
'wp-pointer',
'mce-view',
'wp-color-picker',
'jquery-ui-sortable',
'jquery-ui-droppable',
'jquery-ui-draggable',
'jquery-ui-autocomplete',
'jquery-ui-resizable',
// used in @deprecated tabs
'jquery-ui-tabs',
'jquery-ui-accordion',
);
$dependencies = array(
'vc_accordion_script',
'wpb_php_js',
// used in our files [e.g. edit form saving sprintf]
'wpb_json-js',
'ace-editor',
'webfont',
'vc-backend-min-js',
);
// This workaround will allow to disable any of dependency on-the-fly
foreach ( $wp_dependencies as $dependency ) {
wp_enqueue_script( $dependency );
}
foreach ( $dependencies as $dependency ) {
wp_enqueue_script( $dependency );
}
}
public function enqueueCss() {
$wp_dependencies = array(
'wp-color-picker',
'farbtastic',
// deprecated for tabs/accordion
'ui-custom-theme',
// used in deprecated message and also in vc-icon shortcode
'vc_font_awesome_5',
// used in css_animation edit form param
'vc_animate-css',
);
$dependencies = array(
'js_composer',
);
// This workaround will allow to disable any of dependency on-the-fly
foreach ( $wp_dependencies as $dependency ) {
wp_enqueue_style( $dependency );
}
foreach ( $dependencies as $dependency ) {
wp_enqueue_style( $dependency );
}
}
/**
* @return bool
* @throws \Exception
*/
public function editorEnabled() {
return vc_user_access()->part( 'backend_editor' )->can()->get();
}
}
classes/editors/class-vc-edit-form-fields.php 0000644 00000025704 15121635561 0015243 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* WPBakery WPBakery Page Builder shortcode attributes fields
*
* @package WPBakeryPageBuilder
*
*/
/**
* Edit form fields builder for shortcode attributes.
*
* @since 4.4
*/
class Vc_Edit_Form_Fields {
/**
* @since 4.4
* @var bool
*/
protected $tag = false;
/**
* @since 4.4
* @var array
*/
protected $atts = array();
/**
* @since 4.4
* @var array
*/
protected $settings = array();
/**
* @since 4.4
* @var bool
*/
protected $post_id = false;
/**
* Construct Form fields.
*
* @param $tag - shortcode tag
* @param $atts - list of attribute assign to the shortcode.
* @throws \Exception
* @since 4.4
*/
public function __construct( $tag, $atts ) {
$this->tag = $tag;
$this->atts = apply_filters( 'vc_edit_form_fields_attributes_' . $this->tag, $atts );
$this->setSettings( WPBMap::getShortCode( $this->tag ) );
}
/**
* Get settings
* @param $key
*
* @return null
* @since 4.4
*
*/
public function setting( $key ) {
return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : null;
}
/**
* Set settings data
* @param array $settings
* @since 4.4
*
*/
public function setSettings( array $settings ) {
$this->settings = $settings;
}
/**
* Shortcode Post ID getter.
* If post id isn't set try to get from get_the_ID function.
* @return int|bool;
* @since 4.4
*/
public function postId() {
if ( ! $this->post_id ) {
$this->post_id = get_the_ID();
}
return $this->post_id;
}
/**
* Shortcode Post ID setter.
* @param $post_id - integer value in post_id
* @since 4.4
*
*/
public function setPostId( $post_id ) {
$this->post_id = (int) $post_id;
}
/**
* Get shortcode attribute value.
*
* This function checks if value isn't set then it uses std or value fields in param settings.
* @param $param_settings
* @param $value
*
* @return null
* @since 4.4
*
*/
protected function parseShortcodeAttributeValue( $param_settings, $value ) {
if ( is_null( $value ) ) { // If value doesn't exists
if ( isset( $param_settings['std'] ) ) {
$value = $param_settings['std'];
} elseif ( isset( $param_settings['value'] ) && is_array( $param_settings['value'] ) && ! empty( $param_settings['type'] ) && 'checkbox' !== $param_settings['type'] ) {
$first_key = key( $param_settings['value'] );
$value = $first_key ? $param_settings['value'][ $first_key ] : '';
} elseif ( isset( $param_settings['value'] ) && ! is_array( $param_settings['value'] ) ) {
$value = $param_settings['value'];
}
}
return $value;
}
/**
* Enqueue js scripts for attributes types.
* @return string
* @since 4.4
*/
public function enqueueScripts() {
$output = '';
$scripts = apply_filters( 'vc_edit_form_enqueue_script', WpbakeryShortcodeParams::getScripts() );
if ( is_array( $scripts ) ) {
foreach ( $scripts as $script ) {
$custom_tag = 'script';
// @todo Check posibility to use wp_add_inline_script
// @codingStandardsIgnoreLine
$output .= '<' . $custom_tag . ' src="' . esc_url( $script ) . '"></' . $custom_tag . '>';
}
}
return $output;
}
/**
* Render grouped fields.
* @param $groups
* @param $groups_content
*
* @return string
* @since 4.4
*
*/
protected function renderGroupedFields( $groups, $groups_content ) {
$output = '';
if ( count( $groups ) > 1 || ( count( $groups ) >= 1 && empty( $groups_content['_general'] ) ) ) {
$output .= '<div class="vc_panel-tabs" id="vc_edit-form-tabs">';
$output .= '<ul class="vc_general vc_ui-tabs-line" data-vc-ui-element="panel-tabs-controls">';
$key = 0;
foreach ( $groups as $g ) {
$output .= '<li class="vc_edit-form-tab-control" data-tab-index="' . esc_attr( $key ) . '"><button data-vc-ui-element-target="#vc_edit-form-tab-' . ( $key ++ ) . '" class="vc_ui-tabs-line-trigger" data-vc-ui-element="panel-tab-control">' . ( '_general' === $g ? esc_html__( 'General', 'js_composer' ) : $g ) . '</button></li>';
}
$output .= '<li class="vc_ui-tabs-line-dropdown-toggle" data-vc-action="dropdown"
data-vc-content=".vc_ui-tabs-line-dropdown" data-vc-ui-element="panel-tabs-line-toggle">
<span class="vc_ui-tabs-line-trigger" data-vc-accordion
data-vc-container=".vc_ui-tabs-line-dropdown-toggle"
data-vc-target=".vc_ui-tabs-line-dropdown"> </span>
<ul class="vc_ui-tabs-line-dropdown" data-vc-ui-element="panel-tabs-line-dropdown">
</ul>
</ul>';
$key = 0;
foreach ( $groups as $g ) {
$output .= '<div id="vc_edit-form-tab-' . ( $key ++ ) . '" class="vc_edit-form-tab vc_row vc_ui-flex-row" data-vc-ui-element="panel-edit-element-tab">';
$output .= $groups_content[ $g ];
$output .= '</div>';
}
$output .= '</div>';
} elseif ( ! empty( $groups_content['_general'] ) ) {
$output .= '<div class="vc_edit-form-tab vc_row vc_ui-flex-row vc_active" data-vc-ui-element="panel-edit-element-tab">' . $groups_content['_general'] . '</div>';
}
return $output;
}
/**
* Render fields html and output it.
* @since 4.4
* vc_filter: vc_edit_form_class - filter to override editor_css_classes array
*/
public function render() {
$this->loadDefaultParams();
$output = $el_position = '';
$groups_content = $groups = array();
$params = $this->setting( 'params' );
$editor_css_classes = apply_filters( 'vc_edit_form_class', array(
'wpb_edit_form_elements',
'vc_edit_form_elements',
), $this->atts, $params );
$deprecated = $this->setting( 'deprecated' );
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
// TODO: check presets 6.0
// $list_vendor_presets = Vc_Settings_Preset::listVendorSettingsPresets( $this->tag );
// $list_presets = Vc_Settings_Preset::listSettingsPresets( $this->tag );
$show_settings = false;
$saveAsTemplateElements = apply_filters( 'vc_popup_save_as_template_elements', array(
'vc_row',
'vc_section',
) );
$show_presets = ! in_array( $this->tag, $saveAsTemplateElements, true ) && vc_user_access()->part( 'presets' )->checkStateAny( true, null )->get();
if ( in_array( $this->tag, $saveAsTemplateElements, true ) && vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) {
$show_settings = true;
}
$custom_tag = 'script';
$output .= sprintf( '<' . $custom_tag . '>window.vc_presets_show=%s;</' . $custom_tag . '>', $show_presets ? 'true' : 'false' );
$output .= sprintf( '<' . $custom_tag . '>window.vc_settings_show=%s;</' . $custom_tag . '>', $show_presets || $show_settings ? 'true' : 'false' );
if ( ! empty( $deprecated ) ) {
$output .= '<div class="vc_row vc_ui-flex-row vc_shortcode-edit-form-deprecated-message"><div class="vc_col-sm-12 wpb_element_wrapper">' . vc_message_warning( sprintf( esc_html__( 'You are using outdated element, it is deprecated since version %s.', 'js_composer' ), $this->setting( 'deprecated' ) ) ) . '</div></div>';
}
$output .= '<div class="' . implode( ' ', $editor_css_classes ) . '" data-title="' . esc_attr__( 'Edit', 'js_composer' ) . ' ' . esc_attr( $this->setting( 'name' ) ) . '">';
if ( is_array( $params ) ) {
foreach ( $params as $param ) {
$name = isset( $param['param_name'] ) ? $param['param_name'] : null;
if ( ! is_null( $name ) ) {
$value = isset( $this->atts[ $name ] ) ? $this->atts[ $name ] : null;
$value = $this->parseShortcodeAttributeValue( $param, $value );
$group = isset( $param['group'] ) && '' !== $param['group'] ? $param['group'] : '_general';
if ( ! isset( $groups_content[ $group ] ) ) {
$groups[] = $group;
$groups_content[ $group ] = '';
}
$groups_content[ $group ] .= $this->renderField( $param, $value );
}
}
}
$output .= $this->renderGroupedFields( $groups, $groups_content );
$output .= '</div>';
$output .= $this->enqueueScripts();
// @codingStandardsIgnoreLine
echo $output;
do_action( 'vc_edit_form_fields_after_render' );
}
/**
* Generate html for shortcode attribute.
*
* Method
* @param $param
* @param $value
*
* vc_filter: vc_single_param_edit - hook to edit any shortode param
* vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param_value - hook to edit shortcode param
* value vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param - hook to edit shortcode
* param attributes vc_filter: vc_single_param_edit_holder_output - hook to edit output of this method
*
* @return mixed
* @since 4.4
*
*/
public function renderField( $param, $value ) {
$param['vc_single_param_edit_holder_class'] = array(
'wpb_el_type_' . $param['type'],
'vc_wrapper-param-type-' . $param['type'],
'vc_shortcode-param',
'vc_column',
);
if ( ! empty( $param['param_holder_class'] ) ) {
$param['vc_single_param_edit_holder_class'][] = $param['param_holder_class'];
}
$param = apply_filters( 'vc_single_param_edit', $param, $value );
$output = '<div class="' . implode( ' ', $param['vc_single_param_edit_holder_class'] ) . '" data-vc-ui-element="panel-shortcode-param" data-vc-shortcode-param-name="' . esc_attr( $param['param_name'] ) . '" data-param_type="' . esc_attr( $param['type'] ) . '" data-param_settings="' . htmlentities( wp_json_encode( $param ) ) . '">';
$output .= ( isset( $param['heading'] ) ) ? '<div class="wpb_element_label">' . $param['heading'] . '</div>' : '';
$output .= '<div class="edit_form_line">';
$value = apply_filters( 'vc_form_fields_render_field_' . $this->setting( 'base' ) . '_' . $param['param_name'] . '_param_value', $value, $param, $this->settings, $this->atts );
$param = apply_filters( 'vc_form_fields_render_field_' . $this->setting( 'base' ) . '_' . $param['param_name'] . '_param', $param, $value, $this->settings, $this->atts );
$output = apply_filters( 'vc_edit_form_fields_render_field_' . $param['type'] . '_before', $output );
$output .= vc_do_shortcode_param_settings_field( $param['type'], $param, $value, $this->setting( 'base' ) );
$output_after = '';
if ( isset( $param['description'] ) ) {
$output_after .= '<span class="vc_description vc_clearfix">' . $param['description'] . '</span>';
}
$output_after .= '</div></div>';
$output .= apply_filters( 'vc_edit_form_fields_render_field_' . $param['type'] . '_after', $output_after );
return apply_filters( 'vc_single_param_edit_holder_output', $output, $param, $value, $this->settings, $this->atts );
}
/**
* Create default shortcode params
*
* List of params stored in global variable $vc_params_list.
* Please check include/params/load.php for default params list.
* @return bool
* @since 4.4
*/
public function loadDefaultParams() {
global $vc_params_list;
if ( empty( $vc_params_list ) ) {
return false;
}
$script_url = vc_asset_url( 'js/dist/edit-form.min.js' );
foreach ( $vc_params_list as $param ) {
vc_add_shortcode_param( $param, 'vc_' . $param . '_form_field', $script_url );
}
do_action( 'vc_load_default_params' );
return true;
}
}
templates/params/column_offset/template.tpl.php 0000644 00000005266 15121635561 0016030 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var Vc_Column_Offset $param
* @var Vc_Column_Offset $sizes ::$size_types
*/
$layouts = array(
'xs' => 'portrait-smartphones',
'sm' => 'portrait-tablets',
'md' => 'landscape-tablets',
'lg' => 'default',
);
$custom_tag = 'script';
?>
<div class="vc_column-offset" data-column-offset="true">
<?php if ( '1' === vc_settings()->get( 'not_responsive_css' ) ) : ?>
<div class="wpb_alert wpb_content_element vc_alert_rounded wpb_alert-warning">
<div class="messagebox_text">
<p><?php printf( esc_html__( 'Responsive design settings are currently disabled. You can enable them in WPBakery Page Builder %ssettings page%s by unchecking "Disable responsive content elements".', 'js_composer' ), '<a href="' . esc_url( admin_url( 'admin.php?page=vc-general' ) ) . '">', '</a>' ); ?></p>
</div>
</div>
<?php endif ?>
<input name="<?php echo esc_attr( $settings['param_name'] ); ?>"
class="wpb_vc_param_value <?php echo esc_attr( $settings['param_name'] ); ?>
<?php echo esc_attr( $settings['type'] ); ?> '_field" type="hidden" value="<?php echo esc_attr( $value ); ?>"/>
<table class="vc_table vc_column-offset-table">
<tr>
<th>
<?php esc_html_e( 'Device', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Offset', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Width', 'js_composer' ); ?>
</th>
<th>
<?php esc_html_e( 'Hide on device?', 'js_composer' ); ?>
</th>
</tr>
<?php foreach ( $sizes as $key => $size ) : ?>
<tr class="vc_size-<?php echo esc_attr( $key ); ?>">
<td class="vc_screen-size vc_screen-size-<?php echo esc_attr( $key ); ?>">
<span title="<?php echo esc_attr( $size ); ?>">
<i class="vc-composer-icon vc-c-icon-layout_<?php echo isset( $layouts[ $key ] ) ? esc_attr( $layouts[ $key ] ) : esc_attr( $key ); ?>"></i>
</span>
</td>
<td>
<?php
// @codingStandardsIgnoreLine
print $param->offsetControl( $key );
?>
</td>
<td>
<?php
// @codingStandardsIgnoreLine
print $param->sizeControl( $key );
?>
</td>
<td>
<label>
<input type="checkbox" name="vc_hidden-<?php echo esc_attr( $key ); ?>"
value="yes"<?php echo in_array( 'vc_hidden-' . $key, $data, true ) ? ' checked="true"' : ''; ?>
class="vc_column_offset_field">
</label>
</td>
</tr>
<?php endforeach ?>
</table>
</div>
<<?php echo esc_attr( $custom_tag ); ?>>
window.VcI8nColumnOffsetParam =
<?php
echo wp_json_encode( array(
'inherit' => esc_html__( 'Inherit: ', 'js_composer' ),
'inherit_default' => esc_html__( 'Inherit from default', 'js_composer' ),
) )
?>
;
</<?php echo esc_attr( $custom_tag ); ?>>
templates/params/google_fonts/template.php 0000644 00000005530 15121635561 0015046 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
?>
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label"><?php esc_html_e( 'Font Family', 'js_composer' ); ?></div>
<div class="vc_google_fonts_form_field-font_family-container">
<select class="vc_google_fonts_form_field-font_family-select"
default[font_style]="<?php echo esc_attr( $values['font_style'] ); ?>">
<?php
/** @var Vc_Google_Fonts $this */
$fonts = $this->_vc_google_fonts_get_fonts();
foreach ( $fonts as $font_data ) :
?>
<option value="<?php echo esc_attr( $font_data->font_family ) . ':' . esc_attr( $font_data->font_styles ); ?>"
data[font_types]="<?php echo esc_attr( $font_data->font_types ); ?>"
data[font_family]="<?php echo esc_attr( $font_data->font_family ); ?>"
data[font_styles]="<?php echo esc_attr( $font_data->font_styles ); ?>"
class="<?php echo esc_attr( vc_build_safe_css_class( $font_data->font_family ) ); ?>" <?php echo( strtolower( $values['font_family'] ) === strtolower( $font_data->font_family ) || strtolower( $values['font_family'] ) === strtolower( $font_data->font_family ) . ':' . $font_data->font_styles ? 'selected' : '' ); ?> ><?php echo esc_html( $font_data->font_family ); ?></option>
<?php endforeach ?>
</select>
</div>
<?php if ( isset( $fields['font_family_description'] ) && strlen( $fields['font_family_description'] ) > 0 ) : ?>
<span class="vc_description clear"><?php echo esc_html( $fields['font_family_description'] ); ?></span>
<?php endif ?>
</div>
<?php if ( isset( $fields['no_font_style'] ) && false === $fields['no_font_style'] || ! isset( $fields['no_font_style'] ) ) : ?>
<div class="vc_row-fluid vc_column">
<div class="wpb_element_label"><?php esc_html_e( 'Font style', 'js_composer' ); ?></div>
<div class="vc_google_fonts_form_field-font_style-container">
<select class="vc_google_fonts_form_field-font_style-select"></select>
</div>
</div>
<?php if ( isset( $fields['font_style_description'] ) && strlen( $fields['font_style_description'] ) > 0 ) : ?>
<span class="vc_description clear"><?php echo esc_html( $fields['font_style_description'] ); ?></span>
<?php endif ?>
<?php endif ?>
<div class="vc_row-fluid vc_column vc_google_fonts_form_field-preview-wrapper">
<div class="wpb_element_label"><?php esc_html_e( 'Google Fonts preview', 'js_composer' ); ?>:</div>
<div class="vc_google_fonts_form_field-preview-container">
<span><?php esc_html_e( 'Grumpy wizards make toxic brew for the evil Queen and Jack.', 'js_composer' ); ?></span>
</div>
<div class="vc_google_fonts_form_field-status-container"><span></span></div>
</div>
<input name="<?php echo esc_attr( $settings['param_name'] ); ?>"
class="wpb_vc_param_value <?php echo esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ); ?>_field" type="hidden"
value="<?php echo esc_attr( $value ); ?>"/>
templates/params/vc_grid_item/editor/vc_ui-template-preview.tpl.php 0000644 00000012147 15121635561 0021664 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
vc_grid_item_map_shortcodes();
do_action( 'vc-render-templates-preview-template' );
/** @var Vc_Grid_Item_Editor $vc_grid_item_editor */
global $vc_grid_item_editor;
if ( $vc_grid_item_editor ) {
$vc_grid_item_editor->registerBackendCss();
$vc_grid_item_editor->registerBackendJavascript();
add_filter( 'admin_body_class', array( $vc_grid_item_editor->templatesEditor(), 'addBodyClassTemplatePreview' ) );
add_action( 'admin_enqueue_scripts', array( &$vc_grid_item_editor, 'enqueueEditorScripts' ) );
add_action( 'admin_footer', array( &$vc_grid_item_editor, 'renderEditorFooter' ) );
add_filter( 'vc_wpbakery_shortcode_get_controls_list', array( $vc_grid_item_editor, 'shortcodesControls' ) );
}
add_action( 'admin_enqueue_scripts', array( visual_composer()->templatesPanelEditor(), 'enqueuePreviewScripts' ) );
global $menu, $submenu, $parent_file, $post_ID, $post, $post_type;
$post_ID = $editorPost->ID;
$post_type = $editorPost->post_type;
$post_title = trim( $editorPost->post_title );
$nonce_action = $nonce_action = 'update-post_' . $post_ID;
$user_ID = isset( $current_user ) && isset( $current_user->ID ) ? (int) $current_user->ID : 0;
$form_action = 'editpost';
$menu = array();
remove_action( 'wp_head', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
add_thickbox();
wp_enqueue_media( array( 'post' => $post_ID ) );
visual_composer()->templatesPanelEditor()->registerPreviewScripts();
require_once ABSPATH . 'wp-admin/admin-header.php';
$custom_tag = 'script';
$first_tag = 'style';
?>
<<?php echo esc_attr( $first_tag ); ?>>
#screen-meta, #adminmenumain, .notice, #wpfooter, #message, .updated {
display: none !important;
}
#wpcontent {
margin-left: 0 !important;
padding-left: 0 !important;
}
.vc_not-remove-overlay {
position: fixed !important;
width: 100%;
height: 100%;
z-index: 199999999;
}
html {
overflow: hidden;
background: transparent;
}
</<?php echo esc_attr( $first_tag ); ?>>
<div class="vc_not-remove-overlay"></div>
<div class="vc_ui-template-preview">
<textarea id="content" style="display: none;">
<?php
// @codingStandardsIgnoreLine
print $content;
?>
</textarea>
<div id="wpb_visual_composer" class="postbox " style="display: block;">
<div class="inside">
<div class="metabox-composer-content">
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper ui-sortable ui-droppable"></div>
<div id="vc_no-content-helper" class="vc_welcome"></div>
</div>
<input type="hidden" name="vc_js_composer_group_access_show_rule" class="vc_js_composer_group_access_show_rule" value="all">
<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true">
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="Loading, please wait...">
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="Crunching...">
<input type="hidden" name="vc_grid_item_editor" value="true"/>
<input type="hidden" name="vc_post_custom_css" id="vc_post-custom-css" value="" autocomplete="off">
</div>
</div>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="<?php esc_attr_e( 'Loading, please wait...', 'js_composer' ); ?>"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="<?php esc_attr_e( 'Crunching...', 'js_composer' ); ?>"/>
</div>
<<?php echo esc_attr( $custom_tag ); ?>>
/**
* Get content of grid item editor of current post. Data is used as models collection of shortcodes.
* Data always wrapped with vc_gitem shortcode.
* @return {*}
*/
var vcDefaultGridItemContent = '' +
'[vc_gitem]' +
'[vc_gitem_animated_block]' +
'[vc_gitem_zone_a]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_a]' +
'[vc_gitem_zone_b]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_b]' +
'[/vc_gitem_animated_block]' +
'[/vc_gitem]';
</<?php echo esc_attr( $custom_tag ); ?>>
<?php
vc_include_template( 'editors/partials/backend-shortcodes-templates.tpl.php' );
do_action( 'vc_backend_editor_render' );
do_action( 'vc_vc_grid_item_editor_render' );
do_action( 'vc_ui-template-preview' );
// fix bug #59741644518985 in firefox
// wp_dequeue_script( 'isotope' );
require_once ABSPATH . 'wp-admin/admin-footer.php';
templates/params/vc_grid_item/editor/vc_grid_item_editor.tpl.php 0000644 00000004752 15121635561 0021273 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/navbar/class-vc-navbar-grid-item.php' );
$nav_bar = new Vc_Navbar_Grid_Item( $post );
$nav_bar->render();
$custom_tag = 'script';
?>
<div class="metabox-composer-content">
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"
data-type="<?php echo esc_attr( get_post_type() ); ?>"></div>
<div id="vc_gitem-preview" class="main_wrapper vc_gitem-preview" data-vc-grid-item="preview">
</div>
</div>
<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true"/>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading"
value="<?php esc_html_e( 'Loading, please wait...', 'js_composer' ); ?>"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row"
value="<?php esc_html_e( 'Crunching...', 'js_composer' ); ?>"/>
<input type="hidden" name="vc_grid_item_editor" value="true"/>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vc_post_id = <?php echo get_the_ID(); ?>;
<?php
$vc_gitem_template = vc_request_param( 'vc_gitem_template' );
$template = Vc_Grid_Item::predefinedTemplate( $vc_gitem_template );
if ( strlen( $vc_gitem_template ) && $template ) {
echo "var vcDefaultGridItemContent = '" . $template['template'] . "';";
} else {
?>
/**
* Get content of grid item editor of current post. Data is used as models collection of shortcodes.
* Data always wrapped with vc_gitem shortcode.
* @return {*}
*/
var vcDefaultGridItemContent = '' +
'[vc_gitem]' +
'[vc_gitem_animated_block]' +
'[vc_gitem_zone_a]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_a]' +
'[vc_gitem_zone_b]' +
'[vc_gitem_row position="top"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="middle"]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[vc_gitem_col width="1/2"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[vc_gitem_row position="bottom"]' +
'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
'[/vc_gitem_row]' +
'[/vc_gitem_zone_b]' +
'[/vc_gitem_animated_block]' +
'[/vc_gitem]';
<?php
}
?>
</<?php echo esc_attr( $custom_tag ); ?>>
templates/params/vc_grid_item/editor/partials/vc_grid_item_editor_footer.tpl.php 0000644 00000004777 15121635561 0024477 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.php' );
$add_element_box = new Vc_Add_Element_Box_Grid_Item();
$add_element_box->render();
// Edit form for mapped shortcode.
visual_composer()->editForm()->render();
require_once vc_path_dir( 'PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php' );
$templates_editor = new Vc_Templates_Editor_Grid_Item();
$templates_editor->renderUITemplate();
$grid_item = new Vc_Grid_Item();
$shortcodes = $grid_item->shortcodes();
if ( vc_user_access()->part( 'presets' )->can()->get() ) {
require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' );
$vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets();
$vc_all_presets = Vc_Settings_Preset::listAllPresets();
} else {
$vc_vendor_settings_presets = array();
$vc_all_presets = array();
}
$custom_tag = 'script';
?>
<<?php echo esc_attr( $custom_tag ); ?>>
window.vc_user_mapper = <?php echo wp_json_encode( WpbMap_Grid_Item::getGitemUserShortCodes() ); ?>;
window.vc_mapper = <?php echo wp_json_encode( WpbMap_Grid_Item::getShortCodes() ); ?>;
window.vc_vendor_settings_presets = <?php echo wp_json_encode( $vc_vendor_settings_presets ); ?>;
window.vc_all_presets = <?php echo wp_json_encode( $vc_all_presets ); ?>;
window.vc_frontend_enabled = false;
window.vc_mode = '<?php echo esc_js( vc_mode() ); ?>';
window.vcAdminNonce = '<?php echo esc_js( vc_generate_nonce( 'vc-admin-nonce' ) ); ?>';
</<?php echo esc_attr( $custom_tag ); ?>>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_settings-image-block">
<li class="added">
<div class="inner" style="width: 80px; height: 80px; overflow: hidden;text-align: center;">
<img rel="{{ id }}" src="<# if(sizes && sizes.thumbnail) { #>{{ sizes.thumbnail.url }}<# } else {#>{{ url }}<# } #>"/>
</div>
<a href="#" class="vc_icon-remove"><i class="vc-composer-icon vc-c-icon-close"></i></a>
</li>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php foreach ( WpbMap_Grid_Item::getShortCodes() as $sc_base => $el ) : ?>
<<?php echo esc_attr( $custom_tag ); ?> type="text/html" id="vc_shortcode-template-<?php echo esc_attr( $sc_base ); ?>">
<?php
// @codingStandardsIgnoreLine
print visual_composer()->getShortCode( $sc_base )->template();
?>
</<?php echo esc_attr( $custom_tag ); ?>>
<?php endforeach ?>
<?php
vc_include_template( 'editors/partials/access-manager-js.tpl.php' );
templates/params/vc_grid_item/attributes/vc_btn.php 0000644 00000020314 15121635561 0016637 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Btn $vc_btn
* @var WP_Post $post
* @var $atts
*
* @var $style
* @var $shape
* @var $color
* @var $custom_background
* @var $custom_text
* @var $size
* @var $align
* @var $link
* @var $title
* @var $button_block
* @var $el_id
* @var $el_class
* @var $outline_custom_color
* @var $outline_custom_hover_background
* @var $outline_custom_hover_text
* @var $add_icon
* @var $i_align
* @var $i_type
* @var $i_icon_fontawesome
* @var $i_icon_openiconic
* @var $i_icon_typicons
* @var $i_icon_entypo
* @var $i_icon_linecons
* @var $i_icon_pixelicons
* @var $css_animation
* @var $css
* @var $gradient_color_1
* @var $gradient_color_2
* @var $gradient_custom_color_1 ;
* @var $gradient_custom_color_2 ;
* @var $gradient_text_color ;
*/
$atts = array();
parse_str( $data, $atts );
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Btn' );
$vc_btn = new WPBakeryShortCode_Vc_Btn( array( 'base' => 'vc_btn' ) );
$style = $shape = $color = $size = $custom_background = $custom_text = $align = $link = $title = $button_block = $el_class = $outline_custom_color = $outline_custom_hover_background = $outline_custom_hover_text = $add_icon = $i_align = $i_type = $i_icon_entypo = $i_icon_fontawesome = $i_icon_linecons = $i_icon_pixelicons = $i_icon_typicons = $css = $css_animation = '';
$gradient_color_1 = $gradient_color_2 = $gradient_custom_color_1 = $gradient_custom_color_2 = $gradient_text_color = '';
$custom_onclick = $custom_onclick_code = '';
$a_href = $a_title = $a_target = $a_rel = '';
$styles = array();
$icon_wrapper = false;
$icon_html = false;
$attributes = array();
/** @var WPBakeryShortCode_Vc_Btn $vc_btn */
$atts = vc_map_get_attributes( $vc_btn->getShortcode(), $atts );
extract( $atts );
// parse link
$link = trim( $link );
$use_link = strlen( $link ) > 0 && 'none' !== $link;
$wrapper_classes = array(
'vc_btn3-container',
$vc_btn->getExtraClass( $el_class ),
$vc_btn->getCSSAnimation( $css_animation ),
'vc_btn3-' . $align,
);
$button_classes = array(
'vc_general',
'vc_btn3',
'vc_btn3-size-' . $size,
'vc_btn3-shape-' . $shape,
'vc_btn3-style-' . $style,
);
$button_html = $title;
if ( '' === trim( $title ) ) {
$button_classes[] = 'vc_btn3-o-empty';
$button_html = '<span class="vc_btn3-placeholder"> </span>';
}
if ( 'true' === $button_block && 'inline' !== $align ) {
$button_classes[] = 'vc_btn3-block';
}
if ( 'true' === $add_icon ) {
$button_classes[] = 'vc_btn3-icon-' . $i_align;
vc_icon_element_fonts_enqueue( $i_type );
if ( isset( ${'i_icon_' . $i_type} ) ) {
if ( 'pixelicons' === $i_type ) {
$icon_wrapper = true;
}
$icon_class = ${'i_icon_' . $i_type};
} else {
$icon_class = 'fa fa-adjust';
}
if ( $icon_wrapper ) {
$icon_html = '<i class="vc_btn3-icon"><span class="vc_btn3-icon-inner ' . esc_attr( $icon_class ) . '"></span></i>';
} else {
$icon_html = '<i class="vc_btn3-icon ' . esc_attr( $icon_class ) . '"></i>';
}
if ( 'left' === $i_align ) {
$button_html = $icon_html . ' ' . $button_html;
} else {
$button_html .= ' ' . $icon_html;
}
}
$output = '';
if ( 'custom' === $style ) {
if ( $custom_background ) {
$styles[] = vc_get_css_color( 'background-color', $custom_background );
}
if ( $custom_text ) {
$styles[] = vc_get_css_color( 'color', $custom_text );
}
if ( ! $custom_background && ! $custom_text ) {
$button_classes[] = 'vc_btn3-color-grey';
}
} elseif ( 'outline-custom' === $style ) {
if ( $outline_custom_color ) {
$styles[] = vc_get_css_color( 'border-color', $outline_custom_color );
$styles[] = vc_get_css_color( 'color', $outline_custom_color );
$attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"';
} else {
$attributes[] = 'onmouseleave="this.style.borderColor=\'\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'\'"';
}
$onmouseenter = array();
if ( $outline_custom_hover_background ) {
$onmouseenter[] = 'this.style.borderColor=\'' . $outline_custom_hover_background . '\';';
$onmouseenter[] = 'this.style.backgroundColor=\'' . $outline_custom_hover_background . '\';';
}
if ( $outline_custom_hover_text ) {
$onmouseenter[] = 'this.style.color=\'' . $outline_custom_hover_text . '\';';
}
if ( $onmouseenter ) {
$attributes[] = 'onmouseenter="' . implode( ' ', $onmouseenter ) . '"';
}
if ( ! $outline_custom_color && ! $outline_custom_hover_background && ! $outline_custom_hover_text ) {
$button_classes[] = 'vc_btn3-color-inverse';
foreach ( $button_classes as $k => $v ) {
if ( 'vc_btn3-style-outline-custom' === $v ) {
unset( $button_classes[ $k ] );
break;
}
}
$button_classes[] = 'vc_btn3-style-outline';
}
} elseif ( 'gradient' === $style || 'gradient-custom' === $style ) {
$gradient_color_1 = vc_convert_vc_color( $gradient_color_1 );
$gradient_color_2 = vc_convert_vc_color( $gradient_color_2 );
$button_text_color = '#fff';
if ( 'gradient-custom' === $style ) {
$gradient_color_1 = $gradient_custom_color_1;
$gradient_color_2 = $gradient_custom_color_2;
$button_text_color = $gradient_text_color;
}
$gradient_css = array();
$gradient_css[] = 'color: ' . $button_text_color;
$gradient_css[] = 'border: none';
$gradient_css[] = 'background-color: ' . $gradient_color_1;
$gradient_css[] = 'background-image: -webkit-linear-gradient(left, ' . $gradient_color_1 . ' 0%, ' . $gradient_color_2 . ' 50%,' . $gradient_color_1 . ' 100%)';
$gradient_css[] = 'background-image: linear-gradient(to right, ' . $gradient_color_1 . ' 0%, ' . $gradient_color_2 . ' 50%,' . $gradient_color_1 . ' 100%)';
$gradient_css[] = '-webkit-transition: all .2s ease-in-out';
$gradient_css[] = 'transition: all .2s ease-in-out';
$gradient_css[] = 'background-size: 200% 100%';
// hover css
$gradient_css_hover = array();
$gradient_css_hover[] = 'color: ' . $button_text_color;
$gradient_css_hover[] = 'background-color: ' . $gradient_color_2;
$gradient_css_hover[] = 'border: none';
$gradient_css_hover[] = 'background-position: 100% 0';
$uid = uniqid();
$first_tag = 'style';
$output .= '<' . $first_tag . '>.vc_btn3-style-' . esc_attr( $style ) . '.vc_btn-gradient-btn-' . esc_attr( $uid ) . ':hover{' . esc_attr( implode( ';', $gradient_css_hover ) ) . ';' . '}</' . $first_tag . '>';
$output .= '<' . $first_tag . '>.vc_btn3-style-' . esc_attr( $style ) . '.vc_btn-gradient-btn-' . esc_attr( $uid ) . '{' . esc_attr( implode( ';', $gradient_css ) ) . ';' . '}</' . $first_tag . '>';
$button_classes[] = 'vc_btn-gradient-btn-' . $uid;
$attributes[] = 'data-vc-gradient-1="' . $gradient_color_1 . '"';
$attributes[] = 'data-vc-gradient-2="' . $gradient_color_2 . '"';
} else {
$button_classes[] = 'vc_btn3-color-' . $color;
}
if ( $styles ) {
$attributes[] = 'style="' . implode( ' ', $styles ) . '"';
}
$class_to_filter = implode( ' ', array_filter( $wrapper_classes ) );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $vc_btn->settings( 'base' ), $atts );
if ( $button_classes ) {
$button_classes = esc_attr( apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $button_classes ) ), $vc_btn->settings( 'base' ), $atts ) );
$attributes[] = 'class="' . trim( $button_classes ) . '"';
}
if ( $use_link ) {
$link_output = vc_gitem_create_link_real( $atts, $post, 'vc_general vc_btn3 ' . trim( $button_classes ), $title );
$attributes[] = $link_output;
}
if ( ! empty( $custom_onclick ) && $custom_onclick_code ) {
$attributes[] = 'onclick="' . esc_attr( $custom_onclick_code ) . '"';
}
$attributes = implode( ' ', $attributes );
$output .= '<div class="' . esc_attr( trim( $css_class ) ) . '"' . ( ! empty( $el_id ) ? ' id="' . esc_attr( $el_id ) . '"' : '' ) . '>';
if ( $use_link ) {
if ( preg_match( '/href=\"[^\"]+/', $link_output ) ) {
$output .= '<a ' . $attributes . '>' . $button_html . '</a>';
} elseif ( 'load-more-grid' === $link ) {
$output .= '<a href="javascript:;" ' . $attributes . '>' . $button_html . '</a>';
}
} else {
$output .= '<button ' . $attributes . '>' . $button_html . '</button>';
}
$output .= '</div>';
return $output;
templates/params/vc_grid_item/attributes/post_categories.php 0000644 00000003612 15121635561 0020560 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Gitem_Post_Categories $vc_btn
* @var WP_Post $post
* @var $atts
*
*/
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Gitem_Post_Categories' );
$categories = get_the_category();
$separator = '';
$css_class = array( 'vc_gitem-post-data' );
$css_class[] = vc_shortcode_custom_css_class( $atts['css'] );
$css_class[] = $atts['el_class'];
$css_class[] = 'vc_gitem-post-data-source-post_categories';
$style = str_replace( ',', 'comma', $atts['category_style'] );
$output = '<div class="' . esc_attr( implode( ' ', array_filter( $css_class ) ) ) . ' vc_grid-filter vc_clearfix vc_grid-filter-' . esc_attr( $style ) . ' vc_grid-filter-size-' . esc_attr( $atts['category_size'] ) . ' vc_grid-filter-center vc_grid-filter-color-' . esc_attr( $atts['category_color'] ) . '">';
$data = array();
if ( ! empty( $categories ) ) {
foreach ( $categories as $category ) {
$category_link = '';
if ( ! empty( $atts['link'] ) ) {
$category_link = 'href="' . esc_url( get_category_link( $category->term_id ) ) . '" alt="' . sprintf( esc_attr__( 'View all posts in %s', 'js_composer' ), $category->name ) . '"';
}
$wrapper = '<div class="vc_grid-filter-item vc_gitem-post-category-name">';
$content = esc_html( $category->name );
if ( ! empty( $category_link ) ) {
$content = '<span class="vc_gitem-post-category-name"><a ' . $category_link . ' class="vc_gitem-link">' . $content . '</a>' . '</span>';
} else {
$content = '<span class="vc_gitem-post-category-name">' . $content . '</span>';
}
$wrapper_end = '</div>';
$data[] = $wrapper . $content . $wrapper_end;
}
}
if ( empty( $atts['category_style'] ) || ' ' === $atts['category_style'] || ', ' === $atts['category_style'] ) {
$separator = $atts['category_style'];
}
$output .= implode( $separator, $data );
$output .= '</div>';
return $output;
templates/params/vc_grid_item/attributes/featured_image.php 0000644 00000003617 15121635561 0020334 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_Vc_Single_image' );
$atts = array();
parse_str( $data, $atts );
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
$image_string = '';
$img_class = new WPBakeryShortCode_Vc_Single_image( array( 'base' => 'vc_single_image' ) );
/** @var WPBakeryShortCode_Vc_Single_image $img_class */
$atts = vc_map_get_attributes( $img_class->getShortcode(), $atts );
extract( $atts );
$style = ( '' !== $style ) ? $style : '';
$border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : '';
$img_id = has_post_thumbnail( $post->ID ) ? get_post_thumbnail_id( $post->ID ) : $post->ID;
$img = wpb_getImageBySize( array(
'attach_id' => $img_id,
'thumb_size' => $img_size,
'class' => 'vc_single_image-img',
) );
$img = apply_filters( 'vc_gitem_attribute_featured_image_img', $img );
if ( null === $img || false === $img ) {
return '';
}
$el_class = $img_class->getExtraClass( $el_class );
$style = preg_replace( '/_circle_2$/', '_circle', $style );
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link_real( $atts, $post, $wrapperClass, $title );
$image_string = ! empty( $link ) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</div>';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class( $css, ' ' ), $img_class->settings( 'base' ), $atts );
$css_class .= $img_class->getCSSAnimation( $css_animation );
$css_class .= ' vc_align_' . $alignment;
$output = '
<div class="' . esc_attr( $css_class ) . '">
<figure class="wpb_wrapper vc_figure">
' . $image_string . '
</figure>
</div>
';
return $output;
templates/params/vc_grid_item/preview.tpl.php 0000644 00000004364 15121635561 0015464 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$custom_tag = 'script';
$first_tag = 'style';
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>"/>
<meta name="viewport" content="width=device-width"/>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php wp_head(); ?>
<<?php echo esc_attr( $first_tag ); ?>>
body {
background-color: #FFF;
color: #000;
font-size: 12px;
}
<?php
// @codingStandardsIgnoreLine
print visual_composer()->parseShortcodesCustomCss( $shortcodes_string );
?>
.vc_gitem-preview {
margin: 60px auto;
}
.vc_gitem-preview .vc_grid-item {
display: block;
margin: 0 auto;
}
.vc_grid-item-width-dropdown {
margin-top: 10px;
text-align: center;
}
.vc_container {
margin: 0 15px;
}
img {
width: 100%;
}
</<?php echo esc_attr( $first_tag ); ?>>
</head>
<div id="vc_grid-item-primary" class="vc_grid-item-site-content">
<div id="vc_grid-item-content" role="vc_grid-item-main">
<div class="vc_gitem-preview" data-vc-grid-settings="{}">
<div class="vc_container">
<div class="vc_row">
<?php
// @codingStandardsIgnoreLine
print $grid_item->renderItem( $post );
?>
</div>
</div>
</div>
</div>
<!-- #content -->
</div>
<!-- #primary -->
<?php wp_footer(); ?>
<<?php echo esc_attr( $custom_tag ); ?>>
var currentWidth = '<?php echo esc_js( $default_width_value ); ?>',
vcSetItemWidth = function ( value ) {
jQuery( '.vc_grid-item' ).removeClass( 'vc_col-sm-' + currentWidth )
.addClass( 'vc_col-sm-' + value );
currentWidth = value;
}, changeAnimation;
changeAnimation = function ( animation ) {
var $animatedBlock, prevAnimation;
$animatedBlock = jQuery( '.vc_gitem-animated-block' );
prevAnimation = $animatedBlock.data( 'vcAnimation' );
$animatedBlock.hide()
.addClass( 'vc_gitem-animate vc_gitem-animate-' + animation )
.removeClass( 'vc_gitem-animate-' + prevAnimation )
.data( 'vcAnimation', animation );
setTimeout( function () {
$animatedBlock.show();
}, 100 );
};
jQuery( document ).ready( function ( $ ) {
window.parent.vc && window.parent.vc.app.showPreview( currentWidth );
} );
</<?php echo esc_attr( $custom_tag ); ?>>
</body>
</html>
templates/params/vc_grid_item/shortcodes/vc_icon.php 0000644 00000004535 15121635561 0017002 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/** @var WPBakeryShortCode_Vc_Icon $this */
$icon = $color = $size = $align = $el_class = $custom_color = $link = $background_style = $background_color = $type = $icon_fontawesome = $icon_openiconic = $icon_typicons = $icon_entypoicons = $icon_linecons = $custom_background_color = '';
/** @var array $atts - shortcode attributes */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$link = vc_gitem_create_link( $atts, 'vc_icon_element-link' );
$class_to_filter = $this->getCSSAnimation( $css_animation );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
// Enqueue needed icon font.
vc_icon_element_fonts_enqueue( $type );
$has_style = false;
if ( strlen( $background_style ) > 0 ) {
$has_style = true;
if ( false !== strpos( $background_style, 'outline' ) ) {
$background_style .= ' vc_icon_element-outline'; // if we use outline style it is border in css
} else {
$background_style .= ' vc_icon_element-background';
}
}
$style = '';
if ( 'custom' === $background_color ) {
if ( false !== strpos( $background_style, 'outline' ) ) {
$style = 'border-color:' . $custom_background_color;
} else {
$style = 'background-color:' . $custom_background_color;
}
}
$style = $style ? 'style="' . esc_attr( $style ) . '"' : '';
$output = '';
$output .= '<div class="vc_icon_element vc_icon_element-outer' . esc_attr( $css_class ) . ' vc_icon_element-align-' . esc_attr( $align );
if ( $has_style ) {
$output .= 'vc_icon_element-have-style';
}
$output .= '">';
$output .= '<div class="vc_icon_element-inner vc_icon_element-color-' . esc_attr( $color ) . ' ';
if ( $has_style ) {
$output .= 'vc_icon_element-have-style-inner';
}
$output .= ' vc_icon_element-size-' . esc_attr( $size ) . ' vc_icon_element-style-' . esc_attr( $background_style ) . ' vc_icon_element-background-color-' . esc_attr( $background_color ) . '" ' . $style . '><span class="vc_icon_element-icon ' . esc_attr( ${'icon_' . $type} ) . '" ' . ( 'custom' === $color ? 'style="color:' . esc_attr( $custom_color ) . ' !important"' : '' ) . '></span>';
if ( strlen( $link ) > 0 ) {
$output .= '<' . $link . '></a>';
}
$output .= '</div></div>';
return $output;
templates/params/vc_grid_item/shortcodes/vc_btn.php 0000644 00000000161 15121635561 0016624 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return '{{ vc_btn: ' . http_build_query( $atts ) . ' }}';
templates/params/vc_grid_item/shortcodes/vc_button2.php 0000644 00000004165 15121635561 0017446 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$wrapper_css_class = 'vc_button-2-wrapper';
/** @var WPBakeryShortCode_Vc_Button2 $this */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$class = 'vc_btn';
// parse link
$class .= ( '' !== $color ) ? ( ' vc_btn_' . $color . ' vc_btn-' . $color ) : '';
$class .= ( '' !== $size ) ? ( ' vc_btn_' . $size . ' vc_btn-' . $size ) : '';
$class .= ( '' !== $style ) ? ' vc_btn_' . $style : '';
$css = isset( $css ) ? $css : '';
$class_to_filter = $class;
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$link = 'class="' . esc_attr( $css_class ) . '"';
$target = '';
$rel = '';
if ( isset( $atts['link'] ) ) {
$css_class .= ' vc_gitem-link';
if ( 'custom' === $atts['link'] && ! empty( $atts['url'] ) ) {
$vc_link = vc_build_link( $atts['url'] );
if ( strlen( $vc_link['target'] ) ) {
$target = ' target="' . esc_attr( $vc_link['target'] ) . '"';
}
if ( strlen( $vc_link['rel'] ) ) {
$rel = ' rel="' . esc_attr( $vc_link['rel'] ) . '"';
}
$link = 'href="' . esc_url( $vc_link['url'] ) . '" class="' . esc_attr( $css_class ) . '"';
} elseif ( 'post_link' === $atts['link'] ) {
$link = 'href="{{ post_link_url }}" class="' . esc_attr( $css_class ) . '"';
} elseif ( 'image' === $atts['link'] ) {
$link = '{{ post_image_url_href }} class="' . esc_attr( $css_class ) . '"';
} elseif ( 'image_lightbox' === $atts['link'] ) {
$link = '{{ post_image_url_attr_prettyphoto:' . esc_attr( $css_class ) . ' }}';
}
}
$link = apply_filters( 'vc_gitem_post_data_get_link_link', 'a ' . $link, $atts, $css_class ) . apply_filters( 'vc_gitem_post_data_get_link_target', $target, $atts ) . apply_filters( 'vc_gitem_post_data_get_link_rel', $rel, $atts );
if ( $align ) {
$wrapper_css_class .= ' vc_button-2-align-' . $align;
}
$output = '<div class="' . esc_attr( $wrapper_css_class ) . '">';
$output .= '<' . $link . $target . $rel . '>' . $title . '</a>';
$output .= '</div>';
return $output;
templates/params/vc_grid_item/shortcodes/vc_single_image.php 0000644 00000004160 15121635561 0020467 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $alignment = $css_animation = $css = '';
/** @var WPBakeryShortCode_Vc_Single_image $this */
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
$default_src = vc_asset_url( 'vc/no_image.png' );
$style = ( '' !== $style ) ? $style : '';
$border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : '';
$img_id = preg_replace( '/[^\d]/', '', $image );
switch ( $source ) {
case 'media_library':
$img = wpb_getImageBySize( array(
'attach_id' => $img_id,
'thumb_size' => $img_size,
'class' => 'vc_single_image-img',
) );
break;
case 'external_link':
$dimensions = vc_extract_dimensions( $img_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
$custom_src = $custom_src ? esc_attr( $custom_src ) : $default_src;
$img = array(
'thumbnail' => '<img class="vc_single_image-img" ' . $hwstring . ' src="' . esc_url( $custom_src ) . '" />',
);
break;
default:
$img = false;
}
if ( ! $img ) {
$img['thumbnail'] = '<img class="vc_single_image-img" src="' . esc_url( $default_src ) . '" />';
}
$wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color;
$link = vc_gitem_create_link( $atts, $wrapperClass );
$image_string = ! empty( $link ) ? '<' . $link . '>' . $img['thumbnail'] . '</a>' : '<div class="' . $wrapperClass . '"> ' . $img['thumbnail'] . ' </div>';
$class_to_filter = 'wpb_single_image wpb_content_element vc_align_' . $alignment . ' ' . $this->getCSSAnimation( $css_animation );
$class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class );
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
$output = '
<div class="' . esc_attr( $css_class ) . '">
' . wpb_widget_title( array(
'title' => $title,
'extraclass' => 'wpb_singleimage_heading',
) ) . '
<figure class="wpb_wrapper vc_figure">
' . $image_string . '
</figure>
</div>
';
return $output;
templates/params/vc_grid_item/shortcodes/vc_custom_heading.php 0000644 00000003165 15121635561 0021041 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @var WPBakeryShortCode_Vc_Custom_heading $this
*/
extract( $this->getAttributes( $atts ) );
extract( $this->getStyles( $el_class, $css, $google_fonts_data, $font_container_data, $atts ) );
$settings = get_option( 'wpb_js_google_fonts_subsets' );
if ( is_array( $settings ) && ! empty( $settings ) ) {
$subsets = '&subset=' . implode( ',', $settings );
} else {
$subsets = '';
}
$link = vc_gitem_create_link( $atts );
if ( ! empty( $link ) ) {
$text = '<' . $link . '>' . $text . '</a>';
}
if ( ( ! isset( $atts['use_theme_fonts'] ) || 'yes' !== $atts['use_theme_fonts'] ) && ! empty( $google_fonts_data ) && isset( $google_fonts_data['values']['font_family'] ) ) {
wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $google_fonts_data['values']['font_family'] ), 'https://fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets, [], WPB_VC_VERSION );
}
if ( ! empty( $styles ) ) {
$style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"';
} else {
$style = '';
}
$output = '';
if ( apply_filters( 'vc_custom_heading_template_use_wrapper', false ) ) {
$output .= '<div class="' . esc_attr( $css_class ) . '" >';
$output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >';
$output .= $text;
$output .= '</' . $font_container_data['values']['tag'] . '>';
$output .= '</div>';
} else {
$output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' class="' . esc_attr( $css_class ) . '">';
$output .= $text;
$output .= '</' . $font_container_data['values']['tag'] . '>';
}
return $output;
templates/params/param_group/content.tpl.php 0000644 00000000342 15121635561 0015326 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$template = vc_include_template( 'params/param_group/inner_content.tpl.php' );
return '<li class="vc_param wpb_vc_row vc_param_group-collapsed">' . $template . '</li>';
templates/params/param_group/inner_content.tpl.php 0000644 00000002417 15121635561 0016526 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
return '
<div class="vc_controls vc_controls-row vc_clearfix vc_param_group-controls">
<a class="vc_control column_move vc_move-param" href="#" title="' . esc_attr__( 'Drag row to reorder', 'js_composer' ) . '" data-vc-control="move"><i class="vc-composer-icon vc-c-icon-dragndrop"></i></a>
<span class="vc_param-group-admin-labels"></span>
<span class="vc_row_edit_clone_delete">
<a class="vc_control column_delete vc_delete-param" href="#" title="' . esc_attr__( 'Delete this param', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-delete_empty"></i></a>
<a class="vc_control column_clone" href="#" title="' . esc_attr__( 'Clone this row', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-content_copy"></i></a>
<a class="vc_control column_toggle" href="#" title="' . esc_attr__( 'Toggle row', 'js_composer' ) . '"><i class="vc-composer-icon vc-c-icon-arrow_drop_down"></i></a>
</span>
</div>
<div class="wpb_element_wrapper">
<div class="vc_row vc_row-fluid wpb_row_container">
<div class="wpb_vc_column wpb_sortable vc_col-sm-12 wpb_content_holder vc_empty-column">
<div class="wpb_element_wrapper">
<div class="vc_fields vc_clearfix">
%content%
</div>
</div>
</div>
</div>
</div>';
templates/params/param_group/add.tpl.php 0000644 00000000431 15121635561 0014403 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$template = vc_include_template( 'params/param_group/inner_content.tpl.php' );
return '<li class="vc_param wpb_vc_row vc_param_group-collapsed vc_param_group-add_content-wrapper" style="display:none">' . $template . '</li>';
templates/params/loop/templates.html 0000644 00000015701 15121635561 0013673 0 ustar 00 <script type="text/html" id="vcl-loop-frame">
<div class="vc_row">
<div class="vc_col-sm-12">
<# if(vc.loop_field_not_hidden('post_type', loop)) { #>
<label class="wpb_element_label"><?php esc_html_e('Post types', 'js_composer') ?></label>
<div class="post-types-list">
{{{ vc.loop_partial('checkboxes', 'post_type', loop) }}}
</div>
<span class="description clear"><?php esc_html_e('Select post types to populate posts from. Note: If no post type is selected, WordPress will use default "Post" value.', 'js_composer'); ?></span>
<# } #>
</div>
</div>
<div class="vc_row">
<# if(vc.loop_field_not_hidden('size', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Post count', 'js_composer') ?></label>
{{{ vc.loop_partial('text-input', 'size', loop) }}}
<span class="description clear"><?php esc_html_e('How many teasers to show? Enter number or word "All".', 'js_composer'); ?></span>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('order_by', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Order by', 'js_composer') ?></label>
{{{ vc.loop_partial('dropdown', 'order_by', loop) }}}
<span class="description clear"><?php echo sprintf(__('Select how to sort retrieved posts. More at %s.', 'js_composer'), '<a href="https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters" target="_blank">
WordPress codex page</a>'); ?></span>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('order', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Sort order', 'js_composer') ?></label>
{{{ vc.loop_partial('dropdown', 'order', loop) }}}
<span class="description clear"><?php esc_html_e('Designates the ascending or descending order.', 'js_composer'); ?></span>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('ignore_sticky', loop)) { #>
<div class="vc_col-sm-4">
<label class="wpb_element_label"><?php esc_html_e('Ignore Sticky posts', 'js_composer') ?></label>
{{{ vc.loop_partial('checkboxes', 'ignore_sticky_posts', loop) }}}
</div>
<# } #>
</div>
<# if(vc.loop_field_not_hidden('categories', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Categories', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'categories', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by posts categories, enter category names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('tags', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Tags', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'tags', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by posts tags, enter tag names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('tax_query', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Taxonomies', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'tax_query', loop) }}}
<span class="description clear"><?php esc_html_e('Filter output by custom taxonomies categories, enter category names here.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('by_id', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Individual Posts/Pages/Custom Post Types', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'by_id', loop) }}}
<span class="description clear"><?php esc_html_e('Only entered posts/pages will be included in the output. Note: Works in conjunction with selected "Post types".', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
<# if(vc.loop_field_not_hidden('authors', loop)) { #>
<div class="vc_row">
<div class="vc_col-sm-12">
<div class="vc_suggest-field" data-block="suggestion">
<label class="wpb_element_label"><?php esc_html_e('Author', 'js_composer') ?></label>
{{{ vc.loop_partial('autosuggest', 'authors', loop) }}}
<span class="description clear"><?php esc_html_e('Filter by author name.', 'js_composer'); ?></span>
</div>
</div>
</div>
<# } #>
</script>
<script type="text/html" id="_vcl-text-input">
<#
var is_locked = vc.is_locked(data),
disabled = is_locked ? ' disabled="true"' : '',
value = _.isObject(data) && !_.isUndefined(data.value) ? data.value : '';
#>
<input type="text" name="{{ name }}" value="{{ value }}" class="vc_{{ name }}_field" {{ disabled }}>
</script>
<script type="text/html" id="_vcl-dropdown">
<#
var is_locked = vc.is_locked(data),
disabled = is_locked ? ' disabled="true"' : '';
#>
<select name="{{ name }}" class="vc_dropdown" {{ disabled }}>
<option value=""></option>
<# if(_.isObject(data) && _.isArray(data.options)) { #>
<#
_.each(data.options, function(opt) {
var value, label;
if(_.isArray(opt)) {
value = opt[0];
label = opt[1];
} else {
value = opt;
label = opt;
}#>
<option value="{{ value }}"
{{ data.value===value ?
' selected="true"' : '' }}>{{ label }}</option>
<#
});
#>
<# } #>
</select>
</script>
<script type="text/html" id="_vcl-checkboxes">
<#
var is_locked = vc.is_locked(data);
#>
<input type="hidden" name="{{ name }}" value="{{ data.value }}" data-name="{{ name }}">
<# if(_.isObject(data) && _.isArray(data.options)) {
_.each(data.options, function(opt) {
var value, label, params;
if(_.isArray(opt)) {
value = opt[0];
label = opt[1];
} else {
value = opt;
label = opt;
}
params = _.indexOf(data.value, value) >=0 ? ' checked="true"' : '';
if(!_.isEmpty(params) && is_locked) params += ' disabled="true"';
#>
<label><input type="checkbox" data-input="{{ name }}" value="{{ value }}" {{ params }}/> {{ label }}</label>
<#
});
} #>
</script>
<script type="text/html" id="_vcl-autosuggest">
<# limit_param = _.isObject(settings) && !_.isUndefined(settings.limit) ? ' data-limit="' + settings.limit + '"' : ''; #>
<input type="hidden" data-suggest-prefill="{{ name }}"
value="{{ _.isObject(data) && _.isArray(data.options) ? window.encodeURIComponent(JSON.stringify(data.options)) : '' }}">
<input type="hidden" name="{{ name }}"
value="{{ _.isObject(data) && _.isArray(data.value) ? data.value.join(',') : '' }}"
data-suggest-value="{{ name }}">
<input type="text" name="{{ name }}_autosuggest" value=""
placeholder="<?php esc_html_e('Click here and start typing...', 'js_composer'); ?>" class="vc_{{ name }}_field"
data-suggest="{{ name }}" {{ limit_param }}/>
</script>