PK1\oȵ1UU params/iconpicker/iconpicker.phpnuW+A 'iconpicker', * 'heading' => __( '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(); /** * @since 4.4 * * @param $settings - param field data array * @param $value - param field value */ 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'] = __( 'From all categories', 'js_composer' ); } if ( ! isset( $this->settings['settings'], $this->settings['settings']['unCategorizedText'] ) ) { // If categorized then use this option $this->settings['settings']['unCategorizedText'] = __( '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 * @since 4.4 * @return string - rendered param field for editor panel */ public function render() { $output = '
'; $output .= 'settings['settings'] ) && ! empty( $this->settings['settings'] ) ) ? ' data-settings="' . esc_attr( 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 * * @since 4.4 * @return string - rendered template for params in edit form * */ function vc_iconpicker_form_field( $settings, $value, $tag ) { $icon_picker = new Vc_IconPicker( $settings, $value, $tag ); 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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.6.3 */ $fontawesome_icons = array( 'New in 4.6' => array( array( 'fa fa-instagram' => 'Instagram' ), array( 'fa fa-gitlab' => 'GitLab' ), array( 'fa fa-wpbeginner' => 'WPBeginner' ), array( 'fa fa-wpforms' => 'WPForms' ), array( 'fa fa-envira' => 'Envira Gallery(leaf)' ), array( 'fa fa-universal-access' => 'Universal Access' ), array( 'fa fa-wheelchair-alt' => 'Wheelchair Alt' ), array( 'fa fa-question-circle-o' => 'Question Circle Outlined' ), array( 'fa fa-blind' => 'Blind' ), array( 'fa fa-audio-description' => 'Audio Description' ), array( 'fa fa-volume-control-phone' => 'Volume Control Phone' ), array( 'fa fa-braille' => 'Braille' ), array( 'fa fa-assistive-listening-systems' => 'Assistive Listening Systems' ), array( 'fa fa-american-sign-language-interpreting' => 'American Sign Language Interpreting(asl-interpreting)' ), array( 'fa fa-deaf' => 'Deaf(deafness, hard-of-hearing)' ), array( 'fa fa-glide' => 'Glide' ), array( 'fa fa-glide-g' => 'Glide G' ), array( 'fa fa-sign-language' => 'Sign Language(signing)' ), array( 'fa fa-low-vision' => 'Low Vision' ), array( 'fa fa-viadeo' => 'Viadeo' ), array( 'fa fa-viadeo-square' => 'Viadeo Square' ), array( 'fa fa-snapchat' => 'Snapchat' ), array( 'fa fa-snapchat-ghost' => 'Snapchat Ghost' ), array( 'fa fa-snapchat-square' => 'Snapchat Square' ), array( 'fa fa-pied-piper' => 'Pied Piper Logo' ), array( 'fa fa-first-order' => 'First Order' ), array( 'fa fa-yoast' => 'Yoast' ), array( 'fa fa-themeisle' => 'ThemeIsle' ), array( 'fa fa-google-plus-official' => 'Google Plus Official(google-plus-circle)' ), array( 'fa fa-font-awesome' => 'Font Awesome(fa)' ), ), 'Web Application Icons' => array( array( 'fa fa-glass' => 'Glass(martini, drink, bar, alcohol, liquor)' ), array( 'fa fa-music' => 'Music(note, sound)' ), array( 'fa fa-search' => 'Search(magnify, zoom, enlarge, bigger)' ), array( 'fa fa-envelope-o' => 'Envelope Outlined(email, support, e-mail, letter, mail, notification)' ), array( 'fa fa-heart' => 'Heart(love, like, favorite)' ), array( 'fa fa-star' => 'Star(award, achievement, night, rating, score, favorite)' ), array( 'fa fa-star-o' => 'Star Outlined(award, achievement, night, rating, score, favorite)' ), array( 'fa fa-user' => 'User(person, man, head, profile)' ), array( 'fa fa-film' => 'Film(movie)' ), array( 'fa fa-check' => 'Check(checkmark, done, todo, agree, accept, confirm, tick, ok)' ), array( 'fa fa-times' => 'Times(close, exit, x, cross)(remove, close)' ), array( 'fa fa-search-plus' => 'Search Plus(magnify, zoom, enlarge, bigger)' ), array( 'fa fa-search-minus' => 'Search Minus(magnify, minify, zoom, smaller)' ), array( 'fa fa-power-off' => 'Power Off(on)' ), array( 'fa fa-signal' => 'signal(graph, bars)' ), array( 'fa fa-cog' => 'cog(settings)(gear)' ), array( 'fa fa-trash-o' => 'Trash Outlined(garbage, delete, remove, trash, hide)' ), array( 'fa fa-home' => 'home(main, house)' ), array( 'fa fa-clock-o' => 'Clock Outlined(watch, timer, late, timestamp)' ), array( 'fa fa-road' => 'road(street)' ), array( 'fa fa-download' => 'Download(import)' ), array( 'fa fa-inbox' => 'inbox' ), array( 'fa fa-refresh' => 'refresh(reload, sync)' ), array( 'fa fa-lock' => 'lock(protect, admin)' ), array( 'fa fa-flag' => 'flag(report, notification, notify)' ), array( 'fa fa-headphones' => 'headphones(sound, listen, music, audio)' ), array( 'fa fa-volume-off' => 'volume-off(audio, mute, sound, music)' ), array( 'fa fa-volume-down' => 'volume-down(audio, lower, quieter, sound, music)' ), array( 'fa fa-volume-up' => 'volume-up(audio, higher, louder, sound, music)' ), array( 'fa fa-qrcode' => 'qrcode(scan)' ), array( 'fa fa-barcode' => 'barcode(scan)' ), array( 'fa fa-tag' => 'tag(label)' ), array( 'fa fa-tags' => 'tags(labels)' ), array( 'fa fa-book' => 'book(read, documentation)' ), array( 'fa fa-bookmark' => 'bookmark(save)' ), array( 'fa fa-print' => 'print' ), array( 'fa fa-camera' => 'camera(photo, picture, record)' ), array( 'fa fa-video-camera' => 'Video Camera(film, movie, record)' ), array( 'fa fa-picture-o' => 'Picture Outlined(photo, image)' ), array( 'fa fa-pencil' => 'pencil(write, edit, update)' ), array( 'fa fa-map-marker' => 'map-marker(map, pin, location, coordinates, localize, address, travel, where, place)' ), array( 'fa fa-adjust' => 'adjust(contrast)' ), array( 'fa fa-tint' => 'tint(raindrop, waterdrop, drop, droplet)' ), array( 'fa fa-pencil-square-o' => 'Pencil Square Outlined(write, edit, update)(edit)' ), array( 'fa fa-share-square-o' => 'Share Square Outlined(social, send, arrow)' ), array( 'fa fa-check-square-o' => 'Check Square Outlined(todo, done, agree, accept, confirm, ok)' ), array( 'fa fa-arrows' => 'Arrows(move, reorder, resize)' ), array( 'fa fa-plus-circle' => 'Plus Circle(add, new, create, expand)' ), array( 'fa fa-minus-circle' => 'Minus Circle(delete, remove, trash, hide)' ), array( 'fa fa-times-circle' => 'Times Circle(close, exit, x)' ), array( 'fa fa-check-circle' => 'Check Circle(todo, done, agree, accept, confirm, ok)' ), array( 'fa fa-question-circle' => 'Question Circle(help, information, unknown, support)' ), array( 'fa fa-info-circle' => 'Info Circle(help, information, more, details)' ), array( 'fa fa-crosshairs' => 'Crosshairs(picker)' ), array( 'fa fa-times-circle-o' => 'Times Circle Outlined(close, exit, x)' ), array( 'fa fa-check-circle-o' => 'Check Circle Outlined(todo, done, agree, accept, confirm, ok)' ), array( 'fa fa-ban' => 'ban(delete, remove, trash, hide, block, stop, abort, cancel)' ), array( 'fa fa-share' => 'Share(mail-forward)' ), array( 'fa fa-plus' => 'plus(add, new, create, expand)' ), array( 'fa fa-minus' => 'minus(hide, minify, delete, remove, trash, hide, collapse)' ), array( 'fa fa-asterisk' => 'asterisk(details)' ), array( 'fa fa-exclamation-circle' => 'Exclamation Circle(warning, error, problem, notification, alert)' ), array( 'fa fa-gift' => 'gift(present)' ), array( 'fa fa-leaf' => 'leaf(eco, nature, plant)' ), array( 'fa fa-fire' => 'fire(flame, hot, popular)' ), array( 'fa fa-eye' => 'Eye(show, visible, views)' ), array( 'fa fa-eye-slash' => 'Eye Slash(toggle, show, hide, visible, visiblity, views)' ), array( 'fa fa-exclamation-triangle' => 'Exclamation Triangle(warning, error, problem, notification, alert)(warning)' ), array( 'fa fa-plane' => 'plane(travel, trip, location, destination, airplane, fly, mode)' ), array( 'fa fa-calendar' => 'calendar(date, time, when, event)' ), array( 'fa fa-random' => 'random(sort, shuffle)' ), array( 'fa fa-comment' => 'comment(speech, notification, note, chat, bubble, feedback, message, texting, sms)' ), array( 'fa fa-magnet' => 'magnet' ), array( 'fa fa-retweet' => 'retweet(refresh, reload, share)' ), array( 'fa fa-shopping-cart' => 'shopping-cart(checkout, buy, purchase, payment)' ), array( 'fa fa-folder' => 'Folder' ), array( 'fa fa-folder-open' => 'Folder Open' ), array( 'fa fa-arrows-v' => 'Arrows Vertical(resize)' ), array( 'fa fa-arrows-h' => 'Arrows Horizontal(resize)' ), array( 'fa fa-bar-chart' => 'Bar Chart(graph, analytics)(bar-chart-o)' ), array( 'fa fa-camera-retro' => 'camera-retro(photo, picture, record)' ), array( 'fa fa-key' => 'key(unlock, password)' ), array( 'fa fa-cogs' => 'cogs(settings)(gears)' ), array( 'fa fa-comments' => 'comments(conversation, notification, notes, message, texting, sms, chat)' ), array( 'fa fa-thumbs-o-up' => 'Thumbs Up Outlined(like, approve, favorite, agree, hand)' ), array( 'fa fa-thumbs-o-down' => 'Thumbs Down Outlined(dislike, disapprove, disagree, hand)' ), array( 'fa fa-star-half' => 'star-half(award, achievement, rating, score)' ), array( 'fa fa-heart-o' => 'Heart Outlined(love, like, favorite)' ), array( 'fa fa-sign-out' => 'Sign Out(log out, logout, leave, exit, arrow)' ), array( 'fa fa-thumb-tack' => 'Thumb Tack(marker, pin, location, coordinates)' ), array( 'fa fa-external-link' => 'External Link(open, new)' ), array( 'fa fa-sign-in' => 'Sign In(enter, join, log in, login, sign up, sign in, signin, signup, arrow)' ), array( 'fa fa-trophy' => 'trophy(award, achievement, winner, game)' ), array( 'fa fa-upload' => 'Upload(import)' ), array( 'fa fa-lemon-o' => 'Lemon Outlined(food)' ), array( 'fa fa-phone' => 'Phone(call, voice, number, support, earphone)' ), array( 'fa fa-square-o' => 'Square Outlined(block, square, box)' ), array( 'fa fa-bookmark-o' => 'Bookmark Outlined(save)' ), array( 'fa fa-phone-square' => 'Phone Square(call, voice, number, support)' ), array( 'fa fa-unlock' => 'unlock(protect, admin, password, lock)' ), array( 'fa fa-credit-card' => 'credit-card(money, buy, debit, checkout, purchase, payment)' ), array( 'fa fa-rss' => 'rss(blog)(feed)' ), array( 'fa fa-hdd-o' => 'HDD(harddrive, hard drive, storage, save)' ), array( 'fa fa-bullhorn' => 'bullhorn(announcement, share, broadcast, louder)' ), array( 'fa fa-bell' => 'bell(alert, reminder, notification)' ), array( 'fa fa-certificate' => 'certificate(badge, star)' ), array( 'fa fa-globe' => 'Globe(world, planet, map, place, travel, earth, global, translate, all, language, localize, location, coordinates, country)' ), array( 'fa fa-wrench' => 'Wrench(settings, fix, update)' ), array( 'fa fa-tasks' => 'Tasks(progress, loading, downloading, downloads, settings)' ), array( 'fa fa-filter' => 'Filter(funnel, options)' ), array( 'fa fa-briefcase' => 'Briefcase(work, business, office, luggage, bag)' ), array( 'fa fa-users' => 'Users(people, profiles, persons)(group)' ), array( 'fa fa-cloud' => 'Cloud(save)' ), array( 'fa fa-flask' => 'Flask(science, beaker, experimental, labs)' ), array( 'fa fa-square' => 'Square(block, box)' ), array( 'fa fa-bars' => 'Bars(menu, drag, reorder, settings, list, ul, ol, checklist, todo, list, hamburger)(navicon, reorder)' ), array( 'fa fa-magic' => 'magic(wizard, automatic, autocomplete)' ), array( 'fa fa-truck' => 'truck(shipping)' ), array( 'fa fa-money' => 'Money(cash, money, buy, checkout, purchase, payment)' ), array( 'fa fa-sort' => 'Sort(order)(unsorted)' ), array( 'fa fa-sort-desc' => 'Sort Descending(dropdown, more, menu, arrow)(sort-down)' ), array( 'fa fa-sort-asc' => 'Sort Ascending(arrow)(sort-up)' ), array( 'fa fa-envelope' => 'Envelope(email, e-mail, letter, support, mail, notification)' ), array( 'fa fa-gavel' => 'Gavel(legal)' ), array( 'fa fa-tachometer' => 'Tachometer(dashboard)' ), array( 'fa fa-comment-o' => 'comment-o(speech, notification, note, chat, bubble, feedback, message, texting, sms)' ), array( 'fa fa-comments-o' => 'comments-o(conversation, notification, notes, message, texting, sms, chat)' ), array( 'fa fa-bolt' => 'Lightning Bolt(lightning, weather)(flash)' ), array( 'fa fa-sitemap' => 'Sitemap(directory, hierarchy, organization)' ), array( 'fa fa-umbrella' => 'Umbrella' ), array( 'fa fa-lightbulb-o' => 'Lightbulb Outlined(idea, inspiration)' ), array( 'fa fa-exchange' => 'Exchange(transfer, arrows, arrow)' ), array( 'fa fa-cloud-download' => 'Cloud Download(import)' ), array( 'fa fa-cloud-upload' => 'Cloud Upload(import)' ), array( 'fa fa-suitcase' => 'Suitcase(trip, luggage, travel, move, baggage)' ), array( 'fa fa-bell-o' => 'Bell Outlined(alert, reminder, notification)' ), array( 'fa fa-coffee' => 'Coffee(morning, mug, breakfast, tea, drink, cafe)' ), array( 'fa fa-cutlery' => 'Cutlery(food, restaurant, spoon, knife, dinner, eat)' ), array( 'fa fa-building-o' => 'Building Outlined(work, business, apartment, office, company)' ), array( 'fa fa-fighter-jet' => 'fighter-jet(fly, plane, airplane, quick, fast, travel)' ), array( 'fa fa-beer' => 'beer(alcohol, stein, drink, mug, bar, liquor)' ), array( 'fa fa-plus-square' => 'Plus Square(add, new, create, expand)' ), array( 'fa fa-desktop' => 'Desktop(monitor, screen, desktop, computer, demo, device)' ), array( 'fa fa-laptop' => 'Laptop(demo, computer, device)' ), array( 'fa fa-tablet' => 'tablet(ipad, device)' ), array( 'fa fa-mobile' => 'Mobile Phone(cell phone, cellphone, text, call, iphone, number)(mobile-phone)' ), array( 'fa fa-circle-o' => 'Circle Outlined' ), array( 'fa fa-quote-left' => 'quote-left' ), array( 'fa fa-quote-right' => 'quote-right' ), array( 'fa fa-spinner' => 'Spinner(loading, progress)' ), array( 'fa fa-circle' => 'Circle(dot, notification)' ), array( 'fa fa-reply' => 'Reply(mail-reply)' ), array( 'fa fa-folder-o' => 'Folder Outlined' ), array( 'fa fa-folder-open-o' => 'Folder Open Outlined' ), array( 'fa fa-smile-o' => 'Smile Outlined(face, emoticon, happy, approve, satisfied, rating)' ), array( 'fa fa-frown-o' => 'Frown Outlined(face, emoticon, sad, disapprove, rating)' ), array( 'fa fa-meh-o' => 'Meh Outlined(face, emoticon, rating, neutral)' ), array( 'fa fa-gamepad' => 'Gamepad(controller)' ), array( 'fa fa-keyboard-o' => 'Keyboard Outlined(type, input)' ), array( 'fa fa-flag-o' => 'Flag Outlined(report, notification)' ), array( 'fa fa-flag-checkered' => 'flag-checkered(report, notification, notify)' ), array( 'fa fa-terminal' => 'Terminal(command, prompt, code)' ), array( 'fa fa-code' => 'Code(html, brackets)' ), array( 'fa fa-reply-all' => 'reply-all(mail-reply-all)' ), array( 'fa fa-star-half-o' => 'Star Half Outlined(award, achievement, rating, score)(star-half-empty, star-half-full)' ), array( 'fa fa-location-arrow' => 'location-arrow(map, coordinates, location, address, place, where)' ), array( 'fa fa-crop' => 'crop' ), array( 'fa fa-code-fork' => 'code-fork(git, fork, vcs, svn, github, rebase, version, merge)' ), array( 'fa fa-question' => 'Question(help, information, unknown, support)' ), array( 'fa fa-info' => 'Info(help, information, more, details)' ), array( 'fa fa-exclamation' => 'exclamation(warning, error, problem, notification, notify, alert)' ), array( 'fa fa-eraser' => 'eraser(remove, delete)' ), array( 'fa fa-puzzle-piece' => 'Puzzle Piece(addon, add-on, section)' ), array( 'fa fa-microphone' => 'microphone(record, voice, sound)' ), array( 'fa fa-microphone-slash' => 'Microphone Slash(record, voice, sound, mute)' ), array( 'fa fa-shield' => 'shield(award, achievement, winner)' ), array( 'fa fa-calendar-o' => 'calendar-o(date, time, when, event)' ), array( 'fa fa-fire-extinguisher' => 'fire-extinguisher' ), array( 'fa fa-rocket' => 'rocket(app)' ), array( 'fa fa-anchor' => 'Anchor(link)' ), array( 'fa fa-unlock-alt' => 'Unlock Alt(protect, admin, password, lock)' ), array( 'fa fa-bullseye' => 'Bullseye(target)' ), array( 'fa fa-ellipsis-h' => 'Ellipsis Horizontal(dots)' ), array( 'fa fa-ellipsis-v' => 'Ellipsis Vertical(dots)' ), array( 'fa fa-rss-square' => 'RSS Square(feed, blog)' ), array( 'fa fa-ticket' => 'Ticket(movie, pass, support)' ), array( 'fa fa-minus-square' => 'Minus Square(hide, minify, delete, remove, trash, hide, collapse)' ), array( 'fa fa-minus-square-o' => 'Minus Square Outlined(hide, minify, delete, remove, trash, hide, collapse)' ), array( 'fa fa-level-up' => 'Level Up(arrow)' ), array( 'fa fa-level-down' => 'Level Down(arrow)' ), array( 'fa fa-check-square' => 'Check Square(checkmark, done, todo, agree, accept, confirm, ok)' ), array( 'fa fa-pencil-square' => 'Pencil Square(write, edit, update)' ), array( 'fa fa-external-link-square' => 'External Link Square(open, new)' ), array( 'fa fa-share-square' => 'Share Square(social, send)' ), array( 'fa fa-compass' => 'Compass(safari, directory, menu, location)' ), array( 'fa fa-caret-square-o-down' => 'Caret Square Outlined Down(more, dropdown, menu)(toggle-down)' ), array( 'fa fa-caret-square-o-up' => 'Caret Square Outlined Up(toggle-up)' ), array( 'fa fa-caret-square-o-right' => 'Caret Square Outlined Right(next, forward)(toggle-right)' ), array( 'fa fa-sort-alpha-asc' => 'Sort Alpha Ascending' ), array( 'fa fa-sort-alpha-desc' => 'Sort Alpha Descending' ), array( 'fa fa-sort-amount-asc' => 'Sort Amount Ascending' ), array( 'fa fa-sort-amount-desc' => 'Sort Amount Descending' ), array( 'fa fa-sort-numeric-asc' => 'Sort Numeric Ascending(numbers)' ), array( 'fa fa-sort-numeric-desc' => 'Sort Numeric Descending(numbers)' ), array( 'fa fa-thumbs-up' => 'thumbs-up(like, favorite, approve, agree, hand)' ), array( 'fa fa-thumbs-down' => 'thumbs-down(dislike, disapprove, disagree, hand)' ), array( 'fa fa-female' => 'Female(woman, user, person, profile)' ), array( 'fa fa-male' => 'Male(man, user, person, profile)' ), array( 'fa fa-sun-o' => 'Sun Outlined(weather, contrast, lighter, brighten, day)' ), array( 'fa fa-moon-o' => 'Moon Outlined(night, darker, contrast)' ), array( 'fa fa-archive' => 'Archive(box, storage)' ), array( 'fa fa-bug' => 'Bug(report, insect)' ), array( 'fa fa-caret-square-o-left' => 'Caret Square Outlined Left(previous, back)(toggle-left)' ), array( 'fa fa-dot-circle-o' => 'Dot Circle Outlined(target, bullseye, notification)' ), array( 'fa fa-wheelchair' => 'Wheelchair(handicap, person, accessibility, accessibile)' ), array( 'fa fa-plus-square-o' => 'Plus Square Outlined(add, new, create, expand)' ), array( 'fa fa-space-shuttle' => 'Space Shuttle' ), array( 'fa fa-envelope-square' => 'Envelope Square' ), array( 'fa fa-university' => 'University(institution, bank)' ), array( 'fa fa-graduation-cap' => 'Graduation Cap(learning, school, student)(mortar-board)' ), array( 'fa fa-language' => 'Language' ), array( 'fa fa-fax' => 'Fax' ), array( 'fa fa-building' => 'Building(work, business, apartment, office, company)' ), array( 'fa fa-child' => 'Child' ), array( 'fa fa-paw' => 'Paw(pet)' ), array( 'fa fa-spoon' => 'spoon' ), array( 'fa fa-cube' => 'Cube' ), array( 'fa fa-cubes' => 'Cubes' ), array( 'fa fa-recycle' => 'Recycle' ), array( 'fa fa-car' => 'Car(vehicle)(automobile)' ), array( 'fa fa-taxi' => 'Taxi(vehicle)(cab)' ), array( 'fa fa-tree' => 'Tree' ), array( 'fa fa-database' => 'Database' ), array( 'fa fa-file-pdf-o' => 'PDF File Outlined' ), array( 'fa fa-file-word-o' => 'Word File Outlined' ), array( 'fa fa-file-excel-o' => 'Excel File Outlined' ), array( 'fa fa-file-powerpoint-o' => 'Powerpoint File Outlined' ), array( 'fa fa-file-image-o' => 'Image File Outlined(file-photo-o, file-picture-o)' ), array( 'fa fa-file-archive-o' => 'Archive File Outlined(file-zip-o)' ), array( 'fa fa-file-audio-o' => 'Audio File Outlined(file-sound-o)' ), array( 'fa fa-file-video-o' => 'Video File Outlined(file-movie-o)' ), array( 'fa fa-file-code-o' => 'Code File Outlined' ), array( 'fa fa-life-ring' => 'Life Ring(life-bouy, life-buoy, life-saver, support)' ), array( 'fa fa-circle-o-notch' => 'Circle Outlined Notched' ), array( 'fa fa-paper-plane' => 'Paper Plane(send)' ), array( 'fa fa-paper-plane-o' => 'Paper Plane Outlined(send-o)' ), array( 'fa fa-history' => 'History' ), array( 'fa fa-circle-thin' => 'Circle Outlined Thin' ), array( 'fa fa-sliders' => 'Sliders(settings)' ), array( 'fa fa-share-alt' => 'Share Alt' ), array( 'fa fa-share-alt-square' => 'Share Alt Square' ), array( 'fa fa-bomb' => 'Bomb' ), array( 'fa fa-futbol-o' => 'Futbol Outlined(soccer-ball-o)' ), array( 'fa fa-tty' => 'TTY' ), array( 'fa fa-binoculars' => 'Binoculars' ), array( 'fa fa-plug' => 'Plug(power, connect)' ), array( 'fa fa-newspaper-o' => 'Newspaper Outlined(press)' ), array( 'fa fa-wifi' => 'WiFi' ), array( 'fa fa-calculator' => 'Calculator' ), array( 'fa fa-bell-slash' => 'Bell Slash' ), array( 'fa fa-bell-slash-o' => 'Bell Slash Outlined' ), array( 'fa fa-trash' => 'Trash(garbage, delete, remove, hide)' ), array( 'fa fa-copyright' => 'Copyright' ), array( 'fa fa-at' => 'At' ), array( 'fa fa-eyedropper' => 'Eyedropper' ), array( 'fa fa-paint-brush' => 'Paint Brush' ), array( 'fa fa-birthday-cake' => 'Birthday Cake' ), array( 'fa fa-area-chart' => 'Area Chart(graph, analytics)' ), array( 'fa fa-pie-chart' => 'Pie Chart(graph, analytics)' ), array( 'fa fa-line-chart' => 'Line Chart(graph, analytics)' ), array( 'fa fa-toggle-off' => 'Toggle Off' ), array( 'fa fa-toggle-on' => 'Toggle On' ), array( 'fa fa-bicycle' => 'Bicycle(vehicle, bike)' ), array( 'fa fa-bus' => 'Bus(vehicle)' ), array( 'fa fa-cc' => 'Closed Captions' ), array( 'fa fa-cart-plus' => 'Add to Shopping Cart(add, shopping)' ), array( 'fa fa-cart-arrow-down' => 'Shopping Cart Arrow Down(shopping)' ), array( 'fa fa-diamond' => 'Diamond(gem, gemstone)' ), array( 'fa fa-ship' => 'Ship(boat, sea)' ), array( 'fa fa-user-secret' => 'User Secret(whisper, spy, incognito, privacy)' ), array( 'fa fa-motorcycle' => 'Motorcycle(vehicle, bike)' ), array( 'fa fa-street-view' => 'Street View(map)' ), array( 'fa fa-heartbeat' => 'Heartbeat(ekg)' ), array( 'fa fa-server' => 'Server' ), array( 'fa fa-user-plus' => 'Add User(sign up, signup)' ), array( 'fa fa-user-times' => 'Remove User' ), array( 'fa fa-bed' => 'Bed(travel)(hotel)' ), array( 'fa fa-battery-full' => 'Battery Full(power)(battery-4)' ), array( 'fa fa-battery-three-quarters' => 'Battery 3/4 Full(power)(battery-3)' ), array( 'fa fa-battery-half' => 'Battery 1/2 Full(power)(battery-2)' ), array( 'fa fa-battery-quarter' => 'Battery 1/4 Full(power)(battery-1)' ), array( 'fa fa-battery-empty' => 'Battery Empty(power)(battery-0)' ), array( 'fa fa-mouse-pointer' => 'Mouse Pointer' ), array( 'fa fa-i-cursor' => 'I Beam Cursor' ), array( 'fa fa-object-group' => 'Object Group' ), array( 'fa fa-object-ungroup' => 'Object Ungroup' ), array( 'fa fa-sticky-note' => 'Sticky Note' ), array( 'fa fa-sticky-note-o' => 'Sticky Note Outlined' ), array( 'fa fa-clone' => 'Clone(copy)' ), array( 'fa fa-balance-scale' => 'Balance Scale' ), array( 'fa fa-hourglass-o' => 'Hourglass Outlined' ), array( 'fa fa-hourglass-start' => 'Hourglass Start(hourglass-1)' ), array( 'fa fa-hourglass-half' => 'Hourglass Half(hourglass-2)' ), array( 'fa fa-hourglass-end' => 'Hourglass End(hourglass-3)' ), array( 'fa fa-hourglass' => 'Hourglass' ), array( 'fa fa-hand-rock-o' => 'Rock (Hand)(hand-grab-o)' ), array( 'fa fa-hand-paper-o' => 'Paper (Hand)(stop)(hand-stop-o)' ), array( 'fa fa-hand-scissors-o' => 'Scissors (Hand)' ), array( 'fa fa-hand-lizard-o' => 'Lizard (Hand)' ), array( 'fa fa-hand-spock-o' => 'Spock (Hand)' ), array( 'fa fa-hand-pointer-o' => 'Hand Pointer' ), array( 'fa fa-hand-peace-o' => 'Hand Peace' ), array( 'fa fa-trademark' => 'Trademark' ), array( 'fa fa-registered' => 'Registered Trademark' ), array( 'fa fa-creative-commons' => 'Creative Commons' ), array( 'fa fa-television' => 'Television(display, computer, monitor)(tv)' ), array( 'fa fa-calendar-plus-o' => 'Calendar Plus Outlined' ), array( 'fa fa-calendar-minus-o' => 'Calendar Minus Outlined' ), array( 'fa fa-calendar-times-o' => 'Calendar Times Outlined' ), array( 'fa fa-calendar-check-o' => 'Calendar Check Outlined(ok)' ), array( 'fa fa-industry' => 'Industry(factory)' ), array( 'fa fa-map-pin' => 'Map Pin' ), array( 'fa fa-map-signs' => 'Map Signs' ), array( 'fa fa-map-o' => 'Map Outline' ), array( 'fa fa-map' => 'Map' ), array( 'fa fa-commenting' => 'Commenting(message)' ), array( 'fa fa-commenting-o' => 'Commenting Outlined(message)' ), array( 'fa fa-credit-card-alt' => 'Credit Card(money, buy, debit, checkout, purchase, payment, credit card)' ), array( 'fa fa-shopping-bag' => 'Shopping Bag' ), array( 'fa fa-shopping-basket' => 'Shopping Basket' ), array( 'fa fa-hashtag' => 'Hashtag' ), array( 'fa fa-bluetooth' => 'Bluetooth' ), array( 'fa fa-bluetooth-b' => 'Bluetooth' ), array( 'fa fa-percent' => 'Percent' ), array( 'fa fa-universal-access' => 'Universal Access' ), array( 'fa fa-wheelchair-alt' => 'Wheelchair Alt' ), array( 'fa fa-question-circle-o' => 'Question Circle Outlined' ), array( 'fa fa-blind' => 'Blind' ), array( 'fa fa-audio-description' => 'Audio Description' ), array( 'fa fa-volume-control-phone' => 'Volume Control Phone' ), array( 'fa fa-braille' => 'Braille' ), array( 'fa fa-assistive-listening-systems' => 'Assistive Listening Systems' ), array( 'fa fa-american-sign-language-interpreting' => 'American Sign Language Interpreting(asl-interpreting)' ), array( 'fa fa-deaf' => 'Deaf(deafness, hard-of-hearing)' ), array( 'fa fa-sign-language' => 'Sign Language(signing)' ), array( 'fa fa-low-vision' => 'Low Vision' ), ), 'Medical Icons' => array( array( 'fa fa-heart' => 'Heart(love, like, favorite)' ), array( 'fa fa-heart-o' => 'Heart Outlined(love, like, favorite)' ), array( 'fa fa-user-md' => 'user-md(doctor, profile, medical, nurse)' ), array( 'fa fa-stethoscope' => 'Stethoscope' ), array( 'fa fa-hospital-o' => 'hospital Outlined(building)' ), array( 'fa fa-ambulance' => 'ambulance(vehicle, support, help)' ), array( 'fa fa-medkit' => 'medkit(first aid, firstaid, help, support, health)' ), array( 'fa fa-h-square' => 'H Square(hospital, hotel)' ), array( 'fa fa-plus-square' => 'Plus Square(add, new, create, expand)' ), array( 'fa fa-wheelchair' => 'Wheelchair(handicap, person, accessibility, accessibile)' ), array( 'fa fa-heartbeat' => 'Heartbeat(ekg)' ), ), 'Text Editor Icons' => array( array( 'fa fa-th-large' => 'th-large(blocks, squares, boxes, grid)' ), array( 'fa fa-th' => 'th(blocks, squares, boxes, grid)' ), array( 'fa fa-th-list' => 'th-list(ul, ol, checklist, finished, completed, done, todo)' ), array( 'fa fa-file-o' => 'File Outlined(new, page, pdf, document)' ), array( 'fa fa-repeat' => 'Repeat(redo, forward)(rotate-right)' ), array( 'fa fa-list-alt' => 'list-alt(ul, ol, checklist, finished, completed, done, todo)' ), array( 'fa fa-font' => 'font(text)' ), array( 'fa fa-bold' => 'bold' ), array( 'fa fa-italic' => 'italic(italics)' ), array( 'fa fa-text-height' => 'text-height' ), array( 'fa fa-text-width' => 'text-width' ), array( 'fa fa-align-left' => 'align-left(text)' ), array( 'fa fa-align-center' => 'align-center(middle, text)' ), array( 'fa fa-align-right' => 'align-right(text)' ), array( 'fa fa-align-justify' => 'align-justify(text)' ), array( 'fa fa-list' => 'list(ul, ol, checklist, finished, completed, done, todo)' ), array( 'fa fa-outdent' => 'Outdent(dedent)' ), array( 'fa fa-indent' => 'Indent' ), array( 'fa fa-link' => 'Link(chain)(chain)' ), array( 'fa fa-scissors' => 'Scissors(cut)' ), array( 'fa fa-files-o' => 'Files Outlined(duplicate, clone, copy)(copy)' ), array( 'fa fa-paperclip' => 'Paperclip(attachment)' ), array( 'fa fa-floppy-o' => 'Floppy Outlined(save)' ), array( 'fa fa-list-ul' => 'list-ul(ul, ol, checklist, todo, list)' ), array( 'fa fa-list-ol' => 'list-ol(ul, ol, checklist, list, todo, list, numbers)' ), array( 'fa fa-strikethrough' => 'Strikethrough' ), array( 'fa fa-underline' => 'Underline' ), array( 'fa fa-table' => 'table(data, excel, spreadsheet)' ), array( 'fa fa-columns' => 'Columns(split, panes)' ), array( 'fa fa-undo' => 'Undo(back)(rotate-left)' ), array( 'fa fa-clipboard' => 'Clipboard(copy)(paste)' ), array( 'fa fa-file-text-o' => 'File Text Outlined(new, page, pdf, document)' ), array( 'fa fa-chain-broken' => 'Chain Broken(remove)(unlink)' ), array( 'fa fa-superscript' => 'superscript(exponential)' ), array( 'fa fa-subscript' => 'subscript' ), array( 'fa fa-eraser' => 'eraser(remove, delete)' ), array( 'fa fa-file' => 'File(new, page, pdf, document)' ), array( 'fa fa-file-text' => 'File Text(new, page, pdf, document)' ), array( 'fa fa-header' => 'header(heading)' ), array( 'fa fa-paragraph' => 'paragraph' ), ), 'Spinner Icons' => array( array( 'fa fa-cog' => 'cog(settings)(gear)' ), array( 'fa fa-refresh' => 'refresh(reload, sync)' ), array( 'fa fa-spinner' => 'Spinner(loading, progress)' ), array( 'fa fa-circle-o-notch' => 'Circle Outlined Notched' ), ), 'File Type Icons' => array( array( 'fa fa-file-o' => 'File Outlined(new, page, pdf, document)' ), array( 'fa fa-file-text-o' => 'File Text Outlined(new, page, pdf, document)' ), array( 'fa fa-file' => 'File(new, page, pdf, document)' ), array( 'fa fa-file-text' => 'File Text(new, page, pdf, document)' ), array( 'fa fa-file-pdf-o' => 'PDF File Outlined' ), array( 'fa fa-file-word-o' => 'Word File Outlined' ), array( 'fa fa-file-excel-o' => 'Excel File Outlined' ), array( 'fa fa-file-powerpoint-o' => 'Powerpoint File Outlined' ), array( 'fa fa-file-image-o' => 'Image File Outlined(file-photo-o, file-picture-o)' ), array( 'fa fa-file-archive-o' => 'Archive File Outlined(file-zip-o)' ), array( 'fa fa-file-audio-o' => 'Audio File Outlined(file-sound-o)' ), array( 'fa fa-file-video-o' => 'Video File Outlined(file-movie-o)' ), array( 'fa fa-file-code-o' => 'Code File Outlined' ), ), 'Directional Icons' => array( array( 'fa fa-arrow-circle-o-down' => 'Arrow Circle Outlined Down(download)' ), array( 'fa fa-arrow-circle-o-up' => 'Arrow Circle Outlined Up' ), array( 'fa fa-arrows' => 'Arrows(move, reorder, resize)' ), array( 'fa fa-chevron-left' => 'chevron-left(bracket, previous, back)' ), array( 'fa fa-chevron-right' => 'chevron-right(bracket, next, forward)' ), array( 'fa fa-arrow-left' => 'arrow-left(previous, back)' ), array( 'fa fa-arrow-right' => 'arrow-right(next, forward)' ), array( 'fa fa-arrow-up' => 'arrow-up' ), array( 'fa fa-arrow-down' => 'arrow-down(download)' ), array( 'fa fa-chevron-up' => 'chevron-up' ), array( 'fa fa-chevron-down' => 'chevron-down' ), array( 'fa fa-arrows-v' => 'Arrows Vertical(resize)' ), array( 'fa fa-arrows-h' => 'Arrows Horizontal(resize)' ), array( 'fa fa-hand-o-right' => 'Hand Outlined Right(point, right, next, forward, finger)' ), array( 'fa fa-hand-o-left' => 'Hand Outlined Left(point, left, previous, back, finger)' ), array( 'fa fa-hand-o-up' => 'Hand Outlined Up(point, finger)' ), array( 'fa fa-hand-o-down' => 'Hand Outlined Down(point, finger)' ), array( 'fa fa-arrow-circle-left' => 'Arrow Circle Left(previous, back)' ), array( 'fa fa-arrow-circle-right' => 'Arrow Circle Right(next, forward)' ), array( 'fa fa-arrow-circle-up' => 'Arrow Circle Up' ), array( 'fa fa-arrow-circle-down' => 'Arrow Circle Down(download)' ), array( 'fa fa-arrows-alt' => 'Arrows Alt(expand, enlarge, fullscreen, bigger, move, reorder, resize, arrow)' ), array( 'fa fa-caret-down' => 'Caret Down(more, dropdown, menu, triangle down, arrow)' ), array( 'fa fa-caret-up' => 'Caret Up(triangle up, arrow)' ), array( 'fa fa-caret-left' => 'Caret Left(previous, back, triangle left, arrow)' ), array( 'fa fa-caret-right' => 'Caret Right(next, forward, triangle right, arrow)' ), array( 'fa fa-exchange' => 'Exchange(transfer, arrows, arrow)' ), array( 'fa fa-angle-double-left' => 'Angle Double Left(laquo, quote, previous, back, arrows)' ), array( 'fa fa-angle-double-right' => 'Angle Double Right(raquo, quote, next, forward, arrows)' ), array( 'fa fa-angle-double-up' => 'Angle Double Up(arrows)' ), array( 'fa fa-angle-double-down' => 'Angle Double Down(arrows)' ), array( 'fa fa-angle-left' => 'angle-left(previous, back, arrow)' ), array( 'fa fa-angle-right' => 'angle-right(next, forward, arrow)' ), array( 'fa fa-angle-up' => 'angle-up(arrow)' ), array( 'fa fa-angle-down' => 'angle-down(arrow)' ), array( 'fa fa-chevron-circle-left' => 'Chevron Circle Left(previous, back, arrow)' ), array( 'fa fa-chevron-circle-right' => 'Chevron Circle Right(next, forward, arrow)' ), array( 'fa fa-chevron-circle-up' => 'Chevron Circle Up(arrow)' ), array( 'fa fa-chevron-circle-down' => 'Chevron Circle Down(more, dropdown, menu, arrow)' ), array( 'fa fa-caret-square-o-down' => 'Caret Square Outlined Down(more, dropdown, menu)(toggle-down)' ), array( 'fa fa-caret-square-o-up' => 'Caret Square Outlined Up(toggle-up)' ), array( 'fa fa-caret-square-o-right' => 'Caret Square Outlined Right(next, forward)(toggle-right)' ), array( 'fa fa-long-arrow-down' => 'Long Arrow Down' ), array( 'fa fa-long-arrow-up' => 'Long Arrow Up' ), array( 'fa fa-long-arrow-left' => 'Long Arrow Left(previous, back)' ), array( 'fa fa-long-arrow-right' => 'Long Arrow Right' ), array( 'fa fa-arrow-circle-o-right' => 'Arrow Circle Outlined Right(next, forward)' ), array( 'fa fa-arrow-circle-o-left' => 'Arrow Circle Outlined Left(previous, back)' ), array( 'fa fa-caret-square-o-left' => 'Caret Square Outlined Left(previous, back)(toggle-left)' ), ), 'Video Player Icons' => array( array( 'fa fa-play-circle-o' => 'Play Circle Outlined' ), array( 'fa fa-step-backward' => 'step-backward(rewind, previous, beginning, start, first)' ), array( 'fa fa-fast-backward' => 'fast-backward(rewind, previous, beginning, start, first)' ), array( 'fa fa-backward' => 'backward(rewind, previous)' ), array( 'fa fa-play' => 'play(start, playing, music, sound)' ), array( 'fa fa-pause' => 'pause(wait)' ), array( 'fa fa-stop' => 'stop(block, box, square)' ), array( 'fa fa-forward' => 'forward(forward, next)' ), array( 'fa fa-fast-forward' => 'fast-forward(next, end, last)' ), array( 'fa fa-step-forward' => 'step-forward(next, end, last)' ), array( 'fa fa-eject' => 'eject' ), array( 'fa fa-expand' => 'Expand(enlarge, bigger, resize)' ), array( 'fa fa-compress' => 'Compress(collapse, combine, contract, merge, smaller)' ), array( 'fa fa-random' => 'random(sort, shuffle)' ), array( 'fa fa-arrows-alt' => 'Arrows Alt(expand, enlarge, fullscreen, bigger, move, reorder, resize, arrow)' ), array( 'fa fa-play-circle' => 'Play Circle(start, playing)' ), array( 'fa fa-youtube-play' => 'YouTube Play(start, playing)' ), array( 'fa fa-pause-circle' => 'Pause Circle' ), array( 'fa fa-pause-circle-o' => 'Pause Circle Outlined' ), array( 'fa fa-stop-circle' => 'Stop Circle' ), array( 'fa fa-stop-circle-o' => 'Stop Circle Outlined' ), ), 'Form Control Icons' => array( array( 'fa fa-check-square-o' => 'Check Square Outlined(todo, done, agree, accept, confirm, ok)' ), array( 'fa fa-square-o' => 'Square Outlined(block, square, box)' ), array( 'fa fa-square' => 'Square(block, box)' ), array( 'fa fa-plus-square' => 'Plus Square(add, new, create, expand)' ), array( 'fa fa-circle-o' => 'Circle Outlined' ), array( 'fa fa-circle' => 'Circle(dot, notification)' ), array( 'fa fa-minus-square' => 'Minus Square(hide, minify, delete, remove, trash, hide, collapse)' ), array( 'fa fa-minus-square-o' => 'Minus Square Outlined(hide, minify, delete, remove, trash, hide, collapse)' ), array( 'fa fa-check-square' => 'Check Square(checkmark, done, todo, agree, accept, confirm, ok)' ), array( 'fa fa-dot-circle-o' => 'Dot Circle Outlined(target, bullseye, notification)' ), array( 'fa fa-plus-square-o' => 'Plus Square Outlined(add, new, create, expand)' ), ), 'Transportation Icons' => array( array( 'fa fa-plane' => 'plane(travel, trip, location, destination, airplane, fly, mode)' ), array( 'fa fa-truck' => 'truck(shipping)' ), array( 'fa fa-ambulance' => 'ambulance(vehicle, support, help)' ), array( 'fa fa-fighter-jet' => 'fighter-jet(fly, plane, airplane, quick, fast, travel)' ), array( 'fa fa-rocket' => 'rocket(app)' ), array( 'fa fa-wheelchair' => 'Wheelchair(handicap, person, accessibility, accessibile)' ), array( 'fa fa-space-shuttle' => 'Space Shuttle' ), array( 'fa fa-car' => 'Car(vehicle)(automobile)' ), array( 'fa fa-taxi' => 'Taxi(vehicle)(cab)' ), array( 'fa fa-bicycle' => 'Bicycle(vehicle, bike)' ), array( 'fa fa-bus' => 'Bus(vehicle)' ), array( 'fa fa-ship' => 'Ship(boat, sea)' ), array( 'fa fa-motorcycle' => 'Motorcycle(vehicle, bike)' ), array( 'fa fa-train' => 'Train' ), array( 'fa fa-subway' => 'Subway' ), ), 'Chart Icons' => array( array( 'fa fa-bar-chart' => 'Bar Chart(graph, analytics)(bar-chart-o)' ), array( 'fa fa-area-chart' => 'Area Chart(graph, analytics)' ), array( 'fa fa-pie-chart' => 'Pie Chart(graph, analytics)' ), array( 'fa fa-line-chart' => 'Line Chart(graph, analytics)' ), ), 'Brand Icons' => array( array( 'fa fa-twitter-square' => 'Twitter Square(tweet, social network)' ), array( 'fa fa-facebook-square' => 'Facebook Square(social network)' ), array( 'fa fa-linkedin-square' => 'LinkedIn Square' ), array( 'fa fa-github-square' => 'GitHub Square(octocat)' ), array( 'fa fa-twitter' => 'Twitter(tweet, social network)' ), array( 'fa fa-facebook' => 'Facebook(social network)(facebook-f)' ), array( 'fa fa-github' => 'GitHub(octocat)' ), array( 'fa fa-pinterest' => 'Pinterest' ), array( 'fa fa-pinterest-square' => 'Pinterest Square' ), array( 'fa fa-google-plus-square' => 'Google Plus Square(social network)' ), array( 'fa fa-google-plus' => 'Google Plus(social network)' ), array( 'fa fa-linkedin' => 'LinkedIn' ), array( 'fa fa-github-alt' => 'GitHub Alt(octocat)' ), array( 'fa fa-maxcdn' => 'MaxCDN' ), array( 'fa fa-html5' => 'HTML 5 Logo' ), array( 'fa fa-css3' => 'CSS 3 Logo(code)' ), array( 'fa fa-btc' => 'Bitcoin (BTC)(bitcoin)' ), array( 'fa fa-youtube-square' => 'YouTube Square(video, film)' ), array( 'fa fa-youtube' => 'YouTube(video, film)' ), array( 'fa fa-xing' => 'Xing' ), array( 'fa fa-xing-square' => 'Xing Square' ), array( 'fa fa-youtube-play' => 'YouTube Play(start, playing)' ), array( 'fa fa-dropbox' => 'Dropbox' ), array( 'fa fa-stack-overflow' => 'Stack Overflow' ), array( 'fa fa-instagram' => 'Instagram' ), array( 'fa fa-flickr' => 'Flickr' ), array( 'fa fa-adn' => 'App.net' ), array( 'fa fa-bitbucket' => 'Bitbucket(git)' ), array( 'fa fa-bitbucket-square' => 'Bitbucket Square(git)' ), array( 'fa fa-tumblr' => 'Tumblr' ), array( 'fa fa-tumblr-square' => 'Tumblr Square' ), array( 'fa fa-apple' => 'Apple(osx, food)' ), array( 'fa fa-windows' => 'Windows(microsoft)' ), array( 'fa fa-android' => 'Android(robot)' ), array( 'fa fa-linux' => 'Linux(tux)' ), array( 'fa fa-dribbble' => 'Dribbble' ), array( 'fa fa-skype' => 'Skype' ), array( 'fa fa-foursquare' => 'Foursquare' ), array( 'fa fa-trello' => 'Trello' ), array( 'fa fa-gratipay' => 'Gratipay (Gittip)(heart, like, favorite, love)(gittip)' ), array( 'fa fa-vk' => 'VK' ), array( 'fa fa-weibo' => 'Weibo' ), array( 'fa fa-renren' => 'Renren' ), array( 'fa fa-pagelines' => 'Pagelines(leaf, leaves, tree, plant, eco, nature)' ), array( 'fa fa-stack-exchange' => 'Stack Exchange' ), array( 'fa fa-vimeo-square' => 'Vimeo Square' ), array( 'fa fa-slack' => 'Slack Logo(hashtag, anchor, hash)' ), array( 'fa fa-wordpress' => 'WordPress Logo' ), array( 'fa fa-openid' => 'OpenID' ), array( 'fa fa-yahoo' => 'Yahoo Logo' ), array( 'fa fa-google' => 'Google Logo' ), array( 'fa fa-reddit' => 'reddit Logo' ), array( 'fa fa-reddit-square' => 'reddit Square' ), array( 'fa fa-stumbleupon-circle' => 'StumbleUpon Circle' ), array( 'fa fa-stumbleupon' => 'StumbleUpon Logo' ), array( 'fa fa-delicious' => 'Delicious Logo' ), array( 'fa fa-digg' => 'Digg Logo' ), array( 'fa fa-pied-piper-pp' => 'Pied Piper PP Logo (Old)' ), array( 'fa fa-pied-piper-alt' => 'Pied Piper Alternate Logo' ), array( 'fa fa-drupal' => 'Drupal Logo' ), array( 'fa fa-joomla' => 'Joomla Logo' ), array( 'fa fa-behance' => 'Behance' ), array( 'fa fa-behance-square' => 'Behance Square' ), array( 'fa fa-steam' => 'Steam' ), array( 'fa fa-steam-square' => 'Steam Square' ), array( 'fa fa-spotify' => 'Spotify' ), array( 'fa fa-deviantart' => 'deviantART' ), array( 'fa fa-soundcloud' => 'SoundCloud' ), array( 'fa fa-vine' => 'Vine' ), array( 'fa fa-codepen' => 'Codepen' ), array( 'fa fa-jsfiddle' => 'jsFiddle' ), array( 'fa fa-rebel' => 'Rebel Alliance(ra, resistance)' ), array( 'fa fa-empire' => 'Galactic Empire(ge)' ), array( 'fa fa-git-square' => 'Git Square' ), array( 'fa fa-git' => 'Git' ), array( 'fa fa-hacker-news' => 'Hacker News(y-combinator-square, yc-square)' ), array( 'fa fa-tencent-weibo' => 'Tencent Weibo' ), array( 'fa fa-qq' => 'QQ' ), array( 'fa fa-weixin' => 'Weixin (WeChat)(wechat)' ), array( 'fa fa-share-alt' => 'Share Alt' ), array( 'fa fa-share-alt-square' => 'Share Alt Square' ), array( 'fa fa-slideshare' => 'Slideshare' ), array( 'fa fa-twitch' => 'Twitch' ), array( 'fa fa-yelp' => 'Yelp' ), array( 'fa fa-paypal' => 'Paypal' ), array( 'fa fa-google-wallet' => 'Google Wallet' ), array( 'fa fa-cc-visa' => 'Visa Credit Card' ), array( 'fa fa-cc-mastercard' => 'MasterCard Credit Card' ), array( 'fa fa-cc-discover' => 'Discover Credit Card' ), array( 'fa fa-cc-amex' => 'American Express Credit Card(amex)' ), array( 'fa fa-cc-paypal' => 'Paypal Credit Card' ), array( 'fa fa-cc-stripe' => 'Stripe Credit Card' ), array( 'fa fa-lastfm' => 'last.fm' ), array( 'fa fa-lastfm-square' => 'last.fm Square' ), array( 'fa fa-ioxhost' => 'ioxhost' ), array( 'fa fa-angellist' => 'AngelList' ), array( 'fa fa-meanpath' => 'meanpath' ), array( 'fa fa-buysellads' => 'BuySellAds' ), array( 'fa fa-connectdevelop' => 'Connect Develop' ), array( 'fa fa-dashcube' => 'DashCube' ), array( 'fa fa-forumbee' => 'Forumbee' ), array( 'fa fa-leanpub' => 'Leanpub' ), array( 'fa fa-sellsy' => 'Sellsy' ), array( 'fa fa-shirtsinbulk' => 'Shirts in Bulk' ), array( 'fa fa-simplybuilt' => 'SimplyBuilt' ), array( 'fa fa-skyatlas' => 'skyatlas' ), array( 'fa fa-facebook-official' => 'Facebook Official' ), array( 'fa fa-pinterest-p' => 'Pinterest P' ), array( 'fa fa-whatsapp' => 'What\'s App' ), array( 'fa fa-viacoin' => 'Viacoin' ), array( 'fa fa-medium' => 'Medium' ), array( 'fa fa-y-combinator' => 'Y Combinator(yc)' ), array( 'fa fa-optin-monster' => 'Optin Monster' ), array( 'fa fa-opencart' => 'OpenCart' ), array( 'fa fa-expeditedssl' => 'ExpeditedSSL' ), array( 'fa fa-cc-jcb' => 'JCB Credit Card' ), array( 'fa fa-cc-diners-club' => 'Diner\'s Club Credit Card' ), array( 'fa fa-gg' => 'GG Currency' ), array( 'fa fa-gg-circle' => 'GG Currency Circle' ), array( 'fa fa-tripadvisor' => 'TripAdvisor' ), array( 'fa fa-odnoklassniki' => 'Odnoklassniki' ), array( 'fa fa-odnoklassniki-square' => 'Odnoklassniki Square' ), array( 'fa fa-get-pocket' => 'Get Pocket' ), array( 'fa fa-wikipedia-w' => 'Wikipedia W' ), array( 'fa fa-safari' => 'Safari(browser)' ), array( 'fa fa-chrome' => 'Chrome(browser)' ), array( 'fa fa-firefox' => 'Firefox(browser)' ), array( 'fa fa-opera' => 'Opera' ), array( 'fa fa-internet-explorer' => 'Internet-explorer(browser, ie)' ), array( 'fa fa-contao' => 'Contao' ), array( 'fa fa-500px' => '500px' ), array( 'fa fa-amazon' => 'Amazon' ), array( 'fa fa-houzz' => 'Houzz' ), array( 'fa fa-vimeo' => 'Vimeo' ), array( 'fa fa-black-tie' => 'Font Awesome Black Tie' ), array( 'fa fa-fonticons' => 'Fonticons' ), array( 'fa fa-reddit-alien' => 'reddit Alien' ), array( 'fa fa-edge' => 'Edge Browser(browser, ie)' ), array( 'fa fa-codiepie' => 'Codie Pie' ), array( 'fa fa-modx' => 'MODX' ), array( 'fa fa-fort-awesome' => 'Fort Awesome' ), array( 'fa fa-usb' => 'USB' ), array( 'fa fa-product-hunt' => 'Product Hunt' ), array( 'fa fa-mixcloud' => 'Mixcloud' ), array( 'fa fa-scribd' => 'Scribd' ), array( 'fa fa-bluetooth' => 'Bluetooth' ), array( 'fa fa-bluetooth-b' => 'Bluetooth' ), array( 'fa fa-gitlab' => 'GitLab' ), array( 'fa fa-wpbeginner' => 'WPBeginner' ), array( 'fa fa-wpforms' => 'WPForms' ), array( 'fa fa-envira' => 'Envira Gallery(leaf)' ), array( 'fa fa-glide' => 'Glide' ), array( 'fa fa-glide-g' => 'Glide G' ), array( 'fa fa-viadeo' => 'Viadeo' ), array( 'fa fa-viadeo-square' => 'Viadeo Square' ), array( 'fa fa-snapchat' => 'Snapchat' ), array( 'fa fa-snapchat-ghost' => 'Snapchat Ghost' ), array( 'fa fa-snapchat-square' => 'Snapchat Square' ), array( 'fa fa-pied-piper' => 'Pied Piper Logo' ), array( 'fa fa-first-order' => 'First Order' ), array( 'fa fa-yoast' => 'Yoast' ), array( 'fa fa-themeisle' => 'ThemeIsle' ), array( 'fa fa-google-plus-official' => 'Google Plus Official(google-plus-circle)' ), array( 'fa fa-font-awesome' => 'Font Awesome(fa)' ), ), 'Hand Icons' => array( array( 'fa fa-thumbs-o-up' => 'Thumbs Up Outlined(like, approve, favorite, agree, hand)' ), array( 'fa fa-thumbs-o-down' => 'Thumbs Down Outlined(dislike, disapprove, disagree, hand)' ), array( 'fa fa-hand-o-right' => 'Hand Outlined Right(point, right, next, forward, finger)' ), array( 'fa fa-hand-o-left' => 'Hand Outlined Left(point, left, previous, back, finger)' ), array( 'fa fa-hand-o-up' => 'Hand Outlined Up(point, finger)' ), array( 'fa fa-hand-o-down' => 'Hand Outlined Down(point, finger)' ), array( 'fa fa-thumbs-up' => 'thumbs-up(like, favorite, approve, agree, hand)' ), array( 'fa fa-thumbs-down' => 'thumbs-down(dislike, disapprove, disagree, hand)' ), array( 'fa fa-hand-rock-o' => 'Rock (Hand)(hand-grab-o)' ), array( 'fa fa-hand-paper-o' => 'Paper (Hand)(stop)(hand-stop-o)' ), array( 'fa fa-hand-scissors-o' => 'Scissors (Hand)' ), array( 'fa fa-hand-lizard-o' => 'Lizard (Hand)' ), array( 'fa fa-hand-spock-o' => 'Spock (Hand)' ), array( 'fa fa-hand-pointer-o' => 'Hand Pointer' ), array( 'fa fa-hand-peace-o' => 'Hand Peace' ), ), 'Payment Icons' => array( array( 'fa fa-credit-card' => 'credit-card(money, buy, debit, checkout, purchase, payment)' ), array( 'fa fa-paypal' => 'Paypal' ), array( 'fa fa-google-wallet' => 'Google Wallet' ), array( 'fa fa-cc-visa' => 'Visa Credit Card' ), array( 'fa fa-cc-mastercard' => 'MasterCard Credit Card' ), array( 'fa fa-cc-discover' => 'Discover Credit Card' ), array( 'fa fa-cc-amex' => 'American Express Credit Card(amex)' ), array( 'fa fa-cc-paypal' => 'Paypal Credit Card' ), array( 'fa fa-cc-stripe' => 'Stripe Credit Card' ), array( 'fa fa-cc-jcb' => 'JCB Credit Card' ), array( 'fa fa-cc-diners-club' => 'Diner\'s Club Credit Card' ), array( 'fa fa-credit-card-alt' => 'Credit Card(money, buy, debit, checkout, purchase, payment, credit card)' ), ), 'Currency Icons' => array( array( 'fa fa-money' => 'Money(cash, money, buy, checkout, purchase, payment)' ), array( 'fa fa-eur' => 'Euro (EUR)(euro)' ), array( 'fa fa-gbp' => 'GBP' ), array( 'fa fa-usd' => 'US Dollar(dollar)' ), array( 'fa fa-inr' => 'Indian Rupee (INR)(rupee)' ), array( 'fa fa-jpy' => 'Japanese Yen (JPY)(cny, rmb, yen)' ), array( 'fa fa-rub' => 'Russian Ruble (RUB)(ruble, rouble)' ), array( 'fa fa-krw' => 'Korean Won (KRW)(won)' ), array( 'fa fa-btc' => 'Bitcoin (BTC)(bitcoin)' ), array( 'fa fa-try' => 'Turkish Lira (TRY)(turkish-lira)' ), array( 'fa fa-ils' => 'Shekel (ILS)(shekel, sheqel)' ), array( 'fa fa-gg' => 'GG Currency' ), array( 'fa fa-gg-circle' => 'GG Currency Circle' ), ), 'Accessibility Icons' => array( array( 'fa fa-wheelchair' => 'Wheelchair(handicap, person, accessibility, accessibile)' ), array( 'fa fa-tty' => 'TTY' ), array( 'fa fa-cc' => 'Closed Captions' ), array( 'fa fa-universal-access' => 'Universal Access' ), array( 'fa fa-wheelchair-alt' => 'Wheelchair Alt' ), array( 'fa fa-question-circle-o' => 'Question Circle Outlined' ), array( 'fa fa-blind' => 'Blind' ), array( 'fa fa-audio-description' => 'Audio Description' ), array( 'fa fa-volume-control-phone' => 'Volume Control Phone' ), array( 'fa fa-braille' => 'Braille' ), array( 'fa fa-assistive-listening-systems' => 'Assistive Listening Systems' ), array( 'fa fa-american-sign-language-interpreting' => 'American Sign Language Interpreting(asl-interpreting)' ), array( 'fa fa-deaf' => 'Deaf(deafness, hard-of-hearing)' ), array( 'fa fa-sign-language' => 'Sign Language(signing)' ), array( 'fa fa-low-vision' => 'Low Vision' ), ), 'Gender Icons' => array( array( 'fa fa-venus' => 'Venus(female)' ), array( 'fa fa-mars' => 'Mars(male)' ), array( 'fa fa-mercury' => 'Mercury(transgender)' ), array( 'fa fa-transgender' => 'Transgender(intersex)' ), array( 'fa fa-transgender-alt' => 'Transgender Alt' ), array( 'fa fa-venus-double' => 'Venus Double' ), array( 'fa fa-mars-double' => 'Mars Double' ), array( 'fa fa-venus-mars' => 'Venus Mars' ), array( 'fa fa-mars-stroke' => 'Mars Stroke' ), array( 'fa fa-mars-stroke-v' => 'Mars Stroke Vertical' ), array( 'fa fa-mars-stroke-h' => 'Mars Stroke Horizontal' ), array( 'fa fa-neuter' => 'Neuter' ), array( 'fa fa-genderless' => 'Genderless' ), ), ); 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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 * * @since 4.4 * @return array - of icons for iconpicker, can be categorized, or not. */ 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 * @since 5.0 * * @param $icons * * @return array */ 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 ); } PK2\e^^"params/sorted_list/sorted_list.phpnuW+A' . '' . '
' . vc_sorted_list_parts_list( $settings['options'] ) . '
' . '' . ''; } /** * Teaser box meta box generator for post's edit page. * @since 4.2 * The instance of this class is called from */ class Vc_Teaser_Box { /** * @since 4.2 * @var string */ protected static $meta_data_name = 'vc_teaser'; /** * @since 4.4 (code inspection) * @var bool */ public $teaser_data = false; /** * Add action hook to create Meta box. On admin_init jsComposerEditPage method is called. * @since 4.2 */ public function init() { add_action( 'admin_init', array( &$this, 'jsComposerEditPage' ), 6 ); } /** * Calls add_meta_box function for generating * @since 4.2 */ public function jsComposerEditPage() { $pt_array = vc_editor_post_types(); foreach ( $pt_array as $pt ) { add_meta_box( 'vc_teaser', __( 'VC: Custom Teaser', 'js_composer' ), array( &$this, 'outputTeaser', ), $pt, 'side' ); } add_action( 'save_post', array( &$this, 'saveTeaserMetaBox' ) ); } /** * Get teaser box data from database. * * @param $name * @param bool $id * * @since 4.2 * @return string */ public function getTeaserData( $name, $id = false ) { if ( false === $id ) { $id = get_the_ID(); } $this->teaser_data = get_post_meta( $id, self::$meta_data_name, true ); return isset( $this->teaser_data[ $name ] ) ? $this->teaser_data[ $name ] : ''; } /** * Outputs teaser box html content. * * @since 4.2 */ public function outputTeaser() { wp_enqueue_script( 'wpb_jscomposer_teaser_js' ); wp_localize_script( 'wpb_jscomposer_teaser_js', 'i18nVcTeaser', array( 'empty_title' => __( 'Empty title', 'js_composer' ), 'text_label' => __( 'Text', 'js_composer' ), 'image_label' => __( 'Image', 'js_composer' ), 'title_label' => __( 'Title', 'js_composer' ), 'link_label' => __( 'Link', 'js_composer' ), 'text_text' => __( 'Text', 'js_composer' ), 'text_excerpt' => __( 'Excerpt', 'js_composer' ), 'text_custom' => __( 'Custom', 'js_composer' ), 'image_featured' => __( 'Featered', 'js_composer' ), 'image_custom' => __( 'Custom', 'js_composer' ), 'link_label_text' => __( 'Link text', 'js_composer' ), 'no_link' => __( 'No link', 'js_composer' ), 'link_post' => __( 'Link to post', 'js_composer' ), 'link_big_image' => __( 'Link to big image', 'js_composer' ), 'add_custom_image' => __( 'Add custom image', 'js_composer' ), ) ); $output = '
'; $output .= ''; $output .= '
'; $output .= '

' . __( 'Customize teaser block design to overwrite default settings used in "Carousel" content element.', 'js_composer' ) . '

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; require_once vc_path_dir( 'TEMPLATES_DIR', 'teaser.html.php' ); echo $output; } /** * @param $post_id * * @since 4.2 */ public function saveTeaserMetaBox( $post_id ) { if ( isset( $_POST[ self::$meta_data_name ] ) ) { $options = isset( $_POST[ self::$meta_data_name ] ) ? $_POST[ self::$meta_data_name ] : ''; update_post_meta( (int) $post_id, self::$meta_data_name, $options ); } } } /** * @param $list * * @since 4.2 * @return string */ function vc_sorted_list_parts_list( $list ) { $output = ''; foreach ( $list as $control ) { $output .= '
'; } return $output; } /** * @param $value * * @since 4.2 * @return array */ 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 ) ); if ( count( $v_split ) > 0 ) { $data[] = array( $v_split[0], count( $v_split ) > 1 ? array_slice( $v_split, 1 ) : array() ); } } return $data; } global $vc_teaser_box; $vc_teaser_box = new Vc_Teaser_Box(); /** * @param $attributes * * @since 4.2 * @return mixed */ function vc_add_teaser_box_generator( $attributes ) { global $vc_teaser_box; $vc_teaser_box->init(); return $attributes; } add_filter( 'vc_mapper_attribute_sorted_list', 'vc_add_teaser_box_generator' ); PK2\!params/tab_id/tab_id.phpnuW+A' . '' . '' . ''; } PK2\`o&params/textarea_html/textarea_html.phpnuW+A' . $value . ''; $output .= '

' . sprintf( __( '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 ) . '

'; } elseif ( function_exists( 'wp_editor' ) ) { $default_content = $value; // WP 3.3+ ob_start(); wp_editor( '', 'wpb_tinymce_' . $settings['param_name'], array( 'editor_class' => 'wpb-textarea visual_composer_tinymce ' . $settings['param_name'] . ' ' . $settings['type'], 'media_buttons' => true, 'wpautop' => false, ) ); $output_value = ob_get_contents(); ob_end_clean(); $output .= $output_value . ''; $vc_html_editor_already_is_use = $settings['param_name']; } return $output; } PK2\IY99*params/animation_style/animation_style.phpnuW+A 'animation_style', * 'heading' => __( 'Animation', 'js_composer' ), * 'param_name' => 'animation', * ), * Preview in http://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 * @since 4.4 * vc_filter: vc_param_animation_style_list - to override animation styles * array * @return array */ protected function animationStyles() { $styles = array( array( 'values' => array( __( 'None', 'js_composer' ) => 'none', ), ), array( 'label' => __( 'Attention Seekers', 'js_composer' ), 'values' => array( // text to display => value __( 'bounce', 'js_composer' ) => array( 'value' => 'bounce', 'type' => 'other', ), __( 'flash', 'js_composer' ) => array( 'value' => 'flash', 'type' => 'other', ), __( 'pulse', 'js_composer' ) => array( 'value' => 'pulse', 'type' => 'other', ), __( 'rubberBand', 'js_composer' ) => array( 'value' => 'rubberBand', 'type' => 'other', ), __( 'shake', 'js_composer' ) => array( 'value' => 'shake', 'type' => 'other', ), __( 'swing', 'js_composer' ) => array( 'value' => 'swing', 'type' => 'other', ), __( 'tada', 'js_composer' ) => array( 'value' => 'tada', 'type' => 'other', ), __( 'wobble', 'js_composer' ) => array( 'value' => 'wobble', 'type' => 'other', ), ), ), array( 'label' => __( 'Bouncing Entrances', 'js_composer' ), 'values' => array( // text to display => value __( 'bounceIn', 'js_composer' ) => array( 'value' => 'bounceIn', 'type' => 'in', ), __( 'bounceInDown', 'js_composer' ) => array( 'value' => 'bounceInDown', 'type' => 'in', ), __( 'bounceInLeft', 'js_composer' ) => array( 'value' => 'bounceInLeft', 'type' => 'in', ), __( 'bounceInRight', 'js_composer' ) => array( 'value' => 'bounceInRight', 'type' => 'in', ), __( 'bounceInUp', 'js_composer' ) => array( 'value' => 'bounceInUp', 'type' => 'in', ), ), ), array( 'label' => __( 'Bouncing Exits', 'js_composer' ), 'values' => array( // text to display => value __( 'bounceOut', 'js_composer' ) => array( 'value' => 'bounceOut', 'type' => 'out', ), __( 'bounceOutDown', 'js_composer' ) => array( 'value' => 'bounceOutDown', 'type' => 'out', ), __( 'bounceOutLeft', 'js_composer' ) => array( 'value' => 'bounceOutLeft', 'type' => 'out', ), __( 'bounceOutRight', 'js_composer' ) => array( 'value' => 'bounceOutRight', 'type' => 'out', ), __( 'bounceOutUp', 'js_composer' ) => array( 'value' => 'bounceOutUp', 'type' => 'out', ), ), ), array( 'label' => __( 'Fading Entrances', 'js_composer' ), 'values' => array( // text to display => value __( 'fadeIn', 'js_composer' ) => array( 'value' => 'fadeIn', 'type' => 'in', ), __( 'fadeInDown', 'js_composer' ) => array( 'value' => 'fadeInDown', 'type' => 'in', ), __( 'fadeInDownBig', 'js_composer' ) => array( 'value' => 'fadeInDownBig', 'type' => 'in', ), __( 'fadeInLeft', 'js_composer' ) => array( 'value' => 'fadeInLeft', 'type' => 'in', ), __( 'fadeInLeftBig', 'js_composer' ) => array( 'value' => 'fadeInLeftBig', 'type' => 'in', ), __( 'fadeInRight', 'js_composer' ) => array( 'value' => 'fadeInRight', 'type' => 'in', ), __( 'fadeInRightBig', 'js_composer' ) => array( 'value' => 'fadeInRightBig', 'type' => 'in', ), __( 'fadeInUp', 'js_composer' ) => array( 'value' => 'fadeInUp', 'type' => 'in', ), __( 'fadeInUpBig', 'js_composer' ) => array( 'value' => 'fadeInUpBig', 'type' => 'in', ), ), ), array( 'label' => __( 'Fading Exits', 'js_composer' ), 'values' => array( __( 'fadeOut', 'js_composer' ) => array( 'value' => 'fadeOut', 'type' => 'out', ), __( 'fadeOutDown', 'js_composer' ) => array( 'value' => 'fadeOutDown', 'type' => 'out', ), __( 'fadeOutDownBig', 'js_composer' ) => array( 'value' => 'fadeOutDownBig', 'type' => 'out', ), __( 'fadeOutLeft', 'js_composer' ) => array( 'value' => 'fadeOutLeft', 'type' => 'out', ), __( 'fadeOutLeftBig', 'js_composer' ) => array( 'value' => 'fadeOutLeftBig', 'type' => 'out', ), __( 'fadeOutRight', 'js_composer' ) => array( 'value' => 'fadeOutRight', 'type' => 'out', ), __( 'fadeOutRightBig', 'js_composer' ) => array( 'value' => 'fadeOutRightBig', 'type' => 'out', ), __( 'fadeOutUp', 'js_composer' ) => array( 'value' => 'fadeOutUp', 'type' => 'out', ), __( 'fadeOutUpBig', 'js_composer' ) => array( 'value' => 'fadeOutUpBig', 'type' => 'out', ), ), ), array( 'label' => __( 'Flippers', 'js_composer' ), 'values' => array( __( 'flip', 'js_composer' ) => array( 'value' => 'flip', 'type' => 'other', ), __( 'flipInX', 'js_composer' ) => array( 'value' => 'flipInX', 'type' => 'in', ), __( 'flipInY', 'js_composer' ) => array( 'value' => 'flipInY', 'type' => 'in', ), __( 'flipOutX', 'js_composer' ) => array( 'value' => 'flipOutX', 'type' => 'out', ), __( 'flipOutY', 'js_composer' ) => array( 'value' => 'flipOutY', 'type' => 'out', ), ), ), array( 'label' => __( 'Lightspeed', 'js_composer' ), 'values' => array( __( 'lightSpeedIn', 'js_composer' ) => array( 'value' => 'lightSpeedIn', 'type' => 'in', ), __( 'lightSpeedOut', 'js_composer' ) => array( 'value' => 'lightSpeedOut', 'type' => 'out', ), ), ), array( 'label' => __( 'Rotating Entrances', 'js_composer' ), 'values' => array( __( 'rotateIn', 'js_composer' ) => array( 'value' => 'rotateIn', 'type' => 'in', ), __( 'rotateInDownLeft', 'js_composer' ) => array( 'value' => 'rotateInDownLeft', 'type' => 'in', ), __( 'rotateInDownRight', 'js_composer' ) => array( 'value' => 'rotateInDownRight', 'type' => 'in', ), __( 'rotateInUpLeft', 'js_composer' ) => array( 'value' => 'rotateInUpLeft', 'type' => 'in', ), __( 'rotateInUpRight', 'js_composer' ) => array( 'value' => 'rotateInUpRight', 'type' => 'in', ), ), ), array( 'label' => __( 'Rotating Exits', 'js_composer' ), 'values' => array( __( 'rotateOut', 'js_composer' ) => array( 'value' => 'rotateOut', 'type' => 'out', ), __( 'rotateOutDownLeft', 'js_composer' ) => array( 'value' => 'rotateOutDownLeft', 'type' => 'out', ), __( 'rotateOutDownRight', 'js_composer' ) => array( 'value' => 'rotateOutDownRight', 'type' => 'out', ), __( 'rotateOutUpLeft', 'js_composer' ) => array( 'value' => 'rotateOutUpLeft', 'type' => 'out', ), __( 'rotateOutUpRight', 'js_composer' ) => array( 'value' => 'rotateOutUpRight', 'type' => 'out', ), ), ), array( 'label' => __( 'Specials', 'js_composer' ), 'values' => array( __( 'hinge', 'js_composer' ) => array( 'value' => 'hinge', 'type' => 'out', ), __( 'rollIn', 'js_composer' ) => array( 'value' => 'rollIn', 'type' => 'in', ), __( 'rollOut', 'js_composer' ) => array( 'value' => 'rollOut', 'type' => 'out', ), ), ), array( 'label' => __( 'Zoom Entrances', 'js_composer' ), 'values' => array( __( 'zoomIn', 'js_composer' ) => array( 'value' => 'zoomIn', 'type' => 'in', ), __( 'zoomInDown', 'js_composer' ) => array( 'value' => 'zoomInDown', 'type' => 'in', ), __( 'zoomInLeft', 'js_composer' ) => array( 'value' => 'zoomInLeft', 'type' => 'in', ), __( 'zoomInRight', 'js_composer' ) => array( 'value' => 'zoomInRight', 'type' => 'in', ), __( 'zoomInUp', 'js_composer' ) => array( 'value' => 'zoomInUp', 'type' => 'in', ), ), ), array( 'label' => __( 'Zoom Exits', 'js_composer' ), 'values' => array( __( 'zoomOut', 'js_composer' ) => array( 'value' => 'zoomOut', 'type' => 'out', ), __( 'zoomOutDown', 'js_composer' ) => array( 'value' => 'zoomOutDown', 'type' => 'out', ), __( 'zoomOutLeft', 'js_composer' ) => array( 'value' => 'zoomOutLeft', 'type' => 'out', ), __( 'zoomOutRight', 'js_composer' ) => array( 'value' => 'zoomOutRight', 'type' => 'out', ), __( 'zoomOutUp', 'js_composer' ) => array( 'value' => 'zoomOutUp', 'type' => 'out', ), ), ), array( 'label' => __( 'Slide Entrances', 'js_composer' ), 'values' => array( __( 'slideInDown', 'js_composer' ) => array( 'value' => 'slideInDown', 'type' => 'in', ), __( 'slideInLeft', 'js_composer' ) => array( 'value' => 'slideInLeft', 'type' => 'in', ), __( 'slideInRight', 'js_composer' ) => array( 'value' => 'slideInRight', 'type' => 'in', ), __( 'slideInUp', 'js_composer' ) => array( 'value' => 'slideInUp', 'type' => 'in', ), ), ), array( 'label' => __( 'Slide Exits', 'js_composer' ), 'values' => array( __( 'slideOutDown', 'js_composer' ) => array( 'value' => 'slideOutDown', 'type' => 'out', ), __( 'slideOutLeft', 'js_composer' ) => array( 'value' => 'slideOutLeft', 'type' => 'out', ), __( 'slideOutRight', 'js_composer' ) => array( 'value' => 'slideOutRight', 'type' => 'out', ), __( '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 * * @since 4.4 * @return array */ 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 ) ) ) || ! 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 * @since 4.4 * * @param $settings * @param $value */ public function __construct( $settings, $value ) { $this->settings = $settings; $this->value = $value; wp_register_style( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION, false ); } /** * Render edit form output * @since 4.4 * @return string */ public function render() { $output = '
'; wp_enqueue_style( '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 = '
'; $build_style_select = "\n" . '' . "\n"; $left_side .= $build_style_select; $left_side .= '
'; // Close left_side div $output .= $left_side; $right_side = '
'; $right_side .= '
'; $right_side .= '
'; // Close right_side div $output .= $right_side; } $output .= '
'; // Close Row $output .= ''; 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 * * @since 4.4 * @return mixed|void rendered template for params in edit form * */ function vc_animation_style_form_field( $settings, $value, $tag ) { $field = new Vc_ParamAnimation( $settings, $value, $tag ); /** * 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 ); } PK2\y@params/hidden/hidden.phpnuW+A'; } /** * Remove content before hidden field type input. * * @param $output * * @since 4.5 * * @return string */ function vc_edit_form_fields_render_field_hidden_before( $output ) { return '
'; } /** * Remove content after hidden field type input. * * @param $output * * @since 4.5 * * @return string */ function vc_edit_form_fields_render_field_hidden_after( $output ) { return '
'; } PK2\,i params/css_editor/css_editor.phpnuW+Asettings = $settings; } return $this->settings; } /** * @param $key * * @return string */ function setting( $key ) { return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : ''; } /** * @param null $value * * @return string */ function value( $value = null ) { if ( is_string( $value ) ) { $this->value = $value; } return $this->value; } /** * @param null $values * * @return array */ 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|void */ function render() { $output = '
'; $output .= $this->onionLayout(); $output .= '
' . ' ' . '
' . ' ' . '
' . ' ' . '
' . ' ' . '
' . '
' . $this->getBackgroundImageControl() . '
' . '
' . ' ' . ' ' . '
'; $output .= ''; $output .= '
'; $output .= ''; return apply_filters( 'vc_css_editor', $output ); } /** * @return string */ function getBackgroundImageControl() { return apply_filters( 'vc_css_editor_background_image_control', '' . '' . __( 'Add image', 'js_composer' ) . '' ); } /** * @return string */ function getBorderRadiusOptions() { $radiuses = apply_filters( 'vc_css_editor_border_radius_options_data', array( '' => __( '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 .= ''; } return $output; } /** * @return string */ function getBorderStyleOptions() { $output = ''; $styles = apply_filters( 'vc_css_editor_border_style_options_data', array( 'solid', 'dotted', 'dashed', 'none', 'hidden', 'double', 'groove', 'ridge', 'inset', 'outset', 'initial', 'inherit', ) ); foreach ( $styles as $style ) { $output .= ''; } return $output; } /** * @return string */ function getBackgroundStyleOptions() { $output = ''; $styles = apply_filters( 'vc_css_editor_background_style_options_data', array( __( 'Cover', 'js_composer' ) => 'cover', __( 'Contain', 'js_composer' ) => 'contain', __( 'No Repeat', 'js_composer' ) => 'no-repeat', __( 'Repeat', 'js_composer' ) => 'repeat', ) ); foreach ( $styles as $name => $style ) { $output .= ''; } return $output; } /** * @return string */ function onionLayout() { $output = '
' . '
' . $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 = ''; foreach ( $this->positions as $pos ) { $output .= ''; } return apply_filters( 'vc_css_editor_layer_controls', $output ); } } } /** * @param $settings * @param $value * * @return mixed|void */ function vc_css_editor_form_field( $settings, $value ) { $css_editor = new WPBakeryVisualComposerCssEditor(); $css_editor->settings( $settings ); $css_editor->value( $value ); return $css_editor->render(); } PK2\o`params/load.phpnuW+A 'hidden_markup1', // all params must have a unique name 'type' => 'custom_markup', // this param type 'description' => __( 'Enter your content..', 'js_composer' ), // some description if needed 'value' => '
aaa
', // your custom markup ), */ PK2\0params/vc_grid_element/vc_grid_id/vc_grid_id.phpnuW+A' . '' . ''; } PK2\R!n%n%*params/vc_grid_element/vc_grid_element.phpnuW+Ashortcodes; } function setTemplate( $template ) { $this->template = $template; $this->parseTemplate( $template ); } function template() { return $this->template; } public function parseTemplate( $template ) { $this->setShortcodes(); $this->html_template = do_shortcode( $template ); } 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 '
' . "\n" . preg_replace( $pattern, $replacement, $this->html_template ) . "\n" . '
' . "\n"; } public function renderParam() { $output = '
' . '' . __( 'Add row', 'js_composer' ) . ''; 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 ); } $output .= ''; $output .= ''; } self::$templates_added = true; } return $output; } public function setGridAttributes( $grid_atts ) { $this->grid_atts = $grid_atts; } public function gridAttribute( $name, $default = '' ) { return isset( $this->grid_atts[ $name ] ) ? $this->grid_atts[ $name ] : $default; } public function setAttribute( $name ) { $this->attributes[] = $name; } public function attributes() { return $this->attributes; } 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 ''; } public function setIsEnd( $is_end = true ) { $this->is_end = $is_end; } 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' ) ) ); } } // Templates {{ public function vcGitemRowShortcode( $atts, $content = '' ) { return '
' . "\n" . do_shortcode( $content ) . "\n" . '
'; } public function vcGitemRowTemplate() { $output = '
'; $output .= '
'; // Move control $output .= ''; // Layout control $output .= '' . '' // Destroy control . '' . '' . '' . ''; $output .= '
'; $output .= '
'; $output .= '
'; return $output; } public function vcGitemColShortcode( $atts, $content = '' ) { $width = '12'; $atts = shortcode_atts( array( 'width' => '12', ), $atts ); extract( $atts ); return '
' . "\n" . do_shortcode( $content ) . "\n" . '
'; } public function vcGitemColTemplate() { $output = '
'; // Controls // Control "Add" $controls = '' . '' . ''; $output .= '
' . $controls . '
'; // Content $output .= '
' . '
'; /* $output .= '
' .$controls . '
'; */ $output .= '
'; return $output; } public function vcGitemPostTitleShortcode( $atts, $content = '' ) { $atts = shortcode_atts( array(), $atts ); extract( $atts ); $this->setAttribute( 'post_title' ); return '

{{post_title}}

'; } public function vcDefaultTemplate( $tag ) { $name = preg_replace( '/^vc_gitem_/', '', $tag ); $title = ucfirst( preg_replace( '/\_/', ' ', $name ) ); return '
' . $this->elementControls( $title, preg_match( '/^post/', $name ) ? 'orange' : 'green' ) . '
'; } protected function elementControls( $title, $theme = null ) { return '
' // Move control . '' . '' . '' // Label . ' ' . $title . '' // Edit control . '' . '' . '' // Delete control . '' . '' . '' . '
'; } // }} } function vc_vc_grid_element_form_field( $settings, $value ) { $grid_element = new Vc_Grid_Element(); return '
' . '' . $grid_element->renderParam() . '
'; } 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' ); PK2\Sparams/el_id/el_id.phpnuW+A' . '' . '' ); } PK2\.params/options/options.phpnuW+A' . '' . '' . __( 'Manage options', 'js_composer' ) . '' . '
' . __( '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' ); PK2\1"params/colorpicker/colorpicker.phpnuW+A' . '' . ''; } PK2\E#6#6(params/font_container/font_container.phpnuW+A 'font_container', * 'param_name' => 'font_container', * 'value'=>'', * 'settings'=>array( * 'fields'=>array( * 'tag'=>'h2', * 'text_align', * 'font_size', * 'line_height', * 'color', * * 'tag_description' => __('Select element tag.','js_composer'), * 'text_align_description' => __('Select text alignment.','js_composer'), * 'font_size_description' => __('Enter font size.','js_composer'), * 'line_height_description' => __('Enter line height.','js_composer'), * 'color_description' => __('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'] = '
' . __( 'Element tag', 'js_composer' ) . '
'; if ( isset( $fields['tag_description'] ) && strlen( $fields['tag_description'] ) > 0 ) { $data['tag'] .= ' ' . $fields['tag_description'] . ' '; } $data['tag'] .= '
'; } if ( isset( $fields['font_size'] ) ) { $data['font_size'] = '
' . __( 'Font size', 'js_composer' ) . '
'; if ( isset( $fields['font_size_description'] ) && strlen( $fields['font_size_description'] ) > 0 ) { $data['font_size'] .= ' ' . $fields['font_size_description'] . ' '; } $data['font_size'] .= '
'; } if ( isset( $fields['text_align'] ) ) { $data['text_align'] = '
' . __( 'Text align', 'js_composer' ) . '
'; if ( isset( $fields['text_align_description'] ) && strlen( $fields['text_align_description'] ) > 0 ) { $data['text_align'] .= ' ' . $fields['text_align_description'] . ' '; } $data['text_align'] .= '
'; } if ( isset( $fields['line_height'] ) ) { $data['line_height'] = '
' . __( 'Line height', 'js_composer' ) . '
'; if ( isset( $fields['line_height_description'] ) && strlen( $fields['line_height_description'] ) > 0 ) { $data['line_height'] .= ' ' . $fields['line_height_description'] . ' '; } $data['line_height'] .= '
'; } if ( isset( $fields['color'] ) ) { $data['color'] = '
' . __( 'Text color', 'js_composer' ) . '
'; if ( isset( $fields['color_description'] ) && strlen( $fields['color_description'] ) > 0 ) { $data['color'] .= ' ' . $fields['color_description'] . ' '; } $data['color'] .= '
'; } if ( isset( $fields['font_family'] ) ) { $data['font_family'] = '
' . __( 'Font Family', 'js_composer' ) . '
'; if ( isset( $fields['font_family_description'] ) && strlen( $fields['font_family_description'] ) > 0 ) { $data['font_family'] .= ' ' . $fields['font_family_description'] . ' '; } $data['font_family'] .= '
'; } if ( isset( $fields['font_style'] ) ) { $data['font_style'] = '
' . __( 'Font style', 'js_composer' ) . '

'; if ( isset( $fields['font_style_description'] ) && strlen( $fields['font_style_description'] ) > 0 ) { $data['font_style'] .= ' ' . $fields['font_style_description'] . ' '; } $data['font_style'] .= '
'; } $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 .= ''; 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|void */ 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 ) ); } PK2\]QQparams/loop/loop.phpnuW+AgetContent(); $loop_info = ''; if ( is_array( $params ) ) { foreach ( $params as $key => $param ) { $param_value = vc_loop_get_value( $param ); if ( ! empty( $param_value ) ) { $loop_info .= ' ' . $query_builder->getLabel( $key ) . ': ' . $param_value . ';'; } } } return '
' . '' . '' . __( 'Build query', 'js_composer' ) . '' . '
' . $loop_info . '
' . '
'; } /** * @param $param * * @since 4.2 * @return string */ 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 ) ) { $value[] = $option['action'] . $option['name']; } } elseif ( is_array( $option ) && isset( $option[0] ) ) { if ( in_array( $option[0], $selected_values ) ) { $value[] = $option[1]; } } elseif ( in_array( $option, $selected_values ) ) { $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 ); /** * @since 4.2 * * @param $data */ function __construct( $data ) { foreach ( $data as $key => $value ) { $method = 'parse_' . $key; if ( method_exists( $this, $method ) ) { $this->$method( $value ); } } } /** * Pages count * @since 4.2 * * @param $value */ protected function parse_size( $value ) { $this->args['posts_per_page'] = 'All' === $value ? - 1 : (int) $value; } /** * Sorting field * @since 4.2 * * @param $value */ protected function parse_order_by( $value ) { $this->args['orderby'] = $value; } /** * Sorting order * @since 4.2 * * @param $value */ protected function parse_order( $value ) { $this->args['order'] = $value; } /** * By post types * @since 4.2 * * @param $value */ protected function parse_post_type( $value ) { $this->args['post_type'] = $this->stringToArray( $value ); } /** * By author * @since 4.2 * * @param $value */ protected function parse_authors( $value ) { $this->args['author'] = $value; } /** * By categories * @since 4.2 * * @param $value */ protected function parse_categories( $value ) { $this->args['cat'] = $value; } /** * By taxonomies * @since 4.2 * * @param $value */ 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 ) ) { $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 * @since 4.2 * * @param $value */ 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; } /** * By posts ids * @since 4.2 * * @param $value */ 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; } /** * @since 4.2 * * @param $id */ 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 * @since 4.2 * * @param $value * * @return array */ 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() { return array( $this->args, new WP_Query( $this->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', 'authors', 'categories', 'tags', 'tax_query', 'by_id', ); /** * @since 4.2 * * @param $value * @param array $settings */ function __construct( $value, $settings = array() ) { $this->parts = array( 'size' => __( 'Post count', 'js_composer' ), 'order_by' => __( 'Order by', 'js_composer' ), 'order' => __( 'Sort order', 'js_composer' ), 'post_type' => __( 'Post types', 'js_composer' ), 'authors' => __( 'Author', 'js_composer' ), 'categories' => __( 'Categories', 'js_composer' ), 'tags' => __( 'Tags', 'js_composer' ), 'tax_query' => __( 'Taxonomies', 'js_composer' ), 'by_id' => __( '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 * * @since 4.2 * @return bool */ protected function replaceLockedValue( $part ) { return in_array( $part, array( 'size', 'order_by', 'order' ) ); } /** * @param $key * * @since 4.2 * @return mixed */ public function getLabel( $key ) { return isset( $this->parts[ $key ] ) ? $this->parts[ $key ] : $key; } /** * @param $part * @param $name * * @since 4.2 * @return null */ 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 * * @since 4.2 * @return array */ public function parseString( $value ) { return array( 'value' => $value ); } /** * @param $value * @param array $options * * @since 4.2 * @return array */ protected function parseDropDown( $value, $options = array() ) { return array( 'value' => $value, 'options' => $options ); } /** * @param $value * @param array $options * * @since 4.2 * @return array */ protected function parseMultiSelect( $value, $options = array() ) { return array( 'value' => explode( ',', $value ), 'options' => $options ); } /** * @param $value * * @since 4.2 * @return array */ public function parse_order_by( $value ) { return $this->parseDropDown( $value, array( array( 'date', __( 'Date', 'js_composer' ) ), 'ID', array( 'author', __( 'Author', 'js_composer' ) ), array( 'title', __( 'Title', 'js_composer' ) ), array( 'modified', __( 'Modified', 'js_composer' ) ), array( 'rand', __( 'Random', 'js_composer' ) ), array( 'comment_count', __( 'Comment count', 'js_composer' ) ), array( 'menu_order', __( 'Menu order', 'js_composer' ) ), ) ); } /** * @param $value * * @since 4.2 * @return array */ public function parse_order( $value ) { return $this->parseDropDown( $value, array( array( 'ASC', __( 'Ascending', 'js_composer' ) ), array( 'DESC', __( 'Descending', 'js_composer' ) ), ) ); } /** * @param $value * * @since 4.2 * @return array */ 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 * * @since 4.2 * @return array */ 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 ) ? '-' : '+', ); } return $this->parseMultiSelect( $value, $options ); } /** * @param $value * * @since 4.2 * @return array */ 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 ) ? '-' : '+', ); } return $this->parseMultiSelect( $value, $options ); } /** * @param $value * * @since 4.2 * @return array */ 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 ) ? '-' : '+', ); } return $this->parseMultiSelect( $value, $options ); } /** * @param $value * * @since 4.2 * @return array */ 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 ) ? '-' : '+', ); } return $this->parseMultiSelect( $value, $options ); } /** * @param $value * * @since 4.2 * @return array */ 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 ) ? '-' : '+', ); } return $this->parseMultiSelect( $value, $options ); } /** * @since 4.2 */ public function render() { echo json_encode( $this->content ); } /** * @since 4.2 * @return array */ public function getContent() { return $this->content; } /** * get list of taxonomies which has no tags and categories items. * @since 4.2 * @static * @return array */ 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 ) ) { $taxonomies[] = $taxonomy; } } return $taxonomies; } /** * @param $settings * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return array */ 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 * * @since 4.2 * @return array */ 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 */ 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' ) : array( 'post_type' => 'any' ); if ( ! empty( $this->exclude ) ) { $args['exclude'] = $this->exclude; } $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 json_encode( $this->content ); } } /** * Build WP_Query object from query string. * String created by loop controllers * * @param $query * @param bool $exclude_id * * @since 4.2 * @return string */ 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' ); /** * @param $param * * @since 4.2 * @return mixed */ function vc_set_loop_default_value( $param ) { if ( empty( $param['value'] ) && isset( $param['settings'] ) ) { $param['value'] = VcLoopSettings::buildDefault( $param ); } return $param; } add_filter( 'vc_mapper_attribute_loop', 'vc_set_loop_default_value' ); PK2\&ͱ_!_!$params/autocomplete/autocomplete.phpnuW+Atag = $tag; $this->settings = $settings; $this->value = $value; } /** * @since 4.4 * vc_filter: vc_autocomplete_{shortcode_tag}_{param_name}_render - hook to define output for autocomplete item * @return string */ public function render() { $output = '
' . ''; $output .= 'settings['settings'] ) && ! empty( $this->settings['settings'] ) ) ? ' data-settings="' . htmlentities( 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 = strip_tags( vc_post_param( 'shortcode' ) ); $param_name = vc_post_param( 'param' ); vc_render_suggestion( $query, $tag, $param_name ); } /** * @since 4.4 * * @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). */ 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( json_encode( $suggestions ) ); } die( '' ); // 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 * * @since 4.4 * vc_filter: vc_autocomplete_render_filter - hook to override output of edit for field "autocomplete" * @return mixed|void rendered template for params in edit form */ 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() ); } // Some examples /* vc_map( array( 'name' => __( 'Check autocomplete', 'js_composer' ), 'base' => 'vc_some_autocomplete', 'icon' => 'icon-wpb-empty_space', 'category' => __( 'New Elements', 'js_composer' ), 'description' => __( 'Something cool and best', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Type a for example', 'js_composer' ), 'param_name' => 'ids', 'settings' => array( 'multiple' => true, 'sortable' => true, 'min_length' => 1, 'no_hide' => true, // In UI after select doesn't hide an select list 'groups' => true, // In UI show results grouped by groups 'unique_values' => true, // In UI show results except selected. NB! You should manually check values in backend 'display_inline' => true, // In UI show results inline view 'values' => array( // Using key 'values' will disable an AJAX requests on autocomplete input and also any filter for suggestions array( 'label' => 'Abrams', 'value' => 1, 'group' => 'category' ), array( 'label' => 'Brama', 'value' => 2, 'group' => 'category' ), array( 'label' => 'Dron', 'value' => 3, 'group' => 'tags' ), array( 'label' => 'Akelloam', 'value' => 4, 'group' => 'tags' ), // Label will show when adding // Value will saved in input // Group only used if groups=>true, this will group data in select dropdown by groups ), ), 'description' => __( '', 'js_composer' ), ), ), ) ); // Or with AJAX suggester: See \js_composer\include\classes\vendors\plugins\class-vc-vendor-woocommerce.php vc_map( array( 'name' => __( 'Product', 'js_composer' ), 'base' => 'product', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show a single product by ID or SKU', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Select identificator', 'js_composer' ), 'param_name' => 'id', 'description' => __( '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', ), ) ) ); //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 item. Must return an array (label,value) function productIdAutocompleteSuggester($query) -> should proccess your request, and return an multi-dimension associative array with keys 'label', 'value' and if necessary 'group' function productIdAutocompleteRender($value) -> should proccess your request (for 1 exact item from "value") and return an associative array with keys 'label','value' and if necessary 'group' */ PK2\Rparams/vc_link/vc_link.phpnuW+A' . '' . '' . __( 'Select URL', 'js_composer' ) . ' ' . __( 'Title', 'js_composer' ) . ': ' . $link['title'] . ' ' . __( 'URL', 'js_composer' ) . ': ' . $link['url'] . ' ' . $link['target'] . '' . ''; } /** * @param $value * * @since 4.2 * @return array */ function vc_build_link( $value ) { return vc_parse_multi_attribute( $value, array( 'url' => '', 'title' => '', 'target' => '', 'rel' => '' ) ); } PK2\ Ƶ**params/default_params.phpnuW+A'; } /** * Dropdown(select with options) shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.4 * @return string - html string. */ function vc_dropdown_form_field( $settings, $value ) { $output = ''; $css_option = str_replace( '#', 'hash-', vc_get_dropdown_option( $settings, $value ) ); $output .= ''; return $output; } /** * Checkbox shortcode attribute type generator. * * @param $settings * @param string $value * * @since 4.4 * @return string - html string. */ 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( __( 'Yes' ) => 'true' ); if ( ! empty( $values ) ) { foreach ( $values as $label => $v ) { $checked = count( $current_value ) > 0 && in_array( $v, $current_value ) ? ' checked' : ''; $output .= ' '; } } return $output; } add_filter( 'vc_map_get_param_defaults', 'vc_checkbox_param_defaults', 10, 2 ); 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 * * @since 4.4 * @return string - html string. */ 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 ) ) ) { $checked = ' checked="checked"'; } $output .= ' '; } } return $output; } /** * Taxonomies shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.4 * @return string - html string. */ 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 ) ) ) { $checked = ' checked'; } $output .= ' '; } } 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 * * @since 4.4 * @return string - html string. */ function vc_exploded_textarea_form_field( $settings, $value ) { $value = str_replace( ',', "\n", $value ); return ''; } /** * Safe Textarea shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.8.2 * @return string - html string. */ function vc_exploded_textarea_safe_form_field( $settings, $value ) { $value = vc_value_from_safe( $value, true ); $value = str_replace( ',', "\n", $value ); return ''; } /** * Textarea raw html shortcode attribute type generator. * * This attribute type allows safely add custom html to your post/page. * * @param $settings * @param $value * * @since 4.4 * @return string - html string. */ function vc_textarea_raw_html_form_field( $settings, $value ) { return ''; } /** * Safe Textarea shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.4 * @return string - html string. */ function vc_textarea_safe_form_field( $settings, $value ) { return ''; } /** * Textarea shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.4 * @return string - html string. */ function vc_textarea_form_field( $settings, $value ) { return ''; } /** * Attach images shortcode attribute type generator. * * @param $settings * @param $value * * @since 4.4 * * @param $tag * @param bool $single * * @return string - html string. */ function vc_attach_images_form_field( $settings, $value, $tag, $single = false ) { $output = ''; $param_value = wpb_removeNotExistingImgIDs( $value ); $output .= ''; $output .= ''; $output .= ''; if ( true === $single ) { $output .= '' . __( 'Add image', 'js_composer' ) . ''; //class: button } else { $output .= '' . __( 'Add images', 'js_composer' ) . ''; //class: button } return $output; } /** * Attach image shortcode attribute type generator. * * @param $settings * @param $value * * @param $tag * * @since 4.4 * @return string - html string. */ 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 * * @since 4.4 * @return string - html string. */ function vc_widgetised_sidebars_form_field( $settings, $value ) { $output = ''; $sidebars = $GLOBALS['wp_registered_sidebars']; $output .= ''; return $output; } PK2\\Dparams/params.phpnuW+A $script_name, 'script' => $script, ); } /** * @deprecated 4.4 - TODO check for usage * @not used * @since 4.2 */ public static function enqueueScripts() { // _deprecated_function( 'WpbakeryShortcodeParams::enqueueScripts', '4.4' ); if ( self::isEnqueue() ) { foreach ( self::$enqueue_script as $item ) { wp_register_script( $item['name'], $item['script'], array( 'jquery', 'wp-color-picker', ), WPB_VC_VERSION, true ); wp_enqueue_script( $item['name'] ); } } } /** * Create new attribute type * * @static * @since 4.2 * * @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 */ 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 ) ) { self::registerScript( $script_url ); self::$scripts[] = $script_url; } } return $result; } /** * Calls hook for attribute type * @since 4.2 * @static * * @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 */ 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. * @since 4.2 * @static * @return array - list of js scripts */ public static function getScripts() { return self::$scripts; } /** * @since 4.2 * * @param $value */ public static function setEnqueue( $value ) { self::$is_enqueue = (boolean) $value; } /** * @since 4.2 * @return bool */ public static function isEnqueue() { return self::$is_enqueue; } } /** * 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. * * @since 4.4 * @return bool */ function vc_add_shortcode_param( $name, $form_field_callback, $script_url = null ) { return WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url ); } /** * 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. * * @since 4.2 * @deprecated due to without prefix name 4.4 * @return bool */ function add_shortcode_param( $name, $form_field_callback, $script_url = null ) { _deprecated_function( 'add_shortcode_param', '4.4 (will be removed in 5.1)', 'vc_add_shortcode_param' ); return vc_add_shortcode_param( $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 * * @since 4.2 * @deprecated due to without prefix function 4.4 * @return mixed|string - returns html which will be render in hook */ function do_shortcode_param_settings_field( $name, $param_settings, $param_value, $tag ) { _deprecated_function( 'do_shortcode_param_settings_field', '4.4 (will be removed in 5.1)', 'vc_do_shortcode_param_settings_field' ); return vc_do_shortcode_param_settings_field( $name, $param_settings, $param_value, $tag ); } /** * Call hook for attribute. * * @param $name - attribute name * @param $param_settings - attribute settings from shortcode * @param $param_value - attribute value * @param $tag - attribute tag * * @since 4.4 * @return mixed|string - returns html which will be render in hook */ function vc_do_shortcode_param_settings_field( $name, $param_settings, $param_value, $tag ) { return WpbakeryShortcodeParams::renderSettingsField( $name, $param_settings, $param_value, $tag ); } /** * Helper function to create tag attributes string for linked attributes of shortcode. * * @param $settings * * @since 4.2 * @return string * @deprecated 4.8 */ function vc_generate_dependencies_attributes( $settings ) { _deprecated_function( 'vc_generate_dependencies_attributes', '4.8 (will be removed in 5.1)' ); return ''; } PK2\ yUparams/href/href.phpnuW+A' . '' . ''; } PK2\Ek"params/param_group/param_group.phpnuW+AsetSettings( $settings ); } /** * @param $param * @param $value * * @since 4.4 * @return mixed|void */ public function renderField( $param, $value ) { return parent::renderField( $param, $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; /** * @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 * * @since 4.4 * @return array */ public function params_to_arr( $param_name, $arr ) { $data = array(); foreach ( $arr as $param ) { $data[ $param_name . '_' . $param['param_name'] ] = $param['type']; } return $data; } /** * @since 4.4 * @return mixed|string */ public function render() { $output = ''; $edit_form = new Vc_ParamGroup_Edit_Form_Fields( $this->settings ); $settings = $this->settings; $output .= ''; $add_template = vc_include_template( 'params/param_group/add.tpl.php' ); $add_template = str_replace( '%content%', $content, $add_template ); $output .= ''; $output .= ''; 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 * * @since 4.4 * * vc_filter: vc_param_group_render_filter * * @return mixed|void rendered template for params in edit form */ 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' ); die( vc_param_group_clone_by_data( $tag, json_decode( urldecode( $param ), true ), json_decode( urldecode( $value ), true ) ) ); } /** * @param $tag * @param $params * @param $data * * @since 4.4 * @return mixed|string */ 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 = "
"; $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 .= '
'; $output = str_replace( '%content%', $value_block, $output ); return $output; } /** * @param $atts_string * * @since 4.4 * @return array|mixed */ 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 ); 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 = urlencode( json_encode( array( $defaults ) ) ); } return $value; } PK2\rvq`<<$params/google_fonts/google_fonts.phpnuW+A 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' => __('Select font family.','js_composer'), * 'font_style_description' => __('Select font styling.','js_composer') * ) * ), * 'description' => __( '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":"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":"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":"Bitter","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700: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":"Cinzel","font_styles":"regular,700,900","font_types":"400 regular:400:normal,700 bold regular:700:normal,900 bold regular:900:normal"},{"font_family":"Coda","font_styles":"regular,800","font_types":"400 regular:400:normal,800 bold regular:800:normal"},{"font_family":"Condiment","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Delius","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":"Droid Sans","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700: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":"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":"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":"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":"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":"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":"Libre Baskerville","font_styles":"regular,italic,700","font_types":"400 regular:400:normal,400 italic:400:italic,700 bold regular:700:normal"},{"font_family":"Lobster","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":"Merienda","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700: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":"Montserrat","font_styles":"regular,700","font_types":"400 regular:400:normal,700 bold regular:700: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":"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":"Nothing You Could Do","font_styles":"regular","font_types":"400 regular:400:normal"},{"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":"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":"Oleo Script","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":"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":"Oswald","font_styles":"300,regular,700","font_types":"300 light regular:300:normal,400 regular:400:normal,700 bold regular:700: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":"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 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":"Pacifico","font_styles":"regular","font_types":"400 regular:400:normal"},{"font_family":"Permanent Marker","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":"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":"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":"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":"Satisfy","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":"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":"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 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":"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":"Yeseva One","font_styles":"regular","font_types":"400 regular:400:normal"}]'; /** * @param $settings * @param $value * * @since 4.3 * @return string */ public function render( $settings, $value ) { $fields = array(); $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 * @since 4.3 * @return array List of available fonts as array of objects. {"font_family":"Abril * Fatface","font_styles":"regular","font_types":"400 regular:400:normal"} * * @return array */ 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 * * @since 4.3 * @return array */ 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 * * @since 4.3 * vc_filter: vc_google_fonts_render_filter * @return mixed|void rendered template for params in edit form * */ 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 ) ); } PK2\1]GG&params/column_offset/column_offset.phpnuW+A '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( __( '1 column - 1/12', 'js_composer' ) => '1', __( '2 columns - 1/6', 'js_composer' ) => '2', __( '3 columns - 1/4', 'js_composer' ) => '3', __( '4 columns - 1/3', 'js_composer' ) => '4', __( '5 columns - 5/12', 'js_composer' ) => '5', __( '6 columns - 1/2', 'js_composer' ) => '6', __( '7 columns - 7/12', 'js_composer' ) => '7', __( '8 columns - 2/3', 'js_composer' ) => '8', __( '9 columns - 3/4', 'js_composer' ) => '9', __( '10 columns - 5/6', 'js_composer' ) => '10', __( '11 columns - 11/12', 'js_composer' ) => '11', __( '12 columns - 1/1', 'js_composer' ) => '12', ); } /** * @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 '' . __( 'Default value from width attribute', 'js_composer' ) . ''; } $empty_label = 'xs' === $size ? '' : __( 'Inherit from smaller', 'js_composer' ); $output = ''; return $output; } /** * @param $size * * @return string */ public function offsetControl( $size ) { $prefix = 'vc_col-' . $size . '-offset-'; $empty_label = 'xs' === $size ? __( 'No offset', 'js_composer' ) : __( 'Inherit from smaller', 'js_composer' ); $output = ''; 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' ); PK2\T)^^!params/vc_grid_item/templates.phpnuW+A array( 'name' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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="' . __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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="' . __( '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' => __( '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' => __( '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="' . __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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' => __( '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]', ), ); PK2\^> /params/vc_grid_item/class-wpb-map-grid-item.phpnuW+A $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 ) ) { self::$gitem_user_categories[] = $c; } $values['_category_ids'][] = md5( $c ); } } else { if ( false === array_search( $categories, self::$gitem_user_categories ) ) { 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 array */ public static function getSortedGitemUserShortCodes() { self::generateGitemUserData(); return self::$gitem_user_sorted_sc; } /** * Get list of mapped shortcode settings for current user. * @static * @return array - associated array of shortcodes settings with tag as the key. */ 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 array */ public static function getGitemUserCategories() { self::generateGitemUserData(); return self::$gitem_user_categories; } } PK2\Ern<<Iparams/vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.phpnuW+A'; if ( isset( $category['category_name'] ) ) { $category['output'] .= '

' . esc_html( $category['category_name'] ) . '

'; } if ( isset( $category['category_description'] ) ) { $category['output'] .= '

' . esc_html( $category['category_description'] ) . '

'; } $category['output'] .= ''; $category['output'] .= '
'; if ( ! empty( $category['templates'] ) ) { foreach ( $category['templates'] as $template ) { $category['output'] .= $this->renderTemplateListItem( $template ); } } $category['output'] .= '
'; } return $category; } /** Output rendered template in modal dialog * @since 4.4 * * @param $template_name * @param $template_data * * @return string */ 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; } /** * @since 4.4 * * @param $templateName * @param $templateData * * @return string */ protected function renderTemplateWindowGridTemplate( $templateName, $templateData ) { ob_start(); $templateId = esc_attr( $templateData['unique_id'] ); $templateName = esc_html( $templateName ); $templateNameLower = strtolower( $templateName ); $templateType = esc_attr( isset( $templateData['type'] ) ? $templateData['type'] : 'custom' ); $customClass = esc_attr( isset( $templateData['custom_class'] ) ? $templateData['custom_class'] : '' ); $previewTemplateTitle = esc_attr( 'Preview template', 'js_composer' ); $addTemplateTitle = esc_attr( 'Preview template', 'js_composer' ); echo <<$templateName
HTML; return ob_get_clean(); } 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(); } if ( false !== ( $predefined_template = Vc_Grid_Item::predefinedTemplate( $template_id ) ) ) { echo trim( $predefined_template['template'] ); } } 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 ''; } 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' => __( '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' => __( '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 ); } 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; } public function getGridTemplates() { $list = Vc_Grid_Item::predefinedTemplates(); return $list; } } PK2\<  Hparams/vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.phpnuW+Apart( 'grid_builder' )->getState(); } } PK2\qq8params/vc_grid_item/editor/class-vc-grid-item-editor.phpnuW+Arender( get_post_type() ); } 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 ); } } 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', ), ) ); } public static function getPostTypesLabels() { return array( 'add_new_item' => __( 'Add Grid template', 'js_composer' ), 'name' => __( 'Grid Builder', 'js_composer' ), 'singular_name' => __( 'Grid template', 'js_composer' ), 'edit_item' => __( 'Edit Grid template', 'js_composer' ), 'view_item' => __( 'View Grid template', 'js_composer' ), 'search_items' => __( 'Search Grid templates', 'js_composer' ), 'not_found' => __( 'No Grid templates found', 'js_composer' ), 'not_found_in_trash' => __( 'No Grid templates found in Trash', 'js_composer' ), ); } /** * Rewrites validation for correct post_type of th post. * * @param string $type * @return bool */ 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', __( '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 * * @return mixed|void */ public function renderEditor( $post = null ) { if ( ! vc_user_access()->part( 'grid_builder' )->can()->get() ) { return; } add_filter( 'vc_wpbakery_shortcode_get_controls_list', array( $this, 'shortcodesControls', ) ); 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 ); return; } public function accessCheckShortcodeEdit( $null, $shortcode ) { return vc_user_access()->part( 'grid_builder' )->can()->get(); } 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' => __( 'Preview', 'js_composer' ), 'builder' => __( 'Builder', 'js_composer' ), 'add_template_message' => __( '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' ); } 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; } public function loadPredefinedTemplate( $template_id, $template_type ) { ob_start(); $this->templatesEditor()->load( $template_id ); return ob_get_clean(); } public function loadTemplate( $template_id, $template_type ) { if ( 'grid_templates' === $template_type ) { return $this->loadPredefinedTemplate( $template_id, $template_type ); } else if ( 'grid_templates_custom' === $template_type ) { return $this->templatesEditor()->loadCustomTemplate( $template_id ); } return $template_id; } 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(); } } PK2\VDD9params/vc_grid_item/editor/class-vc-grid-item-preview.phpnuW+Apost_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 ), ) ); } public function addCssBackgroundImage( $css ) { if ( empty( $css ) ) { $css = 'background-image: url(' . vc_asset_url( 'vc/vc_gitem_image.png' ) . ') !important'; } return $css; } public function addImageUrl( $url ) { if ( empty( $url ) ) { $url = vc_asset_url( 'vc/vc_gitem_image.png' ); } return $url; } public function addImage( $img ) { if ( empty( $img ) ) { $img = ''; } return $img; } /** * * @since 4.5 * * @param $link * * @param $atts * @param $css_class * @return string */ public function disableContentLink( $link, $atts, $css_class ) { return 'a' . ( strlen( $css_class ) > 0 ? ' class="' . esc_attr( $css_class ) . '"' : '' ); } /** * * @since 4.5 * * @param $link * * @param $atts * @param $post * @param $css_class * @return string */ 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 * @since 4.5 * * @param $link * * @return string */ 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(); } public function mockingPost() { $post = get_post( $this->post_id ); setup_postdata( $post ); $post->post_title = __( 'Post title', 'js_composer' ); $post->post_content = __( 'The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.', 'js_composer' ); $post->post_excerpt = __( '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; } 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; } public function addPlaceholderImage( $img ) { if ( null === $img || false === $img ) { $img = array( 'thumbnail' => '', ); } return $img; } } PK2\ߍ\T^ ^ ?params/vc_grid_item/editor/navbar/class-vc-navbar-grid-item.phpnuW+A'; } public function getControlPreviewTemplate() { return '
  • ' . '' . __( 'Preview', 'js_composer' ) . '' . '
  • '; } public function getControlEdit() { return '
  • ' . '' . '' . '
  • '; } /** * @return string */ public function getControlSaveBackend() { return '
  • ' . '' . __( 'Update', 'js_composer' ) . '' . '
  • '; } /** * @return string */ public function getControlPreviewItemWidth() { $output = '
  • '; return $output; } public function getControlAnimationList() { VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_VC_Gitem_Animated_Block' ); $output = ''; $animations = WPBakeryShortCode_VC_Gitem_Animated_Block::animations(); if ( is_array( $animations ) ) { $output .= '
  • ' . '
  • '; } return $output; } } PK2\+++"params/vc_grid_item/attributes.phpnuW+A 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|void */ 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 ); } 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 * * @since 4.5 * * @return mixed */ 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 ) ); if ( 'attachment' === $post->post_type ) { $src = wp_get_attachment_image_src( $post->ID, 'large' ); } else { $attachment_id = get_post_thumbnail_id( $post->ID ); $src = wp_get_attachment_image_src( $attachment_id, 'large' ); } if ( empty( $src ) && ! empty( $data ) ) { $output = esc_attr( rawurldecode( $data ) ); } elseif ( ! empty( $src ) ) { $output = $src[0]; } 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_attr( $link ) . '"' : ''; } /** * Add image url as href with css classes for PrettyPhoto js plugin. * * @param $value * @param $data * * @return string */ function vc_gitem_template_attribute_post_image_url_attr_prettyphoto( $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-rel="' . esc_attr( 'prettyPhoto[rel-' . md5( vc_request_param( 'shortcode_id' ) ) . ']' ) . '"'; return $href . $rel . ' class="' . esc_attr( $data . ( strlen( $href ) ? ' prettyphoto' : '' ) ) . '" title="' . esc_attr( apply_filters( 'vc_gitem_template_attribute_post_title', $post->post_title, $data_default ) ) . '"'; } /** * 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( strip_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 ) ); if ( 'attachment' === $post->post_type ) { $src = wp_get_attachment_image_src( $post->ID, 'large' ); } else { $attachment_id = get_post_thumbnail_id( $post->ID ); $src = wp_get_attachment_image_src( $attachment_id, 'large' ); } if ( ! empty( $src ) ) { $output = 'background-image: url(\'' . $src[0] . '\') !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 ); } 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(); } 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' ) ); } 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 ); PK2\%ww"params/vc_grid_item/shortcodes.phpnuW+AincludeClass( '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' => __( 'Add link', 'js_composer' ), 'param_name' => 'link', 'value' => array( __( 'None', 'js_composer' ) => 'none', __( 'Post link', 'js_composer' ) => 'post_link', __( 'Post author', 'js_composer' ) => 'post_author', __( 'Large image', 'js_composer' ) => 'image', __( 'Large image (prettyPhoto)', 'js_composer' ) => 'image_lightbox', __( 'Custom', 'js_composer' ) => 'custom', ), 'description' => __( 'Select link option.', 'js_composer' ), ) ); $zone_params = array( $vc_gitem_add_link_param, array( 'type' => 'vc_link', 'heading' => __( 'URL (Link)', 'js_composer' ), 'param_name' => 'url', 'dependency' => array( 'element' => 'link', 'value' => array( 'custom' ), ), 'description' => __( 'Add custom link.', 'js_composer' ), ), array( 'type' => 'checkbox', 'heading' => __( 'Use featured image on background?', 'js_composer' ), 'param_name' => 'featured_image', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'URL (Link)', 'js_composer' ), 'param_name' => 'url', 'dependency' => array( 'element' => 'link', 'value' => array( 'custom' ), ), 'description' => __( 'Add custom link.', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( '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' => __( 'Select element tag.', 'js_composer' ), 'text_align_description' => __( 'Select text alignment.', 'js_composer' ), 'font_size_description' => __( 'Enter font size.', 'js_composer' ), 'line_height_description' => __( 'Enter line height.', 'js_composer' ), 'color_description' => __( 'Select color for your element.', 'js_composer' ), ), ), ), array( 'type' => 'checkbox', 'heading' => __( 'Use custom fonts?', 'js_composer' ), 'param_name' => 'use_custom_fonts', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( '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' => __( 'Select element tag.', 'js_composer' ), 'text_align_description' => __( 'Select text alignment.', 'js_composer' ), 'font_size_description' => __( 'Enter font size.', 'js_composer' ), 'line_height_description' => __( 'Enter line height.', 'js_composer' ), 'color_description' => __( 'Select color for your element.', 'js_composer' ), ), ), 'group' => __( 'Custom fonts', 'js_composer' ), 'dependency' => array( 'element' => 'use_custom_fonts', 'value' => array( 'yes' ), ), ), array( 'type' => 'checkbox', 'heading' => __( 'Yes theme default font family?', 'js_composer' ), 'param_name' => 'use_theme_fonts', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( 'Yes font family from the theme.', 'js_composer' ), 'group' => __( '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' => __( 'Select font family.', 'js_composer' ), 'font_style_description' => __( 'Select font styling.', 'js_composer' ), ), ), 'group' => __( 'Custom fonts', 'js_composer' ), 'dependency' => array( 'element' => 'use_theme_fonts', 'value_not_equal_to' => 'yes', ), ), ); $list = array( 'vc_gitem' => array( 'name' => __( 'Grid Item', 'js_composer' ), 'base' => 'vc_gitem', 'is_container' => true, 'icon' => 'icon-wpb-gitem', 'content_element' => false, 'show_settings_on_create' => false, 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Main grid item', 'js_composer' ), 'params' => array( array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'A/B block', 'js_composer' ), 'content_element' => false, 'is_container' => true, 'show_settings_on_create' => false, 'icon' => 'icon-wpb-gitem-block', 'category' => __( 'Content', 'js_composer' ), 'controls' => array(), 'as_parent' => array( 'only' => array( 'vc_gitem_zone_a', 'vc_gitem_zone_b' ) ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( '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' => __( 'Zone', 'js_composer' ), 'base' => 'vc_gitem_zone', 'content_element' => false, 'is_container' => true, 'show_settings_on_create' => false, 'icon' => 'icon-wpb-gitem-zone', 'category' => __( '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' => __( 'Normal Block', 'js_composer' ), 'base' => 'vc_gitem_zone_a', 'content_element' => false, 'is_container' => true, 'show_settings_on_create' => false, 'icon' => 'icon-wpb-gitem-zone', 'category' => __( 'Content', 'js_composer' ), 'controls' => array( 'edit' ), 'as_parent' => array( 'only' => 'vc_gitem_row' ), 'js_view' => 'VcGitemZoneView', 'params' => array_merge( array( array( 'type' => 'dropdown', 'heading' => __( 'Height mode', 'js_composer' ), 'param_name' => 'height_mode', 'value' => array( '1:1' => '1-1', __( 'Original', 'js_composer' ) => 'original', '4:3' => '4-3', '3:4' => '3-4', '16:9' => '16-9', '9:16' => '9-16', __( 'Custom', 'js_composer' ) => 'custom', ), 'description' => __( 'Sizing proportions for height and width. Select "Original" to scale image without cropping.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Height', 'js_composer' ), 'param_name' => 'height', 'dependency' => array( 'element' => 'height_mode', 'value' => array( 'custom' ), ), 'description' => __( 'Enter custom height.', 'js_composer' ), ), ), $zone_params ), 'post_type' => Vc_Grid_Item_Editor::postType(), ), 'vc_gitem_zone_b' => array( 'name' => __( 'Hover Block', 'js_composer' ), 'base' => 'vc_gitem_zone_b', 'content_element' => false, 'is_container' => true, 'show_settings_on_create' => false, 'icon' => 'icon-wpb-gitem-zone', 'category' => __( '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' => __( 'Additional Block', 'js_composer' ), 'base' => 'vc_gitem_zone_c', 'content_element' => false, 'is_container' => true, 'show_settings_on_create' => false, 'icon' => 'icon-wpb-gitem-zone', 'category' => __( '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' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( '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' => __( 'Content', 'js_composer' ), 'description' => __( 'Place content elements inside the row', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( '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' => __( 'Place content elements inside the column', 'js_composer' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Width', 'js_composer' ), 'param_name' => 'width', 'value' => array( __( '1 column - 1/12', 'js_composer' ) => '1/12', __( '2 columns - 1/6', 'js_composer' ) => '1/6', __( '3 columns - 1/4', 'js_composer' ) => '1/4', __( '4 columns - 1/3', 'js_composer' ) => '1/3', __( '5 columns - 5/12', 'js_composer' ) => '5/12', __( '6 columns - 1/2', 'js_composer' ) => '1/2', __( '7 columns - 7/12', 'js_composer' ) => '7/12', __( '8 columns - 2/3', 'js_composer' ) => '2/3', __( '9 columns - 3/4', 'js_composer' ) => '3/4', __( '10 columns - 5/6', 'js_composer' ) => '5/6', __( '11 columns - 11/12', 'js_composer' ) => '11/12', __( '12 columns - 1/1', 'js_composer' ) => '1/1', ), 'description' => __( 'Select column width.', 'js_composer' ), 'std' => '1/1', ), array( 'type' => 'checkbox', 'heading' => __( 'Use featured image on background?', 'js_composer' ), 'param_name' => 'featured_image', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( 'Note: Featured image overwrites background image and color from "Design Options".', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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_data' => array( 'name' => __( 'Post data', 'js_composer' ), 'base' => 'vc_gitem_post_data', 'content_element' => false, 'category' => __( 'Post', 'js_composer' ), 'params' => array_merge( array( array( 'type' => 'textfield', 'heading' => __( 'Post data source', 'js_composer' ), 'param_name' => 'data_source', 'value' => 'ID', ) ), $post_data_params, $custom_fonts_params, array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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_title' => array( 'name' => __( 'Post Title', 'js_composer' ), 'base' => 'vc_gitem_post_title', 'icon' => 'vc_icon-vc-gitem-post-title', 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Title of current post', 'js_composer' ), 'params' => array_merge( $post_data_params, $custom_fonts_params, array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'Post Excerpt', 'js_composer' ), 'base' => 'vc_gitem_post_excerpt', 'icon' => 'vc_icon-vc-gitem-post-excerpt', 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Excerpt or manual excerpt', 'js_composer' ), 'params' => array_merge( $post_data_params, $custom_fonts_params, array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'Post Author', 'js_composer' ), 'base' => 'vc_gitem_post_author', 'icon' => 'vc_icon-vc-gitem-post-author', // @todo change icon ? 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Author of current post', 'js_composer' ), 'params' => array_merge( array( array( 'type' => 'checkbox', 'heading' => __( 'Add link', 'js_composer' ), 'param_name' => 'link', 'value' => '', 'description' => __( 'Add link to author?', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'js_composer' ), ), ), $custom_fonts_params, array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'Post Categories', 'js_composer' ), 'base' => 'vc_gitem_post_categories', 'icon' => 'vc_icon-vc-gitem-post-categories', // @todo change icon ? 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Categories of current post', 'js_composer' ), 'params' => array( array( 'type' => 'checkbox', 'heading' => __( 'Add link', 'js_composer' ), 'param_name' => 'link', 'value' => '', 'description' => __( 'Add link to category?', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Style', 'js_composer' ), 'param_name' => 'category_style', 'value' => array( __( 'None', 'js_composer' ) => ' ', __( 'Comma', 'js_composer' ) => ', ', __( 'Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-round-all', __( 'Less Rounded', 'js_composer' ) => 'filled vc_grid-filter-filled-rounded-all', __( 'Border', 'js_composer' ) => 'bordered', __( 'Rounded Border', 'js_composer' ) => 'bordered-rounded vc_grid-filter-filled-round-all', __( 'Less Rounded Border', 'js_composer' ) => 'bordered-rounded-less vc_grid-filter-filled-rounded-all', ), 'description' => __( 'Select category display style.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Color', 'js_composer' ), 'param_name' => 'category_color', 'value' => getVcShared( 'colors' ), 'std' => 'grey', 'param_holder_class' => 'vc_colored-dropdown', 'dependency' => array( 'element' => 'category_style', 'value_not_equal_to' => array( ' ', ', ' ), ), 'description' => __( 'Select category color.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Category size', 'js_composer' ), 'param_name' => 'category_size', 'value' => getVcShared( 'sizes' ), 'std' => 'md', 'description' => __( 'Select category size.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'js_composer' ), ), ), 'post_type' => Vc_Grid_Item_Editor::postType(), ), 'vc_gitem_image' => array( 'name' => __( 'Post Image', 'js_composer' ), 'base' => 'vc_gitem_image', 'icon' => 'vc_icon-vc-gitem-image', 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Featured image', 'js_composer' ), 'params' => array( $vc_gitem_add_link_param, array( 'type' => 'vc_link', 'heading' => __( 'URL (Link)', 'js_composer' ), 'param_name' => 'url', 'dependency' => array( 'element' => 'link', 'value' => array( 'custom' ), ), 'description' => __( 'Add custom link.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Image size', 'js_composer' ), 'param_name' => 'img_size', 'description' => __( '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' => __( 'Image alignment', 'js_composer' ), 'param_name' => 'alignment', 'value' => array( __( 'Left', 'js_composer' ) => '', __( 'Right', 'js_composer' ) => 'right', __( 'Center', 'js_composer' ) => 'center', ), 'description' => __( 'Select image alignment.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Image style', 'js_composer' ), 'param_name' => 'style', 'value' => getVcShared( 'single image styles' ), 'description' => __( 'Select image display style.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Border color', 'js_composer' ), 'param_name' => 'border_color', 'value' => getVcShared( 'colors' ), 'std' => 'grey', 'dependency' => array( 'element' => 'style', 'value' => array( 'vc_box_border', 'vc_box_border_circle', 'vc_box_outline', 'vc_box_outline_circle', ), ), 'description' => __( 'Border color.', 'js_composer' ), 'param_holder_class' => 'vc_colored-dropdown', ), vc_add_css_animation(), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( 'Design Options', 'js_composer' ), ), ), 'post_type' => Vc_Grid_Item_Editor::postType(), ), 'vc_gitem_post_date' => array( 'name' => __( 'Post Date', 'js_composer' ), 'base' => 'vc_gitem_post_date', 'icon' => 'vc_icon-vc-gitem-post-date', 'category' => __( 'Post', 'js_composer' ), 'description' => __( 'Post publish date', 'js_composer' ), 'params' => array_merge( $post_data_params, $custom_fonts_params, array( array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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' => __( 'Custom Field', 'js_composer' ), 'base' => 'vc_gitem_post_meta', 'icon' => 'vc_icon-vc-gitem-post-meta', 'category' => array( __( 'Elements', 'js_composer' ) ), 'description' => __( 'Custom fields data from meta values of the post.', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Field key name', 'js_composer' ), 'param_name' => 'key', 'description' => __( 'Enter custom field name to retrieve meta data value.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Label', 'js_composer' ), 'param_name' => 'label', 'description' => __( 'Enter label to display before key value.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Alignment', 'js_composer' ), 'param_name' => 'align', 'value' => array( __( 'Left', 'js_composer' ) => 'left', __( 'Right', 'js_composer' ) => 'right', __( 'Center', 'js_composer' ) => 'center', __( 'Justify', 'js_composer' ) => 'justify', ), 'description' => __( 'Select alignment.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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(); } $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(); } $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(); } $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' ) ) ); } $list['vc_single_image'] = array( 'name' => __( 'Single Image', 'js_composer' ), 'base' => 'vc_single_image', 'icon' => 'icon-wpb-single-image', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Simple image with CSS animation', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Widget title', 'js_composer' ), 'param_name' => 'title', 'description' => __( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Image source', 'js_composer' ), 'param_name' => 'source', 'value' => array( __( 'Media library', 'js_composer' ) => 'media_library', __( 'External link', 'js_composer' ) => 'external_link', ), 'std' => 'media_library', 'description' => __( 'Select image source.', 'js_composer' ), ), array( 'type' => 'attach_image', 'heading' => __( 'Image', 'js_composer' ), 'param_name' => 'image', 'value' => '', 'description' => __( 'Select image from media library.', 'js_composer' ), 'dependency' => array( 'element' => 'source', 'value' => 'media_library', ), ), array( 'type' => 'textfield', 'heading' => __( 'External link', 'js_composer' ), 'param_name' => 'custom_src', 'description' => __( 'Select external link.', 'js_composer' ), 'dependency' => array( 'element' => 'source', 'value' => 'external_link', ), ), vc_add_css_animation(), array( 'type' => 'textfield', 'heading' => __( 'Image size', 'js_composer' ), 'param_name' => 'img_size', 'description' => __( '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' => __( 'Image alignment', 'js_composer' ), 'param_name' => 'alignment', 'value' => array( __( 'Left', 'js_composer' ) => '', __( 'Right', 'js_composer' ) => 'right', __( 'Center', 'js_composer' ) => 'center', ), 'description' => __( 'Select image alignment.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Image style', 'js_composer' ), 'param_name' => 'style', 'value' => getVcShared( 'single image styles' ), 'description' => __( 'Select image display style.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Border color', 'js_composer' ), 'param_name' => 'border_color', 'value' => getVcShared( 'colors' ), 'std' => 'grey', 'dependency' => array( 'element' => 'style', 'value' => array( 'vc_box_border', 'vc_box_border_circle', 'vc_box_outline', 'vc_box_outline_circle' ), ), 'description' => __( 'Border color.', 'js_composer' ), 'param_holder_class' => 'vc_colored-dropdown', ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => __( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => __( '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] ); } $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' ); foreach ( $list['vc_custom_heading']['params'] as $k => $v ) { if ( in_array( $v['param_name'], $remove ) ) { 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(); } 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' => __( 'URL (Link)', 'js_composer' ), 'param_name' => 'url', 'dependency' => array( 'element' => 'link', 'value' => array( 'custom' ), ), 'description' => __( 'Add custom link.', 'js_composer' ), ); } else { array_unshift( $list[ $key ]['params'], array( 'type' => 'vc_link', 'heading' => __( 'URL (Link)', 'js_composer' ), 'param_name' => 'url', 'dependency' => array( 'element' => 'link', 'value' => array( 'custom' ), ), 'description' => __( 'Add custom link.', 'js_composer' ), ) ); } // Add link dropdown array_unshift( $list[ $key ]['params'], $vc_gitem_add_link_param ); } } return $list; PK2\b2-%-%*params/vc_grid_item/class-vc-grid-item.phpnuW+Ashortcodes ) { $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 ) { $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 ) { $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 ) { $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 ) { $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 ) { $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. */ 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 */ 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 ); $post && $this->setTemplate( $post->post_content, $post->ID ); return true; } elseif ( false !== ( $predefined_template = $this->predefinedTemplate( $id ) ) ) { $this->setTemplate( $predefined_template['template'], $id ); return true; } return false; } /** * Setter for template attribute. * * @param $template * @param $template_id */ public function setTemplate( $template, $template_id ) { $this->template = $template; $this->template_id = $template_id; $this->parseTemplate( $template ); } /** * Getter for template attribute. * @return string */ function template() { return $this->template; } /** * Add custom css from shortcodes that were mapped for vc grid item. * @return string */ 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 ); } elseif ( false !== ( $predefined_template = $this->predefinedTemplate( $id ) ) ) { $shortcodes_custom_css = visual_composer()->parseShortcodesCustomCss( $predefined_template['template'] ); } if ( ! empty( $shortcodes_custom_css ) ) { $shortcodes_custom_css = strip_tags( $shortcodes_custom_css ); $output .= ''; } return $output; } /** * Generates html with template's variables for rendering new project. * * @param $template */ 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 ); $this->html_template .= do_shortcode( $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 */ 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|void */ 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; } /** * Set elements templates. */ protected function setShortcodes() { foreach ( $this->shortcodes() as $tag => $settings ) { add_shortcode( $tag, array( $this, vc_camel_case( $tag . '_shortcode' ) ) ); } } // }} } PK2\PiSSS&params/params_preset/params_preset.phpnuW+A'; 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 .= ''; } } $output .= ''; return $output; } PK2\xY{{helpers/helpers.phpnuW+A 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 = ''; if ( is_string( $thumb_size ) && ( ( ! empty( $_wp_additional_image_sizes[ $thumb_size ] ) && is_array( $_wp_additional_image_sizes[ $thumb_size ] ) ) || in_array( $thumb_size, array( 'thumbnail', 'thumb', 'medium', 'large', 'full', ) ) ) ) { $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(); if ( count( $thumb_matches[0] ) > 1 ) { $thumb_size[] = $thumb_matches[0][0]; // width $thumb_size[] = $thumb_matches[0][1]; // height } elseif ( count( $thumb_matches[0] ) > 0 && count( $thumb_matches[0] ) < 2 ) { $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( strip_tags( get_post_meta( $attach_id, '_wp_attachment_image_alt', true ) ) ); $attachment = get_post( $attach_id ); if ( ! empty( $attachment ) ) { $title = trim( strip_tags( $attachment->post_title ) ); if ( empty( $alt ) ) { $alt = trim( strip_tags( $attachment->post_excerpt ) ); // If not, Use the Caption } if ( empty( $alt ) ) { $alt = $title; } // Finally, use the 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 = ''; } } } } $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 $width * * @deprecated 4.5 * @since 4.2 * @return string */ function wpb_getColumnControls( $width ) { _deprecated_function( 'wpb_getColumnControls', '4.5 (will be removed in 5.1)' ); switch ( $width ) { case 'vc_col-md-2' : $w = '1/6'; break; 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 = $width; } return $w; } /* Convert vc_col-sm-3 to 1/4 ---------------------------------------------------------- */ /** * @param $width * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return bool|string */ function wpb_translateColumnWidthToSpan( $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 ) { $width = 'vc_col-sm-' . $value; } } } return $width; } /** * @param $content * @param bool $autop * * @since 4.2 * @return string */ function wpb_js_remove_wpautop( $content, $autop = false ) { if ( $autop ) { // Possible to use !preg_match('('.WPBMap::getTagsRegexp().')', $content) $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 * * @since 4.2 * @return bool */ function shortcode_exists( $shortcode = false ) { global $shortcode_tags; if ( ! $shortcode ) { return false; } if ( array_key_exists( $shortcode, $shortcode_tags ) ) { return true; } return false; } } /* Helper function which returns list of site attached images, and if image is attached to the current post it adds class 'added' ---------------------------------------------------------- */ if ( ! function_exists( 'vc_siteAttachedImages' ) ) { /** * @param array $att_ids * * @since 4.11 * @return string */ 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 ) ) ? ' class="added"' : ''; $output .= ' ' . __( 'Added', 'js_composer' ) . ' '; } if ( '' !== $output ) { $output = ''; } return $output; } } /** * @param array $images IDs or srcs of images * * @since 4.2 * @return string */ function fieldAttachedImages( $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 .= '
  • '; } } return $output; } /** * @param $param_value * * @since 4.2 * @return array */ 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 * * php 5.2+ * * Exemplo de uso: * * * * */ if ( ! function_exists( 'wpb_resize' ) ) { /** * @param int $attach_id * @param string $img_url * @param int $width * @param int $height * @param bool $crop * * @since 4.2 * @return array */ function wpb_resize( $attach_id = null, $img_url = null, $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 = 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 ( false == $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; } } if ( ! function_exists( 'wpb_debug' ) ) { /** * Returns bool if wpb_debug is provided in url - set visual composer debug mode. * Used for example in shortcodes (end block comment for example) * @since 4.2 * @return bool */ function wpb_debug() { if ( ( isset( $_GET['wpb_debug'] ) && 'true' === $_GET['wpb_debug'] ) || ( isset( $_GET['vc_debug'] ) && 'true' === $_GET['vc_debug'] ) ) { return true; } else { 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 * * @since 4.2 * @return array */ 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 * * @since 4.2 * @return string */ 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 = $width = $el_position = ''; $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 * * @since 4.2 * @return string */ function vc_convert_tab_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 ) ) ); $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 * * @since 4.2 * @return string */ 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( /* * How to count mask? * mask = column_count . sum of all numbers. Example layout 12_12 mask = (column count=2)(1+2+1+2=6)= 26 */ 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', ), ); /** * @param $width * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return string */ 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; } } else if ( 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 * * @since 4.2 * @return array|bool */ 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 * * @since 4.2 * @return array */ 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] ] = rawurldecode( $param[1] ); } } } return $result; } /** * @param $string * * @deprecated 4.5 * @since 4.2 * @return string */ function wpb_stripslashes_if_gpc_magic_quotes( $string ) { _deprecated_function( 'wpb_stripslashes_if_gpc_magic_quotes', '4.5 (will be removed in 5.1)', 'stripslashes' ); if ( get_magic_quotes_gpc() ) { return stripslashes( $string ); } else { return $string; } } /** * @param $v * * @since 4.2 * @return string */ function vc_param_options_parse_values( $v ) { return rawurldecode( $v ); } /** * @param $name * @param $settings * * @since 4.2 * @return bool */ 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 * * @since 4.2 * @return string */ function vc_convert_atts_to_string( $atts ) { $output = ''; foreach ( $atts as $key => $value ) { $output .= ' ' . $key . '="' . $value . '"'; } return $output; } /** * @param $string * @param $tag * @param $param * * @since 4.2 * @return array */ function vc_parse_options_string( $string, $tag, $param ) { $options = $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 = $option_settings_list[ $option_name ] = vc_param_options_get_settings( $option_name, $settings['options'] ); 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'] ] = (boolean) $options[ $setting_option['name'] ]; } } } } return $options; } /** * @since 4.2 * @deprecated 4.2 */ function wpb_js_composer_check_version_schedule_deactivation() { _deprecated_function( 'wpb_js_composer_check_version_schedule_deactivation', '4.2 (will be removed in 5.1)' ); wp_clear_scheduled_hook( 'wpb_check_for_update' ); delete_option( 'wpb_js_composer_show_new_version_message' ); } /** * Helper function to add new third-party adaptation class. * @deprecated 4.4 * @since 4.3 * * @param Vc_Vendor_Interface $vendor - instance of class. */ function vc_add_vendor( Vc_Vendor_Interface $vendor ) { _deprecated_function( 'vc_add_vendor', '4.4 (will be removed in 5.1)', 'autoload logic' ); visual_composer()->vendorsManager()->add( $vendor ); } /** * Convert string to a valid css class name. * * @since 4.3 * * @param string $class * * @return string */ function vc_build_safe_css_class( $class ) { return preg_replace( '/\W+/', '', strtolower( str_replace( ' ', '_', strip_tags( $class ) ) ) ); } /** * Include template from templates dir. * * @since 4.3 * * @param $template * @param array $variables - passed variables to the template. * * @param bool $once * * @return mixed */ 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. * * @since 4.4 * * @param $template * @param array $variables - passed variables to the template. * * @param bool $once * * @return string */ function vc_get_template( $template, $variables = array(), $once = false ) { ob_start(); vc_include_template( $template, $variables, $once ); return ob_get_clean(); } /** * if php version < 5.3 this function is required. */ if ( ! function_exists( 'lcfirst' ) ) { /** * @param $str * * @since 4.3, fix #1093 * @return mixed */ 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. * * @since 4.3 * * @param string $value * * @return string */ function vc_studly( $value ) { $value = ucwords( str_replace( array( '-', '_', ), ' ', $value ) ); return str_replace( ' ', '', $value ); } /** * VC Convert a value to camel case. * * @since 4.3 * * @param string $value * * @return string */ function vc_camel_case( $value ) { return lcfirst( vc_studly( $value ) ); } /** * Enqueue icon element font * @todo move to separate folder * @since 4.4 * * @param $font */ function vc_icon_element_fonts_enqueue( $font ) { switch ( $font ) { case 'fontawesome': wp_enqueue_style( 'font-awesome' ); 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' * * @since 4.4 * * @param array $defaults * @param array $attributes * * @return array - merged attributes * * @see vc_map_get_attributes */ function vc_shortcode_attribute_parse( $defaults = array(), $attributes = array() ) { $atts = $attributes + shortcode_atts( $defaults, $attributes ); return $atts; } 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 * * @since 4.5 * * @param $message * * @return string */ function vc_message_warning( $message ) { return '

    ' . $message . '

    '; } /** * Extract video ID from youtube url * * @param string $url Youtube url * * @return string */ function vc_extract_youtube_id( $url ) { parse_str( parse_url( $url, PHP_URL_QUERY ), $vars ); if ( ! isset( $vars['v'] ) ) { return ''; } return $vars['v']; } function vc_taxonomies_types() { global $vc_taxonomies_types; if ( is_null( $vc_taxonomies_types ) ) { $vc_taxonomies_types = get_taxonomies( array( 'public' => true ), 'objects' ); } return $vc_taxonomies_types; } /** * Since * * @since 4.5.3 * * @param $term * * @return array */ 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 : __( 'Taxonomies', 'js_composer' ), ); } /** * Extract width/height from string * * @param string $dimensions WxH * * @since 4.7 * * @return mixed array(width, height) or false */ function vcExtractDimensions( $dimensions ) { $dimensions = str_replace( ' ', '', $dimensions ); $matches = null; if ( preg_match( '/(\d+)x(\d+)/', $dimensions, $matches ) ) { return array( $matches[1], $matches[2], ); } return false; } /** * 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 ) ) ); } /** * 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 ); } function vc_is_responsive_disabled() { $disable_responsive = vc_settings()->get( 'not_responsive_css' ); return '1' === $disable_responsive; } /** * @deprecated 4.2 * @since 4.2 * @return mixed|string|void */ function get_row_css_class() { _deprecated_function( 'get_row_css_class', '4.2 (will be removed in 5.1)' ); $custom = vc_settings()->get( 'row_css_class' ); return ! empty( $custom ) ? $custom : 'vc_row-fluid'; } /** * @deprecated and will be removed * @since 4.2 * @return int */ function vc_get_interface_version() { _deprecated_function( 'vc_get_interface_version', '4.2 (will be removed in 5.1)' ); return 2; } /** * @deprecated and will be removed. * @since 4.2 * @return int */ function vc_get_initerface_version() { _deprecated_function( 'vc_get_initerface_version', '4.2 (will be removed in 5.1)' ); return vc_get_interface_version(); } /** * Do shortcode single render point * * @param $atts * @param null $content * @param null $tag * * @return string */ function vc_do_shortcode( $atts, $content = null, $tag = null ) { return Vc_Shortcodes_Manager::getInstance()->getElementClass( $tag )->output( $atts, $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[ rand( 0, $len - 1 ) ]; } return $str; } function vc_slugify( $str ) { $str = strtolower( $str ); $str = html_entity_decode( $str ); $str = preg_replace( '/[^\w ]+/', '', $str ); $str = preg_replace( '/ +/', '-', $str ); return $str; } PK2\&2IGIGhelpers/helpers_api.phpnuW+AsetIsAsTheme( true ); } } if ( ! function_exists( 'vc_is_as_theme' ) ) { /** * Is VC as-theme-plugin. * @since 4.2 * @return bool */ function vc_is_as_theme() { return vc_manager()->isAsTheme(); } } if ( ! function_exists( 'vc_is_updater_disabled' ) ) { /** * @since 4.2 * @return bool */ function vc_is_updater_disabled() { return vc_manager()->isUpdaterDisabled(); } } if ( ! function_exists( 'vc_default_editor_post_types' ) ) { /** * Returns list of default post type. * @since 4.2 * @return array */ 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. * @since 4.2 * * @param array $list - list of valid post types to set */ 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. * @since 4.2 * @return array */ 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. * @since 4.4 * * @param array $post_types * */ function vc_editor_set_post_types( array $post_types ) { vc_manager()->setEditorPostTypes( $post_types ); } } if ( ! function_exists( 'vc_mode' ) ) { /** * Return current VC mode. * @since 4.2 * @see Vc_Mapper::$mode * @return string */ function vc_mode() { return vc_manager()->mode(); } } if ( ! function_exists( 'vc_set_shortcodes_templates_dir' ) ) { /** * Sets directory where Visual Composer should look for template files for content elements. * @since 4.2 * * @param string - full directory path to new template directory with trailing slash */ function vc_set_shortcodes_templates_dir( $dir ) { vc_manager()->setCustomUserShortcodesTemplateDir( $dir ); } } if ( ! function_exists( 'vc_shortcodes_theme_templates_dir' ) ) { /** * Get custom theme template path * @since 4.2 * * @param $template - filename for template * * @return string */ function vc_shortcodes_theme_templates_dir( $template ) { return vc_manager()->getShortcodesTemplateDir( $template ); } } if ( ! function_exists( 'vc_set_template_dir' ) ) { /** * Sets directory where Visual Composer should look for template files for content elements. * @since 4.2 * @deprecated 4.2 * * @param string - full directory path to new template directory with trailing slash */ function vc_set_template_dir( $dir ) { _deprecated_function( 'vc_set_template_dir', '4.2 (will be removed in 5.1)', 'vc_set_shortcodes_templates_dir' ); vc_set_shortcodes_templates_dir( $dir ); } } /** * @param bool $value * * @todo check usage. * * @since 4.3 */ function set_vc_is_inline( $value = true ) { global $vc_is_inline; $vc_is_inline = $value; } /** * Disable frontend editor for VC * @since 4.3 * * @param bool $disable */ function vc_disable_frontend( $disable = true ) { vc_frontend_editor()->disableInline( $disable ); } /** * Check is front end enabled. * @since 4.3 * @return bool */ 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) * * @since 4.3 * @return bool */ function vc_add_default_templates( $data ) { return visual_composer() ->templatesPanelEditor() ->addDefaultTemplates( $data ); } } 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 $shortcode WPBakeryShortCodeFishBones */ $params = isset( $shortcode_data['params'] ) && ! empty( $shortcode_data['params'] ) ? $shortcode_data['params'] : false; if ( is_array( $params ) && ! empty( $params ) ) { $keys = array_keys( $params ); for ( $i = 0; $i < count( $keys ); $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) * * @internal * * @param $param * @param $change_fields * * @return array|null */ 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'] ) ) { $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 ) { 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['exclude_regex'] ) && strlen( $change_fields['exclude_regex'] ) > 0 ) { if ( false === @preg_match( $change_fields['exclude_regex'], null ) ) { // Regular expression is invalid, (don't remove @). } else { 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'] ) ) { // 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 ) { 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 ) { 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; } /** * @internal used to add dependency to existed param * * @param $param * @param $dependency * * @return array */ 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; } 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; } 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; } 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 ) { 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; } function vc_map_add_css_animation( $label = true ) { $data = array( 'type' => 'animation_style', 'heading' => __( 'CSS Animation', 'js_composer' ), 'param_name' => 'css_animation', 'admin_label' => $label, 'value' => '', 'settings' => array( 'type' => 'in', 'custom' => array( array( 'label' => __( 'Default', 'js_composer' ), 'values' => array( __( 'Top to bottom', 'js_composer' ) => 'top-to-bottom', __( 'Bottom to top', 'js_composer' ) => 'bottom-to-top', __( 'Left to right', 'js_composer' ) => 'left-to-right', __( 'Right to left', 'js_composer' ) => 'right-to-left', __( 'Appear from center', 'js_composer' ) => 'appear', ), ), ), ), 'description' => __( 'Select type of animation for element to be animated when it "enters" the browsers viewport (Note: works only in modern browsers).', 'js_composer' ), ); /* array( 'label' => __( 'Slide Exits', 'js_composer' ), 'values' => array( __( 'slideOutDown', 'js_composer' ) => array( 'value' => 'slideOutDown', 'type' => 'out', ), __( 'slideOutLeft', 'js_composer' ) => array( 'value' => 'slideOutLeft', 'type' => 'out', ), __( 'slideOutRight', 'js_composer' ) => array( 'value' => 'slideOutRight', 'type' => 'out', ), __( 'slideOutUp', 'js_composer' ) => array( 'value' => 'slideOutUp', 'type' => 'out', ), ), ) */ return apply_filters( 'vc_map_add_css_animation', $data, $label ); } /** * Get settings of the mapped shortcode. * * @param $tag * * @since 4.4.3 * @return array|null - settings or null if shortcode not mapped */ 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. * @since 4.6 * * @param $tag - shortcode tag * * @return array - list of param=>default_value */ 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 * * @since 4.12 * @return array */ 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 $atts - shortcode attributes * * @return array - return merged values with provided attributes ( * 'a'=>1,'b'=>2 + 'b'=>3,'c'=>4 --> 'a'=>1,'b'=>3 ) * * @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() ) { return shortcode_atts( vc_map_get_defaults( $tag ), $atts, $tag ); } /** * New Vc now called Frontend editor * @deprecated 4.7 * @return Vc_Frontend_Editor * @since 4.3 */ function new_vc() { _deprecated_function( 'new_vc', '4.7 (will be removed in 5.1)', 'vc_frontend_editor' ); return vc_frontend_editor(); } PK2\4a,a,!helpers/class-vc-color-helper.phpnuW+A * 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 */ 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" */ 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]; } else if ( 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 ); } 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 */ public static function hexToHsl( $color ) { // Sanity check $color = self::_checkHex( $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 ( 0 != $del_Max ) { 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 ( 0 == $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( $var_1, $var_2, $H + ( 1 / 3 ) ) ), 255 ); $g = self::clamp( round( 255.0 * self::_huetorgb( $var_1, $var_2, $H ) ), 255 ); $b = self::clamp( round( 255.0 * self::_huetorgb( $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 */ public static function hexToRgb( $color ) { // Sanity check $color = self::_checkHex( $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 */ public function darken( $amount = self::DEFAULT_ADJUST ) { // Darken $darkerHSL = $this->_darken( $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 */ public function lighten( $amount = self::DEFAULT_ADJUST ) { // Lighten $lighterHSL = $this->_lighten( $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 */ public function mix( $hex2, $amount = 0 ) { $rgb2 = self::hexToRgb( $hex2 ); $mixed = $this->_mix( $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 */ 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 * */ 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( $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( $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( $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( $v1, $v2, $vH ) { if ( $vH < 0 ) { $vH += 1; } if ( $vH > 1 ) { $vH -= 1; } 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 _checkHex( $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]; } else if ( strlen( $color ) != 6 ) { throw new Exception( 'HEX color needs to be 6 or 3 digits long' ); } return $color; } } PK2\Zy,44helpers/helpers_factory.phpnuW+Avc(); } } if ( ! function_exists( 'vc_mapper' ) ) { /** * Shorthand for Vc Mapper. * @since 4.2 * @return Vc_Mapper */ function vc_mapper() { return vc_manager()->mapper(); } } if ( ! function_exists( 'vc_settings' ) ) { /** * Shorthand for Visual composer settings. * @since 4.2 * @return Vc_Settings */ function vc_settings() { return vc_manager()->settings(); } } if ( ! function_exists( 'vc_license' ) ) { /** * Get License manager * @since 4.2 * @return Vc_License */ function vc_license() { return vc_manager()->license(); } } if ( ! function_exists( 'vc_automapper' ) ) { /** * @since 4.2 * @return Vc_Automapper */ function vc_automapper() { return vc_manager()->automapper(); } } if ( ! function_exists( 'vc_frontend_editor' ) ) { /** * Shorthand for VC frontend editor * @since 4.2 * @return Vc_Frontend_Editor */ function vc_frontend_editor() { return vc_manager()->frontendEditor(); } } if ( ! function_exists( 'vc_backend_editor' ) ) { /** * Shorthand for VC frontend editor * @since 4.2 * @return Vc_Backend_Editor */ function vc_backend_editor() { return vc_manager()->backendEditor(); } } if ( ! function_exists( 'vc_updater' ) ) { /** * @since 4.2 * @return Vc_Updater */ function vc_updater() { return vc_manager()->updater(); } } if ( ! function_exists( 'vc_is_network_plugin' ) ) { /** * Vc is network plugin or not. * @since 4.2 * @return bool */ 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 * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return string */ function vc_asset_url( $file ) { return vc_manager()->assetUrl( $file ); } } if ( ! function_exists( 'vc_upload_dir' ) ) { /** * Temporary files upload dir; * @since 4.2 * @return string */ function vc_upload_dir() { return vc_manager()->uploadDir(); } } if ( ! function_exists( 'vc_template' ) ) { /** * @param $file * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return null|string - null for undefined param. */ function vc_post_param( $param, $default = null ) { 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 * * @since 4.2 * @return null|string - null for undefined param. */ function vc_get_param( $param, $default = null ) { return isset( $_GET[ $param ] ) ? $_GET[ $param ] : $default; } } if ( ! function_exists( 'vc_request_param' ) ) { /** * Get param value from $_REQUEST if exists. * * @param $param * @param $default * * @since 4.4 * @return null|string - null for undefined param. */ function vc_request_param( $param, $default = null ) { return isset( $_REQUEST[ $param ] ) ? $_REQUEST[ $param ] : $default; } } if ( ! function_exists( 'vc_is_frontend_editor' ) ) { /** * @since 4.2 * @return bool */ function vc_is_frontend_editor() { return 'admin_frontend_editor' === vc_mode(); } } if ( ! function_exists( 'vc_is_page_editable' ) ) { /** * @since 4.2 * @return bool */ function vc_is_page_editable() { return 'page_editable' === vc_mode(); } } if ( ! function_exists( 'vc_action' ) ) { /** * Get VC special action param. * @since 4.2 * @return string|null */ function vc_action() { $vc_action = null; if ( isset( $_GET['vc_action'] ) ) { $vc_action = $_GET['vc_action']; } elseif ( isset( $_POST['vc_action'] ) ) { $vc_action = $_POST['vc_action']; } return $vc_action; } } if ( ! function_exists( 'vc_is_inline' ) ) { /** * Get is inline or not. * @since 4.2 * @return bool */ 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' ) ) { /** * @since 4.2 * @return bool */ 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 ) * @since 4.2 * @return bool */ function vc_is_editor() { return vc_is_frontend_editor(); } /** * @param $value * @param bool $encode * * @since 4.2 * @return string */ function vc_value_from_safe( $value, $encode = false ) { $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; } /** * @since 4.2 * * @param bool $disable */ function vc_disable_automapper( $disable = true ) { vc_automapper()->setDisabled( $disable ); } /** * @since 4.2 * @return bool */ function vc_automapper_is_disabled() { return vc_automapper()->disabled(); } /** * @param $param * @param $value * * @since 4.2 * @return mixed|string */ 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 * * @since 4.2 * @return string */ 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 * * @since 4.2 * @return string */ 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 * * @since 4.9 * @return bool */ 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. * * @since 4.2 * @return string */ function vc_plugin_name() { return vc_manager()->pluginName(); } /** * @since 4.4.3 used in vc_base when getting an custom css output * * @param $filename * * @param bool $partial * @return bool|mixed|string */ function vc_file_get_contents( $filename, $partial = false ) { global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once( ABSPATH . '/wp-admin/includes/file.php' ); WP_Filesystem(); } /** @var $wp_filesystem WP_Filesystem_Base */ if ( ! is_object( $wp_filesystem ) || ! $output = $wp_filesystem->get_contents( $filename ) ) { /*if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) { } elseif ( ! $wp_filesystem->connect() ) { } elseif ( ! $wp_filesystem->is_writable( $filename ) ) { } else { }*/ $output = file_get_contents( $filename ); } return $output; } /** * HowTo: vc_role_access()->who('administrator')->with('editor')->can('frontend_editor'); * @since 4.8 * @return Vc_Role_Access; */ function vc_role_access() { return vc_manager()->getRoleAccess(); } /** * Get access manager for current user. * HowTo: vc_user_access()->->with('editor')->can('frontend_editor'); * @since 4.8 * @return Vc_Current_User_Access; */ function vc_user_access() { return vc_manager()->getCurrentUserAccess(); } 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' => $partObj->getState(), 'state_key' => $partObj->getStateKey(), 'capabilities' => $partObj->getAllCaps(), ); } return $capabilities; } /** * Return a $_GET action param for ajax * @since 4.8 * @return bool */ function vc_wp_action() { return isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; } /** * @param $data * * @return string */ function vc_generate_nonce( $data ) { return wp_create_nonce( is_array( $data ) ? ( 'vc-nonce-' . implode( '|', $data ) ) : ( 'vc-nonce-' . $data ) ); } /** * @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' ); } 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() ); } else if ( true === $state && ! in_array( $type, vc_default_editor_post_types() ) ) { $valid = false; } else { $valid = vc_user_access()->part( 'post_types' )->can( $type )->get(); } } return $valid; } function vc_user_access_check_shortcode_edit( $shortcode ) { $do_check = apply_filters( 'vc_user_access_check-shortcode_edit', null, $shortcode ); 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; } } function vc_user_access_check_shortcode_all( $shortcode ) { $do_check = apply_filters( 'vc_user_access_check-shortcode_all', null, $shortcode ); 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 * * @since 4.8 * * @param mixed $value The value to be stripped. * * @return mixed Stripped value. */ 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; } function vc_str_remove_protocol( $str ) { return str_replace( array( 'https://', 'http://', ), '//', $str ); } PK2\ڵhelpers/filters.phpnuW+A'.$params['title'].''; * } * * @param array $params * * @return mixed|string|void */ function wpb_widget_title( $params = array( 'title' => '' ) ) { if ( '' === $params['title'] ) { return ''; } $extraclass = ( isset( $params['extraclass'] ) ) ? ' ' . $params['extraclass'] : ''; $output = '

    ' . $params['title'] . '

    '; return apply_filters( 'wpb_widget_title', $output, $params ); } /* Available filters in default.php wpb_toggle_heading Available filters in buttons.php wpb_cta_text Available filters in teaser_grid.php vc_teaser_grid_title vc_teaser_grid_thumbnail vc_teaser_grid_content vc_teaser_grid_carousel_arrows */ PK2\>bOOautoload/params-to-init.phpnuW+A if ( window.vc ) { window.vc.required_params_to_init = [' . implode( ',', $js_array ) . ']; } '; } PK2\B 'autoload/post-type-default-template.phpnuW+AisValidPostType( $post->post_type ) ) { return $post_content; } $template_settings = new Vc_Setting_Post_Type_Default_Template_Field( 'general', 'default_template_post_type' ); if ( ( $new_post_content = $template_settings->getTemplateByPostType( $post->post_type ) ) !== null ) { 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; function __construct( $tab, $key ) { $this->tab = $tab; $this->key = $key; add_action( 'vc_settings_tab-general', array( $this, 'addField', ) ); } protected function getFieldName() { return __( 'Default template for post types', 'js_composer' ); } protected function getFieldKey() { require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-settings.php' ); return Vc_Settings::getFieldPrefix() . $this->key; } protected function isValidPostType( $type ) { return post_type_exists( $type ); } 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; } protected function getTemplates() { return $this->getTemplatesEditor()->getAllTemplates(); } protected function getTemplatesEditor() { return visual_composer()->templatesPanelEditor(); } /** * Get settings data for default templates * * @return array|mixed|void */ protected function get() { require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-settings.php' ); return ( $value = Vc_Settings::get( $this->key ) ) ? $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( $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; } public function getTemplateByPostType( $type ) { $value = $this->get(); return isset( $value[ $type ] ) ? $this->getTemplate( $value[ $type ] ) : null; } public function sanitize( $settings ) { foreach ( $settings as $type => $template ) { if ( empty( $template ) ) { unset( $settings[ $type ] ); } else if ( ! $this->isValidPostType( $type ) || ! $this->getTemplate( $template ) ) { add_settings_error( $this->getFieldKey(), 1, __( '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 ); } PK2\autoload/components.jsonnuW+A{ "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/wp_customize.php": "", "vendors/yoast_seo.php": "", "vendors/wpml.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", "backend-editor-ie.php": "add ie9 degradation", "frontend-editor-ie.php": "add ie9 degradation", "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" }PK2\@\??autoload/backend-editor-ie.phpnuW+A'; } add_action( 'vc_backend_editor_footer_render', 'vc_add_ie9_degradation' ); PK2\Om&RR&autoload/class-vc-settings-presets.phpnuW+A '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'], 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 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; } } PK2\4 v$SSautoload/hook-vc-wp-text.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Wp_Text' ); add_filter( 'vc_edit_form_fields_attributes_vc_wp_text', array( 'WPBakeryShortCode_VC_Wp_Text', 'convertTextAttributeToContent', ) ); } PK2\zI  autoload/ui-vc-pointers.phpnuW+Aid; // 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 ) || 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' => __( 'Finish', 'js_composer' ), 'next' => __( 'Next', 'js_composer' ), 'prev' => __( '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' ); PK2\KX $autoload/class-vc-vendor-presets.phpnuW+A $shortcode, 'default' => $default, 'params' => $params, 'title' => $title, ); $id = md5( serialize( $preset ) ); self::$presets[ $id ] = $preset; return true; } /** * Get specific vendor preset * * @since 4.8 * * @param string $id * * @return mixed array|false */ public function get( $id ) { if ( isset( self::$presets[ $id ] ) ) { return self::$presets[ $id ]; } return false; } /** * Get all vendor presets for specific shortcode * * @since 4.8 * * @param string $shortcode * * @return array */ 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 * * @since 4.8 * * @return array */ public function getDefaults() { $list = array(); $added = array(); foreach ( self::$presets as $id => $preset ) { if ( $preset['default'] && ! in_array( $preset['shortcode'], $added ) ) { $added[] = $preset['shortcode']; $list[ $id ] = $preset; } } return $list; } /** * Get ID of default preset for specific shortcode * * If multiple presets are default, return first * * @since 4.8 * * @param string $shortcode * * @return string|null */ public function getDefaultId( $shortcode ) { foreach ( self::$presets as $id => $preset ) { if ( $shortcode === $preset['shortcode'] && $preset['default'] ) { return $id; } } return null; } } PK2\|O!autoload/vendors/qtranslate-x.phpnuW+Aload(); } } PK2\  autoload/vendors/woocommerce.phpnuW+A '' ); foreach ( $gravity_forms as $gravity_form ) { $gravity_forms_array[ $gravity_form->title ] = $gravity_form->id; } } } vc_map( array( 'name' => __( 'Gravity Form', 'js_composer' ), 'base' => 'gravityform', 'icon' => 'icon-wpb-vc_gravityform', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Gravity form', 'js_composer' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Form', 'js_composer' ), 'param_name' => 'id', 'value' => $gravity_forms_array, 'save_always' => true, 'description' => __( 'Select a form to add it to your post or page.', 'js_composer' ), 'admin_label' => true, ), array( 'type' => 'dropdown', 'heading' => __( 'Display Form Title', 'js_composer' ), 'param_name' => 'title', 'value' => array( __( 'No', 'js_composer' ) => 'false', __( 'Yes', 'js_composer' ) => 'true', ), 'save_always' => true, 'description' => __( 'Would you like to display the forms title?', 'js_composer' ), 'dependency' => array( 'element' => 'id', 'not_empty' => true, ), ), array( 'type' => 'dropdown', 'heading' => __( 'Display Form Description', 'js_composer' ), 'param_name' => 'description', 'value' => array( __( 'No', 'js_composer' ) => 'false', __( 'Yes', 'js_composer' ) => 'true', ), 'save_always' => true, 'description' => __( 'Would you like to display the forms description?', 'js_composer' ), 'dependency' => array( 'element' => 'id', 'not_empty' => true, ), ), array( 'type' => 'dropdown', 'heading' => __( 'Enable AJAX?', 'js_composer' ), 'param_name' => 'ajax', 'value' => array( __( 'No', 'js_composer' ) => 'false', __( 'Yes', 'js_composer' ) => 'true', ), 'save_always' => true, 'description' => __( 'Enable AJAX submission?', 'js_composer' ), 'dependency' => array( 'element' => 'id', 'not_empty' => true, ), ), array( 'type' => 'textfield', 'heading' => __( 'Tab Index', 'js_composer' ), 'param_name' => 'tabindex', 'description' => __( '(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, ), ), ), ) ); } PK2\ 7  autoload/vendors/cf7.phpnuW+AfrontendEditorBuild(); } } } /*function vc_init_vendor_yoast_reset_page_now() { $GLOBALS['pagenow'] = 'post.php'; }*/ PK2\@!autoload/vendors/wp_customize.phpnuW+Aload(); } } PK2\ãb||autoload/vendors/wpml.phpnuW+Aload(); } } PK2\К autoload/vendors/ninja_forms.phpnuW+A' . ''; 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' ); function vc_gitem_post_data_get_link_target_frontend_editor( $target ) { return ' target="_blank"'; } function vc_gitem_post_data_get_link_rel_frontend_editor( $rel ) { return ' rel="' . $rel . '"'; } 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_attr( $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 ); } 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']; } 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_attr( $link['url'] ) . '" class="' . esc_attr( $link_css_class ) . '"'; } elseif ( 'post_link' === $atts['link'] ) { $link = 'a href="' . 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="' . $href_link . '" class="' . esc_attr( $link_css_class ) . '"'; } elseif ( 'image_lightbox' === $atts['link'] ) { $link = 'a' . vc_gitem_template_attribute_post_image_url_attr_prettyphoto( '', 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 ); } 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' ); } PK2\' WV__%autoload/hook-vc-iconpicker-param.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Progress_Bar' ); add_filter( 'vc_edit_form_fields_attributes_vc_progress_bar', array( 'WPBakeryShortCode_VC_Progress_Bar', 'convertAttributesToNewProgressBar', ) ); } PK2\:Cf%$%$autoload/hook-vc-grid.phpnuW+Agrid_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]] } /** * Set page meta box values with vc_adv_pager shortcodes data * @since 4.4 * @deprecated 4.4.3 * * @param array $settings * @param $post_id * @param $post * * @return array - shortcode settings to save. */ public function gridSavePostSettings( array $settings, $post_id, $post ) { // _deprecated_function( 'Vc_Hooks_Vc_Grid: gridSavePostSettings method', '4.4.3 (will be removed in 4.10)', 'gridSavePostSettingsId' ); $pattern = $this->getShortcodeRegexForHash(); preg_match_all( "/$pattern/", $post->post_content, $found ); // fetch only needed shortcodes $settings['vc_grid'] = array(); if ( is_array( $found ) && ! empty( $found[0] ) ) { $to_save = array(); if ( isset( $found[3] ) && is_array( $found[3] ) ) { foreach ( $found[3] as $key => $shortcode_atts ) { if ( false !== strpos( $shortcode_atts, 'vc_gid:' ) ) { continue; } $atts = shortcode_parse_atts( $shortcode_atts ); $data = array( 'tag' => $found[2][ $key ], 'atts' => $atts, 'content' => $found[5][ $key ], ); $hash = sha1( serialize( $data ) ); $to_save[ $hash ] = $data; } } if ( ! empty( $to_save ) ) { $settings['vc_grid'] = array( 'shortcodes' => $to_save ); } } return $settings; } /** * @since 4.4.3 * * @param array $settings * @param $post_id * @param $post * * @return array */ public function gridSavePostSettingsId( array $settings, $post_id, $post ) { $pattern = $this->getShortcodeRegexForId(); preg_match_all( "/$pattern/", $post->post_content, $found ); // fetch only needed shortcodes $settings['vc_grid_id'] = array(); 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 $atts array */ $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; } /** * @since 4.4 * * @output/@return string - grid data for ajax request. */ public function getGridDataForAjax() { $tag = 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 ) ) { /** @var $vc_grid WPBakeryShortcode_Vc_Basic_Grid */ $vc_grid = $shortcode_fishbone->shortcodeClass(); if ( method_exists( $vc_grid, 'isObjectPageable' ) && $vc_grid->isObjectPageable() && method_exists( $vc_grid, 'renderAjax' ) ) { echo $vc_grid->renderAjax( vc_request_param( 'data' ) ); die(); } } } } } /** * @since 4.4 * @var Vc_Hooks_Vc_Grid $hook */ $hook = new Vc_Hooks_Vc_Grid(); // when visual composer 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', ) ); } PK2\ aa autoload/vc-settings-presets.phpnuW+AcheckAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie()->part( 'presets' )->can()->validateDie(); 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 ); } PK2\Mautoload/frontend-editor-ie.phpnuW+Aget( 'content_types' ); if ( empty( $content_types ) ) { $state = true; } else { $state = 'custom'; } } return $state; } 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 ); } return $value; } // Part BC: shortcodes // ========================= 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; } 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 */ 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 // =========================== 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; } 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; } 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; } 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' ); PK2\7y: 'autoload/vc-pointers-backend-editor.phpnuW+Aaction ) { $pointers['vc_pointers_backend_editor'] = array( 'name' => 'vcPointerController', 'messages' => array( array( 'target' => '.composer-switch', 'options' => array( 'content' => sprintf( '

    %s

    %s

    ', __( 'Welcome to Visual Composer', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Add Elements', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Rows and Columns', 'js_composer' ), __( '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( '

    %s

    %s

    %s

    ', __( 'Control Elements', 'js_composer' ), __( 'You can edit your element at any time and drag it around your layout.', 'js_composer' ), sprintf( __( 'P.S. Learn more at our Knowledge Base.', 'js_composer' ), 'http://kb.wpbakery.com' ) ), 'position' => array( 'edge' => 'left', 'align' => 'center', ), 'buttonsEvent' => 'vcPointersEditorsTourEvents', ), 'showCallback' => 'vcPointersShowOnContentElementControls', 'closeEvent' => 'click #wpb_visual_composer', ), ), ); } return $pointers; } PK2\u##autoload/vc-image-filters.phpnuW+A __( 'Antique', 'js_composer' ), 'blackwhite' => __( 'Black & White', 'js_composer' ), 'boost' => __( 'Boost', 'js_composer' ), 'concentrate' => __( 'Concentrate', 'js_composer' ), 'country' => __( 'Country', 'js_composer' ), 'darken' => __( 'Darken', 'js_composer' ), 'dream' => __( 'Dream', 'js_composer' ), 'everglow' => __( 'Everglow', 'js_composer' ), 'forest' => __( 'Forest', 'js_composer' ), 'freshblue' => __( 'Fresh Blue', 'js_composer' ), 'frozen' => __( 'Frozen', 'js_composer' ), 'hermajesty' => __( 'Her Majesty', 'js_composer' ), 'light' => __( 'Light', 'js_composer' ), 'orangepeel' => __( 'Orange Peel', 'js_composer' ), 'rain' => __( 'Rain', 'js_composer' ), 'retro' => __( 'Retro', 'js_composer' ), 'sepia' => __( 'Sepia', 'js_composer' ), 'summer' => __( 'Summer', 'js_composer' ), 'tender' => __( 'Tender', 'js_composer' ), 'vintage' => __( 'Vintage', 'js_composer' ), 'washed' => __( 'Washed', 'js_composer' ), ); } /** * Add Image Filter field to media uploader * * @param $form_fields array, fields to include in attachment form * @param $post object, 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 = ''; foreach ( $options as $value => $title ) { $html_options .= ''; } $form_fields['vc-image-filter'] = array( 'label' => '', 'input' => 'html', 'html' => '
    ' . __( 'Image filter', 'js_composer' ) . '
    ', '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( 'APP_ROOT', 'vendor/mmihey/PHP-Instagram-effects/src/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 */ function vc_media_editor_preview_image() { vc_user_access() ->checkAdminNonce() ->validateDie() ->wpAny( 'upload_files' ) ->validateDie(); require_once vc_path_dir( 'APP_ROOT', 'vendor/mmihey/PHP-Instagram-effects/src/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(); $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 $media_meta array, meta to include in attachment form * @param $post object, attachment record in database * * @return array $media_meta, modified meta fields */ 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 .= __( 'Filter:', 'js_composer' ) . ' ' . $filters[ $filter_name ]; return $media_meta; } PK2\"O|>>autoload/hook-vc-pie.phpnuW+AincludeClass( 'WPBakeryShortCode_Vc_Pie' ); add_filter( 'vc_edit_form_fields_attributes_vc_pie', array( 'WPBakeryShortCode_VC_Pie', 'convertOldColorsToNew', ) ); } PK2\.!autoload/bc-multisite-options.phpnuW+Aid, '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 ); } PK2\Vg$$ autoload/vc-grid-item-editor.phpnuW+AaddMetaBox(); 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' ); } 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( '

    %s

    %s

    ', __( 'Start Here!', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Use Animations', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Style Design Options', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Extend Element', 'js_composer' ), __( 'Additional content zone can be added to grid element edges (Note: This zone can not be animated).', 'js_composer' ) ) . '

    ', 'position' => array( 'edge' => 'right', 'align' => 'center', ), ), ), array( 'target' => '#wpadminbar', 'options' => array( 'content' => sprintf( '

    %s

    %s', __( 'Watch Video Tutorial', 'js_composer' ), '

    ' . __( 'Have a look how easy it is to work with grid element builder.', 'js_composer' ) . '

    ' . '' ), 'position' => array( 'edge' => 'top', 'align' => 'center', ), 'pointerClass' => 'vc_gitem-animated-block-pointer-video', 'pointerWidth' => '530', ), ), ), ); } return $pointers; } 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 ); } 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 Visual Composer 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' ); PK2\>TTautoload/hook-vc-message.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Message' ); add_filter( 'vc_edit_form_fields_attributes_vc_message', array( 'WPBakeryShortCode_VC_Message', 'convertAttributesToMessageBox2', ) ); } PK2\9Tautoload/vc-pages/pages.phpnuW+AsetSlug( $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( __( 'Visual Composer', 'js_composer' ), __( 'Visual Composer', 'js_composer' ), 'exist', VC_PAGE_MAIN_SLUG, null, vc_asset_url( 'vc/visual_composer.png' ), 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( __( 'Visual Composer', 'js_composer' ), __( 'Visual Composer', 'js_composer' ), 'exist', VC_PAGE_MAIN_SLUG, null, vc_asset_url( 'vc/visual_composer.png' ), 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' ); PK2\W#autoload/vc-pages/settings-tabs.phpnuW+ArenderTab( $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' ); } PK2\*0QQ%autoload/vc-pages/page-custom-css.phpnuW+AwpAny( 'manage_options' ) ->part( 'settings' ) ->can( 'vc-automapper-tab' ) ->get() ) { vc_automapper()->addAjaxActions(); } } /** * Returns automapper template. * * @since 4.5 * @return string */ 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() && ( 'vc_automapper' === vc_request_param( 'action' ) || 'vc-automapper' === vc_get_param( 'page' ) ) && add_action( 'admin_init', 'vc_automapper_init' ); PK2\}  $autoload/vc-pages/welcome-screen.phpnuW+Arender(); } } function vc_page_welcome_add_sub_page() { // Add submenu page $page = add_submenu_page( VC_PAGE_MAIN_SLUG, __( 'About', 'js_composer' ), __( 'About', 'js_composer' ), 'exist', 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' ); $redirect && wp_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' ); 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' => __( 'What\'s New', 'js_composer' ), 'vc-faq' => __( 'FAQ', 'js_composer' ), 'vc-resources' => __( 'Resources', 'js_composer' ), ) ); return $vc_page_welcome_tabs; } PK2\7y*'autoload/vc-pages/page-role-manager.phpnuW+A $value ) { $new[ $key ] = $value; if ( 'vc-general' === $key ) { $new['vc-roles'] = __( 'Role Manager', 'js_composer' ); } } $tabs = $new; } else { $tabs['vc-roles'] = __( 'Roles Manager', 'js_composer' ); } return $tabs; } if ( ! is_network_admin() ) { add_filter( 'vc_settings_tabs', 'vc_settings_tabs_vc_roles' ); } 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 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' ), WPB_VC_VERSION, true ); } add_action( 'admin_init', 'vc_settings_render_tab_vc_roles_scripts' ); } PK2\uЖ)autoload/vc-pages/page-design-options.phpnuW+AgetCustomCssVersion(); 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 = __( 'Important notice', 'js_composer' ); if ( is_object( $current_screen ) && isset( $current_screen->id ) && 'visual-composer_page_vc-color' === $current_screen->id ) { $message = __( 'You have an outdated version of Visual Composer Design Options. It is required to review and save it.', 'js_composer' ); $html = '

    ' . esc_html( $message_important ) . ': ' . esc_html( $message ) . '

    '; } else { $message = __( 'You have an outdated version of Visual Composer Design Options. It is required to review and save it.', 'js_composer' ); $btnClass = 'button button-primary button-large vc_button-settings-less'; $btnAtts = array( 'href="' . 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" ); $html = '

    ' . esc_html( $message_important ) . ': ' . esc_html( $message ) . '

    ' . '

    ' . __( 'Open Design Options', 'js_composer' ) . '

    '; } echo '
    ' . $html . '
    '; } 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'] = 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', ), ), ), ), ) ) ); 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 ); } add_action( 'vc-settings-render-tab-vc-color', 'vc_page_settings_desing_options_load' ); PK2\O??$autoload/vc-shortcode-autoloader.phpnuW+A 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; } /** * Include class dependencies * * @param string $class Class name * * @return string[] Included (if any) files */ public static function includeClass( $class ) { $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(); $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(); $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 ) ) ) { 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', ) ) ) { $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 ); $code = ''; return (bool) file_put_contents( $target, $code ); } } PK2\H;D D (autoload/vc-pointers-frontend-editor.phpnuW+Apost_content ) ) { $pointers['vc_pointers_frontend_editor'] = array( 'name' => 'vcPointerController', 'messages' => array( array( 'target' => '#vc_add-new-element', 'options' => array( 'content' => sprintf( '

    %s

    %s

    ', __( 'Add Elements', 'js_composer' ), __( '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( '

    %s

    %s

    ', __( 'Rows and Columns', 'js_composer' ), __( '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( '

    %s

    %s

    %s

    ', __( 'Control Elements', 'js_composer' ), __( 'You can edit your element at any time and drag it around your layout.', 'js_composer' ), sprintf( __( 'P.S. Learn more at our Knowledge Base.', 'js_composer' ), 'http://kb.wpbakery.com' ) ), 'position' => array( 'edge' => 'left', 'align' => 'center', ), 'buttonsEvent' => 'vcPointersEditorsTourEvents', ), 'closeCallback' => 'vcPointersCloseInIFrame', 'showCallback' => 'vcPointersSetInIFrame', ), ), ); } return $pointers; } // @todo check is this correct place (editable page) 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' ); PK2\8S!!+classes/editors/class-vc-backend-editor.phpnuW+AisValidPostType( $post_type ) ) { $this->registerBackendJavascript(); $this->registerBackendCss(); // B.C: visual_composer()->registerAdminCss(); visual_composer()->registerAdminJavascript(); // meta box to render add_meta_box( 'wpb_visual_composer', __( 'Visual Composer', '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 = strip_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 */ public function isValidPostType( $type = '' ) { if ( 'vc_grid_item' === $type ) { return false; } return vc_check_post_type( ! empty( $type ) ? $type : get_post_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' ); } /** * @deprecated 4.8 * @return string */ public function showRulesValue() { _deprecated_function( '\Vc_Backend_Editor::showRulesValue', '4.8 (will be removed in next release)' ); global $current_user; wp_get_current_user(); /** @var $settings - get use group access rules */ $settings = vc_settings()->get( 'groups_access_rules' ); $role = is_object( $current_user ) && isset( $current_user->roles[0] ) ? $current_user->roles[0] : ''; return isset( $settings[ $role ]['show'] ) ? $settings[ $role ]['show'] : ''; } 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', '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' ), WPB_VC_VERSION, true ); wp_register_script( 'wpb_php_js', vc_asset_url( 'lib/php.default/php.default.min.js' ), array( 'jquery' ), 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' ), WPB_VC_VERSION, true ); wp_register_script( 'webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js' ); // 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, false ); /** * @todo check vc_add-element-deprecated-warning for fa icon usage ( set to our font ) * also used in vc_icon shortcode */ wp_register_style( 'font-awesome', vc_asset_url( 'lib/bower/font-awesome/css/font-awesome.min.css' ), array(), WPB_VC_VERSION, false ); /** * @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( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION, false ); } } public function enqueueJs() { $wp_dependencies = array( 'jquery', '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 'font-awesome', // used in css_animation edit form param '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 */ public function editorEnabled() { return vc_user_access()->part( 'backend_editor' )->can()->get(); } } PK2\G*""3classes/editors/navbar/class-vc-navbar-frontend.phpnuW+A' . '' . ''; } /** * @return string */ public function getControlScreenSize() { $disable_responsive = vc_settings()->get( 'not_responsive_css' ); if ( '1' !== $disable_responsive ) { $screen_sizes = array( array( 'title' => __( 'Desktop', 'js_composer' ), 'size' => '100%', 'key' => 'default', 'active' => true, ), array( 'title' => __( 'Tablet landscape mode', 'js_composer' ), 'size' => '1024px', 'key' => 'landscape-tablets', ), array( 'title' => __( 'Tablet portrait mode', 'js_composer' ), 'size' => '768px', 'key' => 'portrait-tablets', ), array( 'title' => __( 'Smartphone landscape mode', 'js_composer' ), 'size' => '480px', 'key' => 'landscape-smartphones', ), array( 'title' => __( 'Smartphone portrait mode', 'js_composer' ), 'size' => '320px', 'key' => 'portrait-smartphones', ), ); $output = '
  • ' . '
    ' . '' . '
      '; while ( $screen = current( $screen_sizes ) ) { $output .= '
    • '; next( $screen_sizes ); } $output .= '
  • '; return $output; } return ''; } /** * @return string */ 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(); ?>
  • post_status, array( 'publish', 'future', 'private', ) ) ) : ?> post_status ) : ?> post_status && $can_publish ) : ?>
  • ' . '' . ''; } } PK2\eMULL*classes/editors/navbar/class-vc-navbar.phpnuW+Apost = $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() { $list = array(); foreach ( $this->controls as $control ) { $method = vc_camel_case( 'get_control_' . $control ); if ( method_exists( $this, $method ) ) { $list[] = array( $control, $this->$method() . "\n" ); } } return apply_filters( $this->controls_filter_name, $list ); } /** * Get current post. * @return null|WP_Post */ public function post() { if ( $this->post ) { return $this->post; } return get_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 visual composer logo * @return mixed|void */ public function getLogo() { $output = ''; return apply_filters( 'vc_nav_front_logo', $output ); } /** * @return string */ public function getControlCustomCss() { if ( ! vc_user_access()->part( 'post_settings' )->can()->get() ) { return ''; } return '
  • ' . '' . '
  • '; } /** * @return string */ public function getControlFullscreen() { return '
  • ' . '' . '
  • '; } /** * @return string */ public function getControlWindowed() { return '
  • ' . '' . '
  • '; } /** * @return string */ 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 '
  • ' . ' ' . ' ' . ' ' . '
  • '; } return ''; } /** * @return string */ public function getControlTemplates() { if ( ! vc_user_access()->part( 'templates' )->can()->get() ) { return ''; } return '
  • '; } /** * @return string */ public function getControlFrontend() { if ( ! vc_enabled_frontend() ) { return ''; } return '
  • ' . '' . __( 'Frontend', 'js_composer' ) . '' . '
  • '; } /** * @return string */ public function getControlPreview() { return ''; } /** * @return string */ public function getControlSaveBackend() { return '
  • ' . '' . __( 'Preview', 'js_composer' ) . '' . '' . __( 'Update', 'js_composer' ) . '' . '
  • '; } } PK2\-Y884classes/editors/popups/class-vc-templates-editor.phpnuW+Ainitialized ) { return; } $this->initialized = true; add_filter( 'vc_frontend_template_the_content', array( $this, 'frontendDoTemplatesShortcodes', ) ); add_action( 'wp_ajax_wpb_save_template', array( &$this, 'save' ) ); add_action( 'wp_ajax_vc_backend_template', array( &$this, 'load' ) ); add_action( 'wp_ajax_wpb_load_template_shortcodes', array( &$this, 'loadTemplateShortcodes', ) ); add_action( 'wp_ajax_vc_backend_default_template', array( &$this, 'getBackendDefaultTemplate', ) ); add_action( 'wp_ajax_wpb_delete_template', array( &$this, 'delete' ) ); } /** * Used in Vc_Frontend_Editor::loadShortcodes, action 'vc_frontend_template' * @deprecated 4.4 will be removed, use action 'vc_frontend_template_panel' */ function renderFrontendTemplate() { _deprecated_function( 'Vc_Templates_Editor::renderFrontendTemplate', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_editor' ); add_filter( 'vc_frontend_template_the_content', array( &$this, 'frontendDoTemplatesShortcodes', ) ); $this->template_id = vc_post_param( 'template_id' ); if ( empty( $this->template_id ) ) { die( '0' ); } $saved_templates = get_option( $this->option_name ); vc_frontend_editor()->setTemplateContent( $saved_templates[ $this->template_id ]['template'] ); vc_frontend_editor()->enqueueRequired(); vc_include_template( 'editors/frontend_template.tpl.php', array( 'editor' => vc_frontend_editor(), ) ); die(); } /** * @deprecated 4.4 and will be removed, use Vc_Templates_Panel_Editor::save */ public function save() { _deprecated_function( 'Vc_Templates_Editor::save', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_Editor::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 ) ) { echo 'Error: TPL-01'; die(); } $template_arr = array( 'name' => stripslashes( $template_name ), 'template' => stripslashes( $template ), ); $saved_templates = get_option( $this->option_name ); $template_id = sanitize_title( $template_name ) . '_' . rand(); if ( false === $saved_templates ) { $deprecated = ''; $autoload = 'no'; $new_template = array(); $new_template[ $template_id ] = $template_arr; add_option( $this->option_name, $new_template, $deprecated, $autoload ); } else { $saved_templates[ $template_id ] = $template_arr; update_option( $this->option_name, $saved_templates ); } $this->renderMenu( true ); die(); } /** * @deprecated 4.4 and will be removed, use Vc_Templates_Panel_Editor::renderBackendTemplate */ public function load() { _deprecated_function( 'Vc_Templates_Editor::load', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_Editor::renderBackendTemplate' ); vc_user_access() ->checkAdminNonce() ->validateDie() ->wpAny( 'edit_posts', 'edit_pages' ) ->validateDie() ->part( 'templates' ) ->can() ->validateDie(); $template_id = vc_post_param( 'template_id' ); if ( ! isset( $template_id ) || '' === $template_id ) { echo 'Error: TPL-02'; die(); } $saved_templates = get_option( $this->option_name ); $content = trim( $saved_templates[ $template_id ]['template'] ); $content = str_replace( '\"', '"', $content ); // if not used causes a #1360 bug. $pattern = get_shortcode_regex(); $content = preg_replace_callback( "/{$pattern}/s", 'vc_convert_shortcode', $content ); echo $content; die(); } /** * @deprecated 4.9 */ public function loadInline() { _deprecated_function( '\Vc_Templates_Editor::loadInline', '4.9 (will be removed in 5.1)', '\Vc_Post_Admin::save' ); echo $this->renderMenu(); die(); } /** * @deprecated and will not used anymore */ public function loadTemplateShortcodes() { _deprecated_function( 'Vc_Templates_Editor::loadTemplateShortcodes', '4.4 (will be removed in 5.1)' ); vc_user_access() ->checkAdminNonce() ->validateDie() ->wpAny( 'edit_posts', 'edit_pages' ) ->validateDie() ->part( 'templates' ) ->can() ->validateDie(); $template_id = vc_post_param( 'template_id' ); if ( ! isset( $template_id ) || '' === $template_id ) { echo 'Error: TPL-02'; die(); } $saved_templates = get_option( $this->option_name ); $content = trim( $saved_templates[ $template_id ]['template'] ); $content = str_replace( '\"', '"', $content ); // if not used causes a #1360 bug. $pattern = get_shortcode_regex(); $content = preg_replace_callback( "/{$pattern}/s", 'vc_convert_shortcode', $content ); echo $content; die(); } /** * @deprecated 4.4 and will be removed, use Vc_Templates_Panel_Editor::delete */ public function delete() { _deprecated_function( 'Vc_Templates_Editor::delete', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_Editor::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' ); if ( ! isset( $template_id ) || '' === $template_id ) { echo 'Error: TPL-03'; die(); } $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 ); } echo $this->renderMenu( true ); die(); } /** * Add custom template to default templates list ( at end of list ) * $data = array( 'name'=>'', 'image'=>'', 'content'=>'' ) * * @param $data * * @deprecated, since 4.4 use Vc_Templates_Panel_Editor::addDefaultTemplates, will be removed * @moved to Vc_Templates_Panel_Editor::addDefaultTemplates * @return bool true if added, false if failed */ public function addDefaultTemplates( $data ) { _deprecated_function( 'Vc_Templates_Editor::addDefaultTemplates', '4.4 (will be removed in 5.1)', 'visual_composer()->templatesPanelEditor()->addDefaultTemplates( $data )' ); return visual_composer() ->templatesPanelEditor() ->addDefaultTemplates( $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'=>__('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. * @deprecated 4.4 and moved to Vc_Templates_Panel_Editor::loadDefaultTemplates(), will be removed * @moved to Vc_Templates_Panel_Editor * @return array */ public function loadDefaultTemplates() { _deprecated_function( 'Vc_Templates_Editor::loadDefaultTemplates', '4.4 (will be removed in 5.1)', 'visual_composer()->templatesPanelEditor()->loadDefaultTemplates()' ); return visual_composer() ->templatesPanelEditor() ->loadDefaultTemplates(); } /** * Alias for loadDefaultTemplates * @deprecated 4.4 moved to Vc_Templates_Panel_Editor::getDefaultTemplates(), will be removed * @moved to Vc_Templates_Panel_Editor * @return array - list of default templates */ public function getDefaultTemplates() { _deprecated_function( 'Vc_Templates_Editor::getDefaultTemplates', '4.4 (will be removed in 5.1)', 'visual_composer()->templatesPanelEditor()->getDefaultTemplates()' ); return visual_composer()->templatesPanelEditor()->getDefaultTemplates(); } /** * Get default template data by template index in array. * * @deprecated 4.4 moved to Vc_Templates_Panel_Editor::getDefaultTemplate(), will be removed * @moved to Vc_Templates_Panel_Editor * * @param number $template_index * * @return array|bool */ public function getDefaultTemplate( $template_index ) { _deprecated_function( 'Vc_Templates_Editor::getDefaultTemplate', '4.4 (will be removed in 5.1)', 'visual_composer()->templatesPanelEditor()->getDefaultTemplate( $id )' ); return visual_composer() ->templatesPanelEditor() ->getDefaultTemplate( $template_index ); } /** * Load default template content by index from ajax * @deprecated 4.4 moved to Vc_Templates_Panel_Editor::getBackendDefaultTemplate(), will be removed * @moved to Vc_Templates_Panel_Editor * * @param bool $return | should function return data or not * * @return string */ public function getBackendDefaultTemplate( $return = false ) { _deprecated_function( 'Vc_Templates_Editor::getBackendDefaultTemplate', '4.4 (will be removed in 5.1)', 'visual_composer()->templatesPanelEditor()->getBackendDefaultTemplate( $id )' ); vc_user_access() ->checkAdminNonce() ->validateDie() ->wpAny( 'edit_posts', 'edit_pages' ) ->validateDie() ->part( 'templates' ) ->can() ->validateDie(); return visual_composer() ->templatesPanelEditor() ->getBackendDefaultTemplate( $return ); } /** * @deprecated 4.4 use Vc_Templates_Panel_Editor::render */ public function render() { _deprecated_function( 'Vc_Templates_Editor::render', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_Editor::render' ); vc_include_template( 'editors/popups/panel_templates_editor.tpl.php', array( 'box' => $this, ) ); } /** * @deprecated and will not used anymore * * @param $id * @param $params * * @return string */ public function outputMenuButton( $id, $params ) { _deprecated_function( 'Vc_Templates_Editor::outputMenuButton', '4.4 (will be removed in 5.1)' ); if ( empty( $params ) ) { return ''; } $output = '
  • ' . htmlspecialchars( $params['name'] ) . '
  • '; return $output; } /** * @deprecated 4.4 * * @param bool $only_list * * @return string */ public function renderMenu( $only_list = false ) { _deprecated_function( 'Vc_Templates_Editor::renderMenu', '4.4 (will be removed in 5.1)' ); $templates = get_option( $this->option_name ); $output = ''; if ( false === $only_list ) { $output .= '
  • '; echo $output; return ''; } $templates_arr = $templates; foreach ( $templates as $id => $template ) { if ( is_array( $template ) && isset( $template['name'], $template['template'] ) && strlen( trim( $template['name'] ) ) > 0 && strlen( trim( $template['template'] ) ) > 0 ) { $output .= $this->outputMenuButton( $id, $template ); } else { /* This will delete exists "Wrong" templates */ unset( $templates_arr[ $id ] ); if ( count( $templates_arr ) > 0 ) { update_option( $this->option_name, $templates_arr ); } else { delete_option( $this->option_name ); } } } echo $output; return ''; } /** * Load frontend default template content by index * Used in Vc_Frontend_Editor::loadShortcodes action 'vc_frontend_default_template' * @deprecated 4.4 use action 'vc_frontend_default_template_panel' and * Vc_Templates_Panel_Editor::renderFrontendDefaultTemplate */ public function renderFrontendDefaultTemplate() { _deprecated_function( 'Vc_Templates_Editor::renderMenu', '4.4 (will be removed in 5.1)', 'Vc_Templates_Panel_Editor::renderFrontendDefaultTemplat' ); $template_index = vc_post_param( 'template_name' ); $data = $this->getDefaultTemplate( $template_index ); ! $data && die( '0' ); 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(); } /** * Calls do_shortcode for templates. * * @param $content * * @return string */ public function frontendDoTemplatesShortcodes( $content ) { _deprecated_function( 'Vc_Templates_Editor::frontendDoTemplatesShortcodes', '4.4 (will be removed in 5.1)' ); return do_shortcode( $content ); } } PK2\/Q5pp:classes/editors/popups/class-vc-templates-panel-editor.phpnuW+Ainitialized ) { 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', ) ); /* add_action( 'vc-render-templates-preview-template', array( &$this, 'addScriptsToTemplatePreview', ) );*/ } public function addBodyClassTemplatePreview() { return 'vc_general-template-preview'; } public function renderTemplateBlock( $category ) { if ( 'my_templates' === $category['category'] ) { $category['output'] = ''; if ( vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) { $category['output'] .= '
    ' . esc_html( __( 'Save current layout as a template', 'js_composer' ) ) . '
    ' . esc_html( __( 'Save layout and reuse it on different sections of this site.', 'js_composer' ) ) . '
    '; } $category['output'] .= '
    '; if ( isset( $category['category_name'] ) ) { $category['output'] .= '

    ' . esc_html( $category['category_name'] ) . '

    '; } if ( isset( $category['category_description'] ) ) { $category['output'] .= '

    ' . esc_html( $category['category_description'] ) . '

    '; } $category['output'] .= '
    '; $category['output'] .= '
    '; if ( ! empty( $category['templates'] ) ) { foreach ( $category['templates'] as $template ) { $category['output'] .= $this->renderTemplateListItem( $template ); } } $category['output'] .= '
    '; } else { if ( 'default_templates' === $category['category'] ) { $category['output'] = '
    '; if ( isset( $category['category_name'] ) ) { $category['output'] .= '

    ' . esc_html( $category['category_name'] ) . '

    '; } if ( isset( $category['category_description'] ) ) { $category['output'] .= '

    ' . esc_html( $category['category_description'] ) . '

    '; } $category['output'] .= '
    '; $category['output'] .= '
    '; if ( ! empty( $category['templates'] ) ) { foreach ( $category['templates'] as $template ) { $category['output'] .= $this->renderTemplateListItem( $template ); } } $category['output'] .= '
    '; } } return $category; } /** Output rendered template in new panel dialog * @since 4.4 * * @param $template_name * @param $template_data * * @return string */ 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; } /** * @since 4.4 * * @param $template_name * @param $template_data * * @return string */ 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' ); $deleteControlRender = ''; if ( vc_user_access()->part( 'templates' )->checkStateAny( true, null )->get() ) { $delete_template_title = esc_attr( 'Delete template', 'js_composer' ); $deleteControlRender = << DATA; } echo <<$template_name
    $deleteControlRender
    HTML; return ob_get_clean(); } /** * @since 4.4 * * @param $template_name * @param $template_data * * @return string */ 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 <<$template_name
    HTML; return ob_get_clean(); } /** * @since 4.4 * vc_filter: vc_templates_render_frontend_template - called when unknown template received to render in frontend. */ 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 { echo 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' ); // @todo set default function for reply } $template_arr = array( 'name' => stripslashes( $template_name ), 'template' => stripslashes( $template ), ); $saved_templates = get_option( $this->option_name ); $template_id = sanitize_title( $template_name ) . '_' . rand(); if ( false === $saved_templates ) { $deprecated = ''; $autoload = 'no'; $new_template = array(); $new_template[ $template_id ] = $template_arr; add_option( $this->option_name, $new_template, $deprecated, $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, ); echo $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 ); echo $content; die(); } else { if ( 'default_templates' === $template_type ) { $this->getBackendDefaultTemplate(); die(); } else { echo 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( __( '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(); } /** * @since 4.4 * * @param $templates * * vc_filter: vc_load_default_templates_limit_total - total items to show * * @return array */ 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 * * @since 4.12 * @return mixed */ 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) * @since 4.4 * @return array - all templates with name/unique_id/category_key(optional)/image */ 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' => __( 'My Templates', 'js_composer' ), 'category_description' => __( '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(); // this has 'name', 'image_path', 'custom_class', and 'content' as template data if ( ! empty( $default_templates ) ) { $arr_category = array( 'category' => 'default_templates', 'category_name' => __( 'Default Templates', 'js_composer' ), 'category_description' => __( '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'=>__('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 * @since 4.4 * @return array */ 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 * @since 4.4 * @return array - list of default templates */ public function getDefaultTemplates() { return $this->loadDefaultTemplates(); } /** * Get default template data by template index in array. * @since 4.4 * * @param number $template_index * * @return array|bool */ 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'=>'' ) * @since 4.4 * * @param $data * * @return bool true if added, false if failed */ 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 * @since 4.4 * * @param bool $return | should function return data or not * * @return string */ 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 { echo trim( $data['content'] ); die(); } } /** * @since 4.4 * * @param array $data * * @return array */ public function sortTemplatesByCategories( array $data ) { $buffer = $data; uasort( $buffer, array( &$this, 'cmpCategory', ) ); return $buffer; } /** * @since 4.4 * * @param array $data * * @return array */ public function sortTemplatesByNameWeight( array $data ) { $buffer = $data; uasort( $buffer, array( &$this, 'cmpNameWeight', ) ); return $buffer; } /** * Function should return array of templates categories * @since 4.4 * * @param array $categories * * @return array - associative array of category key => and visible Name */ 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; } /** * @since 4.4 * @return array */ 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 * @since 4.4 * * @param array $a - template one * @param array $b - second template to compare * * @return int */ 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; } /** * @since 4.4 * * @param $a * @param $b * * @return int */ 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 = strip_tags( $shortcodes_custom_css ); $output .= ''; } echo $output; } public function addScriptsToTemplatePreview() { // wp_enqueue_script( 'vc-template-preview-script', vc_asset_url( 'js/editors/vc_ui-panel-templates-preview-be.js' ), array( 'vc-backend-min-js' ), WPB_VC_VERSION, true ); } 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; $output .= apply_filters( 'vc_templates_render_template', $name, $template ); $output .= <<
    HTML; return $output; } public function getOptionName() { return $this->option_name; } } PK2\Bzz1classes/editors/popups/class-vc-post-settings.phpnuW+Aeditor = $editor; } /** * @return Vc_Editor_Interface */ public function editor() { return $this->editor; } /** * */ public function renderUITemplate() { vc_include_template( 'editors/popups/vc_ui-panel-post-settings.tpl.php', array( 'box' => $this, ) ); } } PK2\K??/classes/editors/popups/class-vc-edit-layout.phpnuW+A $vc_row_layouts, ) ); } } PK2\~~3classes/editors/popups/class-vc-add-element-box.phpnuW+A '; } /** * 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'] ); for ( $n = 0; $n < count( $class_ar ); $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'] ) ? '' . htmlspecialchars( $params['description'] ) . '' : ''; $output .= '
  • '; return $output; } /** * Get mapped shortcodes list. * * @since 4.4 * @return array */ public function shortcodes() { return 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 * @see WPBMap::getSortedUserShortCodes * @return mixed|void */ public function getControls() { $output = ''; if ( 0 === $buttons_count ) { $this->show_empty_message = true; } return apply_filters( 'vc_add_element_box_buttons', $output ); } /** * Get categories list from mapping data. * @since 4.5 * * @return array */ public function getCategories() { return 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 * * @since 4.8 * @return string */ public function renderIcon( $params ) { return $this->getIcon( $params ); } /** * @return boolean */ public function isShowEmptyMessage() { return $this->show_empty_message; } public function getPartState() { return vc_user_access()->part( 'shortcodes' )->getState(); } } PK2\;L L 7classes/editors/popups/class-vc-shortcode-edit-form.phpnuW+Ainitialized ) { 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( __( 'Access denied', 'js_composer' ) ) ->wpAny( array( 'edit_post', (int) vc_request_param( 'post_id' ) ) ) ->validateDie( __( 'Access denied', 'js_composer' ) ) ->check( 'vc_user_access_check_shortcode_edit', $tag ) ->validateDie( __( '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 ); $fields->render(); die(); } /** * Build edit form fields * * @deprecated 4.4 * @use Vc_Shortcode_Edit_Form::renderFields */ public function build() { _deprecated_function( 'Vc_Shortcode_Edit_Form::build', '4.4 (will be removed in 5.1)', 'Vc_Shortcode_Edit_Form::renderFields' ); $tag = vc_post_param( 'element' ); vc_user_access() ->checkAdminNonce() ->validateDie( __( 'Access denied', 'js_composer' ) ) ->wpAny( 'edit_posts', 'edit_pages' ) ->validateDie( __( 'Access denied', 'js_composer' ) ) ->check( 'vc_user_access_check_shortcode_edit', $tag ) ->validateDie( __( 'Access denied', 'js_composer' ) ); $shortcode = stripslashes( vc_post_param( 'shortcode' ) ); require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-edit-form-fields.php' ); $fields = new Vc_Edit_Form_Fields( $tag, shortcode_parse_atts( $shortcode ) ); $fields->render(); die(); } /** * @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; } } PK2\Djj,classes/editors/class-vc-frontend-editor.phpnuW+A '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 = 'http://vc.wpbakery.com/?utm_campaign=VCplugin&utm_source=vc_user&utm_medium=frontend_editor'; /** * */ 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' ); } /** * */ public function adminInit() { $this->setPost(); $this->renderEditor(); } /** * */ public function buildEditablePage() { ! defined( 'CONCATENATE_SCRIPTS' ) && define( 'CONCATENATE_SCRIPTS', false ); 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; } 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 */ 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' ) ) { define( 'VC_LOADING_EDITABLE_CONTENT', true ); remove_filter( 'the_content', 'wpautop' ); do_action( 'vc_load_shortcode' ); ob_start(); $this->getPageShortcodesByContent( $post->post_content ); 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(); $GLOBALS['vc_post_content'] = '' . $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() { echo isset( $GLOBALS['vc_post_content'] ) ? $GLOBALS['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 ''; } /** * @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|void */ 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 */ function wrapperStart() { return ''; } /** * @return string */ 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]] } /** * */ function setPost() { global $post; $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 ) ); $post = $this->post; $this->post_id = $this->post->ID; } /** * @return mixed */ 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. */ function renderEditor() { global $current_user; wp_get_current_user(); $this->current_user = $current_user; $this->post_url = vc_str_remove_protocol( get_permalink( $this->post_id ) ); if ( ! self::inlineEnabled() || ! vc_user_access()->wpAny( array( 'edit_post', $this->post_id, ) )->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 = strip_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 */ function setEditorTitle() { return sprintf( __( 'Edit %s with Visual Composer', 'js_composer' ), $this->post_type->labels->singular_name ); } /** * @param $title * * @return string|void */ function setEmptyTitlePlaceholder( $title ) { return ! is_string( $title ) || strlen( $title ) === 0 ? __( '(no title)', 'js_composer' ) : $title; } /** * @param $template */ function render( $template ) { vc_include_template( 'editors/frontend_' . $template . '.tpl.php', array( 'editor' => $this ) ); } /** * @param $link * * @return string */ function renderEditButton( $link ) { if ( $this->showButton( get_the_ID() ) ) { return $link . ' ' . __( 'Edit with Visual Composer', 'js_composer' ) . ''; } return $link; } /** * @param $actions * * @return mixed */ function renderRowAction( $actions ) { $post = get_post(); if ( $this->showButton( $post->ID ) ) { $actions['edit_vc'] = '' . __( 'Edit with Visual Composer', 'js_composer' ) . ''; } return $actions; } /** * @param null $post_id * * @return bool */ function showButton( $post_id = null ) { $type = get_post_type(); return self::inlineEnabled() && ! in_array( get_post_status(), array( 'private', 'trash', ) ) && ! in_array( $type, array( 'templatera', 'vc_grid_item', ) ) && vc_user_access()->wpAny( array( 'edit_post', $post_id, ) )->get() && vc_check_post_type( $type ); } /** * @param WP_Admin_Bar $wp_admin_bar */ 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' => __( 'Edit with Visual Composer', 'js_composer' ), 'href' => self::getInlineUrl(), 'meta' => array( 'class' => 'vc_inline-link' ), ) ); } } } /** * @param $content */ function setTemplateContent( $content ) { $this->template_content = $content; } /** * vc_filter: vc_inline_template_content - filter to override template content * @return mixed|void */ function getTemplateContent() { return apply_filters( 'vc_inline_template_content', $this->template_content ); } /** * */ function renderTemplates() { $this->render( 'templates' ); die(); } /** * */ 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 ); } /** * */ 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( 'waypoints' ); wp_enqueue_script( 'wpb_scrollTo_js', vc_asset_url( 'lib/bower/scrollTo/jquery.scrollTo.min.js' ), array( 'jquery' ), 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' ), WPB_VC_VERSION, true ); wp_enqueue_script( 'vc_inline_iframe_js', vc_asset_url( 'js/dist/page_editable.min.js' ), array( 'jquery', 'underscore', ), WPB_VC_VERSION, true ); do_action( 'vc_load_iframe_jscss' ); } /** * */ function loadShortcodes() { if ( vc_is_page_editable() && vc_enabled_frontend() ) { $action = vc_post_param( 'action' ); if ( 'vc_load_shortcode' === $action ) { ! defined( 'CONCATENATE_SCRIPTS' ) && define( 'CONCATENATE_SCRIPTS', false ); ob_start(); $this->setPost(); $shortcodes = (array) vc_post_param( 'shortcodes' ); do_action( 'vc_load_shortcode', $shortcodes ); $this->renderShortcodes( $shortcodes ); echo '
    '; _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); do_action( 'wp_print_footer_scripts' ); echo '
    '; $output = ob_get_clean(); die( apply_filters( 'vc_frontend_editor_load_shortcode_ajax_output', $output ) ); } elseif ( 'vc_frontend_load_template' === $action ) { $this->setPost(); visual_composer()->templatesPanelEditor()->renderFrontendTemplate(); } else if ( '' !== $action ) { do_action( 'vc_front_load_page_' . esc_attr( vc_post_param( 'action' ) ) ); } } } /** * @param $s * * @return string */ 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; $host = isset( $s['HTTP_X_FORWARDED_HOST'] ) ? $s['HTTP_X_FORWARDED_HOST'] : isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : $s['SERVER_NAME']; return $protocol . '://' . $host . $port . $s['REQUEST_URI']; } /** * @return string */ static function cleanStyle() { return ''; } /** * */ 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 */ 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 .= '
    '; $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 .= '
    ' . $this->wrapperStart() . do_shortcode( stripslashes( $shortcode['string'] ) ) . $this->wrapperEnd() . '
    '; $output .= '
    '; } } } } echo apply_filters( 'vc_front_render_shortcodes', $output ); } /** * @param $string * * @return string */ 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 */ 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' ), WPB_VC_VERSION, true ); wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'wpb_php_js', vc_asset_url( 'lib/php.default/php.default.min.js' ), array( 'jquery' ), 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' ), WPB_VC_VERSION, true ); wp_register_script( 'webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js' ); // Google Web Font CDN wp_register_script( 'wpb_scrollTo_js', vc_asset_url( 'lib/bower/scrollTo/jquery.scrollTo.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'vc_accordion_script', vc_asset_url( 'lib/vc_accordion/vc-accordion.min.js' ), array( 'jquery' ), 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', '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, false ); wp_register_style( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), false, WPB_VC_VERSION, 'screen' ); wp_register_style( 'font-awesome', vc_asset_url( 'lib/bower/font-awesome/css/font-awesome.min.css' ), false, WPB_VC_VERSION, 'screen' ); 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', 'animate-css', 'font-awesome', //'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 ); } } /** * */ 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 * */ function enqueueMappedShortcode() { foreach ( WPBMap::getUserShortCodes() 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 ); } } } public function enqueueMappedShortcodeJs( $value ) { wp_enqueue_script( 'front_enqueue_js_' . md5( $value ), $value, array( 'vc-frontend-editor-min-js' ), WPB_VC_VERSION, true ); } public function enqueueMappedShortcodeCss( $value ) { wp_enqueue_style( 'front_enqueue_css_' . md5( $value ), $value, array( 'vc_inline_css' ), WPB_VC_VERSION ); } /** * @param $content * * @since 4.4 */ 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( '

    ', '

    ', ), '', $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 ); } } echo $this->parseShortcodesString( $content ); } /** * @param $content * @param bool $is_container * @param bool $parent_id * * @since 4.2 * @return string */ 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 ]; $shortcode = array( 'tag' => $s, 'attrs_query' => $found[3][ $index ], 'attrs' => shortcode_parse_atts( $found[3][ $index ] ), 'id' => $id, 'parent_id' => $parent_id, ); if ( false !== WPBMap::getParam( $s, 'content' ) ) { $shortcode['attrs']['content'] = $content; } $this->post_shortcodes[] = rawurlencode( json_encode( $shortcode ) ); $string .= $this->toString( $shortcode, $content ); } return $string; } /** * @param $shortcode * @param $content * * @since 4.2 * @return string */ 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 = ( '
    ' . $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' ) ) { /** * @since 4.2 * @return string */ function vc_container_anchor() { return ''; } } PK2\t:dc*c*-classes/editors/class-vc-edit-form-fields.phpnuW+Atag = $tag; $this->atts = apply_filters( 'vc_edit_form_fields_attributes_' . $this->tag, $atts ); $this->setSettings( WPBMap::getShortCode( $this->tag ) ); } /** * Get settings * @since 4.4 * * @param $key * * @return null */ public function setting( $key ) { return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : null; } /** * Set settings data * @since 4.4 * * @param array $settings */ 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. * @since 4.4 * @return int|bool; */ public function postId() { if ( false === $this->post_id ) { $this->post_id = get_the_ID(); } return $this->post_id; } /** * Shortcode Post ID setter. * @since 4.4 * * @param $post_id - integer value in post_id */ 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. * @since 4.4 * * @param $param_settings * @param $value * * @return null */ 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. * @since 4.4 * @return string */ public function enqueueScripts() { $output = ''; if ( ! WpbakeryShortcodeParams::isEnqueue() ) { $scripts = apply_filters( 'vc_edit_form_enqueue_script', WpbakeryShortcodeParams::getScripts() ); foreach ( $scripts as $script ) { $output .= "\n\n" . ''; } } return $output; } /** * Render grouped fields. * @since 4.4 * * @param $groups * @param $groups_content * * @return string */ protected function renderGroupedFields( $groups, $groups_content ) { $output = ''; if ( sizeof( $groups ) > 1 || ( sizeof( $groups ) >= 1 && empty( $groups_content['_general'] ) ) ) { $output .= '
    '; $output .= '
      '; $key = 0; foreach ( $groups as $g ) { $output .= '
    • '; } $output .= '
    '; $key = 0; foreach ( $groups as $g ) { $output .= '
    '; $output .= $groups_content[ $g ]; $output .= '
    '; } $output .= '
    '; } elseif ( ! empty( $groups_content['_general'] ) ) { $output .= '
    ' . $groups_content['_general'] . '
    '; } 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' ); $list_vendor_presets = Vc_Settings_Preset::listVendorSettingsPresets( $this->tag ); $list_presets = Vc_Settings_Preset::listSettingsPresets( $this->tag ); // TODO: Add template access check $show_settings = false; $show_presets = vc_user_access()->part( 'presets' )->can()->get() || ! empty( $list_presets ) || ! empty( $list_vendor_presets ); if ( in_array( $this->tag, array( 'vc_row' ) ) && vc_user_access()->part( 'templates' )->can()->get() ) { $show_settings = true; } $output .= sprintf( '', $show_presets ? 'true' : 'false' ); $output .= sprintf( '', $show_presets || $show_settings ? 'true' : 'false' ); if ( ! empty( $deprecated ) ) { $output .= '
    ' . vc_message_warning( sprintf( __( 'You are using outdated element, it is deprecated since version %s.', 'js_composer' ), $this->setting( 'deprecated' ) ) ) . '
    '; } $output .= '
    '; 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 .= '
    '; $output .= $this->enqueueScripts(); echo $output; do_action( 'vc_edit_form_fields_after_render' ); } /** * Generate html for shortcode attribute. * * Method * @since 4.4 * * @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|void */ protected 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 = '
    '; $output .= ( isset( $param['heading'] ) ) ? '
    ' . $param['heading'] . '
    ' : ''; $output .= '
    '; $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 .= '' . $param['description'] . ''; } $output_after .= '
    '; $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. * @since 4.4 * @return bool */ 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; } } PK2\|.kuu#classes/shortcodes/vc-pinterest.phpnuW+AgetShortcode(), $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 '
    '; } } PK2\+{TT)classes/shortcodes/vc-gitem-post-data.phpnuW+AgetShortcode(), $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; } } PK2\RHHH"classes/shortcodes/vc-facebook.phpnuW+AgetShortcode(), $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 ''; } } PK2\y,&classes/shortcodes/vc-gitem-zone-c.phpnuW+AjsScripts(); } public function jsScripts() { wp_register_script( 'zoom', vc_asset_url( 'lib/bower/zoom/jquery.zoom.min.js' ), array(), WPB_VC_VERSION ); wp_register_script( 'vc_image_zoom', vc_asset_url( 'lib/vc_image_zoom/vc_image_zoom.min.js' ), array( 'jquery', 'zoom', ), WPB_VC_VERSION, true ); } 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 .= ''; $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'] : '' ) . '' . __( 'Add image', 'js_composer' ) . '' ); $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' ) ) ) { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">'; } elseif ( 'hidden' !== $param['holder'] ) { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . ''; } } if ( ! empty( $param['admin_label'] ) && true === $param['admin_label'] ) { $output .= ': ' . $value . ''; } return $output; } 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; } protected function outputTitle( $title ) { return ''; } protected function outputTitleTrue( $title ) { return '

    ' . $title . ' ' . $this->settings( 'logo' ) . '

    '; } } PK2\#ǕOO%classes/shortcodes/vc-tta-section.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Tta_Accordion' ); 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(); 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'; } } public function containerContentClass() { return 'wpb_column_container vc_container_for_children vc_clearfix'; } 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 ''; } 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; } 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; } 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 ''; } } return null; } public function getParamHeading( $atts, $content ) { $isPageEditable = vc_is_page_editable(); $h4attributes = array(); $h4classes = array( 'vc_tta-panel-title', ); if ( $isPageEditable ) { $h4attributes[] = 'data-vc-tta-controls-icon-position=""'; } else { $controlIconPosition = $this->getTemplateVariable( 'control-icon-position' ); if ( $controlIconPosition ) { $h4classes[] = $controlIconPosition; } } $h4attributes[] = 'class="' . implode( ' ', $h4classes ) . '"'; $output = '

    '; // close h4 if ( $isPageEditable ) { $output .= 'getTemplateVariable( 'tab_id' ) ) . '"'; } $output .= ' data-vc-accordion'; $output .= ' data-vc-container=".vc_tta-container">'; $output .= $this->getTemplateVariable( 'icon-left' ); $output .= '' . $this->getTemplateVariable( 'title' ) . ''; $output .= $this->getTemplateVariable( 'icon-right' ); if ( ! $isPageEditable ) { $output .= $this->getTemplateVariable( 'control-icon' ); } $output .= ''; $output .= '

    '; // close h4 fix #2229 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 = ' '; return $output; } /** * Check is allowed to add another element inside current element. * * @since 4.8 * * @return bool */ public function getAddAllowed() { return vc_user_access() ->part( 'shortcodes' ) ->checkStateAny( true, 'custom', null )->get(); } } PK2\  %classes/shortcodes/vc-cta-button2.phpnuW+Agrid_settings['style'] .= '-masonry'; } protected function contentAllMasonry( $grid_style, $settings, $content ) { return parent::contentAll( $grid_style, $settings, $content ); } protected function contentLazyMasonry( $grid_style, $settings, $content ) { return parent::contentLazy( $grid_style, $settings, $content ); } protected function contentLoadMoreMasonry( $grid_style, $settings, $content ) { return parent::contentLoadMore( $grid_style, $settings, $content ); } } PK2\qF{classes/shortcodes/vc-gitem.phpnuW+Apredefined_atts, $atts ) ); $output = ''; $column_controls = $this->getControls( $this->settings( 'controls' ) ); $output .= '
    mainHtmlBlockParams( '12', '' ) . '>'; $output .= $column_controls; $output .= '
    containerHtmlBlockParams( '12', '' ) . '>'; $output .= $this->itemGrid(); $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; 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 .= '
    '; $output .= ''; return $output; } 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(); } public function itemGrid() { $output = '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    ' . '
    '; return $output; } public function containerHtmlBlockParams( $width, $i ) { return 'class="vc_gitem-content"'; } /** * Get rendered controls * * @param array $controls * * @return string */ 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[] = ''; } break; case 'edit': if ( $editAccess ) { $buttons[] = ''; } break; case 'delete': if ( $allAccess ) { $buttons[] = ''; } break; } } $html = '
    ' . implode( ' ', $buttons ) . '
    '; return $html; } } PK2\mc&classes/shortcodes/vc-column-inner.phpnuW+AgetVcIcon( $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; } public function getHeading( $tag, $atts ) { $inline_css = ''; 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 { 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 = ' style="' . implode( '', $inline_css ) . '"'; } return '<' . $tag . $inline_css . '>' . $atts[ $tag ] . ''; } } return ''; } 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 '
    ' . $btn->render( array_filter( $data ) ) . '
    '; } } return ''; } 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 ''; } public function getTemplateVariable( $string ) { if ( is_array( $this->template_vars ) && isset( $this->template_vars[ $string ] ) ) { return $this->template_vars[ $string ]; } return ''; } } PK2\)../classes/shortcodes/vc-gitem-post-categories.phpnuW+AjsScripts(); } public function jsScripts() { wp_register_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), 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', 'waypoints', 'ChartJS', ), WPB_VC_VERSION, true ); } } PK2\)Wclasses/shortcodes/vc-pie.phpnuW+AjsScripts(); } public function jsScripts() { wp_register_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), 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', '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; } } PK2\ox(classes/shortcodes/vc-widget-sidebar.phpnuW+AgetShortcode(), $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 '
    '; } } PK2\?$classes/shortcodes/vc-gitem-zone.phpnuW+A' . '
      ' . '
    ' . ''; $output .= '' . '
    ' . '
    '; return $output; } public function containerHtmlBlockParams( $width, $i ) { return 'class="vc_gitem-animated-block-content"'; } public static function animations() { return array( __( 'Single block (no animation)', 'js_composer' ) => '', __( 'Double block (no animation)', 'js_composer' ) => 'none', __( 'Fade in', 'js_composer' ) => 'fadeIn', __( 'Scale in', 'js_composer' ) => 'scaleIn', __( 'Scale in with rotation', 'js_composer' ) => 'scaleRotateIn', __( 'Blur out', 'js_composer' ) => 'blurOut', __( 'Blur scale out', 'js_composer' ) => 'blurScaleOut', __( 'Slide in from left', 'js_composer' ) => 'slideInRight', __( 'Slide in from right', 'js_composer' ) => 'slideInLeft', __( 'Slide bottom', 'js_composer' ) => 'slideBottom', __( 'Slide top', 'js_composer' ) => 'slideTop', __( 'Vertical flip in with fade', 'js_composer' ) => 'flipFadeIn', __( 'Horizontal flip in with fade', 'js_composer' ) => 'flipHorizontalFadeIn', __( 'Go top', 'js_composer' ) => 'goTop20', __( 'Go bottom', 'js_composer' ) => 'goBottom20', ); } } PK2\$_\\2classes/shortcodes/paginator/class-vc-pageable.phpnuW+AshortcodeScripts(); } /** * 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', ), WPB_VC_VERSION, true ); wp_register_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), 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, false ); } /** * @param $grid_style * @param $settings * @param $content * * @return string */ protected function contentAll( $grid_style, $settings, $content ) { return '
    ' . $content . '
    '; } /** * @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 return '
    ' . $content . '
    ' . '
    ' . do_shortcode( '[vc_button2 size="' . $settings['button_size'] . '" title="' . __( 'Load more', 'js_composer' ) . '" style="' . $settings['button_style'] . '" color="' . $settings['button_color'] . '" el_class="vc_grid-btn-load_more"]' ) . '
    '; } 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' ) ); return '
    ' . $content . '
    ' . '
    ' . apply_filters( 'vc_gitem_template_attribute_' . 'vc_btn', '', array( 'post' => new stdClass(), 'data' => str_replace( array( '{{ vc_btn:', '}}' ), '', $button3->output( $data ) ), ) ) . '
    '; } return ''; } /** * @param $grid_style * @param $settings * @param $content * * @return string */ protected function contentLazy( $grid_style, $settings, $content ) { return '
    ' . $content . '
    '; } /** * @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 = '
    ' . $content . '
    '; return $output; } public function enqueueScripts() { wp_enqueue_script( 'vc_pageable_owl-carousel' ); wp_enqueue_style( 'vc_pageable_owl-carousel-css' ); wp_enqueue_style( 'animate-css' ); } /** * Find pager data for ajax, must be overwritten * * @param array $vc_request_param request param [data] * * @return string - rendered content for ajax */ abstract function renderAjax( $vc_request_param ); /** * Check is pageable * @since 4.7.4 * @return bool */ 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(); } } PK2\/e&ix x $classes/shortcodes/vc-media-grid.phpnuW+Ashortcode . '_items_list', array( $this, 'setItemsIfEmpty' ) ); } protected function getFileName() { return 'vc_basic_grid'; } 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 ); } 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; } 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][/vc_gitem]'; $grid_item->parseTemplate( $item ); $items = str_repeat( $grid_item->renderItem( get_post( (int) vc_request_param( 'vc_post_id' ) ) ), 3 ); } return $items; } 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 . ''; } if ( 'include' === $param_name ) { $images_ids = empty( $value ) ? array() : explode( ',', trim( $value ) ); $output .= '
      '; foreach ( $images_ids as $image ) { $img = wpb_getImageBySize( array( 'attach_id' => (int) $image, 'thumb_size' => 'thumbnail' ) ); $output .= ( $img ? '
    • ' . $img['thumbnail'] . '
    • ' : '
    • ' ); } $output .= '
    '; $output .= '' . __( 'Add images', 'js_composer' ) . ''; } return $output; } } PK2\i:$classes/shortcodes/vc-googleplus.phpnuW+AgetShortcode(), $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 '
    '; } } PK2\W^*classes/shortcodes/vc-gitem-post-title.phpnuW+AjsScripts(); } public function jsScripts() { wp_register_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), 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', 'waypoints', 'ChartJS', ), WPB_VC_VERSION, true ); } } PK2\| classes/shortcodes/vc-btn.phpnuW+A 0 ) { $link = $atts['href']; $target = isset( $atts['target'] ) ? $atts['target'] : ''; // if empty => same as `_self` $title = isset( $atts['title'] ) ? $atts['title'] : $link; $atts['link'] = 'url:' . rawurlencode( $link ) . '|title:' . $title . ( strlen( $target ) > 0 ? '|target:' . rawurlencode( $target ) : '' ); } /* __( 'Classic Grey', 'js_composer' ) => 'wpb_button', __( 'Classic Blue', 'js_composer' ) => 'btn-primary', __( 'Classic Turquoise', 'js_composer' ) => 'btn-info', __( 'Classic Green', 'js_composer' ) => 'btn-success', __( 'Classic Orange', 'js_composer' ) => 'btn-warning', __( 'Classic Red', 'js_composer' ) => 'btn-danger', __( 'Classic Black', 'js_composer' ) => "btn-inverse" */ 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'] ); } if ( isset( $atts['style'] ) && in_array( $atts['style'], array( 'rounded', 'square', 'round', 'outlined', 'square_outlined', ) ) ) { 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 * * @since 4.5 * @return string */ protected function outputTitle( $title ) { $icon = $this->settings( 'icon' ); return '

    '; } } PK2\/M7K7K$classes/shortcodes/vc-basic-grid.phpnuW+A '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', '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_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', // 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 function __construct( $settings ) { parent::__construct( $settings ); $this->attributes_defaults['btn_title'] = __( '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' ) ); wp_register_script( 'vc_grid', vc_asset_url( 'js/dist/vc_grid.min.js' ), array( 'jquery', 'underscore', 'vc_pageable_owl-carousel', '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' ); } public static function addExcludedId( $id ) { self::$excluded_ids[] = $id; } public static function excludedIds() { return self::$excluded_ids; } /** * Get shortcode hash by it content and attributes * * @param $atts * @param $content * * @deprecated 4.4.3 * @return string */ public function getHash( $atts, $content ) { // _deprecated_function( 'WPBakeryShortCode_VC_Basic_Grid::getHash', '4.4.3 (will be removed in 4.10)', 'getId resave your grid' ); 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 urlencode( json_encode( array( 'tag' => $this->shortcode, 'atts' => $atts, 'content' => $content, ) ) ); } /** Else * We are in preview mode (viewing page). * So hash is shortcode atts and content hash */ return sha1( serialize( array( 'tag' => $this->shortcode, 'atts' => $atts, 'content' => $content, ) ) ); } 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 urlencode( 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 = 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; } /** * Search in post meta vc_post_settings value * For shortcode data by hash * * @param $page_id * @param $hash * * @deprecated 4.4.3 * @return bool|array */ public function findPostShortcodeByHash( $page_id, $hash ) { // _deprecated_function( 'WPBakeryShortCode_VC_Basic_Grid::findPostShortcodeByHash', '4.4.3 (will be removed in 4.10)', 'findPostShortcodeById resave your grid to renew' ); if ( $hash ) { if ( $this->currentUserCanManage( $page_id ) && preg_match( '/\"tag\"\:/', urldecode( $hash ) ) ) { return json_decode( urldecode( $hash ), true ); // if frontend, no hash exists - just RAW data } $post_meta = get_post_meta( (int) $page_id, '_vc_post_settings' ); if ( is_array( $post_meta ) ) { foreach ( $post_meta as $meta ) { if ( isset( $meta['vc_grid'] ) && ! empty( $meta['vc_grid']['shortcodes'] ) && isset( $meta['vc_grid']['shortcodes'][ $hash ] ) ) { return $meta['vc_grid']['shortcodes'][ $hash ]; } } } } return false; } 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' ); 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 ] ) ) { return $meta['vc_grid_id']['shortcodes'][ $grid_id ]; } } } return false; } private 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' : '' ); if ( is_array( $this->items ) && ! empty( $this->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( $atts ); $grid_item->setIsEnd( $is_end ); $grid_item->setTemplateById( $atts['item'] ); $output .= $grid_item->addShortcodesCustomCss(); ob_start(); wp_print_styles(); $output .= ob_get_clean(); $attributes = array( 'filter_terms' => $filter_terms, 'atts' => $atts, 'grid_item', $grid_item, ); $output .= apply_filters( 'vc_basic_grid_template_filter', vc_get_template( 'shortcodes/vc_basic_grid_filter.php', $attributes ), $attributes ); while ( have_posts() ) { the_post(); $items .= $grid_item->renderItem( get_post() ); } wp_reset_postdata(); } $items = apply_filters( $this->shortcode . '_items_list', $items ); $output .= $this->renderPagination( $atts['style'], $settings, $items, $css_classes ); 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 { $this->atts['offset'] = $offset = isset( $atts['offset'] ) ? (int) $atts['offset'] : $this->attributes_defaults['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'] ); } protected function setPagingAll( $max_items ) { $atts = $this->atts; $this->atts['items_per_page'] = $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['query_offset'] = isset( $atts['offset'] ) ? (int) $atts['offset'] : $this->attributes_defaults['offset']; } 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; if ( ! isset( $vc_request_param['page_id'] ) ) { return json_encode( array( 'status' => 'Nothing found' ) ); } if ( $id ) { $shortcode = $this->findPostShortcodeById( $vc_request_param['page_id'], $id ); } else { /** * @deprecated since 4.4.3 due to invalid logic in hash algorithm */ $hash = isset( $vc_request_param['shortcode_hash'] ) ? $vc_request_param['shortcode_hash'] : false; $shortcode = $this->findPostShortcodeByHash( $vc_request_param['page_id'], $hash ); } if ( ! is_array( $shortcode ) ) { return 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(); } public function postID() { if ( false == $this->post_id ) { $this->post_id = get_the_ID(); } return $this->post_id; } public function buildAtts( $atts, $content ) { $arr_keys = array_keys( $atts ); for ( $i = 0; $i < count( $atts ); $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 ); } else { $hash = $this->getHash( $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; } else if ( isset( $hash ) ) { $this->atts['shortcode_hash'] = $hash; } $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 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', ) ) ? $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 $t ) { if ( ! isset( $tax_queries[ $t->taxonomy ] ) ) { $tax_queries[ $t->taxonomy ] = array( 'taxonomy' => $t->taxonomy, 'field' => 'id', 'terms' => array( $t->term_id ), 'relation' => 'IN', ); } else { $tax_queries[ $t->taxonomy ]['terms'][] = $t->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->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' ); $post_data = query_posts( $query ); $this->atts['items_per_page'] = - 1; } elseif ( false !== $this->atts['query_items_per_page'] ) { $settings = $this->filterQuerySettings( $this->buildQuery( $this->atts ) ); $post_data = query_posts( $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; } } 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; } 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; } } PK2\#"{{$classes/shortcodes/rev-slider-vc.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Tta_Accordion' ); class WPBakeryShortCode_VC_Tta_Tour extends WPBakeryShortCode_VC_Tta_Tabs { public $layout = 'tabs'; 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 ); } } PK2\FF#classes/shortcodes/vc-accordion.phpnuW+A '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; } } PK2\zvvclasses/shortcodes/vc-video.phpnuW+A 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 += 1; $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'] = urlencode( json_encode( $paramValues ) ); } } return $atts; } } PK2\Nclasses/shortcodes/vc-icon.phpnuW+A SLIDE_TITLE, 'title' => '', ); protected function getFileName() { return 'vc_tabs'; } public function getTabTemplate() { return '
    ' . do_shortcode( '[vc_tab title="' . SLIDE_TITLE . '" tab_id=""][/vc_tab]' ) . '
    '; } } PK2\9Q#classes/shortcodes/vc-gitem-col.phpnuW+Ashortcode ) ? ' 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(); } public function outputEditorControlAlign() { $alignment = array( array( 'name' => 'left', 'label' => __( 'Left', 'js_composer' ) ), array( 'name' => 'center', 'label' => __( 'Center', 'js_composer' ) ), array( 'name' => 'right', 'label' => __( 'Right', 'js_composer' ) ), ); $output = ''; foreach ( $alignment as $data ) { $attr = esc_attr( $data['name'] ); $output .= ''; } return $output . ''; } } PK2\"Ϣ'classes/shortcodes/vc-accordion-tab.phpnuW+A '', 'width' => '', 'title' => '', ); public $nonDraggableClass = 'vc-non-draggable-container'; public function contentAdmin( $atts, $content = null ) { $width = $el_class = $title = ''; extract( shortcode_atts( $this->predefined_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' ); } else { $width = array( '' ); } $sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? 'wpb_sortable' : $this->nonDraggableClass ); for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    '; $output .= '

    <%= params.title %>

    '; $output .= '
    mainHtmlBlockParams( $width, $i ) . '>'; $output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls ); $output .= '
    '; $output .= '
    containerHtmlBlockParams( $width, $i ) . '>'; $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; 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 .= '
    '; $output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls_bottom ); $output .= '
    '; $output .= '
    '; } return $output; } public function mainHtmlBlockParams( $width, $i ) { return 'data-element_type="' . $this->settings['base'] . '" class=" wpb_' . $this->settings['base'] . '"' . $this->customAdminBlockParams(); } public function containerHtmlBlockParams( $width, $i ) { return 'class="wpb_column_container vc_container_for_children"'; } public function contentAdmin_old( $atts, $content = null ) { $width = $el_class = $title = ''; extract( shortcode_atts( $this->predefined_atts, $atts ) ); $output = ''; $column_controls = $this->getColumnControls( $this->settings( 'controls' ) ); for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '

    ' . $title . '

    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; 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 .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; $output .= '
    '; } return $output; } protected function outputTitle( $title ) { return ''; } public function customAdminBlockParams() { return ''; } } PK2\atts = $atts; $this->content = $content; $this->template_vars = array(); } public function setGlobalTtaInfo() { $sectionClass = visual_composer()->getShortCode( 'vc_tta_section' )->shortcodeClass(); $this->sectionClass = $sectionClass; /** @var $sectionClass WPBakeryShortCode_VC_Tta_Section */ 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 */ 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; } public function getTtaContainerClasses() { $classes = array(); $classes[] = 'vc_tta-container'; return implode( ' ', apply_filters( 'vc_tta_container_classes', array_filter( $classes ), $this->getAtts() ) ); } 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->atts['el_class']; } return implode( ' ', apply_filters( 'vc_tta_accordion_general_classes', array_filter( $classes ), $this->getAtts() ) ); } 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 ); } 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 ) { $attributes[] = 'data-vc-tta-autoplay="' . esc_attr( json_encode( array( 'delay' => intval( $autoplay ) * 1000, ) ) ) . '"'; } return implode( ' ', $attributes ); } 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-' . $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-' . $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 '

    ' . $atts['title'] . '

    '; } 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 }}}', '', $panelsContent ); } else { $panelsContent = str_replace( '{{{ control-icon }}}', '', $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 */ 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(); $sectionClass = $this->sectionClass; $html = array(); $html[] = '
      '; if ( ! $isPageEditabe ) { VcShortcodeAutoloader::getInstance()->includeClass( 'WPBakeryShortCode_VC_Tta_Section' ); foreach ( WPBakeryShortCode_VC_Tta_Section::$section_info as $nth => $section ) { $strict_bounds = ( 'vc_tta_tabs' === $this->shortcode ); $active_section = $this->getActiveSection( $atts, $strict_bounds ); $classes = array( 'vc_pagination-item' ); if ( ( $nth + 1 ) === $active_section ) { $classes[] = $this->activeClass; } $a_html = ''; $html[] = '
    • ' . $a_html . '
    • '; } } $html[] = '
    '; 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' ), 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. * * @since 4.8 * * @return bool */ public function getAddAllowed() { return vc_user_access_check_shortcode_all( 'vc_tta_section' ); } } PK2\33!classes/shortcodes/shortcodes.phpnuW+Asettings = $settings; $this->shortcode = $this->settings['base']; } /** * @param $content * * @return string */ public function addInlineAnchors( $content ) { return ( $this->isInline() || $this->isEditor() && true === $this->settings( 'is_container' ) ? '' : '' ) . $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; } echo ' '; } /** * @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' ), 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' ); } return ''; } /** * @param $atts * @param null $content * * @return mixed|void */ 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|void */ protected function loadTemplate( $atts, $content = null ) { $output = ''; if ( ! is_null( $content ) ) { $content = apply_filters( 'vc_shortcode_content_filter', $content, $this->shortcode ); } $this->findShortcodeTemplate(); if ( $this->html_template ) { ob_start(); include( $this->html_template ); $output = ob_get_contents(); ob_end_clean(); } else { trigger_error( sprintf( __( 'Template file is missing for `%s` shortcode. Make sure you have `%s` file in your theme folder.', 'js_composer' ), $this->shortcode, 'wp-content/themes/your_theme/vc_templates/' . $this->shortcode . '.php' ) ); } return apply_filters( 'vc_shortcode_content_filter_after', $output, $this->shortcode ); } /** * @param $atts * @param $content * * @return string */ 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->shortcode, $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 */ public function output( $atts, $content = null, $base = '' ) { $this->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, $this->atts ); 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 * @since 4.4 * @return array */ 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( 'waypoints' ); wp_enqueue_style( '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 * * @deprecated 4.7 For debug type html comments use more generic debugComment function. * * @param $string * * @return string */ public function endBlockComment( $string ) { // _deprecated_function( 'WPBakeryShortCode::endBlockComment', '4.7 (will be removed in 4.10)', 'vc_asset_url' ); return wpb_debug() ? '' : ''; } /** * if wpb_debug=true return HTML comment * * @since 4.7 * * @param string $comment * * @return string */ public function debugComment( $comment ) { return wpb_debug() ? '' : ''; } /** * @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; } /** * @param $width * * @return string */ 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 .= '
    '; $output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width ), $column_controls ); $output .= $this->getCallbacks( $this->shortcode ); $output .= '
    '; $output .= '%wpb_element_content%'; $output .= '
    '; $output .= '
    '; return $output; } // Return block controls /** * @param $controls * @param string $extended_css * * @return string */ public function getColumnControls( $controls, $extended_css = '' ) { $controls_start = '
    '; $controls_end = '
    '; $controls_add = ''; $controls_edit = ' '; $controls_delete = ' '; $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 */ 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 ) ? array( 'add' ) : array(); } } } /** * Build new modern controls for shortcode. * * @param string $extended_css * * @return string */ 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(); } public function getBackendEditorControlsElementCssClass() { $sortable = ( vc_user_access_check_shortcode_all( $this->shortcode ) ? ' 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 .= ''; } } 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', ) ) ) { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">'; } elseif ( 'hidden' !== $param['holder'] ) { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . ''; } } if ( ! empty( $param['admin_label'] ) && true === $param['admin_label'] ) { $output .= ': ' . $value . ''; } 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="' . $params['title'] . '" '; } return ' '; } /** * @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 '

    ' . $this->getIcon( $params ) . esc_attr( $title ) . '

    '; } /** * @param string $content * * @return string */ public function template( $content = '' ) { return $this->contentAdmin( $this->atts, $content ); } /** * @param $atts * * @return array */ protected function prepareAtts( $atts ) { $return = array(); if ( is_array( $atts ) ) { foreach ( $atts as $key => $val ) { $return[ $key ] = str_replace( array( '`{`', '`}`', '``', ), array( '[', ']', '"', ), $val ); } } return $return; } /** * @return mixed */ public function getShortcode() { return $this->shortcode; } /** * Since 4.5 * Possible placeholders: * {{ content }} * {{ title }} * {{ container-class }} * * Possible keys: * {{ * <% * % * @since 4.5 * * @param $markup * @param string $content * * @return string */ 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] ) ) ) { // TODO: remove maybe create an wrappers as classes 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; } /* * not really work. there is not $atts and no dynamically updated. case 'params': { $inner = ''; if ( isset( $this->settings['params'] ) && is_array( $this->settings['params'] ) ) { 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 = is_null( $first_key ) ? '' : $param_value[ $first_key ]; } $inner .= $this->singleParamHtmlHolder( $param, $param_value ); } } $markup = str_replace( $match[0], $inner, $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. * * @since 4.8 * * @return bool */ public function getAddAllowed() { return true; } } } if ( ! class_exists( 'WPBakeryShortCodesContainer' ) ) { /** * 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 */ 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 . '' . ( ! empty( $this->settings['class'] ) ? ' ' . $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'; } /** * @param $controls * @param string $extended_css * * @return string */ public function getColumnControls( $controls = 'full', $extended_css = '' ) { $controls_start = '
    '; $controls_end = '
    '; if ( 'bottom-controls' === $extended_css ) { $control_title = sprintf( __( 'Append to this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ); } else { $control_title = sprintf( __( 'Prepend to this %s', 'js_composer' ), strtolower( $this->settings( 'name' ) ) ); } $controls_move = ''; $controls_add = ''; $controls_edit = ''; $controls_clone = ''; $controls_delete = ''; $controls_full = $controls_move . $controls_add . $controls_edit . $controls_clone . $controls_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_start; foreach ( $controls as $control ) { $control_var = 'controls_' . $control; if ( ( $editAccess && 'edit' == $control ) || $allAccess ) { if ( isset( ${$control_var} ) ) { $controls_string .= ${$control_var}; } } } return $controls_string . $controls_end; } if ( $allAccess ) { return $controls_start . $controls_full . $controls_end; } elseif ( $editAccess ) { return $controls_start . $controls_edit . $controls_end; } return $controls_start . $controls_end; } /** * @param $atts * @param null $content * * @return string */ public function contentAdmin( $atts, $content = null ) { $width = $el_class = ''; $atts = shortcode_atts( $this->predefined_atts, $atts ); extract( $atts ); $this->atts = $atts; $output = ''; for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    mainHtmlBlockParams( $width, $i ) . '>'; if ( $this->backened_editor_prepend_controls ) { $output .= $this->getColumnControls( $this->settings( 'controls' ) ); } $output .= '
    '; 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 .= '
    containerHtmlBlockParams( $width, $i ) . '>'; $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; $output .= $this->paramsHtmlHolders( $atts ); } $output .= '
    '; if ( $this->backened_editor_prepend_controls ) { $output .= $this->getColumnControls( 'add', 'bottom-controls' ); } $output .= '
    '; } 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 '

    ' . $this->getIcon( $params ) . '

    '; } public function getBackendEditorChildControlsElementCssClass() { return 'vc_element-name'; } } } if ( ! class_exists( 'WPBakeryShortCodeFishBones' ) ) { /** * Class WPBakeryShortCodeFishBones */ class WPBakeryShortCodeFishBones extends WPBakeryShortCode { /** * @var bool */ protected $shortcode_class = false; /** * @param $settings */ public function __construct( $settings ) { $this->settings = $settings; $this->shortcode = $this->settings['base']; $this->addAction( 'admin_init', 'hookAdmin' ); if ( ! shortcode_exists( $this->shortcode ) ) { add_shortcode( $this->shortcode, array( &$this, 'render', ) ); } } public function hookAdmin() { $this->enqueueAssets(); $this->addAction( 'admin_init', 'enqueueAssets' ); if ( vc_is_page_editable() ) { // fix for page editable $this->addAction( 'wp_head', 'printIconStyles' ); } $this->addAction( 'admin_head', 'printIconStyles' ); // fe+be $this->addAction( 'admin_print_scripts-post.php', 'enqueueAssets' ); $this->addAction( 'admin_print_scripts-post-new.php', 'enqueueAssets' ); } /** * @return WPBakeryShortCodeFishBones */ public function shortcodeClass() { // _deprecated_function( '\WPBakeryShortCodeFishBones::shortcodeClass', '4.9 (will be removed in 4.11)' ); 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::getInstance()->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; } /** * * * @since 4.9 * * @param $tag * @return \WPBakeryShortCodeFishBones */ public static function getElementClass( $tag ) { $settings = WPBMap::getShortCode( $tag ); require_once vc_path_dir( 'SHORTCODES_DIR', 'wordpress-widgets.php' ); $class_name = ! empty( $settings['php_class_name'] ) ? $settings['php_class_name'] : 'WPBakeryShortCode_' . $tag; $autoloaded_dependencies = VcShortcodeAutoloader::getInstance()->includeClass( $class_name ); if ( ! $autoloaded_dependencies ) { $file = vc_path_dir( 'SHORTCODES_DIR', str_replace( '_', '-', $tag ) . '.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 */ public function render( $atts, $content = null, $tag = null ) { return $this->getElementClass( $tag )->output( $atts, $content ); } /** * This method is not used * * @param $atts * @param null $content * * @return string */ protected function content( $atts, $content = null ) { return ''; } /** * @param string $content * * @return string */ public function template( $content = '' ) { return $this->shortcodeClass()->contentAdmin( array(), $content ); } } } /** * @since 4.9 * * Class Vc_Shortcodes_Manager */ final class Vc_Shortcodes_Manager { private $shortcode_classes = 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; } public function setTag( $tag ) { $this->tag = $tag; return $this; } public function getElementClass( $tag ) { if ( isset( $this->shortcode_classes[ $tag ] ) ) { return $this->shortcode_classes[ $tag ]; } $settings = WPBMap::getShortCode( $tag ); require_once vc_path_dir( 'SHORTCODES_DIR', 'wordpress-widgets.php' ); $class_name = ! empty( $settings['php_class_name'] ) ? $settings['php_class_name'] : 'WPBakeryShortCode_' . $tag; $autoloaded_dependencies = VcShortcodeAutoloader::getInstance()->includeClass( $class_name ); if ( ! $autoloaded_dependencies ) { $file = vc_path_dir( 'SHORTCODES_DIR', str_replace( '_', '-', $tag ) . '.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[ $tag ] = $shortcode_class; return $shortcode_class; } public function shortcodeClass() { return $this->getElementClass( $this->tag ); } /** * @param string $content * * @return string */ public function template( $content = '' ) { return $this->getElementClass( $this->tag )->contentAdmin( array(), $content ); } /** * @param $name * * @return null */ 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 */ 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(); } } } PK2\s )classes/shortcodes/vc-images-carousel.phpnuW+AjsCssScripts(); } 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 ); } public static function getCarouselIndex() { return self::$carousel_index ++ . '-' . time(); } protected function getSliderWidth( $size ) { global $_wp_additional_image_sizes; $width = '100%'; if ( in_array( $size, get_intermediate_image_sizes() ) ) { if ( in_array( $size, array( 'thumbnail', 'medium', 'large' ) ) ) { $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; } } PK2\[,classes/shortcodes/vc-gitem-post-excerpt.phpnuW+Asettings( 'icon' ); return '

    '; } } PK2\R$classes/shortcodes/vc-cta-button.phpnuW+A '', 'title' => '', ); protected $controls_template_file = 'editors/partials/backend_controls_tab.tpl.php'; public function __construct( $settings ) { parent::__construct( $settings ); } public function customAdminBlockParams() { return ' id="tab-' . $this->atts['tab_id'] . '"'; } 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(); } public function containerHtmlBlockParams( $width, $i ) { return 'class="wpb_column_container vc_container_for_children"'; } public function getColumnControls( $controls, $extended_css = '' ) { return $this->getColumnControlsModular( $extended_css ); } } /** * @param $settings * @param $value * * @since 4.4 * @return string */ function vc_tab_id_settings_field( $settings, $value ) { return '
    ' . '' . '' . '
    '; // TODO: Add data-js-function to documentation } vc_add_shortcode_param( 'tab_id', 'vc_tab_id_settings_field' ); PK2\7N#classes/shortcodes/vc-row-inner.phpnuW+AcontentAdmin( $this->atts ); } } PK2\@2#classes/shortcodes/vc-separator.phpnuW+AaddFilter( 'vc_inline_template_content', 'setCustomTabId' ); self::$filter_added = true; } } 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 ); $output = ''; $tab_titles = array(); if ( isset( $matches[0] ) ) { $tab_titles = $matches[0]; } $tmp = ''; if ( count( $tab_titles ) ) { $tmp .= '
      '; 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 .= '
    • ' . $tab_matches[1][0] . '
    • '; } } $tmp .= '
    ' . "\n"; } else { $output .= do_shortcode( $content ); } $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; } public function getTabTemplate() { return '
    ' . do_shortcode( '[vc_tab title="Tab" tab_id=""][/vc_tab]' ) . '
    '; } public function setCustomTabId( $content ) { return preg_replace( '/tab\_id\=\"([^\"]+)\"/', 'tab_id="$1-' . time() . '"', $content ); } } PK2\Xg%%!classes/shortcodes/vc-section.phpnuW+AshortcodeScripts(); } protected function shortcodeScripts() { wp_register_script( 'vc_jquery_skrollr_js', vc_asset_url( 'lib/bower/skrollr/dist/skrollr.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'vc_youtube_iframe_api_js', '//www.youtube.com/iframe_api', array(), WPB_VC_VERSION, true ); } 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'] : '' ); } public function getColumnControls( $controls = 'full', $extended_css = '' ) { $controls_start = '
    '; $output = '
    '; $controls_end = '
    '; //Create columns $controls_move = ' '; $controls_add = ' '; $controls_delete = ''; $controls_edit = ' '; $controls_clone = ' '; $editAccess = vc_user_access_check_shortcode_edit( $this->shortcode ); $allAccess = vc_user_access_check_shortcode_all( $this->shortcode ); $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 .= ''; if ( $allAccess ) { $output .= $controls_move . $controls_add . $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; } public function contentAdmin( $atts, $content = null ) { $width = $el_class = ''; $atts = shortcode_atts( $this->predefined_atts, $atts ); $output = ''; $column_controls = $this->getColumnControls(); for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    '; $output .= str_replace( '%column_size%', 1, $column_controls ); $output .= '
    '; 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 .= '
    containerHtmlBlockParams( $width, $i ) . '>'; $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; // $output .= $this->paramsHtmlHolders( $atts ); } 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 .= '
    '; if ( $this->backened_editor_prepend_controls ) { $output .= $this->getColumnControls( 'add', 'vc_section-bottom-controls bottom-controls' ); } $output .= '
    '; } return $output; } } PK2\Rܗٔ"classes/shortcodes/vc-tta-tabs.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Tta_Accordion' ); 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' ); } 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( json_encode( array( 'delay' => intval( $autoplay ) * 1000, ) ) ) . '"'; } return implode( ' ', $attributes ); } 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 */ 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 ''; } /** * @param $atts * @param $content * * @return string */ public function getParamTabsList( $atts, $content ) { $isPageEditabe = vc_is_page_editable(); $html = array(); $html[] = '
    '; $html[] = '
      '; if ( ! $isPageEditabe ) { $strict_bounds = ( 'vc_tta_tabs' === $this->shortcode ); $active_section = $this->getActiveSection( $atts, $strict_bounds ); foreach ( WPBakeryShortCode_VC_Tta_Section::$section_info as $nth => $section ) { $classes = array( 'vc_tta-tab' ); if ( ( $nth + 1 ) === $active_section ) { $classes[] = $this->activeClass; } $title = '' . $section['title'] . ''; 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 = '' . $title . ''; $html[] = '
    • ' . $a_html . '
    • '; } } $html[] = '
    '; $html[] = '
    '; 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; } } PK2\BG++&classes/shortcodes/vc-gitem-zone-a.phpnuW+A '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 * * @since 4.4 * @return bool */ protected function getField( $key ) { return isset( $this->fields[ $key ] ) ? $this->fields[ $key ] : false; } /** * Get param value by providing key * * @param $key * * @since 4.4 * @return array|bool */ 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 * * @since 4.3 * @return array */ 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' => $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 * * @since 4.3 * @return array */ 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 $regexr = 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, ); } } PK2\1س classes/shortcodes/vc-button.phpnuW+Asettings( 'icon' ); return '

    '; } } PK2\Gլ66(classes/shortcodes/vc-text-separator.phpnuW+Ashortcode, 'vc_icon', $atts, 'i_' ); if ( $data ) { $icon = visual_composer()->getShortCode( 'vc_icon' ); if ( is_object( $icon ) ) { return $icon->render( array_filter( $data ) ); } } return ''; } } PK2\ ! !classes/shortcodes/vc-row.phpnuW+A '', ); 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' ), WPB_VC_VERSION, true ); wp_register_script( 'vc_youtube_iframe_api_js', '//www.youtube.com/iframe_api', array(), WPB_VC_VERSION, true ); } 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 = ''; foreach ( $vc_row_layouts as $layout ) { $controls_layout .= ' '; } $controls_layout .= '
    ' . __( 'Custom', 'js_composer' ) . ' '; $controls_layout .= '
    '; return $controls_layout; } public function getColumnControls( $controls, $extended_css = '' ) { $output = '
    '; $controls_end = '
    '; //Create columns $controls_layout = $this->getLayoutsControl(); $controls_move = ' '; $controls_add = ' '; $controls_delete = ''; $controls_edit = ' '; $controls_clone = ' '; $controls_toggle = ' '; $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 = ''; 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 .= ''; if ( $allAccess ) { $output .= $controls_move . $controls_layout . $controls_add . $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; } public function contentAdmin( $atts, $content = null ) { $width = $el_class = ''; $atts = shortcode_atts( $this->predefined_atts, $atts ); $output = ''; $column_controls = $this->getColumnControls( $this->settings( 'controls' ) ); for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    '; $output .= str_replace( '%column_size%', 1, $column_controls ); $output .= '
    '; $output .= '
    '; 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 .= '
    '; 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 .= '
    '; $output .= '
    '; } return $output; } 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'] : '' ); } /** * @deprecated - due to it is not used anywhere? 4.5 * @typo Bock - Block * @return string */ public function customAdminBockParams() { // _deprecated_function( 'WPBakeryShortCode_VC_Row::customAdminBockParams', '4.5 (will be removed in 4.10)' ); return ''; } /** * @deprecated 4.5 * * @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 */ public function buildStyle( $bg_image = '', $bg_color = '', $bg_image_repeat = '', $font_color = '', $padding = '', $margin_bottom = '' ) { // _deprecated_function( 'WPBakeryShortCode_VC_Row::buildStyle', '4.5 (will be removed in 4.10)' ); $has_image = false; $style = ''; if ( (int) $bg_image > 0 && false !== ( $image_url = wp_get_attachment_url( $bg_image ) ) ) { $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 ) . '"'; } } PK2\ "classes/shortcodes/vc-raw-html.phpnuW+A' . htmlentities( rawurldecode( base64_decode( strip_tags( $value ) ) ), ENT_COMPAT, 'UTF-8' ) . ''; } else { $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . ''; } } return $output; } } PK2\O)>)classes/shortcodes/vc-gitem-post-meta.phpnuW+A '', 'el_position' => '', 'width' => '1/2', ), $atts ) ); $el_class = $this->getExtraClass( $el_class ); $el_class .= ' wpb_raw_js'; $content = rawurldecode( base64_decode( strip_tags( $content ) ) ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_raw_code' . $el_class, $this->settings['base'], $atts ); $output = '
    '; return $output; } } PK2\iMGG,classes/shortcodes/vc-masonry-media-grid.phpnuW+Agrid_settings['style'] .= '-masonry'; } protected function contentAllMasonry( $grid_style, $settings, $content ) { return parent::contentAll( $grid_style, $settings, $content ); } protected function contentLazyMasonry( $grid_style, $settings, $content ) { return parent::contentLazy( $grid_style, $settings, $content ); } protected function contentLoadMoreMasonry( $grid_style, $settings, $content ) { return parent::contentLoadMore( $grid_style, $settings, $content ); } } PK2\JT#classes/shortcodes/vc-gitem-row.phpnuW+A'; foreach ( array_slice( $vc_row_layouts, 0, 4 ) as $layout ) { $controls_layout .= ' '; } $controls_layout .= ''; return $controls_layout; } } PK2\Q-&&+classes/shortcodes/vc-gitem-post-author.phpnuW+AjsCssScripts(); } 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 ); } public static function getCarouselIndex() { return self::$carousel_index ++ . '-' . time(); } } PK2\- classes/shortcodes/vc-flickr.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $css = isset( $atts['css'] ) ? $atts['css'] : ''; $el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : ''; $class_to_filter = 'wpb_flickr_widget wpb_content_element'; $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 ); $output = '
    ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_flickr_heading', ) ) . '

    ' . __( 'View stream on flickr', 'js_composer' ) . '

    '; return $output; } } PK2\ᎎ classes/shortcodes/vc-toggle.phpnuW+AgetShortCode( '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 '

    ' . esc_html( $atts['title'] ) . '

    '; } } } PK2\҇xx!classes/shortcodes/vc-twitter.phpnuW+Ateaser_data = get_post_meta( $id, self::$meta_data_name, true ); return isset( $this->teaser_data[ $name ] ) ? $this->teaser_data[ $name ] : ''; } protected function getCategoriesCss( $post_id ) { $categories_css = ''; $post_categories = wp_get_object_terms( $post_id, $this->getTaxonomies() ); foreach ( $post_categories as $cat ) { if ( ! in_array( $cat->term_id, $this->filter_categories ) ) { $this->filter_categories[] = $cat->term_id; } $categories_css .= ' grid-cat-' . $cat->term_id; } return $categories_css; } protected function resetTaxonomies() { $this->taxonomies = false; } protected function getTaxonomies() { if ( false === $this->taxonomies ) { $this->taxonomies = get_object_taxonomies( ! empty( $this->loop_args['post_type'] ) ? $this->loop_args['post_type'] : get_post_types( array( 'public' => false, 'name' => 'attachment', ), 'names', 'NOT' ) ); } return $this->taxonomies; } protected function getLoop( $loop ) { global $vc_posts_grid_exclude_id; $vc_posts_grid_exclude_id[] = get_the_ID(); require_once vc_path_dir( 'PARAMS_DIR', 'loop/loop.php' ); list( $this->loop_args, $this->query ) = vc_build_loop_query( $loop, $vc_posts_grid_exclude_id ); } protected function spanClass( $grid_columns_count ) { $teaser_width = ''; switch ( $grid_columns_count ) { case '1' : $teaser_width = 'vc_col-sm-12'; break; case '2' : $teaser_width = 'vc_col-sm-6'; break; case '3' : $teaser_width = 'vc_col-sm-4'; break; case '4' : $teaser_width = 'vc_col-sm-3'; break; case '5': $teaser_width = 'vc_col-sm-10'; break; case '6' : $teaser_width = 'vc_col-sm-2'; break; } return $teaser_width; } protected function getMainCssClass( $filter ) { return 'wpb_' . ( 'yes' === $filter ? 'filtered_' : '' ) . 'grid'; } protected function getFilterCategories() { return get_terms( $this->getTaxonomies(), array( 'orderby' => 'name', 'include' => implode( ',', $this->filter_categories ), ) ); } protected function getPostThumbnail( $post_id, $grid_thumb_size ) { return wpb_getImageBySize( array( 'post_id' => $post_id, 'thumb_size' => $grid_thumb_size ) ); } protected function getPostContent() { remove_filter( 'the_content', 'wpautop' ); $content = str_replace( ']]>', ']]>', apply_filters( 'the_content', get_the_content() ) ); return $content; } protected function getPostExcerpt() { remove_filter( 'the_excerpt', 'wpautop' ); $content = apply_filters( 'the_excerpt', get_the_excerpt() ); return $content; } protected function getLinked( $post, $content, $type, $css_class ) { $output = ''; if ( 'link_post' === $type || empty( $type ) ) { $url = get_permalink( $post->id ); $title = sprintf( esc_attr__( 'Permalink to %s', 'js_composer' ), $post->title_attribute ); $output .= 'link_target . ' title="' . $title . '">' . $content . ''; } elseif ( 'link_image' === $type && isset( $post->image_link ) && ! empty( $post->image_link ) ) { $this->loadPrettyPhoto(); // actually fixes relations if more prettyphoto added on page if ( ! $this->pretty_rel_random ) { $this->pretty_rel_random = ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . rand() . ']"'; } $output .= 'pretty_rel_random . ' ' . $this->link_target . ' title="' . $post->title_attribute . '">' . $content . ''; } else { $output .= $content; } return $output; } protected function loadPrettyPhoto() { if ( true !== self::$pretty_photo_loaded ) { wp_enqueue_script( 'prettyphoto' ); wp_enqueue_style( 'prettyphoto' ); self::$pretty_photo_loaded = true; } } protected function setLinkTarget( $grid_link_target = '' ) { $this->link_target = '_blank' === $grid_link_target ? ' target="_blank"' : ''; } protected function findBlockTemplate() { $template_path = $this->block_template_dir_name . '/' . $this->block_template_filename; // Check template path in shortcode's mapping settings if ( ! empty( $this->settings['html_template'] ) && is_file( $this->settings( 'html_template' ) . $template_path ) ) { return $this->settings['html_template'] . $template_path; } // Check template in theme directory $user_template = vc_shortcodes_theme_templates_dir( $template_path ); if ( is_file( $user_template ) ) { return $user_template; } // Check default place $default_dir = vc_manager()->getDefaultShortcodesTemplatesDir() . '/'; if ( is_file( $default_dir . $template_path ) ) { return $default_dir . $template_path; } return $template_path; } protected function getBlockTemplate() { if ( ! isset( $this->block_template_path ) ) { $this->block_template_path = $this->findBlockTemplate(); } return $this->block_template_path; } } PK2\zvvclasses/shortcodes/vc-gmaps.phpnuW+A11)classes/shortcodes/vc-gitem-post-date.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Tta_Tabs' ); class WPBakeryShortCode_VC_Tta_Pageable extends WPBakeryShortCode_VC_Tta_Tabs { public $layout = 'tabs'; public function getTtaContainerClasses() { $classes = parent::getTtaContainerClasses(); $classes .= ' vc_tta-o-non-responsive'; return $classes; } 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 ''; } } PK2\K!classes/shortcodes/vc-gallery.phpnuW+AshortcodeScripts(); } public function shortcodeScripts() { wp_register_script( 'vc_grid-js-imagesloaded', vc_asset_url( 'lib/bower/imagesloaded/imagesloaded.pkgd.min.js' ) ); } 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 . ''; } if ( 'images' === $param_name ) { $images_ids = empty( $value ) ? array() : explode( ',', trim( $value ) ); $output .= '
      '; foreach ( $images_ids as $image ) { $img = wpb_getImageBySize( array( 'attach_id' => (int) $image, 'thumb_size' => 'thumbnail' ) ); $output .= ( $img ? '
    • ' . $img['thumbnail'] . '
    • ' : '
    • ' ); } $output .= '
    '; $output .= '' . __( 'Add images', 'js_composer' ) . ''; } return $output; } } PK2\Fo$!! classes/shortcodes/vc-column.phpnuW+A '', 'el_class' => '', 'el_position' => '', 'width' => '1/1', ); public $nonDraggableClass = 'vc-non-draggable-column'; /** * @param $controls * @param string $extended_css * * @return string */ public function getColumnControls( $controls, $extended_css = '' ) { $output = '
    '; $controls_end = '
    '; 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 = ''; } else { $controls_add = ''; } $controls_edit = ''; $controls_delete = ''; $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 . ''; } return $output; } /** * @param $atts * @param null $content * * @return string */ public function contentAdmin( $atts, $content = null ) { $width = $el_class = ''; extract( shortcode_atts( $this->predefined_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===$width-14-14-14' ) { $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===$width-23' ) { $width = array( 'vc_col-sm-4', 'vc_col-sm-8', ); } elseif ( ' column_13===$width-13-13' ) { $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===$width-12' ) { $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( '' ); } for ( $i = 0; $i < count( $width ); $i ++ ) { $output .= '
    mainHtmlBlockParams( $width, $i ) . '>'; $output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls ); $output .= '
    '; $output .= '
    containerHtmlBlockParams( $width, $i ) . '>'; $output .= do_shortcode( shortcode_unautop( $content ) ); $output .= '
    '; 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 .= '
    '; $output .= str_replace( '%column_size%', wpb_translateColumnWidthToFractional( $width[ $i ] ), $column_controls_bottom ); $output .= '
    '; } return $output; } /** * @return string */ public function customAdminBlockParams() { return ''; } /** * @param $width * @param $i * * @return string */ 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 ) . '"'; } } PK2\X2classes/shortcodes/example.phpnuW+A '1/2', 'el_position' => '', 'foo' => '', 'my_dropdown' => '', ), $atts ) ); $width_class = ''; $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $width_class, $this->settings['base'], $atts ); $output = '
    '; $output .= '

    ' . $foo . '

    '; $output .= wpb_js_remove_wpautop( $content, true ); $output .= '

    Dropdown: ' . $my_dropdown . '

    '; $output .= '
    '; return $output; } } /* * Settings array to setup shortcode "Hello world" * base param is required. * * Mapping examples: $PLUGIN_DIR/config/map.php * * name - used in content elements menu and shortcode edit screen. * base - shortcode base. Example my_hello_world * class - helper class to target your shortcode in css in visual composer edit mode * icon - in order to add icon for your shortcode in dropdown menu, add class name here and style it in * your own css file. Note: bootstrap icons supported. * controls - in visual composer mode shortcodes can have different controls (popup_delete, edit_popup_delete, size_delete, popup_delete, full). Default is full. * params - array which holds your shortcode params. This params will be editable in shortcode settings page. * * Available param types: * * textarea_html (only one html textarea is permitted per shortcode) * textfield - simple input field, * dropdown - dropdown element with set of available options, * attach_image - single image selection, * attach_images - multiple images selection, * exploded_textarea - textarea, where each line will be imploded with comma (,), * posttypes - checkboxes with available post types, * widgetised_sidebars - dropdown element with set of available widget regions, * textarea - simple textarea, * textarea_raw_html - textarea, it's content will be codede into base64 (this allows you to store raw js or raw html code). * */ vc_map( array( 'base' => 'my_hello_world', 'name' => __( 'Hello World', 'js_composer' ), 'class' => '', 'icon' => 'icon-heart', 'params' => array( array( 'type' => 'textfield', 'holder' => 'h3', 'class' => '', 'heading' => __( 'Foo attribute', 'js_composer' ), 'param_name' => 'foo', 'value' => __( "I'm foo attribute", 'js_composer' ), 'description' => __( 'Enter foo value.', 'js_composer' ), ), array( 'type' => 'textarea_html', 'holder' => 'div', 'class' => '', 'heading' => __( 'Text', 'js_composer' ), 'param_name' => 'content', 'value' => __( "I'm hello world", 'js_composer' ), 'description' => __( 'Enter your content.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Drop down example', 'js_composer' ), 'param_name' => 'my_dropdown', 'value' => array( 1, 2, 'three' ), 'description' => __( 'One, two or three?', 'js_composer' ), ), ), ) ); PK2\"C"C(classes/settings/class-vc-automapper.phpnuW+AloadOptionData(); $this->id = is_array( $d ) && isset( $d['id'] ) ? $d['id'] : $d; if ( is_array( $d ) ) { $this->data = stripslashes_deep( $d ); } foreach ( $this->vars as $var ) { $this->$var = $this->get( $var ); } } /** * @return array */ 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|void */ 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 */ 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 */ 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 */ function save() { if ( ! $this->isValid() ) { return false; } foreach ( $this->vars as $var ) { $this->data[ $var ] = $this->$var; } return $this->saveOption(); } /** * @return bool */ 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 update_option( self::$option_name, self::$option_data ); } } } 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; /** * */ public function __construct() { $this->title = __( 'Shortcode Mapper', 'js_composer' ); } /** * */ public function addAjaxActions() { add_action( 'wp_ajax_vc_automapper', array( &$this, 'goAction', ) ); return $this; } /** * Builds html for Automapper CRUD like administration block * * @return bool */ public function renderHtml() { if ( $this->disabled() ) { return false; } ?>

    renderTemplates() ?> ' . '' . '' . '' . '' . ''; } /** * */ public function renderMapFormTpl() { ?> renderMapFormTpl(); } /** * Action methods(CRUD) */ public function goAction() { vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-automapper-tab' )->validateDie(); $action = vc_post_param( 'vc_action' ); $this->result( $this->$action() ); } /** * @return bool */ public function create() { $data = vc_post_param( 'data' ); $shortcode = new Vc_Automap_Model( $data ); return $shortcode->save(); } /** * @return bool */ public function update() { $id = 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 ); return $shortcode->save(); } /** * @return bool */ public function delete() { $id = vc_post_param( 'id' ); $shortcode = new Vc_Automap_Model( $id ); return $shortcode->delete(); } /** * @return array */ public function read() { return Vc_Automap_Model::findAll(); } /** * Ajax result output * * @param $data */ function result( $data ) { echo is_array( $data ) || is_object( $data ) ? json_encode( $data ) : $data; die(); } /** * 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', ) ); } } } } // 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; } } PK2\[AA%classes/settings/class-vc-license.phpnuW+AfinishActivationDeactivation( true, $_GET['activate'] ); } else if ( ! empty( $_GET['deactivate'] ) ) { $this->finishActivationDeactivation( false, $_GET['deactivate'] ); } } add_action( 'wp_ajax_vc_get_activation_url', array( $this, 'startActivationResponse', ) ); add_action( 'wp_ajax_vc_get_deactivation_url', array( $this, 'startDeactivationResponse', ) ); // @deprecated 4.8 Remove after 2015-12-01 add_action( 'wp_ajax_wpb_activate_license', array( $this, 'activate', ) ); add_action( 'wp_ajax_wpb_deactivate_license', array( $this, 'deactivate', ) ); add_action( 'wp_ajax_nopriv_vc_check_license_key', array( vc_license(), 'checkLicenseKeyFromRemote', ) ); } /** * Output notice * * @param string $message * @param bool $success */ function outputNotice( $message, $success = true ) { echo '

    ' . 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 */ function outputLastError() { $this->outputNotice( $this->error, false ); } /** * Output successful activation message */ function outputActivatedSuccess() { $this->outputNotice( __( 'Visual Composer successfully activated.', 'js_composer' ), true ); } /** * Output successful deactivation message */ function outputDeactivatedSuccess() { $this->outputNotice( __( 'Visual Composer 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 */ function finishActivationDeactivation( $activation, $user_token ) { if ( ! $this->isValidToken( $user_token ) ) { $this->showError( __( '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 ) ); $response = wp_remote_post( $url, $params ); if ( is_wp_error( $response ) ) { $this->showError( __( sprintf( '%s. Please try again.', $response->get_error_message() ), 'js_composer' ) ); return false; } if ( 200 !== $response['response']['code'] ) { $this->showError( __( sprintf( 'Server did not respond with OK: %s', $response['response']['code'] ), 'js_composer' ) ); return false; } $json = json_decode( $response['body'], true ); if ( ! $json || ! isset( $json['status'] ) ) { $this->showError( __( 'Invalid response structure. Please contact us for support.', 'js_composer' ) ); return false; } if ( ! $json['status'] ) { $this->showError( __( '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( __( '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; } /** * @deprecated 4.8 Remove after 2015-12-01 * * @param $array * * @return string */ public static function getWpbControlUrl( $array ) { _deprecated_function( '\Vc_License::getWpbControlUrl', '4.8 (will be removed in next release)' ); $array1 = array( 'h', 'tt', 'p', ':', '//', 's', 'upp', 'ort.', 'w', 'pba', 'ker', 'y.c', 'om', '', '/a', 'j', 'ax', '/s', 'ite', '/', ); return implode( '', array_merge( $array1, $array ) ); } /** * @deprecated 4.8 Remove after 2015-12-01 * * @param string $deactivation_key */ public function setDeactivation( $deactivation_key ) { _deprecated_function( '\Vc_License::setDeactivation', '4.8 (will be removed in next release)' ); update_option( 'vc_license_activation_key', $deactivation_key ); } /** * @deprecated 4.8 Remove after 2015-12-01 * * @return string */ public function deactivation() { _deprecated_function( '\Vc_License::deactivation', '4.8 (will be removed in next release)' ); return get_option( 'vc_license_activation_key' ); } /** * @return boolean */ public function isActivated() { return (bool) $this->getLicenseKey(); } /** * 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' => __( 'Invalid license key', 'js_composer' ), ); } else { $response = array( 'status' => true ); } die( 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( 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( json_encode( $response ) ); } /** * Old activation process * * @deprecated 4.8 Remove after 2015-12-01 */ public function activate() { _deprecated_function( '\Vc_License::active', '4.8 (will be removed in next release)' ); vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-updater-tab' )->validateDie(); $params = array(); $params['username'] = vc_post_param( 'username' ); $params['version'] = WPB_VC_VERSION; $params['key'] = vc_post_param( 'key' ); $params['api_key'] = vc_post_param( 'api_key' ); $params['url'] = get_site_url(); $params['ip'] = isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; $params['dkey'] = vc_random_string( 20 ); $string = 'activatelicense?'; $request_url = self::getWpbControlUrl( array( $string, http_build_query( $params, '', '&' ), ) ); $response = wp_remote_get( $request_url, array( 'timeout' => 300 ) ); if ( is_wp_error( $response ) ) { echo json_encode( array( 'result' => false ) ); die(); } $result = json_decode( $response['body'] ); if ( ! is_object( $result ) ) { echo json_encode( array( 'result' => false ) ); die(); } if ( true === (boolean) $result->result || ( 401 === (int) $result->code && isset( $result->deactivation_key ) ) ) { $this->setDeactivation( isset( $result->code ) && 401 === (int) $result->code ? $result->deactivation_key : $params['dkey'] ); vc_settings()->set( 'envato_username', $params['username'] ); vc_settings()->set( 'envato_api_key', $params['api_key'] ); vc_license()->setLicenseKey( $params['key'] ); echo json_encode( array( 'result' => true ) ); die(); } echo $response['body']; die(); } /** * 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 $license_key === $this->getLicenseKey(); } /** * Old deactivation process * * @deprecated 4.8 Remove after 2015-12-01 */ public function deactivate() { _deprecated_function( '\Vc_License::active', '4.8 (will be removed in next release)' ); vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'manage_options' )->validateDie()->part( 'settings' )->can( 'vc-updater-tab' )->validateDie(); $params = array(); $params['dkey'] = $this->deactivation(); $string = 'deactivatelicense?'; $request_url = self::getWpbControlUrl( array( $string, http_build_query( $params, '', '&' ), ) ); $response = wp_remote_get( $request_url, array( 'timeout' => 300 ) ); if ( is_wp_error( $response ) ) { echo json_encode( array( 'result' => false ) ); die(); } $result = json_decode( $response['body'] ); if ( (boolean) $result->result ) { $this->setDeactivation( '' ); } echo $response['body']; die(); } /** * Set up license activation notice if needed * * Don't show notice on dev environment */ public function setupReminder() { if ( self::isDevEnvironment() ) { return; } if ( ! $this->isActivated() && ( empty( $_COOKIE['vchideactivationmsg_vc11'] ) || version_compare( $_COOKIE['vchideactivationmsg_vc11'], 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', ) ) ) { 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() ); ?>

    ' . sprintf( __( 'Hola! Would you like to receive automatic updates and unlock premium support? Please activate your copy of Visual Composer.', 'js_composer' ), wp_nonce_url( $redirect ) ) . '

    ' . '
    '; } /** * 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 ); } public static function getSiteUrl() { if ( vc_is_network_plugin() ) { return network_site_url(); } else { return site_url(); } } } PK2\ߞߞ&classes/settings/class-vc-settings.phpnuW+Apage; } /** * @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'] = __( 'General Settings', 'js_composer' ); if ( ! vc_is_as_theme() || apply_filters( 'vc_settings_page_show_design_tabs', false ) ) { $this->tabs['vc-color'] = __( 'Design Options', 'js_composer' ); $this->tabs['vc-custom_css'] = __( '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'] = __( '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(); } } 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 */ 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 ( ( isset( $_GET['build_css'] ) && ( '1' === $_GET['build_css'] || 'true' === $_GET['build_css'] ) ) || ( isset( $_GET['settings-updated'] ) && ( '1' === $_GET['settings-updated'] || 'true' === $_GET['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' => __( 'Main accent color', 'js_composer' ) ) ), array( 'vc_color_hover' => array( 'title' => __( 'Hover color', 'js_composer' ) ) ), array( 'vc_color_call_to_action_bg' => array( 'title' => __( 'Call to action background color', 'js_composer' ) ) ), array( 'vc_color_google_maps_bg' => array( 'title' => __( 'Google maps background color', 'js_composer' ) ) ), array( 'vc_color_post_slider_caption_bg' => array( 'title' => __( 'Post slider caption background color', 'js_composer' ) ) ), array( 'vc_color_progress_bar_bg' => array( 'title' => __( 'Progress bar background color', 'js_composer' ) ) ), array( 'vc_color_separator_border' => array( 'title' => __( 'Separator border color', 'js_composer' ) ) ), array( 'vc_color_tab_bg' => array( 'title' => __( 'Tabs navigation background color', 'js_composer' ) ) ), array( 'vc_color_tab_bg_active' => array( 'title' => __( 'Active tab background color', 'js_composer' ) ) ), ); self::$defaults = array( 'vc_color' => '#f7f7f7', 'vc_color_hover' => '#F0F0F0', 'margin' => '35px', 'gutter' => '15', 'responsive_max' => '768', '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' )// see settings_fields() function ->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, __( '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, __( '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, __( '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, __( 'Elements bottom margin', 'js_composer' ), 'margin', array( $this, 'sanitize_margin_callback', ), array( $this, 'margin_callback', ) ); // Gutter $this->addField( $tab, __( 'Grid gutter width', 'js_composer' ), 'gutter', array( $this, 'sanitize_gutter_callback', ), array( $this, 'gutter_callback', ) ); // Responsive max width $this->addField( $tab, __( 'Mobile screen width', 'js_composer' ), 'responsive_max', array( $this, 'sanitize_responsive_max_callback', ), array( $this, 'responsive_max_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, __( '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 . 'use_custom' ); delete_option( self::$field_prefix . 'compiled_js_composer_less' ); delete_option( self::$field_prefix . 'less_version' ); } /** * @deprecated since 4.4 */ public function removeAllCssClasses() { _deprecated_function( '\Vc_Settings::removeAllCssClasses', '4.4 (will be removed in 5.1)' ); delete_option( self::$field_prefix . 'row_css_class' ); delete_option( self::$field_prefix . 'column_css_classes' ); } /** * @param $option_name * * @param bool $defaultValue * * @return mixed|void */ 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. * */ 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, false ); 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' => __( 'Are you sure you want to reset to defaults?', 'js_composer' ), 'are_you_sure_reset_color' => __( 'Are you sure you want to reset to defaults?', 'js_composer' ), 'saving' => __( 'Saving...', 'js_composer' ), 'save' => __( 'Save Changes', 'js_composer' ), 'saved' => __( 'Design Options successfully saved.', 'js_composer' ), 'save_error' => __( 'Design Options could not be saved', 'js_composer' ), 'form_save_error' => __( 'Problem with AJAX request execution, check internet connection and try again.', 'js_composer' ), 'are_you_sure_delete' => __( 'Are you sure you want to delete this shortcode?', 'js_composer' ), 'are_you_sure_delete_param' => __( "Are you sure you want to delete the shortcode's param?", 'js_composer' ), 'my_shortcodes_category' => __( 'My shortcodes', 'js_composer' ), 'error_shortcode_name_is_required' => __( 'Shortcode name is required.', 'js_composer' ), 'error_enter_valid_shortcode_tag' => __( 'Please enter valid shortcode tag.', 'js_composer' ), 'error_enter_required_fields' => __( 'Please enter all required fields for params.', 'js_composer' ), 'new_shortcode_mapped' => __( 'New shortcode mapped from string!', 'js_composer' ), 'shortcode_updated' => __( 'Shortcode updated!', 'js_composer' ), 'error_content_param_not_manually' => __( 'Content param can not be added manually, please use checkbox.', 'js_composer' ), 'error_param_already_exists' => __( 'Param %s already exists. Param names must be unique.', 'js_composer' ), 'error_wrong_param_name' => __( 'Please use only letters, numbers and underscore for param name', 'js_composer' ), 'error_enter_valid_shortcode' => __( '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' => wpb_debug(), ) ) ); wp_localize_script( 'wpb_js_composer_settings', 'i18nLocaleSettings', $this->locale ); } /** * Access groups * @deprecated 4.8 */ public function groups_access_rules_callback() { _deprecated_function( '\Vc_Settings::groups_access_rules_callback', '4.8 (will be removed in 5.1)' ); global $wp_roles; $groups = is_object( $wp_roles ) ? $wp_roles->roles : array(); $settings = ( $settings = get_option( self::$field_prefix . 'groups_access_rules' ) ) ? $settings : array(); $show_types = array( 'all' => __( 'Show Visual Composer & default editor', 'js_composer' ), 'only' => __( 'Show only Visual Composer', 'js_composer' ), 'no' => __( "Don't allow to use Visual Composer", 'js_composer' ), ); $shortcodes = WPBMap::getShortCodes(); $size_line = ceil( count( array_keys( $shortcodes ) ) / 3 ); ?>
    $params ) : if ( ( isset( $params['capabilities']['edit_posts'] ) && true === $params['capabilities']['edit_posts'] ) || ( isset( $params['capabilities']['edit_pages'] ) && true === $params['capabilities']['edit_pages'] ) ) : $allowed_setting = isset( $settings[ $key ]['show'] ) ? $settings[ $key ]['show'] : 'all'; $shortcode_settings = isset( $settings[ $key ]['shortcodes'] ) ? $settings[ $key ]['shortcodes'] : array(); ?>

    $el ) : ?>
    |

    getPostTypes() as $pt ) { if ( ! in_array( $pt, $this->getExcluded() ) ) { $checked = ( in_array( $pt, $pt_array ) ) ? ' checked' : ''; ?>

    editorPostTypes(); foreach ( $this->getPostTypes() as $pt ) { if ( ! in_array( $pt, $this->getExcluded() ) ) { $checked = ( in_array( $pt, $pt_array ) ) ? ' checked' : ''; ?>

    ' . $value . ''; echo '
    ' . $value . '
    '; echo '

    ' . __( 'Add custom CSS code to the plugin without modifying files.', 'js_composer' ) . '

    '; } /** * Not responsive checkbox callback function */ public function not_responsive_css_field_callback() { $checked = ( $checked = get_option( self::$field_prefix . 'not_responsive_css' ) ) ? $checked : false; ?>

    googleFontsSubsets(); foreach ( $this->getGoogleFontsSubsets() as $pt ) { if ( ! in_array( $pt, $this->getGoogleFontsSubsetsExcluded() ) ) { $checked = ( in_array( $pt, $pt_array ) ) ? ' checked' : ''; ?>

    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; } /** * Row css class callback */ public function row_css_class_callback() { _deprecated_function( '\Vc_Settings::row_css_class_callback', '4.4 (will be removed in 5.1)' ); $value = ( $value = get_option( self::$field_prefix . 'row_css_class' ) ) ? $value : ''; echo ! empty( $value ) ? $value : '' . __( 'Empty value', 'js_composer' ) . ''; } /** * Not responsive checkbox callback function * */ public function use_custom_callback() { $field = 'use_custom'; $checked = ( $checked = get_option( self::$field_prefix . $field ) ) ? $checked : false; ?>

    getDefault( $field ); echo ''; } /** * */ public function margin_callback() { $field = 'margin'; $value = ( $value = get_option( self::$field_prefix . $field ) ) ? $value : $this->getDefault( $field ); echo ''; echo '

    ' . __( 'Change default vertical spacing between content elements (Example: 20px).', 'js_composer' ) . '

    '; } /** * */ public function gutter_callback() { $field = 'gutter'; $value = ( $value = get_option( self::$field_prefix . $field ) ) ? $value : $this->getDefault( $field ); echo ' px'; echo '

    ' . __( 'Change default horizontal spacing between columns, enter new value in pixels.', 'js_composer' ) . '

    '; } /** * */ public function responsive_max_callback() { $field = 'responsive_max'; $value = ( $value = get_option( self::$field_prefix . $field ) ) ? $value : $this->getDefault( $field ); echo ' px'; echo '

    ' . __( 'By default content elements "stack" one on top other when screen size is smaller than 768px. Change the value to change "stacking" size.', 'js_composer' ) . '

    '; } /** * */ public function compiled_js_composer_less_callback() { $field = 'compiled_js_composer_less'; echo ''; // VALUE must be empty } /** * @param $key * * @return string */ public function getDefault( $key ) { return ! empty( self::$defaults[ $key ] ) ? self::$defaults[ $key ] : ''; } /** * @deprecated 4.8 Remove after 2015-12-01 * * @return string */ public function disableIfActivated() { _deprecated_function( '\Vc_Settings::disableIfActivated', '4.8 (will be removed in 5.1)' ); if ( ! isset( $this->deactivate_license ) ) { $this->deactivate_license = vc_license()->deactivation(); } return empty( $this->deactivate_license ) ? '' : ' disabled="true" class="vc_updater-passive"'; } /** * Callback function for settings section * * @param $tab */ public function setting_section_callback_function( $tab ) { if ( 'wpb_js_composer_settings_color' === $tab['id'] ) : ?>

    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; } /** * @return array * @deprecated 4.8 */ protected function getPostTypes() { _deprecated_function( '\Vc_Settings::getPostTypes', '4.8 (will be removed in 5.1)' ); return get_post_types( array( 'public' => true ) ); } /** * Access rules for user's groups * * @param $rules - Array of selected rules for each user's group * * @deprecated 4.8 * * @return array */ public function sanitize_group_access_rules_callback( $rules ) { _deprecated_function( '\Vc_Settings::sanitize_group_access_rules_callback', '4.8 (will be removed in 5.1)' ); $sanitize_rules = array(); $groups = get_editable_roles(); foreach ( $groups as $key => $params ) { if ( isset( $rules[ $key ] ) ) { $sanitize_rules[ $key ] = $rules[ $key ]; } } return $sanitize_rules; } /** * @param $rules * * @return mixed */ public function sanitize_not_responsive_css_callback( $rules ) { return (bool) $rules; } /** * @param $value * * @return mixed */ public function sanitize_row_css_class_callback( $value ) { _deprecated_function( '\Vc_Settings::row_css_class_callback', '4.4 (will be removed in 5.1)' ); return $value; } /** * Post types fields sanitize * * @param $post_types - Post types array selected by user * * @deprecated 4.8 * @return array */ public function sanitize_post_types_callback( $post_types ) { _deprecated_function( '\Vc_Settings::sanitize_post_types_callback', '4.8 (will be removed in 5.1)' ); $pt_array = array(); if ( isset( $post_types ) && is_array( $post_types ) ) { foreach ( $post_types as $pt ) { if ( ! in_array( $pt, $this->getExcluded() ) && in_array( $pt, $this->getPostTypes() ) ) { $pt_array[] = $pt; } } } return $pt_array; } /** * @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() ) && in_array( $pt, $this->getGoogleFontsSubsets() ) ) { $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 strip_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, __( '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, __( '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, __( 'Invalid "Responsive max" value.', 'js_composer' ), 'error' ); } return $responsive_max; } /** * @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 ); } /** * @deprecated 4.4 * @return bool */ public static function requireNotification() { _deprecated_function( '\Vc_Settings::requireNotification', '4.4 (will be removed in 5.1)' ); $row_css_class = ( $value = get_option( self::$field_prefix . 'row_css_class' ) ) ? $value : ''; $column_css_classes = ( $value = get_option( self::$field_prefix . 'column_css_classes' ) ) ? $value : ''; $notification = get_option( self::$notification_name ); if ( 'false' !== $notification && ( ! empty( $row_css_class ) || strlen( implode( '', array_values( $column_css_classes ) ) ) > 0 ) ) { update_option( self::$notification_name, 'true' ); return true; } return false; } public function useCustomCss() { $use_custom = get_option( self::$field_prefix . 'use_custom', false ); return $use_custom; } 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 ); global $wp_filesystem; /** * * Building css file. * */ if ( false === ( $js_composer_upload_dir = self::checkCreateUploadDir( $wp_filesystem, 'use_custom', 'js_composer_front_custom.css' ) ) ) { 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 = strip_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(), __( '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(), __( '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( __( '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(), __( '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 ); global $wp_filesystem; /** * Building css file. */ if ( false === ( $js_composer_upload_dir = self::checkCreateUploadDir( $wp_filesystem, 'custom_css', 'custom.css' ) ) ) { 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 = strip_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(), __( '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(), __( '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(), __( 'custom.css could not be created. Cannot write custom css to "' . $filename . '".', 'js_composer' ), 'error' ); } else { add_settings_error( self::$field_prefix . 'custom_css', $wp_filesystem->errors->get_error_code(), __( 'custom.css could not be created. Problem with access.', 'js_composer' ), 'error' ); } return false; } return true; } /** * @param $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( '%s could not be created. Not available to create js_composer directory in uploads directory (' . $js_composer_upload_dir . ').', $filename ), 'js_composer' ), 'error' ); return false; } } return $js_composer_upload_dir; } /** * @return string */ public static function uploadDir() { $upload_dir = wp_upload_dir(); 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 */ protected static function getFileSystem( $url = '' ) { if ( empty( $url ) ) { $url = wp_nonce_url( 'admin.php?page=vc-general', 'wpb_js_settings_save_action' ); } if ( false === ( $creds = request_filesystem_credentials( $url, '', false, false, null ) ) ) { _e( 'This is required to enable file writing for js_composer', 'js_composer' ); exit(); // stop processing here } $upload_dir = wp_upload_dir(); if ( ! WP_Filesystem( $creds, $upload_dir['basedir'] ) ) { request_filesystem_credentials( $url, '', true, false, null ); _e( 'This is required to enable file writing for js_composer', 'js_composer' ); exit(); } } /** * @return string */ public function getOptionGroup() { return $this->option_group; } } /** * Backward capability for third-party-plugins */ class WPBakeryVisualComposerSettings extends Vc_Settings { /** * @deprecated 5.0 * WPBakeryVisualComposerSettings constructor. */ public function __construct() { _deprecated_function( '\WPBakeryVisualComposerSettings::__construct', '4.8 (will be removed in 5.1)' ); } } PK2\ͣ<(  #classes/settings/class-vc-roles.phpnuW+Aparts ); } /** * Check required capability for this role to have user access. * * @param $part * * @return array */ public function getPartCapability( $part ) { return 'settings' !== $part ? array( 'edit_posts', 'edit_pages', ) : 'manage_options'; } 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; while ( false === $has && $i < count( $caps ) ) { $has = $this->hasRoleCapability( $role, $caps[ $i ++ ] ); } } return $has; } public function getWpRoles() { global $wp_roles; if ( function_exists( 'wp_roles' ) ) { return $wp_roles; } else { if ( ! isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); } } return $wp_roles; } 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', ) ) ? (boolean) $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'] = __( 'Roles settings successfully saved.', 'js_composer' ); return $data; } 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 ) ) { $this->post_types[] = array( $post_type, $post_type ); } } } return $this->post_types; } 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; } } PK2\e}E.classes/updaters/class-vc-updating-manager.phpnuW+Acurrent_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->url = ''; $obj->package = vc_license()->isActivated(); $obj->name = vc_updater()->title; $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( '

    $2

    ', '
    ', '
    ', ); $information->name = vc_updater()->title; $information->sections = (array) $information->sections; $information->sections['changelog'] = '
    ' . preg_replace( $array_pattern, $array_replace, $information->sections['changelog'] ) . '
    '; return $information; } return $false; } /** * Return the remote version * * @return string $remote_version */ public function getRemote_version() { $request = wp_remote_get( $this->update_path ); 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() { $request = wp_remote_get( $this->update_path.'information.json' ); 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 = esc_url( vc_updater()->getUpdaterUrl() ); $redirect = sprintf( '%s', $url, __( 'settings', 'js_composer' ) ); echo sprintf( ' ' . __( 'To receive automatic updates license activation is required. Please visit %s to activate your Visual Composer.', 'js_composer' ), $redirect ) . sprintf( ' %s', __( 'Got Visual Composer in theme?', 'js_composer' ) ); } } } PK2\kZͼ %classes/updaters/class-vc-updater.phpnuW+AcheckLicenseKeyFromRemote()' ); vc_license()->checkLicenseKeyFromRemote(); } /** * 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 * * @param deprecated string $license_key * * @return array|boolean JSON response or false if request failed */ public function getDownloadUrl( $license_key = '' ) { $url = $this->getUrl(); $response = wp_remote_get( $url ); if ( is_wp_error( $response ) ) { return false; } return json_decode( $response['body'], true ); } 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; } 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 $updater WP_Upgrader * * @return mixed|string|WP_Error */ public function preUpgradeFilter( $reply, $package, $updater ) { $condition1 = isset( $updater->skin->plugin ) && vc_plugin_name() === $updater->skin->plugin; $condition2 = isset( $updater->skin->plugin_info ) && $updater->skin->plugin_info['Name'] === $this->title; if ( ! $condition1 && ! $condition2 ) { return $reply; } $res = $updater->fs_connect( array( WP_CONTENT_DIR ) ); if ( ! $res ) { return new WP_Error( 'no_credentials', __( "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 = esc_url( self::getUpdaterUrl() ); return new WP_Error( 'no_credentials', __( 'To receive automatic updates license activation is required. Please visit Settings to activate your Visual Composer.', 'js_composer' ) . ' ' . sprintf( ' %s', __( 'Got Visual Composer in theme?', 'js_composer' ) ) ); } $updater->strings['downloading_package_url'] = __( 'Getting download link...', 'js_composer' ); $updater->skin->feedback( 'downloading_package_url' ); $response = $this->getDownloadUrl(); if ( ! $response ) { return new WP_Error( 'no_credentials', __( 'Download link could not be retrieved', 'js_composer' ) ); } if ( ! $response['status'] ) { return new WP_Error( 'no_credentials', $response['error'] ); } $updater->strings['downloading_package'] = __( '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; } /** * Downloads new VC from Envato marketplace and unzips into temporary directory. * * @deprecated 4.8 * * @param $reply * @param $package * @param $updater WP_Upgrader * * @return mixed|string|WP_Error */ public function upgradeFilterFromEnvato( $reply, $package, $updater ) { _deprecated_function( '\Vc_Updater::upgradeFilterFromEnvato', '4.8 (will be removed in next release)' ); global $wp_filesystem; /** @var \WP_Filesystem_Base $wp_filesystem */ if ( ( isset( $updater->skin->plugin ) && vc_plugin_name() === $updater->skin->plugin ) || ( isset( $updater->skin->plugin_info ) && $updater->skin->plugin_info['Name'] === $this->title ) ) { $updater->strings['download_envato'] = __( 'Downloading package from envato market...', 'js_composer' ); $updater->skin->feedback( 'download_envato' ); $package_filename = 'js_composer.zip'; $res = $updater->fs_connect( array( WP_CONTENT_DIR ) ); if ( ! $res ) { return new WP_Error( 'no_credentials', __( "Error! Can't connect to filesystem", 'js_composer' ) ); } $username = vc_settings()->get( 'envato_username' ); $api_key = vc_settings()->get( 'envato_api_key' ); $purchase_code = vc_license()->getLicenseKey(); if ( ! vc_license()->isActivated() || empty( $username ) || empty( $api_key ) || empty( $purchase_code ) ) { return new WP_Error( 'no_credentials', __( 'To receive automatic updates license activation is required. Please visit Settings to activate your Visual Composer.', 'js_composer' ) ); } $json = wp_remote_get( $this->envatoDownloadPurchaseUrl( $username, $api_key, $purchase_code ) ); $result = json_decode( $json['body'], true ); if ( ! isset( $result['download-purchase']['download_url'] ) ) { return new WP_Error( 'no_credentials', __( 'Error! Envato API error', 'js_composer' ) . ( isset( $result['error'] ) ? ': ' . $result['error'] : '.' ) ); } $result['download-purchase']['download_url']; $download_file = download_url( $result['download-purchase']['download_url'] ); if ( is_wp_error( $download_file ) ) { return $download_file; } $upgrade_folder = $wp_filesystem->wp_content_dir() . 'uploads/js_composer_envato_package'; if ( is_dir( $upgrade_folder ) ) { $wp_filesystem->delete( $upgrade_folder ); } $result = unzip_file( $download_file, $upgrade_folder ); if ( $result && is_file( $upgrade_folder . '/' . $package_filename ) ) { return $upgrade_folder . '/' . $package_filename; } return new WP_Error( 'no_credentials', __( 'Error on unzipping package', 'js_composer' ) ); } return $reply; } /** * @deprecated 4.8 */ public function removeTemporaryDir() { _deprecated_function( '\Vc_Updater::removeTemporaryDir', '4.8 (will be removed in next release)' ); global $wp_filesystem; /** @var \WP_Filesystem_Base $wp_filesystem */ if ( is_dir( $wp_filesystem->wp_content_dir() . 'uploads/js_composer_envato_package' ) ) { $wp_filesystem->delete( $wp_filesystem->wp_content_dir() . 'uploads/js_composer_envato_package', true ); } } /** * @deprecated 4.8 * * @param $username * @param $api_key * @param $purchase_code * * @return string */ protected function envatoDownloadPurchaseUrl( $username, $api_key, $purchase_code ) { _deprecated_function( '\Vc_Updater::envatoDownloadPurchaseUrl', '4.8 (will be removed in next release)' ); return 'http://marketplace.envato.com/api/edge/' . rawurlencode( $username ) . '/' . rawurlencode( $api_key ) . '/download-purchase:' . rawurlencode( $purchase_code ) . '.json'; } } PK2\=w,classes/vendors/class-vc-vendors-manager.phpnuW+Aload(); } /** * @deprecated 4.4 * * @param Vc_Vendor_Interface $vendor */ public function add( Vc_Vendor_Interface $vendor ) { _deprecated_function( 'Vc_Vendors_Manager::add', '4.4 (will be removed in 5.1)', 'autoload logic' ); $this->vendors[] = $vendor; } /** * @deprecated 4.4 */ public function load() { _deprecated_function( 'Vc_Vendors_Manager::load', '4.4 (will be removed in 5.1)', 'autoload logic' ); foreach ( $this->vendors as $vendor ) { /** * @var $vendor Vc_Vendor_Interface */ $vendor->load(); } } } PK2\Y4classes/vendors/plugins/class-vc-vendor-jwplayer.phpnuW+A 0 ) { $id_zero = time(); foreach ( $pairs as $pair ) { $data = str_replace( $pair, 'jwplayer-' . $id_zero ++, $data ); } } return $data; } public function wrapPlaceholder( $content ) { add_shortcode( 'jwplayer', array( &$this, 'renderPlaceholder' ) ); return $content; } public function renderPlaceholder() { return '
    '; } /** * @param $output * * @since 4.3, due to #1065 * * @return string */ 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' ), '1.0', true ); } } PK2\eGB~#~#6classes/vendors/plugins/class-vc-vendor-qtranslate.phpnuW+Alanguages = $languages; } public function isValidPostType() { return in_array( get_post_type(), vc_editor_post_types() ); } /** * @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'] = ''; } } /** * @since 4.3 * @return string */ public function generateSelect() { $output = ''; if ( is_array( $this->languages ) && ! empty( $this->languages ) ) { $output .= ''; } return $output; } /** * @since 4.3 * @return string */ public function generateSelectFrontend() { $output = ''; if ( is_array( $this->languages ) && ! empty( $this->languages ) ) { $output .= ' '; } return $output; } /** * @since 4.3 * * @param $list * * @return array */ public function vcNavControls( $list ) { if ( $this->isValidPostType() ) { if ( is_array( $list ) ) { $list[] = array( 'qtranslate', $this->getControlSelectDropdown(), ); } } return $list; } /** * @since 4.3 * * @param $list * * @return array */ public function vcNavControlsFrontend( $list ) { if ( $this->isValidPostType() ) { if ( is_array( $list ) ) { $list[] = array( 'qtranslate', $this->getControlSelectDropdownFrontend(), ); } } return $list; } /** * @since 4.3 * @return string */ public function getControlSelectDropdown() { return '
  • ' . $this->generateSelect() . '
  • '; } /** * @return string */ public function getControlSelectDropdownFrontend() { return '
  • ' . $this->generateSelectFrontend() . '
  • '; } /** * @since 4.3 * * @param $link * * @return string */ 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 .= ''; $output .= ''; echo $output; } /** * @since 4.3 * * @param $content * * @return string */ public function filterPostContent( $content ) { return qtrans_useCurrentLanguageIfNotFoundShowAvailable( $content ); } } PK2\O 9classes/vendors/plugins/woocommerce/grid-item-filters.phpnuW+AID . '"]' ) . '" 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 * * @since 4.5 * * @return string */ function vc_gitem_post_data_get_link_real_target_woocommerce( $link, $atts, $post ) { return 'woo_add_to_card' === $link ? '' : $link; } 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 ''; } return $image_block; } PK2\ <classes/vendors/plugins/woocommerce/grid-item-shortcodes.phpnuW+A array( 'name' => __( 'WooCommerce field', 'js_composer' ), 'base' => 'vc_gitem_wocommerce', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Woocommerce', 'js_composer' ), 'php_class_name' => 'Vc_Gitem_Woocommerce_Shortcode', 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Content type', 'js_composer' ), 'param_name' => 'post_type', 'value' => array( __( 'Product', 'js_composer' ) => 'product', __( 'Order', 'js_composer' ) => 'order', ), 'save_always' => true, 'description' => __( 'Select Woo Commerce post type.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( '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' => __( 'Select field from product.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Product custom key', 'js_composer' ), 'param_name' => 'product_custom_key', 'description' => __( 'Enter custom key.', 'js_composer' ), 'dependency' => array( 'element' => 'product_field_key', 'value' => array( '_custom_' ), ), ), array( 'type' => 'dropdown', 'heading' => __( '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' => __( 'Select field from order.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Order custom key', 'js_composer' ), 'param_name' => 'order_custom_key', 'dependency' => array( 'element' => 'order_field_key', 'value' => array( '_custom_' ), ), 'description' => __( 'Enter custom key.', 'js_composer' ), ), array( 'type' => 'checkbox', 'heading' => __( 'Show label', 'js_composer' ), 'param_name' => 'show_label', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'save_always' => true, 'description' => __( 'Enter label to display before key value.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Align', 'js_composer' ), 'param_name' => 'align', 'value' => array( __( 'left', 'js_composer' ) => 'left', __( 'right', 'js_composer' ) => 'right', __( 'center', 'js_composer' ) => 'center', __( 'justify', 'js_composer' ) => 'justify', ), 'save_always' => true, 'description' => __( 'Select alignment.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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(), ), ); PK2\^HH<classes/vendors/plugins/woocommerce/grid-item-attributes.phpnuW+A null, 'data' => '', ), $data ) ); require_once WC()->plugin_path() . '/includes/abstracts/abstract-wc-product.php'; $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 = (int) $product->is_type( 'variation' ) ? $product->get_variation_id() : $product->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', $product->get_post_data()->post_excerpt ); break; case 'dimensions': $units = get_option( 'woocommerce_dimension_unit' ); $value = $product->length . $units . 'x' . $product->width . $units . 'x' . $product->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 = $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'; $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->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->order_currency ); break; case 'payment_method': $value = $order->payment_method_title; break; case 'billing_address_city': $value = $order->billing_city; break; case 'billing_address_country': $value = $order->billing_country; break; case 'shipping_address_city': $value = $order->shipping_city; break; case 'shipping_address_country': $value = $order->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 * * @since 4.5 * * @return string */ 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 ); PK2\Lclasses/vendors/plugins/woocommerce/class-vc-gitem-woocommerce-shortcode.phpnuW+A '', '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 '
    ' . '{{ woocommerce_' . $post_type . ':' . $key . ' }}' . '
    '; } } PK2\!6classes/vendors/plugins/acf/class-vc-acf-shortcode.phpnuW+AgetShortcode(), $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'] ) ? '' . $field['label'] . ': ' : ''; $value = $label . $value; } } $css_string = implode( ' ', $css_class ); $output = '
    ' . $value . '
    '; return $output; } } PK2\b H 4classes/vendors/plugins/acf/grid-item-shortcodes.phpnuW+A 'dropdown', 'heading' => __( 'Field name', 'js_composer' ), 'param_name' => 'field_from_' . $group[ $id ], 'value' => $fields_param_value, 'save_always' => true, 'description' => __( 'Select field from group.', 'js_composer' ), 'dependency' => array( 'element' => 'field_group', 'value' => array( (string) $group[ $id ] ), ), ); } return array( 'vc_gitem_acf' => array( 'name' => __( 'Advanced Custom Field', 'js_composer' ), 'base' => 'vc_gitem_acf', 'icon' => 'vc_icon-acf', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Advanced Custom Field', 'js_composer' ), 'php_class_name' => 'Vc_Gitem_Acf_Shortcode', 'params' => array_merge( array( array( 'type' => 'dropdown', 'heading' => __( 'Field group', 'js_composer' ), 'param_name' => 'field_group', 'value' => $groups_param_values, 'save_always' => true, 'description' => __( 'Select field group.', 'js_composer' ), ), ), $fields_params, array( array( 'type' => 'checkbox', 'heading' => __( 'Show label', 'js_composer' ), 'param_name' => 'show_label', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( 'Enter label to display before key value.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Align', 'js_composer' ), 'param_name' => 'align', 'value' => array( __( 'left', 'js_composer' ) => 'left', __( 'right', 'js_composer' ) => 'right', __( 'center', 'js_composer' ) => 'center', __( 'justify', 'js_composer' ) => 'justify', ), 'description' => __( 'Select alignment.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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(), ), ); PK2\e4classes/vendors/plugins/acf/grid-item-attributes.phpnuW+A 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'] ) ? '' . $field['label'] . ': ' : ''; } $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 ); PK2\oam# # )classes/vendors/plugins/acf/shortcode.phpnuW+A 'dropdown', 'heading' => __( 'Field name', 'js_composer' ), 'param_name' => 'field_from_' . $group[ $id ], 'value' => $fields_param_value, 'save_always' => true, 'description' => __( 'Select field from group.', 'js_composer' ), 'dependency' => array( 'element' => 'field_group', 'value' => array( (string) $group[ $id ] ), ), ); } return array( 'name' => __( 'Advanced Custom Field', 'js_composer' ), 'base' => 'vc_acf', 'icon' => 'vc_icon-acf', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Advanced Custom Field', 'js_composer' ), 'params' => array_merge( array( array( 'type' => 'dropdown', 'heading' => __( 'Field group', 'js_composer' ), 'param_name' => 'field_group', 'value' => $groups_param_values, 'save_always' => true, 'description' => __( 'Select field group.', 'js_composer' ), ), ), $fields_params, array( array( 'type' => 'checkbox', 'heading' => __( 'Show label', 'js_composer' ), 'param_name' => 'show_label', 'value' => array( __( 'Yes', 'js_composer' ) => 'yes' ), 'description' => __( 'Enter label to display before key value.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Align', 'js_composer' ), 'param_name' => 'align', 'value' => array( __( 'left', 'js_composer' ) => 'left', __( 'right', 'js_composer' ) => 'right', __( 'center', 'js_composer' ) => 'center', __( 'justify', 'js_composer' ) => 'justify', ), 'description' => __( 'Select alignment.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), ) ), ); PK2\"w))<classes/vendors/plugins/acf/class-vc-gitem-acf-shortcode.phpnuW+A '', '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 '
    ' . '{{ acf' . ( ! empty( $field_key ) ? ':' . $field_key : '' ) . ' }}' . '
    '; } } PK2\D+l0classes/vendors/plugins/class-vc-vendor-wpml.phpnuW+A $sitepress->get_current_language() ), $link ); } } return $link; } public function filterMediaId( $id ) { return apply_filters( 'wpml_object_id', $id, 'post', true ); } } PK2\D7classes/vendors/plugins/class-vc-vendor-layerslider.phpnuW+Aget_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 " ); $layer_sliders = array(); if ( ! empty( $ls ) ) { foreach ( $ls as $slider ) { $layer_sliders[ $slider->name ] = $slider->id; } } else { $layer_sliders[ __( 'No sliders found', 'js_composer' ) ] = 0; } } else { $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[ __( 'No sliders found', 'js_composer' ) ] = 0; } } return array( 'base' => $tag, 'name' => __( 'Layer Slider', 'js_composer' ), 'icon' => 'icon-wpb-layerslider', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place LayerSlider', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Widget title', 'js_composer' ), 'param_name' => 'title', 'description' => __( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'LayerSlider ID', 'js_composer' ), 'param_name' => 'id', 'admin_label' => true, 'value' => $layer_sliders, 'save_always' => true, 'description' => __( 'Select your LayerSlider.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), ), ); } } PK2\޹˸5classes/vendors/plugins/class-vc-vendor-revslider.phpnuW+A 'rev_slider_vc', 'name' => __( 'Revolution Slider', 'js_composer' ), 'icon' => 'icon-wpb-revslider', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Revolution slider', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Widget title', 'js_composer' ), 'param_name' => 'title', 'description' => __( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Revolution Slider', 'js_composer' ), 'param_name' => 'alias', 'admin_label' => true, 'value' => $revsliders, 'save_always' => true, 'description' => __( 'Select your Revolution Slider.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( '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. * @since 4.3 * * @param $output * * @return string */ public function setId( $output ) { return preg_replace( '/rev_slider_(\d+)_(\d+)/', 'rev_slider_$1_$2' . time() . '_' . self::$instanceIndex ++, $output ); } /** * Mapping settings for lean method. * * @since 4.9 * * @param $tag * * @return array */ public function addShortcodeSettings( $tag ) { $slider = new RevSlider(); $arrSliders = $slider->getArrSliders(); $revsliders = array(); if ( $arrSliders ) { foreach ( $arrSliders as $slider ) { /** @var $slider RevSlider */ $revsliders[ $slider->getTitle() ] = $slider->getAlias(); } } else { $revsliders[ __( 'No sliders found', 'js_composer' ) ] = 0; } // Add fixes for frontend editor to regenerate id return array( 'base' => $tag, 'name' => __( 'Revolution Slider', 'js_composer' ), 'icon' => 'icon-wpb-revslider', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Revolution slider', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Widget title', 'js_composer' ), 'param_name' => 'title', 'description' => __( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Revolution Slider', 'js_composer' ), 'param_name' => 'alias', 'admin_label' => true, 'value' => $revsliders, 'save_always' => true, 'description' => __( 'Select your Revolution Slider.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ), ), ), ); } } PK2\=RRR R 5classes/vendors/plugins/class-vc-vendor-yoast_seo.phpnuW+AparsedContent ) ) { 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() { wp_enqueue_script( 'vc_vendor_yoast_js', vc_asset_url( 'js/vendors/yoast.js' ), array( 'yoast-seo-post-scraper' ), 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', ) ); } } PK2\| 7classes/vendors/plugins/class-vc-vendor-ninja-forms.phpnuW+ANAME) * * @since 4.4 * * @deprecated 4.9 */ public function mapNinjaForms( $ninja_forms = array() ) { _deprecated_function( 'mapNinjaForms', '4.2 (will be removed in 5.1)'. 'Vc_Vendor_NinjaForms::addShortcodeSettings' ); // We map only [ninja_form] shortcode same as contact-form-7 vc_map( array( 'base' => 'ninja_forms_display_form', 'name' => __( 'Ninja Forms', 'js_composer' ), 'icon' => 'icon-wpb-ninjaforms', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Ninja Form', 'js_composer' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Select ninja form', 'js_composer' ), 'param_name' => 'id', 'value' => $ninja_forms, 'save_always' => true, 'description' => __( 'Choose previously created ninja form from the drop down list.', 'js_composer' ), ), ), ) ); } /** * Mapping settings for lean method. * * @since 4.9 * * @param $tag * * @return array */ public function addShortcodeSettings( $tag ) { $ninja_forms = $this->get_forms(); return array( 'base' => $tag, 'name' => __( 'Ninja Forms', 'js_composer' ), 'icon' => 'icon-wpb-ninjaforms', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Ninja Form', 'js_composer' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Select ninja form', 'js_composer' ), 'param_name' => 'id', 'value' => $ninja_forms, 'save_always' => true, 'description' => __( 'Choose previously created ninja form from the drop down list.', 'js_composer' ), ), ), ); } 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; } 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 ) ); } } PK2\+ 8classes/vendors/plugins/class-vc-vendor-qtranslate-x.phpnuW+A ( $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', ), '1.0', true ); } /** * @return string */ public function generateSelectFrontend() { global $q_config; $output = ''; $output .= ' '; return $output; } /** * @param $list * * @return array */ public function vcNavControlsFrontend( $list ) { if ( is_array( $list ) ) { $list[] = array( 'qtranslatex', '
  • ' . $this->generateSelectFrontend() . '
  • ', ); } 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 ); } } PK2\nQQ7classes/vendors/plugins/class-vc-vendor-woocommerce.phpnuW+A __( '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 * * @since 4.9 * * @param $tag * * @return array */ public function addShortcodeSettings( $tag ) { $args = array( 'type' => 'post', 'child_of' => 0, 'parent' => '', 'orderby' => 'id', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'product_cat', 'pad_counts' => false, ); $order_by_values = array( '', __( 'Date', 'js_composer' ) => 'date', __( 'ID', 'js_composer' ) => 'ID', __( 'Author', 'js_composer' ) => 'author', __( 'Title', 'js_composer' ) => 'title', __( 'Modified', 'js_composer' ) => 'modified', __( 'Random', 'js_composer' ) => 'rand', __( 'Comment count', 'js_composer' ) => 'comment_count', __( 'Menu order', 'js_composer' ) => 'menu_order', ); $order_way_values = array( '', __( 'Descending', 'js_composer' ) => 'DESC', __( 'Ascending', 'js_composer' ) => 'ASC', ); $settings = array(); switch ( $tag ) { case 'woocommerce_cart': $settings = array( 'name' => __( 'Cart', 'js_composer' ), 'base' => 'woocommerce_cart', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( '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' => __( 'Checkout', 'js_composer' ), 'base' => 'woocommerce_checkout', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( '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' => __( 'Order Tracking Form', 'js_composer' ), 'base' => 'woocommerce_order_tracking', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( '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' => __( 'My Account', 'js_composer' ), 'base' => 'woocommerce_my_account', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Shows the "my account" section', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Order count', 'js_composer' ), 'value' => 15, 'save_always' => true, 'param_name' => 'order_count', 'description' => __( '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' => __( 'Recent products', 'js_composer' ), 'base' => 'recent_products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Lists recent products', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'save_always' => true, 'param_name' => 'per_page', 'description' => __( 'The "per_page" shortcode determines how many products to show on the page', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( 'The columns attribute controls how many columns wide the products should be before wrapping.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), ), ); 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' => __( 'Featured products', 'js_composer' ), 'base' => 'featured_products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Display products set as "featured"', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'param_name' => 'per_page', 'save_always' => true, 'description' => __( 'The "per_page" shortcode determines how many products to show on the page', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( 'The columns attribute controls how many columns wide the products should be before wrapping.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), ), ); 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' => __( 'Product', 'js_composer' ), 'base' => 'product', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show a single product by ID or SKU', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Select identificator', 'js_composer' ), 'param_name' => 'id', 'description' => __( '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' => __( 'Products', 'js_composer' ), 'base' => 'products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show multiple products by ID or SKU.', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'std' => 'title', 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s. Default by Title', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s. Default by ASC', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'autocomplete', 'heading' => __( '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' => __( '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' => __( 'Add to cart', 'js_composer' ), 'base' => 'add_to_cart', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show multiple products by ID or SKU', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Select identificator', 'js_composer' ), 'param_name' => 'id', 'description' => __( 'Input product ID or product SKU or product title to see suggestions', 'js_composer' ), ), array( 'type' => 'hidden', 'param_name' => 'sku', ), array( 'type' => 'textfield', 'heading' => __( 'Wrapper inline style', 'js_composer' ), 'param_name' => 'style', ), ), ); break; case 'add_to_cart_url': /** * @shortcode add_to_cart_url * @description Echo the URL on the add to cart button of a single product by ID. * * @param id integer * @param sku string */ $settings = array( 'name' => __( 'Add to cart URL', 'js_composer' ), 'base' => 'add_to_cart_url', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show URL on the add to cart button', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Select identificator', 'js_composer' ), 'param_name' => 'id', 'description' => __( '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' => __( 'Product page', 'js_composer' ), 'base' => 'product_page', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show single product by ID or SKU', 'js_composer' ), 'params' => array( array( 'type' => 'autocomplete', 'heading' => __( 'Select identificator', 'js_composer' ), 'param_name' => 'id', 'description' => __( '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, 0, $categories, 0, $product_categories_dropdown ); $settings = array( 'name' => __( 'Product category', 'js_composer' ), 'base' => 'product_category', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Show multiple products in a category', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'save_always' => true, 'param_name' => 'per_page', 'description' => __( 'How much items per page to show', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'save_always' => true, 'param_name' => 'columns', 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Category', 'js_composer' ), 'value' => $product_categories_dropdown, 'param_name' => 'category', 'save_always' => true, 'description' => __( 'Product category list', 'js_composer' ), ), ), ); break; case 'product_categories': $settings = array( 'name' => __( 'Product categories', 'js_composer' ), 'base' => 'product_categories', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'Display product categories loop', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Number', 'js_composer' ), 'param_name' => 'number', 'description' => __( 'The `number` field is used to display the number of products.', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Number', 'js_composer' ), 'param_name' => 'hide_empty', 'description' => __( 'Hide empty', 'js_composer' ), ), array( 'type' => 'autocomplete', 'heading' => __( 'Categories', 'js_composer' ), 'param_name' => 'ids', 'settings' => array( 'multiple' => true, 'sortable' => true, ), 'save_always' => true, 'description' => __( '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' => __( 'Sale products', 'js_composer' ), 'base' => 'sale_products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'List all products on sale', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'save_always' => true, 'param_name' => 'per_page', 'description' => __( 'How much items per page to show', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'save_always' => true, 'param_name' => 'columns', 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), ), ); 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' => __( 'Best Selling Products', 'js_composer' ), 'base' => 'best_selling_products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'List best selling products on sale', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'param_name' => 'per_page', 'save_always' => true, 'description' => __( 'How much items per page to show', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( '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' => __( 'Top Rated Products', 'js_composer' ), 'base' => 'top_rated_products', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'List all products on sale', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'param_name' => 'per_page', 'save_always' => true, 'description' => __( 'How much items per page to show', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), ), ); 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' => __( 'Product Attribute', 'js_composer' ), 'base' => 'product_attribute', 'icon' => 'icon-wpb-woocommerce', 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'List products with an attribute shortcode', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'param_name' => 'per_page', 'save_always' => true, 'description' => __( 'How much items per page to show', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Columns', 'js_composer' ), 'value' => 4, 'param_name' => 'columns', 'save_always' => true, 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Attribute', 'js_composer' ), 'param_name' => 'attribute', 'value' => $attributes, 'save_always' => true, 'description' => __( 'List of product taxonomy attribute', 'js_composer' ), ), array( 'type' => 'checkbox', 'heading' => __( 'Filter', 'js_composer' ), 'param_name' => 'filter', 'value' => array( 'empty' => 'empty' ), 'save_always' => true, 'description' => __( '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' => __( 'Related Products', 'js_composer' ), 'base' => 'related_products', 'icon' => 'icon-wpb-woocommerce', 'content_element' => 'product' === $post_type, // disable showing if not product type 'category' => __( 'WooCommerce', 'js_composer' ), 'description' => __( 'List related products', 'js_composer' ), 'params' => array( array( 'type' => 'textfield', 'heading' => __( 'Per page', 'js_composer' ), 'value' => 12, 'save_always' => true, 'param_name' => 'per_page', 'description' => __( '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' => __( 'Columns', 'js_composer' ), 'value' => 4, 'save_always' => true, 'param_name' => 'columns', 'description' => __( 'How much columns grid', 'js_composer' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Order by', 'js_composer' ), 'param_name' => 'orderby', 'value' => $order_by_values, 'save_always' => true, 'description' => sprintf( __( 'Select how to sort retrieved products. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), array( 'type' => 'dropdown', 'heading' => __( 'Sort order', 'js_composer' ), 'param_name' => 'order', 'value' => $order_way_values, 'save_always' => true, 'description' => sprintf( __( 'Designates the ascending or descending order. More at %s.', 'js_composer' ), 'WordPress codex page' ), ), ), ); 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. } 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. * @since 4.4 * * @param array $param_settings * @param $current_value * @param $map_settings * @param $atts * * @return array */ 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 .= ' '; } die( json_encode( $param_line ) ); } /** * Get attribute terms suggester * @since 4.4 * * @param $attribute * * @return array */ 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. * @since 4.4 * @deprecated 4.5.3 - due to dublicated category names causes an issue * * @param $parent_id * @param $pos * @param array $array * @param $level * @param array $dropdown - passed by reference */ public function getCategoryChilds( $parent_id, $pos, $array, $level, &$dropdown ) { // _deprecated_function( 'Vc_Vendor_Woocommerce::getCategoryChilds', '4.5.3 (will be removed in 4.10)', 'Vc_Vendor_Woocommerce::getCategoryChildsFull' ); for ( $i = $pos; $i < count( $array ); $i ++ ) { if ( $array[ $i ]->category_parent == $parent_id ) { $data = array( str_repeat( '- ', $level ) . $array[ $i ]->name => $array[ $i ]->slug, ); $dropdown = array_merge( $dropdown, $data ); $this->getCategoryChilds( $array[ $i ]->term_id, $i, $array, $level + 1, $dropdown ); } } } /** * Get lists of categories. * @since 4.5.3 * * @param $parent_id * @param $pos * @param array $array * @param $level * @param array $dropdown - passed by reference */ protected function getCategoryChildsFull( $parent_id, $pos, $array, $level, &$dropdown ) { for ( $i = $pos; $i < count( $array ); $i ++ ) { if ( $array[ $i ]->category_parent == $parent_id ) { $name = str_repeat( '- ', $level ) . $array[ $i ]->name; $value = $array[ $i ]->slug; $dropdown[] = array( 'label' => $name, 'value' => $value, ); $this->getCategoryChildsFull( $array[ $i ]->term_id, $i, $array, $level + 1, $dropdown ); } } } /** * Replace single product sku to id. * @since 4.4 * * @param $current_value * @param $param_settings * @param $map_settings * @param $atts * * @return bool|string */ 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. * @since 4.4 * * @param $current_value * @param $param_settings * @param $map_settings * @param $atts * * @return string */ 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 * @since 4.4 * * @param $query * * @return array - id's from products with title/sku. */ 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'] = __( 'Id', 'js_composer' ) . ': ' . $value['id'] . ( ( strlen( $value['title'] ) > 0 ) ? ' - ' . __( 'Title', 'js_composer' ) . ': ' . $value['title'] : '' ) . ( ( strlen( $value['sku'] ) > 0 ) ? ' - ' . __( 'Sku', 'js_composer' ) . ': ' . $value['sku'] : '' ); $results[] = $data; } } return $results; } /** * Find product by id * @since 4.4 * * @param $query * * @return bool|array */ 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->id; $product_sku_display = ''; if ( ! empty( $product_sku ) ) { $product_sku_display = ' - ' . __( 'Sku', 'js_composer' ) . ': ' . $product_sku; } $product_title_display = ''; if ( ! empty( $product_title ) ) { $product_title_display = ' - ' . __( 'Title', 'js_composer' ) . ': ' . $product_title; } $product_id_display = __( '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. * @since 4.4 * * @param $query * * @return bool */ public function productIdDefaultValueFromSkuToId( $query ) { $result = $this->productIdAutocompleteSuggesterExactSku( $query ); return isset( $result['value'] ) ? $result['value'] : false; } /** * Find product by SKU * @since 4.4 * * @param $query * * @return bool|array */ 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->id; $product_sku_display = ''; if ( ! empty( $product_sku ) ) { $product_sku_display = ' - ' . __( 'Sku', 'js_composer' ) . ': ' . $product_sku; } $product_title_display = ''; if ( ! empty( $product_title ) ) { $product_title_display = ' - ' . __( 'Title', 'js_composer' ) . ': ' . $product_title; } $product_id_display = __( '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. * @since 4.4 * * @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 */ 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'] = __( 'Id', 'js_composer' ) . ': ' . $value['id'] . ( ( strlen( $value['name'] ) > 0 ) ? ' - ' . __( 'Name', 'js_composer' ) . ': ' . $value['name'] : '' ) . ( ( strlen( $value['slug'] ) > 0 ) ? ' - ' . __( 'Slug', 'js_composer' ) . ': ' . $value['slug'] : '' ); $result[] = $data; } } return $result; } /** * Search product category by id * @since 4.4 * * @param $query * * @return bool|array */ 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 * @since 4.4 * * @param $query * * @return array - slug of products categories. */ public function productCategoryCategoryAutocompleteSuggesterBySlug( $query ) { $result = $this->productCategoryCategoryAutocompleteSuggester( $query, true ); return $result; } /** * Search product category by slug. * @since 4.4 * * @param $query * * @return bool|array */ 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 * * @since 4.4 * @return array|bool */ 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 = ' - ' . __( 'Sku', 'js_composer' ) . ': ' . $term_slug; } $term_title_display = ''; if ( ! empty( $term_title ) ) { $term_title_display = ' - ' . __( 'Title', 'js_composer' ) . ': ' . $term_title; } $term_id_display = __( '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; } public static function getProductsFieldsList() { return array( __( 'SKU', 'js_composer' ) => 'sku', __( 'ID', 'js_composer' ) => 'id', __( 'Price', 'js_composer' ) => 'price', __( 'Regular Price', 'js_composer' ) => 'regular_price', __( 'Sale Price', 'js_composer' ) => 'sale_price', __( 'Price html', 'js_composer' ) => 'price_html', __( 'Reviews count', 'js_composer' ) => 'reviews_count', __( 'Short description', 'js_composer' ) => 'short_description', __( 'Dimensions', 'js_composer' ) => 'dimensions', __( 'Rating count', 'js_composer' ) => 'rating_count', __( 'Weight', 'js_composer' ) => 'weight', __( 'Is on sale', 'js_composer' ) => 'on_sale', __( 'Custom field', 'js_composer' ) => '_custom_', ); } 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 ] : ''; } public static function getOrderFieldsList() { return array( __( 'ID', 'js_composer' ) => 'id', __( 'Order number', 'js_composer' ) => 'order_number', __( 'Currency', 'js_composer' ) => 'order_currency', __( 'Total', 'js_composer' ) => 'total', __( 'Status', 'js_composer' ) => 'status', __( 'Payment method', 'js_composer' ) => 'payment_method', __( 'Billing address city', 'js_composer' ) => 'billing_address_city', __( 'Billing address country', 'js_composer' ) => 'billing_address_country', __( 'Shipping address city', 'js_composer' ) => 'shipping_address_city', __( 'Shipping address country', 'js_composer' ) => 'shipping_address_country', __( 'Customer Note', 'js_composer' ) => 'customer_note', __( 'Customer API', 'js_composer' ) => 'customer_api', __( 'Custom field', 'js_composer' ) => '_custom_', ); } 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', ); } PK2\|o[II9classes/vendors/plugins/class-vc-vendor-contact-form7.phpnuW+Apost_title ] = $cform->ID; } } else { $contact_forms[ __( 'No contact forms found', 'js_composer' ) ] = 0; } return array( 'base' => $tag, 'name' => __( 'Contact Form 7', 'js_composer' ), 'icon' => 'icon-wpb-contactform7', 'category' => __( 'Content', 'js_composer' ), 'description' => __( 'Place Contact Form7', 'js_composer' ), 'params' => array( array( 'type' => 'dropdown', 'heading' => __( 'Select contact form', 'js_composer' ), 'param_name' => 'id', 'value' => $contact_forms, 'save_always' => true, 'description' => __( 'Choose previously created contact form from the drop down list.', 'js_composer' ), ), array( 'type' => 'textfield', 'heading' => __( 'Search title', 'js_composer' ), 'param_name' => 'title', 'admin_label' => true, 'description' => __( 'Enter optional title to search if no ID selected or cannot find by ID.', 'js_composer' ), ), ), ); } } PK2\]NNBclasses/vendors/plugins/class-vc-vendor-advanced-custom-fields.phpnuW+Alanguages = $languages; } /** * @since 4.3 */ public function qtransSwitch() { global $q_config; $q_config['js']['qtrans_save'] .= ' var mqtranslate = true; '; } } PK2\6ccclasses/core/class-vc-page.phpnuW+Aslug; } /** * @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() { ob_start(); vc_include_template( $this->getTemplatePath(), array( 'page' => $this, ) ); echo apply_filters( 'vc_settings-page-render-' . $this->getSlug(), ob_get_clean(), $this ); } } PK2\E4classes/core/access/class-vc-current-user-access.phpnuW+Aparts[ $part ] ) ) { require_once vc_path_dir( 'CORE_DIR', 'access/class-vc-current-user-access-controller.php' ); /** @var $user_access_controller Vc_Current_User_Access_Controller */ $user_access_controller = $this->parts[ $part ] = new Vc_Current_User_Access_Controller( $part ); } /** @var $user_access_controller Vc_Current_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; } 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; } } PK2\Q))?classes/core/access/class-vc-current-user-access-controller.phpnuW+AgetStateKey() . '/' . $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 ); } 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; } } PK2\u$+,classes/core/access/class-vc-role-access.phpnuW+AgetRoleName(); 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 $role_access_controller Vc_Role_Access_Controller */ $role_access_controller = $this->parts[ $key ] = new Vc_Role_Access_Controller( $part ); $role_access_controller->setRoleName( $this->getRoleName() ); } /** @var $role_access_controller Vc_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; } } PK2\x 0classes/core/access/abstract-class-vc-access.phpnuW+AvalidAccess; } /** * @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( $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_Current_User_Access */ public function checkAdminNonce( $nonce = '' ) { return $this->check( 'vc_verify_admin_nonce', $nonce ); } /** * @param string $nonce * * @return Vc_Current_User_Access */ public function checkPublicNonce( $nonce = '' ) { return $this->check( 'vc_verify_public_nonce', $nonce ); } } PK2\9JJ7classes/core/access/class-vc-role-access-controller.phpnuW+A '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', ); 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; */ 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 */ 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 */ 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 */ 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 */ 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. */ 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; } public function getStateKey() { return self::$part_name_prefix . $this->getPart(); } public function checkState( $data ) { if ( $this->getValidAccess() ) { $this->setValidAccess( $this->getState() === $data ); } 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(); } public function updateMergedCaps( $rule ) { if ( isset( $this->mergedCaps[ $rule ] ) ) { return $this->mergedCaps[ $rule ]; } return $rule; } /** * @return array */ public function getMergedCaps() { return $this->mergedCaps; } } PK2\IZ&MMclasses/core/class-wpb-map.phpnuW+Aroles ) ) { 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 ) { return (boolean) 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 ( ! self::$is_init ) { if ( empty( $attributes['name'] ) ) { trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $tag ) ); } elseif ( empty( $attributes['base'] ) ) { trigger_error( sprintf( __( 'Wrong base for shortcode:%s. Base required', 'js_composer' ), $tag ) ); } else { vc_mapper()->addActivity( 'mapper', 'map', array( 'tag' => $tag, 'attributes' => $attributes, ) ); return true; } return false; } if ( empty( $attributes['name'] ) ) { trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $tag ) ); } elseif ( empty( $attributes['base'] ) ) { trigger_error( sprintf( __( 'Wrong base for shortcode:%s. Base required', 'js_composer' ), $tag ) ); } else { self::$sc[ $tag ] = $attributes; 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 * @since 4.9 * * @param $tag * @param $settings_file * @param $settings_function * @param $attributes * * @return bool */ public static function leanMap( $tag, $settings_function = null, $settings_file = null, $attributes = array() ) { 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. */ protected static function generateUserData( $force = false ) { if ( ! $force && false !== self::$user_sc && false !== self::$user_categories ) { return; } //$settings = self::getSettings(); self::$user_sc = self::$user_categories = 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 ) ) { self::$user_categories[] = $c; } $values['_category_ids'][] = md5( $c ); } } else { if ( false === array_search( $categories, self::$user_categories ) ) { self::$user_categories[] = $categories; } $values['_category_ids'][] = md5( $categories ); } } } 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. */ 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 */ public static function getAllShortCodes() { self::generateData(); return self::$sc; } /** * Get mapped shortcode settings. * * @static * @return array */ 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 array */ public static function getSortedUserShortCodes() { self::generateUserData(); return self::$user_sorted_sc; } /** * Get list of mapped shortcode settings for current user. * @static * @return array - associated array of shortcodes settings with tag as the key. */ 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 */ public static function getShortCode( $tag ) { if ( isset( self::$sc[ $tag ] ) && is_array( self::$sc[ $tag ] ) ) { self::setElementSettings( $tag ); $shortcode = self::$sc[ $tag ]; } else { $shortcode = null; } return $shortcode; } /** * Get mapped shortcode settings by tag. * * @since 4.5.2 * @static * * @param $tag - shortcode tag. * * @return array|null */ 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 */ 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 array */ 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 ) { 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 ] ); self::$sc[ $name ]['params'] = array_merge( self::$sc[ $name ]['params'] ); // fix indexes return true; } } } return true; } /** * Returns param settings for mapped shortcodes. * * @static * * @param $tag * @param $param_name * * @return bool| array */ public static function getParam( $tag, $param_name ) { if ( ! isset( self::$sc[ $tag ] ) ) { return trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $tag ) ); } if ( isset( self::$sc[ $tag ]['__vc_settings_function'] ) || isset( self::$sc[ $tag ]['__vc_settings_file'] ) ) { self::setElementSettings( $tag ); } if ( ! isset( self::$sc[ $tag ]['params'] ) ) { return false; } foreach ( self::$sc[ $tag ]['params'] as $index => $param ) { if ( $param['param_name'] == $param_name ) { return self::$sc[ $tag ]['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() ) { if ( ! isset( self::$init_elements[ $name ] ) ) { vc_mapper()->addElementActivity( $name, 'add_param', array( 'name' => $name, 'attribute' => $attribute, ) ); return false; } if ( ! isset( self::$sc[ $name ] ) ) { trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $name ) ); } elseif ( ! isset( $attribute['param_name'] ) ) { trigger_error( sprintf( __( "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 ] = $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; } return false; } /** * Change param attributes of mapped shortcode. * * @static * * @param $name * @param array $attribute * * @return bool */ public static function mutateParam( $name, $attribute = array() ) { if ( ! isset( self::$init_elements[ $name ] ) ) { vc_mapper()->addElementActivity( $name, 'mutate_param', array( 'name' => $name, 'attribute' => $attribute, ) ); return false; } if ( ! isset( self::$sc[ $name ] ) ) { return trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $name ) ); } elseif ( ! isset( $attribute['param_name'] ) ) { trigger_error( sprintf( __( "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 ) { if ( ! isset( self::$init_elements[ $name ] ) ) { vc_mapper()->addElementActivity( $name, 'drop_shortcode', array( 'name' => $name, ) ); return false; } unset( self::$sc[ $name ] ); visual_composer()->removeShortCode( $name ); return true; } public static function dropAllShortcodes() { 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 = self::$user_categories = 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 $value - value of settings if $setting_name is option key. * * @return array|bool */ public static function modify( $name, $setting_name, $value = '' ) { 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 ] ) ) { return trigger_error( sprintf( __( 'Wrong name for shortcode:%s. Name required', 'js_composer' ), $name ) ); } elseif ( 'base' === $setting_name ) { return trigger_error( sprintf( __( "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 ) ) { $value = array_merge( $value ); // fix indexes } 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. * @deprecated - use Vc_Sort::sortByKey since 4.4 * @static * * @param $a * @param $b * * @return int */ public static function sort( $a, $b ) { // _deprecated_function( 'WPBMap::sort', '4.4 (will be removed in 4.10)', 'Vc_Sort class, :sortByKey' ); $a_weight = isset( $a['weight'] ) ? (int) $a['weight'] : 0; $b_weight = isset( $b['weight'] ) ? (int) $b['weight'] : 0; if ( $a_weight == $b_weight ) { $cmpa = array_search( $a, (array) self::$user_sorted_sc ); $cmpb = array_search( $b, (array) self::$user_sorted_sc ); return ( $cmpa > $cmpb ) ? 1 : - 1; } return ( $a_weight < $b_weight ) ? 1 : - 1; } 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 ) ) { $categories[] = $c; } $values['_category_ids'][] = md5( $c ); } } else { if ( false === array_search( $categories, $categories_list ) ) { $categories_list[] = $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 * * @since 4.9 * * @param $tag * * @return bool */ public static function setElementSettings( $tag ) { if ( ! isset( self::$sc[ $tag ] ) ) { return false; } $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 ]['base'] = $tag; self::$init_elements[ $tag ] = true; vc_mapper()->callElementActivities( $tag ); return true; } /** * Add elements as shortcodes * * @since 4.9 */ public static function addAllMappedShortcodes() { foreach ( self::$sc as $tag => $settings ) { if ( ! shortcode_exists( $tag ) ) { add_shortcode( $tag, 'vc_do_shortcode' ); } } } } PK2\4classes/core/class-vc-sort.phpnuW+Adata 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'; /** * @since 4.4 * * @param $data - array to sort */ public function __construct( $data ) { $this->data = $data; } /** * Used to change/set data to sort * * @since 4.5 * * @param $data */ 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). * * @since 4.4 * * @param string $key * * @return array - sorted array */ 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 * @since 4.4 * * @param $a - compare value * @param $b - compare value * * @return int */ 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 ) { $cmp_a = array_search( $a, $this->data ); $cmp_b = array_search( $b, $this->data ); return $cmp_a - $cmp_b; } return $b_weight - $a_weight; } /** * @since 4.4 * * @return array - sorting data */ public function getData() { return $this->data; } } PK2\03classes/core/interfaces.phpnuW+AactivePage; } /** * @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, ) ); } } PK2\/, , $classes/core/class-vc-post-admin.phpnuW+AwpAny( array( 'edit_post', $post_id ) ) ->get() ) { return; } $this->setJsStatus( $post_id ); if ( ! ( isset( $_POST['wp-preview'] ) && 'dopreview' === $_POST['wp-preview'] ) ) { $this->setSettings( $post_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' ) ); if ( null !== $post_custom_css && empty( $post_custom_css ) ) { delete_post_meta( $post_id, '_wpb_post_custom_css' ); } elseif ( null !== $post_custom_css ) { $post_custom_css = strip_tags( $post_custom_css ); update_post_meta( $post_id, '_wpb_post_custom_css', $post_custom_css ); } visual_composer()->buildShortcodesCustomCss( $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'. * @since 4.4 * * @param $post_id */ public function setJsStatus( $post_id ) { $value = vc_post_param( 'wpb_vc_js_status' ); if ( null !== $value ) { // Add value if ( '' === get_post_meta( $post_id, '_wpb_vc_js_status' ) ) { add_post_meta( $post_id, '_wpb_vc_js_status', $value, true ); } // Update value elseif ( get_post_meta( $post_id, '_wpb_vc_js_status', true ) != $value ) { update_post_meta( $post_id, '_wpb_vc_js_status', $value ); } // Delete 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. * @since 4.4 * @todo check is it used everywhere and is it needed?! * @param $post_id */ public function setInterfaceVersion( $post_id ) { if ( null !== ( $value = vc_post_param( 'wpb_vc_js_interface_version' ) ) ) { update_post_meta( $post_id, '_wpb_vc_js_interface_version', $value ); } } /** * 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'. * @since 4.4 * vc_filter: vc_hooks_vc_post_settings - hook to override post meta settings for visual composer (used in grid for * example) * * @param $post_id */ 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' ); } } } PK2\BnBnclasses/core/class-vc-base.phpnuW+ApostAdmin()->init(); } add_filter( 'body_class', array( $this, 'bodyClass', ) ); add_filter( 'the_excerpt', array( $this, 'excerptFilter', ) ); add_action( 'wp_head', array( $this, 'addMetaData', ) ); add_action( 'wp_head', array( $this, 'addIEMinimalSupport', ) ); if ( is_admin() ) { $this->initAdmin(); } else { $this->initPage(); } do_action( 'vc_after_init_base' ); } /** * Post object for interacting with Current post data. * @since 4.4 * @return Vc_Post_Admin */ 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' ); // Build settings for admin page; //$this->registerAdminJavascript(); //$this->registerAdminCss(); // editors actions: $this->editForm()->init(); $this->templatesPanelEditor()->init(); $this->shared_templates->init(); // ajax params/shortcode action add_action( 'wp_ajax_wpb_single_image_src', array( $this, 'singleImageSrc', ) ); // @todo move it add_action( 'wp_ajax_wpb_gallery_html', array( $this, 'galleryHTML', ) ); // @todo move it // plugins list page actions links add_filter( 'plugin_action_links', array( $this, 'pluginActionLinks', ), 10, 2 ); } /** * Setter for edit form. * @since 4.2 * * @param Vc_Shortcode_Edit_Form $form */ public function setEditForm( Vc_Shortcode_Edit_Form $form ) { $this->shortcode_edit_form = $form; } /** * Get Shortcodes Edit form object. * * @see Vc_Shortcode_Edit_Form::__construct * @since 4.2 * @access public * @return Vc_Shortcode_Edit_Form */ public function editForm() { return $this->shortcode_edit_form; } /** * Setter for Templates editor. * @deprecated 4.4 updated to panel editor see Vc_Templates_Panel_Editor::__construct * @use setTemplatesPanelEditor * @since 4.2 * * @param Vc_Templates_Editor $editor */ public function setTemplatesEditor( Vc_Templates_Editor $editor ) { _deprecated_function( 'Vc_Base::setTemplatesEditor', '4.4 (will be removed in 5.1)', 'Vc_Base::setTemplatesPanelEditor' ); $this->templates_editor = $editor; } /** * Setter for Templates editor. * @since 4.4 * * @param Vc_Templates_Panel_Editor $editor */ public function setTemplatesPanelEditor( Vc_Templates_Panel_Editor $editor ) { $this->templates_panel_editor = $editor; } /** * Get templates manager. * @deprecated updated to panel editor see Vc_Templates_Panel_Editor::__construct * @see Vc_Templates_Editor::__construct * @since 4.2 * @access public * @return bool|Vc_Templates_Editor */ public function templatesEditor() { _deprecated_function( 'Vc_Base::templatesEditor', '4.4 (will be removed in 5.1)', 'Vc_Base::templatesPanelEditor' ); return $this->templates_editor; } /** * Get templates manager. * @see Vc_Templates_Panel_Editor::__construct * @since 4.4 * @access public * @return bool|Vc_Templates_Panel_Editor */ public function templatesPanelEditor() { return $this->templates_panel_editor; } /** * Save method for edit_post action. * @deprecated 4.9 * @since 4.2 * @access public * * @param null $post_id */ public function save( $post_id = null ) { _deprecated_function( '\Vc_Base::save', '4.9 (will be removed in 5.1)', '\Vc_Post_Admin::save' ); } /** * Add new shortcode to Visual composer. * * @see WPBMap::map * @since 4.2 * @access public * @deprecated 4.9 * * @param array $shortcode - array of options. */ public function addShortCode( array $shortcode ) { _deprecated_function( '\Vc_Base::addShortcode', '4.9 (will be removed in 5.1)', 'vc_map' ); if ( ! isset( $this->shortcodes[ $shortcode['base'] ] ) ) { require_once vc_path_dir( 'SHORTCODES_DIR', 'shortcodes.php' ); $this->shortcodes[ $shortcode['base'] ] = new WPBakeryShortCodeFishBones( $shortcode ); } } /** * Get shortcode class instance. * * @see WPBakeryShortCodeFishBones * @since 4.2 * @access public * * @param string $tag * * @return Vc_Shortcodes_Manager|null */ public function getShortCode( $tag ) { return Vc_Shortcodes_Manager::getInstance()->setTag( $tag ); } /** * Remove shortcode from shortcodes list of VC. * * @since 4.2 * @access public * * @param $tag - shortcode tag */ public function removeShortCode( $tag ) { remove_shortcode( $tag ); } /** * @todo move it * @since 4.2 */ public function singleImageSrc() { // @todo again, this method should be moved (comment added on 4.8) 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 = 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; } die( $img ); } /** * @todo move it * @since 4.2 */ public function galleryHTML() { // @todo again, this method should be moved (comment added on 4.8) vc_user_access()->checkAdminNonce()->validateDie()->wpAny( 'edit_posts', 'edit_pages' )->validateDie(); $images = vc_post_param( 'content' ); if ( ! empty( $images ) ) { echo fieldAttachedImages( explode( ',', $images ) ); } die(); } /** * Set or modify new settings for shortcode. * * This function widely used by WPBMap class methods to modify shortcodes mapping * * @since 4.3 * * @param $tag * @param $name * @param $value */ 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. * * @since 4.2 * @access public * * @param $post_id */ public function buildShortcodesCustomCss( $post_id ) { $post = get_post( $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 ) ); if ( empty( $css ) ) { delete_post_meta( $post_id, '_wpb_shortcodes_custom_css' ); } else { update_post_meta( $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'. * * @see WPBakeryVisualComposerCssEditor * @since 4.2 * @access public * * @param $content * * @return string */ 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. * * @since 4.2 * @access public * * @param int $id */ public function addPageCustomCss( $id = null ) { if ( ! is_singular() ) { return; } if ( ! $id ) { $id = get_the_ID(); } if ( $id ) { $post_custom_css = get_post_meta( $id, '_wpb_post_custom_css', true ); if ( ! empty( $post_custom_css ) ) { $post_custom_css = strip_tags( $post_custom_css ); echo ''; } } } /** * 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. * * @since 4.2 * @access public * * @param int $id * */ public function addShortcodesCustomCss( $id = null ) { if ( ! is_singular() ) { return; } if ( ! $id ) { $id = get_the_ID(); } if ( $id ) { $shortcodes_custom_css = get_post_meta( $id, '_wpb_shortcodes_custom_css', true ); if ( ! empty( $shortcodes_custom_css ) ) { $shortcodes_custom_css = strip_tags( $shortcodes_custom_css ); echo ''; } } } /** * Add css styles for current page and elements design options added w\ editor. */ public function addFrontCss() { $this->addPageCustomCss(); $this->addShortcodesCustomCss(); } public function addNoScript() { echo ''; } /** * 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/bower/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( 'font-awesome', vc_asset_url( 'lib/bower/font-awesome/css/font-awesome.min.css' ), array(), WPB_VC_VERSION ); wp_register_style( 'animate-css', vc_asset_url( 'lib/bower/animate-css/animate.min.css' ), array(), WPB_VC_VERSION, false ); $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 && preg_match( '/vc_row/', $post->post_content ) ) { 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' ), WPB_VC_VERSION, true ); wp_register_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), 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', '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' ), WPB_VC_VERSION, true ); wp_register_script( 'twbs-pagination', vc_asset_url( 'lib/bower/twbs-pagination/jquery.twbsPagination.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'nivo-slider', vc_asset_url( 'lib/bower/nivoslider/jquery.nivo.slider.pack.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'flexslider', vc_asset_url( 'lib/bower/flexslider/jquery.flexslider-min.js' ), array( 'jquery' ), WPB_VC_VERSION, true ); wp_register_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery' ), 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 * @since 4.2 * * @param $links * @param $file * * @return array */ public function pluginActionLinks( $links, $file ) { if ( plugin_basename( vc_path_dir( 'APP_DIR', '/js_composer.php' ) ) == $file ) { $title = __( 'Visual Composer Settings', 'js_composer' ); $html = esc_html__( 'Settings', 'js_composer' ); if ( ! vc_user_access()->part( 'settings' )->can( 'vc-general-tab' )->get() ) { $title = __( 'About Visual Composer', 'js_composer' ); $html = esc_html__( 'About', 'js_composer' ); } $link = '' . $html . ''; array_unshift( $links, $link ); // Add to top } return $links; } /** * Get settings page link * @since 4.2 * @return string url to settings page */ 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 '' . "\n"; } /** * Also add fix for IE8 bootstrap styles from WPExplorer * @since 4.9 * @access public */ public function addIEMinimalSupport() { echo ''; } /** * 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. * * @since 4.2 * @access public * * @param $classes * * @return array */ 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. * * @since 4.2 * @access public * * @param $output * * @return string */ public function excerptFilter( $output ) { global $post; if ( empty( $output ) && ! empty( $post->post_content ) ) { $text = strip_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. * @since 4.2 * * @param null $content * * @return string|null */ public function fixPContent( $content = null ) { if ( $content ) { $s = array( '/' . preg_quote( '
    ', '/' ) . '[\s\n\f]*' . preg_quote( '

    ', '/' ) . '/i', '/' . preg_quote( '

    ', '/' ) . '[\s\n\f]*' . preg_quote( '

    ', '/' ) . '[\s\n\f]*' . preg_quote( '
    ', '/' ) . '[\s\n\f]*' . preg_quote( '

    ', '/' ) . '/i', ); $r = array( '
    ', '
    ', ); $content = preg_replace( $s, $r, $content ); return $content; } return null; } /** * @todo remove this (comment added on 4.8) also remove helpers * Set manger for custom third-party plugins. * @deprecated due to autoload logic 4.4 * @since 4.3 * * @param Vc_Vendors_Manager $vendor_manager */ public function setVendorsManager( Vc_Vendors_Manager $vendor_manager ) { _deprecated_function( 'Vc_Base::setVendorsManager', '4.4 (will be removed in 5.1)', 'autoload logic' ); $this->vendor_manager = $vendor_manager; } /** * @todo remove this (comment added on 4.8) also remove helpers * Get vendors manager. * @deprecated due to autoload logic from 4.4 * @since 4.3 * @return bool|Vc_Vendors_Manager */ public function vendorsManager() { _deprecated_function( 'Vc_Base::vendorsManager', '4.4 (will be removed in 5.1)', 'autoload logic' ); return $this->vendor_manager; } /** * Get array of string for locale. * * @since 4.7 * * @return array */ public function getEditorsLocale() { return array( 'add_remove_picture' => __( 'Add/remove picture', 'js_composer' ), 'finish_adding_text' => __( 'Finish Adding Images', 'js_composer' ), 'add_image' => __( 'Add Image', 'js_composer' ), 'add_images' => __( 'Add Images', 'js_composer' ), 'settings' => __( 'Settings', 'js_composer' ), 'main_button_title' => __( 'Visual Composer', 'js_composer' ), 'main_button_title_backend_editor' => __( 'BACKEND EDITOR', 'js_composer' ), 'main_button_title_frontend_editor' => __( 'FRONTEND EDITOR', 'js_composer' ), 'main_button_title_revert' => __( 'CLASSIC MODE', 'js_composer' ), 'please_enter_templates_name' => __( 'Enter template name you want to save.', 'js_composer' ), 'confirm_deleting_template' => __( 'Confirm deleting "{template_name}" template, press Cancel to leave. This action cannot be undone.', 'js_composer' ), 'press_ok_to_delete_section' => __( 'Press OK to delete section, Cancel to leave', 'js_composer' ), 'drag_drop_me_in_column' => __( 'Drag and drop me in the column', 'js_composer' ), 'press_ok_to_delete_tab' => __( 'Press OK to delete "{tab_name}" tab, Cancel to leave', 'js_composer' ), 'slide' => __( 'Slide', 'js_composer' ), 'tab' => __( 'Tab', 'js_composer' ), 'section' => __( 'Section', 'js_composer' ), 'please_enter_new_tab_title' => __( 'Please enter new tab title', 'js_composer' ), 'press_ok_delete_section' => __( 'Press OK to delete "{tab_name}" section, Cancel to leave', 'js_composer' ), 'section_default_title' => __( 'Section', 'js_composer' ), 'please_enter_section_title' => __( 'Please enter new section title', 'js_composer' ), 'error_please_try_again' => __( 'Error. Please try again.', 'js_composer' ), 'if_close_data_lost' => __( 'If you close this window all shortcode settings will be lost. Close this window?', 'js_composer' ), 'header_select_element_type' => __( 'Select element type', 'js_composer' ), 'header_media_gallery' => __( 'Media gallery', 'js_composer' ), 'header_element_settings' => __( 'Element settings', 'js_composer' ), 'add_tab' => __( 'Add tab', 'js_composer' ), 'are_you_sure_convert_to_new_version' => __( 'Are you sure you want to convert to new version?', 'js_composer' ), 'loading' => __( 'Loading...', 'js_composer' ), // Media editor 'set_image' => __( 'Set Image', 'js_composer' ), 'are_you_sure_reset_css_classes' => __( 'Are you sure that you want to remove all your data?', 'js_composer' ), 'loop_frame_title' => __( 'Loop settings', 'js_composer' ), 'enter_custom_layout' => __( 'Custom row layout', 'js_composer' ), 'wrong_cells_layout' => __( 'Wrong row layout format! Example: 1/2 + 1/2 or span6 + span6.', 'js_composer' ), 'row_background_color' => __( 'Row background color', 'js_composer' ), 'row_background_image' => __( 'Row background image', 'js_composer' ), 'column_background_color' => __( 'Column background color', 'js_composer' ), 'column_background_image' => __( 'Column background image', 'js_composer' ), 'guides_on' => __( 'Guides ON', 'js_composer' ), 'guides_off' => __( 'Guides OFF', 'js_composer' ), 'template_save' => __( 'New template successfully saved.', 'js_composer' ), 'template_added' => __( 'Template added to the page.', 'js_composer' ), 'template_added_with_id' => __( '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' => __( 'Template successfully removed.', 'js_composer' ), 'template_is_empty' => __( 'Template is empty: There is no content to be saved as a template.', 'js_composer' ), 'template_save_error' => __( 'Error while saving template.', 'js_composer' ), 'css_updated' => __( 'Page settings updated!', 'js_composer' ), 'update_all' => __( 'Update all', 'js_composer' ), 'confirm_to_leave' => __( 'The changes you made will be lost if you navigate away from this page.', 'js_composer' ), 'inline_element_saved' => __( '%s saved!', 'js_composer' ), 'inline_element_deleted' => __( '%s deleted!', 'js_composer' ), 'inline_element_cloned' => __( '%s cloned. Edit now?', 'js_composer' ), 'gfonts_loading_google_font_failed' => __( 'Loading Google Font failed', 'js_composer' ), 'gfonts_loading_google_font' => __( 'Loading Font...', 'js_composer' ), 'gfonts_unable_to_load_google_fonts' => __( 'Unable to load Google Fonts', 'js_composer' ), 'no_title_parenthesis' => sprintf( '(%s)', __( 'no title', 'js_composer' ) ), 'error_while_saving_image_filtered' => __( 'Error while applying filter to the image. Check your server and memory settings.', 'js_composer' ), 'ui_saved' => sprintf( ' %s', __( 'Saved!', 'js_composer' ) ), 'ui_danger' => sprintf( ' %s', __( 'Failed to Save!', 'js_composer' ) ), 'delete_preset_confirmation' => __( 'You are about to delete this preset. This action can not be undone.', 'js_composer' ), 'ui_template_downloaded' => __( 'Downloaded', 'js_composer' ), 'ui_template_update' => __( 'Update', 'js_composer' ), 'ui_templates_failed_to_download' => __( 'Failed to download template', 'js_composer' ), ); } } /** * @todo remove this (comment added on 4.8) also remove helpers * VC backward capability. * @deprecated @since 4.3 */ class WPBakeryVisualComposer extends Vc_Base { /** * @deprecated since 4.3 */ function __construct() { _deprecated_function( 'WPBakeryVisualComposer class', '4.3 (will be removed in 5.1)', 'Vc_Base class' ); } /** * @param $template * * @deprecated 4.3 * @return string */ public static function getUserTemplate( $template ) { _deprecated_function( 'WPBakeryVisualComposer getUserTemplate', '4.3 (will be removed in 5.1)', 'Vc_Base getShortcodesTemplateDir' ); return vc_manager()->getShortcodesTemplateDir( $template ); } } PK2\zsYG G (classes/core/class-vc-shared-library.phpnuW+A '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 ) ) { $list += self::$box_styles; } if ( ! $groups || in_array( 'round', $groups ) ) { $list += self::$round_box_styles; } if ( ! $groups || in_array( 'cirlce', $groups ) ) { $list += self::$circle_box_styles; } return $list; } public static function getColorsDashed() { $colors = array( __( 'Blue', 'js_composer' ) => 'blue', __( 'Turquoise', 'js_composer' ) => 'turquoise', __( 'Pink', 'js_composer' ) => 'pink', __( 'Violet', 'js_composer' ) => 'violet', __( 'Peacoc', 'js_composer' ) => 'peacoc', __( 'Chino', 'js_composer' ) => 'chino', __( 'Mulled Wine', 'js_composer' ) => 'mulled-wine', __( 'Vista Blue', 'js_composer' ) => 'vista-blue', __( 'Black', 'js_composer' ) => 'black', __( 'Grey', 'js_composer' ) => 'grey', __( 'Orange', 'js_composer' ) => 'orange', __( 'Sky', 'js_composer' ) => 'sky', __( 'Green', 'js_composer' ) => 'green', __( 'Juicy pink', 'js_composer' ) => 'juicy-pink', __( 'Sandy brown', 'js_composer' ) => 'sandy-brown', __( 'Purple', 'js_composer' ) => 'purple', __( 'White', 'js_composer' ) => 'white', ); return $colors; } } /** * @param string $asset * * @return array */ function getVcShared( $asset = '' ) { switch ( $asset ) { case 'colors': return VcSharedLibrary::getColors(); break; case 'colors-dashed': return VcSharedLibrary::getColorsDashed(); break; case 'icons': return VcSharedLibrary::getIcons(); break; case 'sizes': return VcSharedLibrary::getSizes(); break; case 'button styles': case 'alert styles': return VcSharedLibrary::getButtonStyles(); break; case 'message_box_styles': return VcSharedLibrary::getMessageBoxStyles(); break; case 'cta styles': return VcSharedLibrary::getCtaStyles(); break; case 'text align': return VcSharedLibrary::getTextAlign(); break; case 'cta widths': case 'separator widths': return VcSharedLibrary::getElementWidths(); break; case 'separator styles': return VcSharedLibrary::getSeparatorStyles(); break; case 'separator border widths': return VcSharedLibrary::getBorderWidths(); break; case 'single image styles': return VcSharedLibrary::getBoxStyles(); break; case 'single image external styles': return VcSharedLibrary::getBoxStyles( array( 'default', 'round' ) ); break; case 'toggle styles': return VcSharedLibrary::getToggleStyles(); break; case 'animation styles': return VcSharedLibrary::getAnimationStyles(); break; default: # code... break; } return ''; } PK2\xmIC classes/core/class-vc-mapper.phpnuW+AcallActivities(); do_action( 'vc_mapper_init_after' ); } /** * This method is called by VC objects methods if it is called before VC initialization. * * @see WPBMAP * @since 4.2 * @access public * * @param $object - mame of class object * @param $method - method name * @param array $params - list of attributes for object method */ 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. * * @see WPBMAP * @since 4.9 * @access public * * @param $tag - shortcode tag of element * @param $method - method name * @param array $params - list of attributes for object method */ 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' ); while ( $activity = each( $this->init_activity ) ) { list( $object, $method, $params ) = $activity[1]; if ( 'mapper' === $object ) { switch ( $method ) { case 'map': WPBMap::map( $params['tag'], $params['attributes'] ); 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 * * @todo fix_roles and maybe remove/@deprecate this * @since 4.5 * @return bool */ 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; } /** * @todo fix_roles and maybe remove/@deprecate this * @since 4.5 * @return bool */ public function isCheckForAccess() { return $this->checkForAccess; } /** * @todo fix_roles and maybe remove/@deprecate this * @since 4.5 * * @param bool $checkForAccess */ public function setCheckForAccess( $checkForAccess ) { $this->checkForAccess = $checkForAccess; } public function callElementActivities( $tag ) { do_action( 'vc_mapper_call_activities_before' ); if ( isset( $this->element_activities[ $tag ] ) ) { while ( $activity = each( $this->element_activities[ $tag ] ) ) { list( $method, $params ) = $activity[1]; 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; } } } } } PK2\?Xctt;classes/core/shared-templates/class-vc-shared-templates.phpnuW+Ainitialized ) { 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_action( 'wp_ajax_vc_frontend_load_template', array( $this, 'renderFrontendTemplate', ) ); */ add_filter( 'wp_ajax_vc_shared_templates_download', array( $this, 'ajaxDownloadTemplate', ) ); add_filter( 'vc_get_all_templates', array( $this, 'addTemplatesTab', ) ); $this->registerPostType(); } 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; } 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; } 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( json_encode( array( 'success' => false, 'message' => 'access denied', ) ) )->part( 'templates' )->checkStateAny( true, null )->validateDie( json_encode( array( 'success' => false, 'message' => 'part access denied', ) ) )->check( array( vc_license(), 'isActivated', ) ); $access->validateDie( 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 ( $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(); } } /** * @param $requestUrl * * @return bool|string */ private function downloadTemplate( $requestUrl ) { $downloadUrlRequest = wp_remote_get( $requestUrl ); if ( is_array( $downloadUrlRequest ) && 200 === $downloadUrlRequest['response']['code'] ) { return $this->parseRequest( $downloadUrlRequest ); } return false; } /** * @param $request * * @return bool|string */ 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; } return false; } /** * @param $data * * @return array */ public function addTemplatesTab( $data ) { $newCategory = array( 'category' => 'shared_templates', 'category_name' => __( '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(); } 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; } } PK2\>D{__2classes/core/shared-templates/importer/parsers.phpnuW+Aparse( $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; } } else if ( 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 '
    ';
    			if ( 'SimpleXML_parse_error' == $result->get_error_code() ) {
    				foreach ( $result->get_error_data() as $error ) {
    					echo $error->line . ':' . $error->column . ' ' . esc_html( $error->message ) . "\n";
    				}
    			} else if ( 'XML_parse_error' == $result->get_error_code() ) {
    				$error = $result->get_error_data();
    				echo $error[0] . ':' . $error[1] . ' ' . esc_html( $error[2] );
    			}
    			echo '
    '; echo '

    ' . __( 'There was an error when reading this WXR file', 'wordpress-importer' ) . '
    '; echo __( 'Details are shown above. The importer will now try again with a different parser...', 'wordpress-importer' ) . '

    '; } // use regular expressions if nothing else available or this is bad XML $parser = new Vc_WXR_Parser_Regex; return $parser->parse( $file ); } } /** * WXR Parser that makes use of the SimpleXML PHP extension. */ class Vc_WXR_Parser_SimpleXML { function parse( $file ) { $authors = $posts = $categories = $tags = $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 ); } $success = $dom->loadXML( file_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', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), 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', __( 'There was an error when reading this WXR file', 'wordpress-importer' ), libxml_get_errors() ); } $wxr_version = $xml->xpath( '/rss/channel/wp:wxr_version' ); if ( ! $wxr_version ) { return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); } $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', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); } $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, ); } } /** * WXR Parser that makes use of the XML Parser PHP extension. */ class Vc_WXR_Parser_XML { var $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 $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', ); function parse( $file ) { $this->wxr_version = $this->in_post = $this->cdata = $this->data = $this->sub_data = $this->in_tag = $this->in_sub_tag = false; $this->authors = $this->posts = $this->term = $this->category = $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' ); if ( ! xml_parse( $xml, file_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', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); } 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, ); } function tag_open( $parse, $tag, $attr ) { if ( in_array( $tag, $this->wp_tags ) ) { $this->in_tag = substr( $tag, 3 ); return; } if ( in_array( $tag, $this->wp_sub_tags ) ) { $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; 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; } } 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 ); } } 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; } else if ( $this->in_tag ) { $this->data[ $this->in_tag ] = ! empty( $this->cdata ) ? $this->cdata : ''; $this->in_tag = false; } } $this->cdata = false; } } /** * WXR Parser that uses regular expressions. Fallback for installs without an XML parser. */ class Vc_WXR_Parser_Regex { var $authors = array(); var $posts = array(); var $categories = array(); var $tags = array(); var $terms = array(); var $base_url = ''; function __construct() { $this->has_gzip = is_callable( 'gzopen' ); } function parse( $file ) { $wxr_version = $in_post = false; $fp = $this->fopen( $file, 'r' ); if ( $fp ) { while ( ! $this->feof( $fp ) ) { $importline = rtrim( $this->fgets( $fp ) ); if ( ! $wxr_version && preg_match( '|(\d+\.\d+)|', $importline, $version ) ) { $wxr_version = $version[1]; } if ( false !== strpos( $importline, '' ) ) { preg_match( '|(.*?)|is', $importline, $url ); $this->base_url = $url[1]; continue; } if ( false !== strpos( $importline, '' ) ) { preg_match( '|(.*?)|is', $importline, $category ); $this->categories[] = $this->process_category( $category[1] ); continue; } if ( false !== strpos( $importline, '' ) ) { preg_match( '|(.*?)|is', $importline, $tag ); $this->tags[] = $this->process_tag( $tag[1] ); continue; } if ( false !== strpos( $importline, '' ) ) { preg_match( '|(.*?)|is', $importline, $term ); $this->terms[] = $this->process_term( $term[1] ); continue; } if ( false !== strpos( $importline, '' ) ) { preg_match( '|(.*?)|is', $importline, $author ); $a = $this->process_author( $author[1] ); $this->authors[ $a['author_login'] ] = $a; continue; } if ( false !== strpos( $importline, '' ) ) { $post = ''; $in_post = true; continue; } if ( false !== strpos( $importline, '' ) ) { $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', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) ); } 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, ); } function get_tag( $string, $tag ) { preg_match( "|<$tag.*?>(.*?)|is", $string, $return ); if ( isset( $return[1] ) ) { if ( substr( $return[1], 0, 9 ) == '' ) !== false ) { preg_match_all( '||s', $return[1], $matches ); $return = ''; foreach ( $matches[1] as $match ) { $return .= $match; } } else { $return = preg_replace( '|^$|s', '$1', $return[1] ); } } else { $return = $return[1]; } } else { $return = ''; } return $return; } 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' ), ); } 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' ), ); } 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' ), ); } 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' ), ); } 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( '
    ', '
    ', $post_excerpt ); $post_excerpt = str_replace( '
    ', '
    ', $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( '
    ', '
    ', $post_content ); $post_content = str_replace( '
    ', '
    ', $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( '|(.+?)|is', $post, $terms, PREG_SET_ORDER ); foreach ( $terms as $t ) { $post_terms[] = array( 'slug' => $t[2], 'domain' => $t[1], 'name' => str_replace( array( '', ), '', $t[3] ), ); } if ( ! empty( $post_terms ) ) { $postdata['terms'] = $post_terms; } preg_match_all( '|(.+?)|is', $post, $comments ); $comments = $comments[1]; if ( $comments ) { foreach ( $comments as $comment ) { preg_match_all( '|(.+?)|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( '|(.+?)|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; } function _normalize_tag( $matches ) { return '<' . strtolower( $matches[1] ); } function fopen( $filename, $mode = 'r' ) { if ( $this->has_gzip ) { return gzopen( $filename, $mode ); } return fopen( $filename, $mode ); } function feof( $fp ) { if ( $this->has_gzip ) { return gzeof( $fp ); } return feof( $fp ); } function fgets( $fp, $len = 8192 ) { if ( $this->has_gzip ) { return gzgets( $fp, $len ); } return fgets( $fp, $len ); } function fclose( $fp ) { if ( $this->has_gzip ) { return gzclose( $fp ); } return fclose( $fp ); } } PK2\::MM=classes/core/shared-templates/importer/wordpress-importer.phpnuW+Aimport_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 '

    ' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '
    '; echo __( 'The file does not exist, please try again.', 'wordpress-importer' ) . '

    '; die(); } $import_data = $this->parse( $file ); if ( is_wp_error( $import_data ) ) { echo '

    ' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '
    '; /** @var \WP_Error $import_data */ echo esc_html( $import_data->get_error_message() ) . '

    '; 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 '

    ' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '
    '; echo esc_html( $file['error'] ) . '

    '; return false; } else if ( ! file_exists( $file['file'] ) ) { echo '

    ' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '
    '; printf( __( 'The export file could not be found at %s. It is likely that this was caused by a permissions problem.', 'wordpress-importer' ), esc_html( $file['file'] ) ); echo '

    '; return false; } $this->id = (int) $file['id']; $import_data = $this->parse( $file['file'] ); if ( is_wp_error( $import_data ) ) { echo '

    ' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '
    '; /** @var \WP_Error $import_data */ echo esc_html( $import_data->get_error_message() ) . '

    '; return false; } $this->version = $import_data['version']; if ( $this->version > $this->max_wxr_version ) { echo '

    '; printf( __( 'This WXR file (version %s) may not be supported by this version of the importer. Please consider updating.', 'wordpress-importer' ), esc_html( $import_data['version'] ) ); echo '

    '; } 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( // 'import_id' => $post['post_id'], // VC: Make the ID always to be new! '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 ( 1 == $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', __( 'Fetching attachments is not enabled', 'wordpress-importer' ) ); } // 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; } if ( $info = wp_check_filetype( $upload['file'] ) ) { $post['post_mime_type'] = $info['type']; } else { return new WP_Error( 'attachment_processing_error', __( 'Invalid file type', 'wordpress-importer' ) ); } $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; } 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 ( false == $file_path ) { return $headers; } // GET request - write it to the supplied filename $out_fp = fopen( $file_path, 'w' ); if ( ! $out_fp ) { return $headers; } fwrite( $out_fp, wp_remote_retrieve_body( $response ) ); 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, 0, '', $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 ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', __( 'Remote server did not respond', 'wordpress-importer' ) ); } // make sure the fetch was successful if ( '200' != $headers['response'] ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', sprintf( __( 'Remote server returned error response %1$d %2$s', 'wordpress-importer' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) ) ); } $filesize = filesize( $upload['file'] ); if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) ); } if ( 0 == $filesize ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', __( 'Zero size file downloaded', 'wordpress-importer' ) ); } $max_size = (int) $this->max_attachment_size(); if ( ! empty( $max_size ) && $filesize > $max_size ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), 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 = $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 ) { $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 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ) ); // remap enclosure urls $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', ) ) ) { 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 public function cmpr_strlen( $a, $b ) { return strlen( $b ) - strlen( $a ); } } } // class_exists( 'WP_Importer' ) PK2\Huw221classes/core/shared-templates/importer/plugin.phpnuW+A 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 ); } } 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\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; } 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; } 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; } public function attributesWalker( &$attributeValue, $key, $data ) { $intValue = intval( $attributeValue ); if ( array_key_exists( $intValue, $data['attachments'] ) ) { $attributeValue = $data['attachments'][ $intValue ]; } } 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; } } PK2\Y5aa$templates/pages/vc-welcome/index.phpnuW+A

    wpAny( 'manage_options' ) ->part( 'settings' ) ->can( 'vc-general-tab' ) ->get() && ( ! is_multisite() || ! is_main_site() ) ) : ?>

    $page->getSlug(), 'active_tab' => $active_page->getSlug(), 'tabs' => $pages, ) ); ?> render(); ?>
    PK2\p  )templates/pages/vc-welcome/vc-welcome.phpnuW+A

    Thank you for choosing Visual Composer,
    Michael M, CEO at WPBakery

    PK2\7 ݊+templates/pages/vc-welcome/vc-resources.phpnuW+A

    support page and open Support ticket. To open a support ticket you should have a valid support subscription in case if your support has expired you can purchase support extension on CodeCanyon.', 'js_composer' ), 'http://support.wpbakery.com', 'http://bit.ly/vcomposer' ); ?>

    Support Policy in order to get your issues solved as soon as possible.', 'js_composer' ), 'http://go.wpbakery.com/support-policy' ); ?>

    PK2\7@||%templates/pages/vc-welcome/vc-faq.phpnuW+A

    kb.wpbakery.com which covers everything related to Visual Composer starting from Installation and up to more advanced features based on our Inner API.', 'js_composer' ), 'http://kb.wpbakery.com' ); ?>

    Visual Composer "How To's"

    In this section, you will find quick tips in form of video tutorials on how to operate with Visual Composer.

    FAQ

    Here you can find answers to the Frequently Asked Question about Visual Composer.

    Theme Integration

    See how you can integrate Visual Composer within your WordPress theme.

    Inner API

    Inner API section describes capabilities of interaction with Visual Composer.

    PK2\j+templates/pages/partials/_settings_tabs.phpnuW+A PK2\iכ"templates/pages/partials/_tabs.phpnuW+A PK2\8;?templates/pages/partials/vc-roles-parts/_backend_editor.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), // 'custom_value' => array(true, 'default'), 'capabilities' => array( array( 'disabled_ce_editor', __( 'Disable Classic editor', 'js_composer' ) ), ), 'options' => array( array( true, __( 'Enabled', 'js_composer' ) ), array( 'default', __( 'Enabled and default', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Backend editor', 'js_composer' ), 'custom_label' => __( 'Backend editor', 'js_composer' ), ) ); PK2\i8templates/pages/partials/vc-roles-parts/_presets.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'options' => array( array( true, __( 'All', 'js_composer' ) ), array( 'add', __( 'Apply presets only', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Element Presets', 'js_composer' ), 'description' => __( 'Control access rights to element presets in element edit form. Note: "Apply presets only" restricts users from saving new presets, deleting existing and setting defaults.', 'js_composer' ), ) ); PK2\|yh>templates/pages/partials/vc-roles-parts/_post_settings.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'options' => array( array( true, __( 'Enabled', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Page settings', 'js_composer' ), 'description' => __( 'Control access to Visual Composer page settings. Note: Disable page settings to restrict editing of Custom CSS through page.', 'js_composer' ), ) ); PK2\5templates/pages/partials/vc-roles-parts/_part.tpl.phpnuW+A

    $categories, ) ) ?> > >
    renderIcon( $cap ) ?>
    ' . esc_html( $cap['description'] ) . '' : '' ?>
    PK2\ ;templates/pages/partials/vc-roles-parts/_shortcodes.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'custom_value' => 'custom', 'capabilities' => WPBMap::getSortedAllShortCodes(), 'ignore_capabilities' => array( 'vc_gitem', 'vc_gitem_animated_block', 'vc_gitem_zone', 'vc_gitem_zone_a', 'vc_gitem_zone_b', 'vc_gitem_zone_c', 'vc_column', 'vc_row_inner', 'vc_column_inner', 'vc_posts_grid', ), 'categories' => WPBMap::getCategories(), 'cap_types' => array( array( 'all', __( 'All', 'js_composer' ) ), array( 'edit', __( 'Edit', 'js_composer' ) ), ), 'item_header_name' => __( 'Element', 'js_composer' ), 'options' => array( array( true, __( 'All', 'js_composer' ) ), array( 'edit', __( 'Edit only', 'js_composer' ) ), array( 'custom', __( 'Custom', 'js_composer' ) ), ), 'main_label' => __( 'Elements', 'js_composer' ), 'custom_label' => __( 'Elements', 'js_composer' ), 'description' => __( 'Control user access to content elements.', 'js_composer' ), 'use_table' => true, ) ); PK2\e||=templates/pages/partials/vc-roles-parts/_grid_builder.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'options' => array( array( true, __( 'Enabled', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Grid Builder', 'js_composer' ), 'custom_label' => __( 'Grid Builder', 'js_composer' ), 'description' => __( 'Control user access to Grid Builder and Grid Builder Elements.', 'js_composer' ), ) ); PK2\-1puu@templates/pages/partials/vc-roles-parts/_frontend_editor.tpl.phpnuW+AinlineEnabled() ) { vc_include_template( 'pages/partials/vc-roles-parts/_part.tpl.php', array( 'part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'custom_value' => 'custom', 'options' => array( array( true, __( 'Enabled', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Frontend editor', 'js_composer' ), 'custom_label' => __( 'Frontend editor', 'js_composer' ), ) ); } PK2\>c:templates/pages/partials/vc-roles-parts/_templates.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'options' => array( array( true, __( 'All', 'js_composer' ) ), array( 'add', __( 'Apply templates only', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Templates', 'js_composer' ), 'description' => __( 'Control access rights to templates and predefined templates. Note: "Apply templates only" restricts users from saving new templates and deleting existing.', 'js_composer' ), ) ); PK2\88;templates/pages/partials/vc-roles-parts/_post_types.tpl.phpnuW+A $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'custom_value' => 'custom', 'capabilities' => $vc_role->getPostTypes(), 'options' => array( array( true, __( 'Pages only', 'js_composer' ) ), array( 'custom', __( 'Custom', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Post types', 'js_composer' ), 'custom_label' => __( 'Post types', 'js_composer' ), 'description' => __( 'Enable Visual Composer for pages, posts and custom post types. Note: By default Visual Composer is available for pages only.', 'js_composer' ), ) ); PK2\9templates/pages/partials/vc-roles-parts/_settings.tpl.phpnuW+AgetTabs() as $tab => $title ) { $tabs[] = array( $tab . '-tab', $title ); } vc_include_template( 'pages/partials/vc-roles-parts/_part.tpl.php', array( 'part' => $part, 'role' => $role, 'params_prefix' => 'vc_roles[' . $role . '][' . $part . ']', 'controller' => vc_role_access()->who( $role )->part( $part ), 'custom_value' => 'custom', 'capabilities' => $tabs, 'options' => array( array( true, __( 'All', 'js_composer' ) ), array( 'custom', __( 'Custom', 'js_composer' ) ), array( false, __( 'Disabled', 'js_composer' ) ), ), 'main_label' => __( 'Settings options', 'js_composer' ), 'custom_label' => __( 'Settings options', 'js_composer' ), 'description' => __( 'Control access rights to Visual Composer admin settings tabs (e.g. General Settings, Shortcode Mapper, ...)', 'js_composer' ), ) ); PK2\5=] ,templates/pages/vc-settings/tab-vc-roles.phpnuW+AgetSlug() ) ); $editable_roles = get_editable_roles(); require_once vc_path_dir( 'SETTINGS_DIR', 'class-vc-roles.php' ); $vc_role = new Vc_Roles(); ?>
    data-vc-roles="form">

    $details ) : $name = translate_user_role( $details['name'] ); $unique_id = 'vc_role-' . $role; $valid_roles = array(); foreach ( $vc_role->getParts() as $part ) { if ( $vc_role->hasRoleCapability( $role, $vc_role->getPartCapability( $part ) ) ) { $valid_roles[] = $part; } } if ( count( $valid_roles ) > 0 ) : ?>
    $part, 'role' => $role, 'vc_role' => $vc_role, ) ); } ?>
    PK2\Y%templates/pages/vc-settings/index.phpnuW+A

    $active_page->getSlug(), 'tabs' => $pages, ) ); ?> render(); ?>
    PK2\2L#templates/pages/vc-settings/tab.phpnuW+AgetSlug() ); $use_custom = get_option( vc_settings()->getFieldPrefix() . 'use_custom' ); $css = ( ( 'color' === $tab ) && $use_custom ) ? ' color_enabled' : ''; $dev_environment = vc_license()->isDevEnvironment(); $license_key = vc_license()->getLicenseKey(); $classes = 'vc_settings-tab-content vc_settings-tab-content-active ' . esc_attr( $css ); ?> isActivated() ) : ?>

    > getOptionGroup() . '_' . $tab ) ?> page() . '_' . $tab ) ?>

    isActivated() ) : ?>


    spinner

    direct plugin updates, access to template library and official support.', 'js_composer' ) ?>


    spinner

    Purchase Visual Composer license.', 'js_composer' ), esc_url( 'http://bit.ly/vcomposer' ) ) ?>

    PK2\H╅-templates/pages/vc-settings/vc-automapper.phpnuW+A
    > renderHtml(); ?>
    PK2\}y>templates/pages/vc-settings/default-template-post-type.tpl.phpnuW+A
    labels->name : $post_type[0] ) ?>
    PK2\jZ Z *templates/params/google_fonts/template.phpnuW+A
    0 ) : ?>
    0 ) : ?>
    :
    PK2\id%%$templates/params/loop/templates.htmlnuW+A PK2\k-templates/params/vc_grid_item/preview.tpl.phpnuW+A > <?php wp_title( '|', true, 'right' ); ?>
    renderItem( $post ); ?>
    PK2\w6Ptemplates/params/vc_grid_item/editor/partials/vc_grid_item_editor_footer.tpl.phpnuW+Arender(); // 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_settings_presets = Vc_Settings_Preset::listDefaultSettingsPresets(); $vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets(); } else { $vc_settings_presets = array(); $vc_vendor_settings_presets = array();; } ?> $el ) : ?> 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' ); ?>
    render(); ?>
    PK2\}߃;templates/params/vc_grid_item/attributes/featured_image.phpnuW+AincludeClass( '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 $img_class WPBakeryShortCode_VC_Single_image */ $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'] . '' : '
    ' . $img['thumbnail'] . '
    '; $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 = '
    ' . $image_string . '
    '; return $output; PK2\|<templates/params/vc_grid_item/attributes/post_categories.phpnuW+AincludeClass( '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 = '
    '; $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="' . esc_attr( sprintf( __( 'View all posts in %s', 'js_composer' ), $category->name ) ) . '"'; } $wrapper = ''; $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 .= '
    '; return $output; PK2\}3templates/params/vc_grid_item/attributes/vc_btn.phpnuW+AincludeClass( 'WPBakeryShortCode_VC_Btn' ); $vc_btn = new WPBakeryShortCode_VC_Btn( array( 'base' => 'vc_btn' ) ); $inline_css = ''; $icon_wrapper = false; $icon_html = false; $attributes = array(); /** @var $vc_btn WPBakeryShortCode_VC_Btn */ $atts = vc_map_get_attributes( $vc_btn->getShortcode(), $atts ); extract( $atts ); //parse link $class_to_filter = 'vc_btn3-container ' . $vc_btn->getCSSAnimation( $css_animation ); $class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ) . $vc_btn->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $vc_btn->settings( 'base' ), $atts ); $button_class = ' vc_btn3-size-' . $size . ' vc_btn3-shape-' . $shape . ' vc_btn3-style-' . $style; $button_html = $title; if ( '' === trim( $title ) ) { $button_class .= ' vc_btn3-o-empty'; $button_html = ' '; } if ( 'true' === $button_block && 'inline' !== $align ) { $button_class .= ' vc_btn3-block'; } if ( 'true' === $add_icon ) { $button_class .= ' vc_btn3-icon-' . $i_align; vc_icon_element_fonts_enqueue( $i_type ); if ( isset( ${'i_icon_' . $i_type} ) ) { switch ( $i_type ) { case 'pixelicons': $icon_wrapper = true; break; } $iconClass = ${'i_icon_' . $i_type}; } else { $iconClass = 'fa fa-info'; } if ( $icon_wrapper ) { $icon_html = ''; } else { $icon_html = ''; } if ( 'left' === $i_align ) { $button_html = $icon_html . ' ' . $button_html; } else { $button_html .= ' ' . $icon_html; } } if ( 'custom' === $style ) { $inline_css = vc_get_css_color( 'background-color', $custom_background ) . vc_get_css_color( 'color', $custom_text ); } elseif ( 'outline-custom' === $style ) { $inline_css = vc_get_css_color( 'border-color', $outline_custom_color ) . vc_get_css_color( 'color', $outline_custom_color ); $attributes[] = 'onmouseenter="this.style.borderColor=\'' . $outline_custom_hover_background . '\'; this.style.backgroundColor=\'' . $outline_custom_hover_background . '\'; this.style.color=\'' . $outline_custom_hover_text . '\'"'; $attributes[] = 'onmouseleave="this.style.borderColor=\'' . $outline_custom_color . '\'; this.style.backgroundColor=\'transparent\'; this.style.color=\'' . $outline_custom_color . '\'"'; } else { $button_class .= ' vc_btn3-color-' . $color . ' '; } if ( '' !== $inline_css ) { $inline_css = ' style="' . $inline_css . '"'; } $attributes = implode( ' ', $attributes ); $link = trim( $link ); // Add link $use_link = strlen( $link ) > 0 && 'none' !== $link; $link_output = ''; if ( $use_link ) { $link_output = vc_gitem_create_link_real( $atts, $post, 'vc_general vc_btn3 ' . trim( $button_class ), $title ); } $output = '
    '; if ( preg_match( '/href=\"[^\"]+/', $link_output ) ) : $output .= '<' . $link_output . ' ' . $inline_css . ' ' . $attributes . '>' . $button_html . ''; elseif ( 'load-more-grid' === $link ) : $output .= '' . $button_html . ''; else : $output .= ''; endif; $output .= '
    '; return $output; PK2\^SS<templates/params/vc_grid_item/shortcodes/vc_single_image.phpnuW+AgetShortcode(), $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 = vcExtractDimensions( $img_size ); $hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : ''; $custom_src = $custom_src ? esc_attr( $custom_src ) : $default_src; $img = array( 'thumbnail' => '', ); break; default: $img = false; } if ( ! $img ) { $img['thumbnail'] = ''; } $wrapperClass = 'vc_single_image-wrapper ' . $style . ' ' . $border_color; $link = vc_gitem_create_link( $atts, $wrapperClass ); $image_string = ! empty( $link ) ? '<' . $link . '>' . $img['thumbnail'] . '' : '
    ' . $img['thumbnail'] . '
    '; $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 = '
    ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_singleimage_heading' ) ) . '
    ' . $image_string . '
    '; echo $output; PK2\ԐQ Q 4templates/params/vc_grid_item/shortcodes/vc_icon.phpnuW+AgetShortcode(), $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 ) . '"' : ''; ?>
    >> 0 ) { echo '<' . $link . '>'; } ?>
    PK2\B6HH7templates/params/vc_grid_item/shortcodes/vc_button2.phpnuW+AgetShortcode(), $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_attr( $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:' . $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; } ?>
    ' . $title . '' ?>
    PK2\5YY>templates/params/vc_grid_item/shortcodes/vc_custom_heading.phpnuW+AgetAttributes( $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 . ''; } 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'] ), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets ); } if ( ! empty( $styles ) ) { $style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"'; } else { $style = ''; } $output = ''; if ( apply_filters( 'vc_custom_heading_template_use_wrapper', false ) ) { $output .= '
    '; $output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >'; $output .= $text; $output .= ''; $output .= '
    '; } else { $output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' class="' . esc_attr( $css_class ) . '">'; $output .= $text; $output .= ''; } echo $output; PK2\pxmm3templates/params/vc_grid_item/shortcodes/vc_btn.phpnuW+A{{ vc_btn: }} PK2\!+_/templates/params/column_offset/template.tpl.phpnuW+A
    get( 'not_responsive_css' ) ) : ?>

    settings page by unchecking "Disable responsive content elements".', 'js_composer' ), admin_url( 'admin.php?page=vc-general' ) ) ?>

    $size ) : ?>
    offsetControl( $key ) ?> sizeControl( $key ) ?>
    PK2\SPx,templates/params/param_group/content.tpl.phpnuW+A' . $template . ''; PK2\:2templates/params/param_group/inner_content.tpl.phpnuW+A
    %content%
    '; PK2\OI(templates/params/param_group/add.tpl.phpnuW+A' . $template . ''; PK2\I  'templates/params/options/templates.htmlnuW+A PK2\z@  templates/teaser.html.phpnuW+A PK2\+templates/editors/frontend_template.tpl.phpnuW+A
    parseShortcodesString( $editor->getTemplateContent() ) ); ?>
    post_shortcodes ) ); ?>
    PK2\uq'templates/editors/navbar/navbar.tpl.phpnuW+A PK2\,KQ 0templates/editors/vc_ui-template-preview.tpl.phpnuW+AtemplatesPanelEditor(), 'enqueuePreviewScripts' ) ); add_filter( 'admin_body_class', array( visual_composer()->templatesPanelEditor(), 'addBodyClassTemplatePreview' ) ); do_action( 'vc-render-templates-preview-template' ); 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_script( 'vc_editors-templates-preview-js' ); wp_enqueue_media( array( 'post' => $post_ID ) ); visual_composer()->templatesPanelEditor()->registerPreviewScripts(); require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
    post_shortcodes); ?> JSON.parse(decodeURIComponent(("post_shortcodes)); ?>"+'').replace(/\+/g,'%20'))); */ ?> PK2\.< < 3templates/editors/partials/vc_welcome_block.tpl.phpnuW+AtemplatesPanelEditor() ->loadDefaultTemplates(); $templates_total_count = count( $total_templates ); ?> part( 'shortcodes' ) ->checkStateAny( true, 'custom', null ) ->get() && vc_user_access_check_shortcode_all( 'vc_row' ) && vc_user_access_check_shortcode_all( 'vc_column' ) ) : ?>
    Start adding content or templates', 'js_composer' ) ?>
    part( 'shortcodes' ) ->checkStateAny( true, 'custom', null ) ->get() && vc_user_access_check_shortcode_all( 'vc_row' ) && vc_user_access_check_shortcode_all( 'vc_column' ) ) : ?> part( 'shortcodes' ) ->can( 'vc_column_text_all' ) ->get() ) : ?> 0 && vc_user_access() ->part( 'templates' ) ->can() ->get() ) : ?>
    part( 'shortcodes' ) ->checkStateAny( true, 'custom', null ) ->get() && vc_user_access_check_shortcode_all( 'vc_row' ) && vc_user_access_check_shortcode_all( 'vc_column' ) ) : ?>

    ' . __( 'knowledge base', 'js_composer' ) . ''; $targetText = __( 'Don\'t know where to start? Visit our %s.', 'js_composer' ); $targetText = sprintf( $targetText, $targetLink ); echo $targetText; ?>

    PK2\#>p?templates/editors/partials/backend-shortcodes-templates.tpl.phpnuW+Apart( 'presets' )->can()->get() ) { $vc_settings_presets = Vc_Settings_Preset::listDefaultSettingsPresets(); $vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets(); } else { $vc_settings_presets = array(); $vc_vendor_settings_presets = array(); } ?> $el ) : ?> PK2\Ƣ03templates/editors/partials/backend_controls.tpl.phpnuW+A PK2\*3templates/editors/partials/add_element_tabs.tpl.phpnuW+A __( 'All', 'js_composer' ), 'active' => true, 'filter' => '*', ), ); foreach ( $categories as $key => $name ) { if ( '_other_category_' === $name ) { $other_tab = array( 'name' => __( 'Other', 'js_composer' ), 'filter' => '.js-category-' . $key, 'active' => false, ); continue; } if ( 'deprecated' === $name ) { $name = __( 'Deprecated', 'js_composer' ); $filter = '.js-category-deprecated'; } else { $filter = '.js-category-' . md5( $name ); } $tabs[] = array( 'name' => $name, 'filter' => $filter, 'active' => false, ); } if ( $other_tab ) { $tabs[] = $other_tab; } $tabs = apply_filters( 'vc_add_element_categories', $tabs ); ?>
      PK2\9templates/editors/partials/settings_presets_popup.tpl.phpnuW+A
      part( 'templates' )->can()->get() ) : ?>
      part( 'presets' )->can()->get() ) : ?>
      PK2\H]K/7templates/editors/partials/vc_ui-templates-tabs.tpl.phpnuW+A 0; if ( count( $categories ) > 0 ) : $first = true; ?>
        $value ) : echo ''; echo ''; $first = false; endforeach; echo '
      • '; echo '
      '; endif; ?> PK2\D:templates/editors/partials/vc_ui-settings-dropdown.tpl.phpnuW+A
      PK2\.07}}8templates/editors/partials/backend_editor_footer.tpl.phpnuW+Arender(); // [/add element box] // [rendering edit form] visual_composer()->editForm()->render(); // [/rendering edit form] // [rendering templates panel editor] if ( vc_user_access()->part( 'templates' )->can()->get() ) { visual_composer()->templatesPanelEditor()->renderUITemplate(); } // [/rendering templates panel editor] // [post settings] if ( vc_user_access()->part( 'post_settings' )->can()->get() ) { require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-post-settings.php' ); $post_settings = new Vc_Post_Settings( $editor ); $post_settings->renderUITemplate(); } // [/post settings] // [shortcode edit layout] require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-edit-layout.php' ); $edit_layout = new Vc_Edit_Layout(); $edit_layout->renderUITemplate(); // [/shortcode edit layout] vc_include_template( 'editors/partials/backend-shortcodes-templates.tpl.php' ); PK2\7templates/editors/partials/backend_controls_tab.tpl.phpnuW+A
      part( 'shortcodes' ) ->checkStateAny( true, 'custom', null ) ->get() ) : ?>
      PK2\Х"MM4templates/editors/partials/frontend_controls.tpl.phpnuW+A PK2\^Ȁ5templates/editors/partials/add_element_search.tpl.phpnuW+A
      PK2\Z:templates/editors/partials/vc_settings-image-block.tpl.phpnuW+A PK2\3templates/editors/partials/prompt-templates.tpl.phpnuW+A
      PK2\ ٗ Y Y 4templates/editors/partials/access-manager-js.tpl.phpnuW+A PK2\^1templates/editors/partials/prompt-presets.tpl.phpnuW+A
      PK2\مRe3templates/editors/partials/templates_search.tpl.phpnuW+A
      PK2\)rr6templates/editors/popups/vc_ui-panel-templates.tpl.phpnuW+A
      getAllTemplatesSorted(); $categories = $box->getAllCategoriesNames( $categories_data ); ?> __( 'Templates', 'js_composer' ), 'controls' => array( 'minimize', 'close', ), 'header_css_class' => 'vc_ui-template-panel-header-container', 'content_template' => 'editors/partials/vc_ui-templates-tabs.tpl.php', 'search_template' => 'editors/partials/templates_search.tpl.php', 'template_variables' => array( 'categories_data' => $categories_data, 'categories' => $categories, ), ) ); ?>
      $category ) : echo '
      '; $templates_block = apply_filters( 'vc_templates_render_category', $category ); if ( isset( $templates_block['output'] ) && is_string( $templates_block['output'] ) ) { echo $templates_block['output']; } echo '
      '; $first = false; endforeach; ?>
      PK2\W;MM9templates/editors/popups/vc_ui-panel-edit-element.tpl.phpnuW+A
      part( 'presets' )->can()->get() || vc_user_access()->part( 'templates' )->can()->get() ) { $controls = array_merge( array( 'settings' => array( 'template' => 'editors/partials/vc_ui-settings-dropdown.tpl.php', ), ), $controls ); } vc_include_template( 'editors/popups/vc_ui-header.tpl.php', array( 'title' => __( 'Page settings', 'js_composer' ), 'controls' => $controls, 'header_css_class' => 'vc_ui-post-settings-header-container', 'content_template' => '', ) ); ?>
      array( array( 'name' => 'close', 'label' => __( 'Close', 'js_composer' ), 'css_classes' => 'vc_ui-button-fw', ), array( 'name' => 'save', 'label' => __( 'Save changes', 'js_composer' ), 'css_classes' => 'vc_ui-button-fw', 'style' => 'action', ), ), ) ); ?>
      PK2\P|Qoo8templates/editors/popups/vc_ui-panel-add-element.tpl.phpnuW+A
      __( 'Add Element', 'js_composer' ), 'controls' => array( 'close' ), 'header_css_class' => 'vc_ui-add-element-header-container', 'content_template' => 'editors/partials/add_element_tabs.tpl.php', 'search_template' => 'editors/partials/add_element_search.tpl.php', 'template_variables' => $template_variables, ) ) ?>
      • getControls() ?>
      • isShowEmptyMessage() && true !== $box->getPartState() ) : ?>
      PK2\^Rs@templates/editors/popups/panel_multi_shortcode_edit_form.tpl.phpnuW+A

      PK2\g:templates/editors/popups/panel_shortcode_edit_form.tpl.phpnuW+A

      PK2\x[7templates/editors/popups/vc_ui-panel-row-layout.tpl.phpnuW+A
      __( 'Row Layout', 'js_composer' ), 'controls' => array( 'minimize', 'close' ), 'header_css_class' => 'vc_ui-row-layout-header-container', )); ?>
      PK2\66-templates/editors/popups/vc_ui-footer.tpl.phpnuW+A PK2\dw1#  -templates/editors/popups/vc_ui-header.tpl.phpnuW+A
      $control ) : ?>

      PK2\c_ :templates/editors/popups/vc_ui-panel-post-settings.tpl.phpnuW+A
      __( 'Page Settings', 'js_composer' ), 'controls' => array( 'minimize', 'close' ), 'header_css_class' => 'vc_ui-post-settings-header-container', 'content_template' => '', )); ?>
      
      					
      						
      array( array( 'name' => 'close', 'label' => __( 'Close', 'js_composer' ), ), array( 'name' => 'save', 'label' => __( 'Save changes', 'js_composer' ), 'css_classes' => 'vc_ui-button-fw', 'style' => 'action', ), ), )); ?>
      PK2\C\ \ :templates/editors/popups/shared-templates/category.tpl.phpnuW+A
      */ ?>
      isActivated() ) : ?>

      isActivated() ) : ?>

      */ ?>

      */ ?>
      part( 'templates' )->checkStateAny( true, null )->get() ) : ?>

      PK2\A-7templates/editors/popups/panel_templates_editor.tpl.phpnuW+A PK2\#3templates/editors/popups/modal_edit_element.tpl.phpnuW+A PK2\Z2)templates/editors/frontend_editor.tpl.phpnuW+Apost_id; $post = $editor->post; $post_type = $post->post_type; $post_type_object = get_post_type_object( $post_type ); $post_title = trim( $post->post_title ); $nonce_action = $nonce_action = 'update-post_' . $editor->post_id; $user_ID = isset( $editor->current_user ) && isset( $editor->current_user->ID ) ? (int) $editor->current_user->ID : 0; $form_action = 'editpost'; $menu = array(); add_thickbox(); wp_enqueue_media( array( 'post' => $editor->post_id ) ); require_once( $editor->adminFile( 'admin-header.php' ) ); // @since 4.8 js logic for user role access manager. vc_include_template( 'editors/partials/access-manager-js.tpl.php' ); ?>
      render(); // [/vc_navbar frontend] ?>
      render(); // [/add element popup/box] // [shortcodes edit form panel render] visual_composer()->editForm()->render(); // [/shortcodes edit form panel render] // [templates panel editor render] if ( vc_user_access()->part( 'templates' )->can()->get() ) { visual_composer()->templatesPanelEditor()->renderUITemplate(); } // [/templates panel editor render] // [post settings panel render] if ( vc_user_access()->part( 'post_settings' )->can()->get() ) { require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-post-settings.php' ); $post_settings = new Vc_Post_Settings( $editor ); $post_settings->renderUITemplate(); } // [/post settings panel render] // [panel edit layout render] require_once vc_path_dir( 'EDITORS_DIR', 'popups/class-vc-edit-layout.php' ); $edit_layout = new Vc_Edit_Layout(); $edit_layout->renderUITemplate(); // [/panel edit layout render] // fe controls vc_include_template( 'editors/partials/frontend_controls.tpl.php' ); // [shortcodes presets data] if ( vc_user_access()->part( 'presets' )->can()->get() ) { require_once vc_path_dir( 'AUTOLOAD_DIR', 'class-vc-settings-presets.php' ); $vc_settings_presets = Vc_Settings_Preset::listDefaultSettingsPresets(); $vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets(); } else { $vc_settings_presets = array(); $vc_vendor_settings_presets = array(); } // [/shortcodes presets data] ?>
      adminFile( 'admin-footer.php' ) ); ?> PK2\J(templates/editors/backend_editor.tpl.phpnuW+Arender(); /** @var $editor Vc_Backend_Editor */ ?>
      ID, '_wpb_vc_js_status', true ) ) ); if ( '' === $wpb_vc_status || ! isset( $wpb_vc_status ) ) { $wpb_vc_status = vc_user_access() ->part( 'backend_editor' ) ->checkState( 'default' ) ->get() ? 'true' : 'false'; } ?> BXcomments^dateLastOpened[dateCreatedTsizeUlabelTkindWversionTname\dateModified UindexUwidthYascendingWvisible, !"&'+, a 01 d 56 s :; K ?  C'  #@O#@(#Tname#@00BJ^py  &,6>@CDENPRST]_abclnpqr{}L shortcodesvSrnlong E DSDB ` @ @ @Tname#@00BJ^py  &,6>@CDENPRST]_abclnpqr{}L shortcodesvSrnlongPK2\pڟ&templates/shortcodes/vc_cta_button.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); if ( 'same' === $target || '_self' === $target ) { $target = ''; } if ( '' !== $target ) { $target = ' target="' . esc_attr( $target ) . '"'; } $icon = ( '' !== $icon && 'none' !== $icon ) ? ' ' . $icon : ''; $i_icon = ( '' !== $icon ) ? ' ' : ''; $color = ( '' !== $color ) ? ' wpb_' . $color : ''; $size = ( '' !== $size && 'wpb_regularsize' !== $size ) ? ' wpb_' . $size : ' ' . $size; $a_class = ''; if ( '' !== $el_class ) { $tmp_class = explode( ' ', $el_class ); if ( in_array( 'prettyphoto', $tmp_class ) ) { wp_enqueue_script( 'prettyphoto' ); wp_enqueue_style( 'prettyphoto' ); $a_class .= ' prettyphoto'; $el_class = str_ireplace( 'prettyphoto', '', $el_class ); } } if ( '' !== $href ) { $button = '' . $title . $i_icon . ''; $button = '' . $button . ''; } else { $button = ''; $el_class .= ' cta_no_button'; } $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_call_to_action wpb_content_element vc_clearfix ' . $position . $el_class, $this->settings['base'], $atts ); $css_class .= $this->getCSSAnimation( $css_animation ); $output .= '
      '; if ( 'cta_align_bottom' !== $position ) { $output .= $button; } $output .= apply_filters( 'wpb_cta_text', '

      ' . $call_text . '

      ', array( 'content' => $call_text ) ); if ( 'cta_align_bottom' === $position ) { $output .= $button; } $output .= '
      '; echo $output; PK2\bi!templates/shortcodes/vc_gmaps.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $zoom = 14; // deprecated 4.0.2. In 4.6 was moved outside from shortcode_atts $type = 'm'; // deprecated 4.0.2 $bubble = ''; // deprecated 4.0.2 if ( '' === $link ) { return null; } $link = trim( vc_value_from_safe( $link ) ); $bubble = ( '' !== $bubble && '0' !== $bubble ) ? '&iwloc=near' : ''; $size = str_replace( array( 'px', ' ', ), array( '', '', ), $size ); if ( is_numeric( $size ) ) { $link = preg_replace( '/height="[0-9]*"/', 'height="' . $size . '"', $link ); } $class_to_filter = 'wpb_gmaps_widget wpb_content_element' . ( '' === $size ? ' vc_map_responsive' : '' ); $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 ); ?>
      $title, 'extraclass' => 'wpb_map_heading', ) ); ?>
      '; } ?>
      PK2\{gg'templates/shortcodes/vc_column_text.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $class_to_filter = 'wpb_text_column wpb_content_element ' . $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 = '
      ' . wpb_js_remove_wpautop( $content, true ) . '
      '; echo $output; PK2\:)t%templates/shortcodes/vc_wp_search.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $output = ''; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_search' ); } // TODO: make more informative if wp is in debug mode PK2\ UU"templates/shortcodes/vc_wp_rss.phpnuW+AgetShortcode(), $atts ); $atts['url'] = html_entity_decode( $atts['url'], ENT_QUOTES ); // fix #2034 extract( $atts ); if ( '' === $url ) { return; } $options = explode( ',', $options ); if ( in_array( 'show_summary', $options ) ) { $atts['show_summary'] = true; } if ( in_array( 'show_author', $options ) ) { $atts['show_author'] = true; } if ( in_array( 'show_date', $options ) ) { $atts['show_date'] = true; } $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Widget_RSS'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_rss' ); } PK2\qq'templates/shortcodes/vc_wp_archives.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $options = explode( ',', $options ); if ( in_array( 'dropdown', $options ) ) { $atts['dropdown'] = true; } if ( in_array( 'count', $options ) ) { $atts['count'] = true; } $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Widget_Archives'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_archives' ); } PK2\cI'templates/shortcodes/vc_wp_tagcloud.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Widget_Tag_Cloud'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_tagcloud' ); } PK2\(Vl ! !templates/shortcodes/vc_btn.phpnuW+A '#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', ); $atts = vc_map_get_attributes( $this->getShortcode(), $atts ); extract( $atts ); //parse link $link = ( '||' === $link ) ? '' : $link; $link = vc_build_link( $link ); $use_link = false; if ( strlen( $link['url'] ) > 0 ) { $use_link = true; $a_href = $link['url']; $a_title = $link['title']; $a_target = $link['target']; $a_rel = $link['rel']; } $wrapper_classes = array( 'vc_btn3-container', $this->getExtraClass( $el_class ), $this->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 = ' '; } 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 = ''; } else { $icon_html = ''; } if ( 'left' === $i_align ) { $button_html = $icon_html . ' ' . $button_html; } else { $button_html .= ' ' . $icon_html; } } 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 = $colors[ $gradient_color_1 ]; $gradient_color_2 = $colors[ $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(); echo ''; echo ''; $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, $this->settings['base'], $atts ); if ( $button_classes ) { $button_classes = esc_attr( apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $button_classes ) ), $this->settings['base'], $atts ) ); $attributes[] = 'class="' . trim( $button_classes ) . '"'; } if ( $use_link ) { $attributes[] = 'href="' . trim( $a_href ) . '"'; $attributes[] = 'title="' . esc_attr( trim( $a_title ) ) . '"'; if ( ! empty( $a_target ) ) { $attributes[] = 'target="' . esc_attr( trim( $a_target ) ) . '"'; } if ( ! empty( $a_rel ) ) { $attributes[] = 'rel="' . esc_attr( trim( $a_rel ) ) . '"'; } } if ( ! empty( $custom_onclick ) && $custom_onclick_code ) { $attributes[] = 'onclick="' . esc_attr( $custom_onclick_code ) . '"'; } $attributes = implode( ' ', $attributes ); ?>
      ' . $button_html . ''; } else { echo ''; } ?>
      PK2\cܠ$templates/shortcodes/vc_wp_posts.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Widget_Recent_Posts'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_posts' ); } PK2\{b)templates/shortcodes/vc_wp_custommenu.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Nav_Menu_Widget'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_custommenu' ); } PK2\D **$templates/shortcodes/vc_wp_links.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $options = explode( ',', $options ); if ( in_array( 'images', $options ) ) { $atts['images'] = true; } if ( in_array( 'name', $options ) ) { $atts['name'] = true; } if ( in_array( 'description', $options ) ) { $atts['description'] = true; } if ( in_array( 'rating', $options ) ) { $atts['rating'] = true; } $el_class = $this->getExtraClass( $el_class ); $output = ''; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_links' ); } PK2\enɷ%templates/shortcodes/vc_accordion.phpnuW+AgetShortcode(), $atts ); extract( $atts ); wp_enqueue_script( 'jquery-ui-accordion' ); $el_class = $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion wpb_content_element ' . $el_class . ' not-column-inherit', $this->settings['base'], $atts ); $output = '
      ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_accordion_heading' ) ) . ' ' . wpb_js_remove_wpautop( $content ) . '
      '; echo $output; PK2\2v4#templates/shortcodes/vc_wp_meta.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $output = '
      '; $type = 'WP_Widget_Meta'; $args = array(); global $wp_widget_factory; // to avoid unwanted warnings let's check before using widget if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { ob_start(); the_widget( $type, $atts, $args ); $output .= ob_get_clean(); $output .= '
      '; echo $output; } else { echo $this->debugComment( 'Widget ' . esc_attr( $type ) . 'Not found in : vc_wp_meta' ); } PK2\W{{)templates/shortcodes/post_block/_item.phpnuW+A

      getLinked( $post, $post->title, $link_setting, 'link_title' ) : $post->title ?>

      thumbnail ) ) : ?>
      getLinked( $post, $post->thumbnail, $link_setting, 'link_image' ) : $post->thumbnail ?>
      content : $post->excerpt; ?>
      link_target ?>> PK2\nc$templates/shortcodes/vc_raw_html.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $content = rawurldecode( base64_decode( strip_tags( $content ) ) ); // template is also used by 'Raw JS' shortcode which doesn't have Design Options if ( ! isset( $css ) ) { $css = ''; } $class_to_filter = 'wpb_raw_code ' . ( ( 'vc_raw_html' === $this->settings['base'] ) ? 'wpb_content_element wpb_raw_html' : 'wpb_raw_js' ); $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 = '
      ' . $content . '
      '; echo $output; PK2\:: templates/shortcodes/vc_tabs.phpnuW+AgetShortcode(), $atts ); extract( $atts ); wp_enqueue_script( 'jquery-ui-tabs' ); $el_class = $this->getExtraClass( $el_class ); $element = 'wpb_tabs'; if ( 'vc_tour' === $this->shortcode ) { $element = 'wpb_tour'; } // Extract tab titles preg_match_all( '/vc_tab([^\]]+)/i', $content, $matches, PREG_OFFSET_CAPTURE ); $tab_titles = array(); /** * vc_tabs * */ if ( isset( $matches[1] ) ) { $tab_titles = $matches[1]; } $tabs_nav = ''; $tabs_nav .= '
        '; foreach ( $tab_titles as $tab ) { $tab_atts = shortcode_parse_atts( $tab[0] ); if ( isset( $tab_atts['title'] ) ) { $tabs_nav .= '
      • ' . $tab_atts['title'] . '
      • '; } } $tabs_nav .= '
      '; $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim( $element . ' wpb_content_element ' . $el_class ), $this->settings['base'], $atts ); if ( 'vc_tour' === $this->shortcode ) { $next_prev_nav = ''; } else { $next_prev_nav = ''; } $output = '
      ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => $element . '_heading' ) ) . $tabs_nav . wpb_js_remove_wpautop( $content ) . $next_prev_nav . '
      '; echo $output; PK2\templates/shortcodes/vc_pie.phpnuW+AconvertOldColorsToNew( $atts ); $atts = vc_map_get_attributes( $this->getShortcode(), $atts ); extract( $atts ); wp_enqueue_script( 'vc_pie' ); $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', ); if ( 'custom' === $color ) { $color = $custom_color; } else { $color = isset( $colors[ $color ] ) ? $colors[ $color ] : ''; } if ( ! $color ) { $color = $colors['grey']; } $class_to_filter = 'vc_pie_chart wpb_content_element'; $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 ); $output = '
      '; $output .= '
      '; $output .= '
      '; $output .= ''; $output .= ''; $output .= ''; $output .= '
      '; if ( '' !== $title ) { $output .= '

      ' . $title . '

      '; } $output .= '
      '; $output .= '
      '; echo $output; PK2\z11%templates/shortcodes/vc_gitem_col.phpnuW+A '1/1', 'align' => 'left', 'css' => '', 'el_class' => '', 'featured_image' => '', ), $atts ); extract( $atts ); // TODO: Note that vc_map_get_attributes doesnt return align so it should be checked in next bug fix $style = ''; $width = wpb_translateColumnWidthToSpan( $width ); $css_class = $width . ( strlen( $el_class ) ? ' ' . $el_class : '' ) . ' vc_gitem-col vc_gitem-col-align-' . $align . vc_shortcode_custom_css_class( $css, ' ' ); if ( 'yes' === $featured_image ) { $style = '{{ post_image_background_image_css }}'; } echo '
      0 ? ' style="' . $style . '"' : '' ) . '>' . do_shortcode( $content ) . '
      '; PK2\ (templates/shortcodes/vc_posts_slider.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $gal_images = ''; $link_start = ''; $link_end = ''; $el_start = ''; $el_end = ''; $slides_wrap_start = ''; $slides_wrap_end = ''; if ( 'nivo' === $type ) { $type = ' wpb_slider_nivo theme-default'; wp_enqueue_script( 'nivo-slider' ); wp_enqueue_style( 'nivo-slider-css' ); wp_enqueue_style( 'nivo-slider-theme' ); $slides_wrap_start = '
      '; $slides_wrap_end = '
      '; } elseif ( 'flexslider' === $type || 'flexslider_fade' === $type || 'flexslider_slide' === $type || 'fading' === $type ) { $el_start = '
    • '; $el_end = '
    • '; $slides_wrap_start = '
        '; $slides_wrap_end = '
      '; wp_enqueue_style( 'flexslider' ); wp_enqueue_script( 'flexslider' ); } $flex_fx = ''; if ( 'flexslider' === $type || 'flexslider_fade' === $type || 'fading' === $type ) { $type = ' wpb_flexslider flexslider_fade flexslider'; $flex_fx = ' data-flex_fx="fade"'; } elseif ( 'flexslider_slide' === $type ) { $type = ' wpb_flexslider flexslider_slide flexslider'; $flex_fx = ' data-flex_fx="slide"'; } if ( 'link_image' === $link ) { wp_enqueue_script( 'prettyphoto' ); wp_enqueue_style( 'prettyphoto' ); } $query_args = array( 'post_status' => 'publish', ); //exclude current post/page from query if ( '' !== $posts_in ) { $query_args['post__in'] = explode( ',', $posts_in ); } global $vc_posts_grid_exclude_id; $vc_posts_grid_exclude_id[] = get_the_ID(); $query_args['post__not_in'] = array( get_the_ID() ); // Post teasers count if ( '' !== $count && ! is_numeric( $count ) ) { $count = - 1; } if ( '' !== $count && is_numeric( $count ) ) { $query_args['posts_per_page'] = $count; } // Post types $pt = array(); if ( '' !== $posttypes ) { $posttypes = explode( ',', $posttypes ); foreach ( $posttypes as $post_type ) { array_push( $pt, $post_type ); } $query_args['post_type'] = $pt; } // Narrow by categories if ( '' !== $categories ) { $categories = explode( ',', $categories ); $gc = array(); foreach ( $categories as $grid_cat ) { array_push( $gc, $grid_cat ); } $gc = implode( ',', $gc ); // http://snipplr.com/view/17434/wordpress-get-category-slug/ $query_args['category_name'] = $gc; $taxonomies = get_taxonomies( '', 'object' ); $query_args['tax_query'] = array( 'relation' => 'OR' ); foreach ( $taxonomies as $t ) { if ( in_array( $t->object_type[0], $pt ) ) { $query_args['tax_query'][] = array( 'taxonomy' => $t->name, 'terms' => $categories, 'field' => 'slug', ); } } } // Order posts if ( null !== $orderby ) { $query_args['orderby'] = $orderby; } $query_args['order'] = $order; // Run query $my_query = new WP_Query( $query_args ); $pretty_rel_random = ' data-rel="prettyPhoto[rel-' . get_the_ID() . '-' . rand() . ']"'; if ( 'custom_link' === $link ) { $custom_links = explode( ',', $custom_links ); } $teasers = ''; $i = - 1; while ( $my_query->have_posts() ) { $i ++; $my_query->the_post(); $post_title = the_title( '', '', false ); $post_id = $my_query->post->ID; if ( in_array( get_the_ID(), $vc_posts_grid_exclude_id ) ) { continue; } if ( 'teaser' === $slides_content ) { $content = apply_filters( 'the_excerpt', get_the_excerpt() ); } else { $content = ''; } $thumbnail = ''; // Thumbnail logic $post_thumbnail = $p_img_large = ''; $post_thumbnail = wpb_getImageBySize( array( 'post_id' => $post_id, 'thumb_size' => $thumb_size ) ); $thumbnail = $post_thumbnail['thumbnail']; $p_img_large = $post_thumbnail['p_img_large']; // Link logic if ( 'link_no' !== $link ) { if ( 'link_post' === $link ) { $link_image_start = ''; } elseif ( 'link_image' === $link ) { $p_video = get_post_meta( $post_id, '_p_video', true ); // if ( '' !== $p_video ) { $p_link = $p_video; } else { $p_link = $p_img_large[0]; } $link_image_start = ''; } elseif ( 'custom_link' === $link ) { if ( isset( $custom_links[ $i ] ) ) { $slide_custom_link = $custom_links[ $i ]; } else { $slide_custom_link = $custom_links[0]; } $link_image_start = ''; } $link_image_end = ''; } else { $link_image_start = ''; $link_image_end = ''; } $description = ''; if ( '' !== $slides_content && '' !== $content && ( ' wpb_flexslider flexslider_fade flexslider' === $type || ' wpb_flexslider flexslider_slide flexslider' === $type ) ) { $description = '
      '; if ( $slides_title ) { $description .= '

      ' . $link_image_start . $post_title . $link_image_end . '

      '; } $description .= $content; $description .= '
      '; } $teasers .= $el_start . $link_image_start . $thumbnail . $link_image_end . $description . $el_end; } // endwhile loop wp_reset_query(); if ( $teasers ) { $teasers = $slides_wrap_start . $teasers . $slides_wrap_end; } else { $teasers = __( 'Nothing found.', 'js_composer' ); } $class_to_filter = 'wpb_gallery wpb_posts_slider wpb_content_element'; $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 = '
      ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_posts_slider_heading' ) ) . '
      '; echo $output; PK2\ I%templates/shortcodes/vc_tweetmeme.phpnuW+AgetShortcode(), $atts ); $tweet_btn_text = ''; $type = $atts['type']; switch ( $type ) { case 'follow': $tweet_btn_text = __( 'Follow', 'js_composer' ); break; case 'mention': $tweet_btn_text = __( 'Tweet to', 'js_composer' ); break; case 'share': case 'hashtag': $tweet_btn_text = __( 'Tweet', 'js_composer' ); break; default: $type = 'share'; $tweet_btn_text = __( 'Tweet', 'js_composer' ); break; } $data = array(); $classes = array(); $class_to_filter = 'vc_tweetmeme-element' . vc_shortcode_custom_css_class( $atts['css'], ' ' ) . $this->getCSSAnimation( $atts['css_animation'] ); $el_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->getShortcode(), $atts ); if ( ! empty( $atts['large_button'] ) ) { $data['data-size'] = 'large'; } $url = 'https://twitter.com/'; if ( 'share' === $type ) { $url = 'https://twitter.com/share'; $classes[] = 'twitter-share-button'; if ( 'page_url' !== $atts['share_use_page_url'] ) { $data['data-url'] = $atts['share_use_custom_url']; } if ( 'page_title' !== $atts['share_text_page_title'] ) { $data['data-text'] = $atts['share_text_custom_text']; } if ( ! empty( $atts['share_via'] ) ) { $data['data-via'] = $atts['share_via']; } if ( ! empty( $atts['share_recommend'] ) ) { $data['data-related'] = $atts['share_recommend']; } if ( ! empty( $atts['share_hashtag'] ) ) { $data['data-hashtags'] = $atts['share_hashtag']; } } else if ( 'follow' === $type ) { $url = 'https://twitter.com/'; $classes[] = 'twitter-follow-button'; if ( ! empty( $atts['follow_user'] ) ) { $url .= esc_attr( $atts['follow_user'] ); $tweet_btn_text .= ' @' . esc_attr( $atts['follow_user'] ); } if ( 'yes' != $atts['follow_show_username'] ) { $data['data-show-screen-name'] = 'false'; } $data['data-show-count'] = ( ! ! $atts['show_followers_count'] ) ? 'true' : 'false'; } else if ( 'hashtag' === $type ) { $url = 'https://twitter.com/intent/tweet?'; $classes[] = 'twitter-hashtag-button'; $url_atts = array(); if ( ! empty( $atts['hashtag_hash'] ) ) { $url_atts[] = 'button_hashtag=' . esc_attr( $atts['hashtag_hash'] ); $tweet_btn_text .= ' #' . esc_attr( $atts['hashtag_hash'] ); } if ( 'yes' !== $atts['hashtag_no_default'] ) { $url_atts[] = 'text=' . esc_attr( $atts['hashtag_custom_tweet_text'] ); } $url .= implode( '&', $url_atts ); $rel = array(); if ( ! empty( $atts['hashtag_recommend_1'] ) ) { $rel[] = $atts['hashtag_recommend_1']; } if ( ! empty( $atts['hashtag_recommend_1'] ) ) { $rel[] = $atts['hashtag_recommend_2']; } if ( ! empty( $rel ) ) { $data['data-related'] = implode( ',', $rel ); } if ( 'yes' !== $atts['hashtag_no_url'] ) { $data['data-url'] = $atts['hashtag_custom_tweet_url']; } } else if ( 'mention' === $type ) { $url = 'https://twitter.com/intent/tweet?'; $classes[] = 'twitter-mention-button'; $url_atts = array(); if ( ! empty( $atts['mention_tweet_to'] ) ) { $url_atts[] = 'screen_name=' . esc_attr( $atts['mention_tweet_to'] ); $tweet_btn_text .= ' @' . esc_attr( $atts['mention_tweet_to'] ); } if ( 'yes' !== $atts['mention_no_default'] ) { $url_atts[] = 'text=' . esc_attr( $atts['mention_custom_tweet_text'] ); } $url .= implode( '&', $url_atts ); $rel = array(); if ( ! empty( $atts['mention_recommend_1'] ) ) { $rel[] = $atts['mention_recommend_1']; } if ( ! empty( $atts['mention_recommend_1'] ) ) { $rel[] = $atts['mention_recommend_1']; } if ( ! empty( $rel ) ) { $data['data-related'] = implode( ',', $rel ); } } if ( ! empty( $atts['lang'] ) ) { $data['data-lang'] = $atts['lang']; } $data_imploded = array(); foreach ( $data as $k => $v ) { $data_imploded[] = $k . '="' . esc_attr( $v ) . '"'; } $wrapper = '
      '; $template = '' . $tweet_btn_text . ''; $template .= ''; $wrapper .= $template; $wrapper .= '
      '; echo $wrapper; PK2\|Lc}}templates/shortcodes/vc_cta.phpnuW+AgetShortcode(), $atts ); $this->buildTemplate( $atts, $content ); $containerClass = trim( 'vc_cta3-container ' . esc_attr( implode( ' ', $this->getTemplateVariable( 'container-class' ) ) ) ); $cssClass = trim( 'vc_general ' . esc_attr( implode( ' ', $this->getTemplateVariable( 'css-class' ) ) ) ); ?>
      getTemplateVariable( 'inline-css' ) ) { echo ' style="' . esc_attr( implode( ' ', $this->getTemplateVariable( 'inline-css' ) ) ) . '"'; } ?>> getTemplateVariable( 'icons-top' ); ?> getTemplateVariable( 'icons-left' ); ?>
      getTemplateVariable( 'actions-top' ); ?> getTemplateVariable( 'actions-left' ); ?>
      getTemplateVariable( 'heading1' ); ?> getTemplateVariable( 'heading2' ); ?>
      getTemplateVariable( 'content' ); ?>
      getTemplateVariable( 'actions-bottom' ); ?> getTemplateVariable( 'actions-right' ); ?>
      getTemplateVariable( 'icons-bottom' ); ?> getTemplateVariable( 'icons-right' ); ?>
      PK2\g=<'templates/shortcodes/vc_gitem_block.phpnuW+AgetShortcode(), $atts ); extract( $atts ); if ( ! empty( $background_color ) ) { $background_color = ' vc_bg-' . $background_color; } echo '
      ' . do_shortcode( $content ) . '
      '; PK2\Qz&templates/shortcodes/vc_googleplus.phpnuW+AgetShortcode(), $atts ); extract( $atts ); if ( empty( $annotation ) ) { $annotation = 'bubble'; } $params = ''; $params .= ( '' !== $type ) ? ' size="' . $type . '"' : ''; $params .= ( '' !== $annotation ) ? ' annotation="' . $annotation . '"' : ''; if ( empty( $type ) ) { $type = 'standard'; } if ( 'inline' === $annotation && strlen( $widget_width ) > 0 ) { $params .= ' width="' . (int) $widget_width . '"'; } $class_to_filter = 'wpb_googleplus wpb_content_element wpb_googleplus_type_' . $type . ' vc_googleplus-annotation-' . $annotation . $this->getCSSAnimation( $css_animation ); $class_to_filter .= vc_shortcode_custom_css_class( $css, ' ' ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts ); $output = '
      '; echo $output; PK2\ #templates/shortcodes/vc_button2.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $class = 'vc_btn'; //parse link $link = ( '||' === $link ) ? '' : $link; $link = vc_build_link( $link ); $a_href = $link['url']; $a_title = $link['title']; $a_target = $link['target']; $a_rel = $link['rel']; if ( ! empty( $a_rel ) ) { $a_rel = ' rel="' . esc_attr( trim( $a_rel ) ) . '"'; } $class .= ( '' !== $color ) ? ( ' vc_btn_' . $color . ' vc_btn-' . $color ) : ''; $class .= ( '' !== $size ) ? ( ' vc_btn_' . $size . ' vc_btn-' . $size ) : ''; $class .= ( '' !== $style ) ? ' vc_btn_' . $style : ''; $el_class = $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . $class . $el_class, $this->settings['base'], $atts ); $wrapper_css_class = 'vc_button-2-wrapper'; if ( $align ) { $wrapper_css_class .= ' vc_button-2-align-' . $align; } ?>
      >
      PK2\HOO'templates/shortcodes/layerslider_vc.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_layerslider_element wpb_content_element' . $el_class, $this->settings['base'], $atts ); $output .= '
      '; $output .= wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_layerslider_heading' ) ); $output .= apply_filters( 'vc_layerslider_shortcode', do_shortcode( '[layerslider id="' . $id . '"]' ) ); $output .= '
      '; echo $output; PK2\j\(templates/shortcodes/vc_single_image.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $default_src = vc_asset_url( 'vc/no_image.png' ); // backward compatibility. since 4.6 if ( empty( $onclick ) && isset( $img_link_large ) && 'yes' === $img_link_large ) { $onclick = 'img_link_large'; } elseif ( empty( $atts['onclick'] ) && ( ! isset( $atts['img_link_large'] ) || 'yes' !== $atts['img_link_large'] ) ) { $onclick = 'custom_link'; } if ( 'external_link' === $source ) { $style = $external_style; $border_color = $external_border_color; } $border_color = ( '' !== $border_color ) ? ' vc_box_border_' . $border_color : ''; $img = false; switch ( $source ) { case 'media_library': case 'featured_image': if ( 'featured_image' === $source ) { $post_id = get_the_ID(); 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 ); } // set rectangular if ( preg_match( '/_circle_2$/', $style ) ) { $style = preg_replace( '/_circle_2$/', '_circle', $style ); $img_size = $this->getImageSquareSize( $img_id, $img_size ); } if ( ! $img_size ) { $img_size = 'medium'; } $img = wpb_getImageBySize( array( 'attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'vc_single_image-img', ) ); // don't show placeholder in public version if post doesn't have featured image if ( 'featured_image' === $source ) { if ( ! $img && 'page' === vc_manager()->mode() ) { return; } } break; case 'external_link': $dimensions = vcExtractDimensions( $external_img_size ); $hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : ''; $custom_src = $custom_src ? esc_attr( $custom_src ) : $default_src; $img = array( 'thumbnail' => '', ); break; default: $img = false; } if ( ! $img ) { $img['thumbnail'] = ''; } $el_class = $this->getExtraClass( $el_class ); // backward compatibility if ( vc_has_class( 'prettyphoto', $el_class ) ) { $onclick = 'link_image'; } // backward compatibility. will be removed in 4.7+ if ( ! empty( $atts['img_link'] ) ) { $link = $atts['img_link']; if ( ! preg_match( '/^(https?\:\/\/|\/\/)/', $link ) ) { $link = 'http://' . $link; } } // backward compatibility if ( in_array( $link, array( 'none', 'link_no' ) ) ) { $link = ''; } $a_attrs = array(); switch ( $onclick ) { case 'img_link_large': if ( 'external_link' === $source ) { $link = $custom_src; } else { $link = wp_get_attachment_image_src( $img_id, 'large' ); $link = $link[0]; } break; case 'link_image': wp_enqueue_script( 'prettyphoto' ); wp_enqueue_style( 'prettyphoto' ); $a_attrs['class'] = 'prettyphoto'; $a_attrs['data-rel'] = 'prettyPhoto[rel-' . get_the_ID() . '-' . rand() . ']'; // backward compatibility if ( vc_has_class( 'prettyphoto', $el_class ) ) { // $link is already defined } elseif ( 'external_link' === $source ) { $link = $custom_src; } else { $link = wp_get_attachment_image_src( $img_id, 'large' ); $link = $link[0]; } break; case 'custom_link': // $link is already defined break; case 'zoom': wp_enqueue_script( 'vc_image_zoom' ); if ( 'external_link' === $source ) { $large_img_src = $custom_src; } else { $large_img_src = wp_get_attachment_image_src( $img_id, 'large' ); if ( $large_img_src ) { $large_img_src = $large_img_src[0]; } } $img['thumbnail'] = str_replace( '' . $img['thumbnail'] . ''; } else { $html = '
      ' . $img['thumbnail'] . '
      '; } $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 ); if ( in_array( $source, array( 'media_library', 'featured_image' ) ) && 'yes' === $add_caption ) { $post = get_post( $img_id ); $caption = $post->post_excerpt; } else { if ( 'external_link' === $source ) { $add_caption = 'yes'; } } if ( 'yes' === $add_caption && '' !== $caption ) { $html .= '
      ' . esc_html( $caption ) . '
      '; } $output = '
      ' . wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_singleimage_heading' ) ) . '
      ' . $html . '
      '; echo $output; PK2\u $templates/shortcodes/vc_facebook.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $url = get_permalink(); $el_class = isset( $el_class ) ? $el_class : ''; $class_to_filter = 'fb_like wpb_content_element fb_type_' . $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 ); $output = '
      '; echo $output; PK2\HH%templates/shortcodes/vc_pinterest.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $url = rawurlencode( get_permalink() ); if ( has_post_thumbnail() ) { $img_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); $media = ( is_array( $img_url ) ) ? '&media=' . rawurlencode( $img_url[0] ) : ''; } else { $media = ''; } $excerpt = is_object( $post ) && isset( $post->post_excerpt ) ? $post->post_excerpt : ''; $description = ( '' !== $excerpt ) ? '&description=' . rawurlencode( strip_tags( $excerpt ) ) : ''; $el_class = isset( $el_class ) ? $el_class : ''; $class_to_filter = 'wpb_pinterest wpb_content_element wpb_pinterest_type_' . $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 ); $output .= '
      '; $output .= ''; $output .= '
      '; echo $output; PK2\]I 7 7 *templates/shortcodes/vc_custom_heading.phpnuW+AgetAttributes * @var $google_fonts_data - returned from $this->getAttributes * Shortcode class * @var $this WPBakeryShortCode_VC_Custom_heading */ $source = $text = $link = $google_fonts = $font_container = $el_class = $css = $css_animation = $font_container_data = $google_fonts_data = ''; // This is needed to extract $font_container_data and $google_fonts_data extract( $this->getAttributes( $atts ) ); $atts = vc_map_get_attributes( $this->getShortcode(), $atts ); extract( $atts ); /** * @var $css_class */ extract( $this->getStyles( $el_class . $this->getCSSAnimation( $css_animation ), $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 = ''; } if ( ( ! isset( $atts['use_theme_fonts'] ) || 'yes' !== $atts['use_theme_fonts'] ) && isset( $google_fonts_data['values']['font_family'] ) ) { wp_enqueue_style( 'vc_google_fonts_' . vc_build_safe_css_class( $google_fonts_data['values']['font_family'] ), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets ); } if ( ! empty( $styles ) ) { $style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"'; } else { $style = ''; } if ( 'post_title' === $source ) { $text = get_the_title( get_the_ID() ); } if ( ! empty( $link ) ) { $link = vc_build_link( $link ); $text = '' . $text . ''; } $output = ''; if ( apply_filters( 'vc_custom_heading_template_use_wrapper', false ) ) { $output .= '
      '; $output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >'; $output .= $text; $output .= ''; $output .= '
      '; } else { $output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' class="' . esc_attr( $css_class ) . '">'; $output .= $text; $output .= ''; } echo $output; PK2\?;=uu&templates/shortcodes/vc_posts_grid.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $this->resetTaxonomies(); if ( empty( $loop ) ) { return; } $this->getLoop( $loop ); $my_query = $this->query; $args = $this->loop_args; $teaser_blocks = vc_sorted_list_parse_value( $grid_layout ); global $vc_posts_grid_exclude_id; /** @var $my_query WP_Query */ while ( $my_query->have_posts() ) { $my_query->the_post(); // Get post from query $post = new stdClass(); // Creating post object. if ( in_array( get_the_ID(), $vc_posts_grid_exclude_id ) ) { continue; } $post->id = get_the_ID(); $post->link = get_permalink( $post->id ); if ( '1' === $vc_teaser_box->getTeaserData( 'enable', $post->id ) ) { $post->custom_user_teaser = true; $data = $vc_teaser_box->getTeaserData( 'data', $post->id ); if ( ! empty( $data ) ) { $data = json_decode( $data ); } $post->bgcolor = $vc_teaser_box->getTeaserData( 'bgcolor', $post->id ); $post->custom_teaser_blocks = array(); $post->title_attribute = the_title_attribute( 'echo=0' ); if ( ! empty( $data ) ) { foreach ( $data as $block ) { $settings = array(); if ( 'title' === $block->name ) { $post->title = the_title( '', '', false ); } elseif ( 'image' === $block->name ) { if ( 'featured' === $block->image ) { $post->thumbnail_data = $this->getPostThumbnail( $post->id, $grid_thumb_size ); } elseif ( ! empty( $block->image ) ) { $post->thumbnail_data = wpb_getImageBySize( array( 'attach_id' => (int) $block->image, 'thumb_size' => $grid_thumb_size, ) ); } else { $post->thumbnail_data = false; } $post->thumbnail = $post->thumbnail_data && isset( $post->thumbnail_data['thumbnail'] ) ? $post->thumbnail_data['thumbnail'] : ''; $post->image_link = empty( $video ) && $post->thumbnail && isset( $post->thumbnail_data['p_img_large'][0] ) ? $post->thumbnail_data['p_img_large'][0] : $video; } elseif ( 'text' === $block->name ) { if ( 'custom' === $block->mode ) { $settings[] = 'text'; $post->content = $block->text; } elseif ( 'excerpt' === $block->mode ) { $settings[] = $block->mode; $post->excerpt = $this->getPostExcerpt(); } else { $settings[] = $block->mode; $post->content = $this->getPostContent(); } } if ( isset( $block->link ) ) { if ( 'post' === $block->link ) { $settings[] = 'link_post'; } elseif ( 'big_image' === $block->link ) { $settings[] = 'link_image'; } else { $settings[] = 'no_link'; } $settings[] = ''; } $post->custom_teaser_blocks[] = array( $block->name, $settings ); } } } else { $post->custom_user_teaser = false; $post->title = the_title( '', '', false ); $post->title_attribute = the_title_attribute( 'echo=0' ); $post->post_type = get_post_type(); $post->content = $this->getPostContent(); $post->excerpt = $this->getPostExcerpt(); $post->thumbnail_data = $this->getPostThumbnail( $post->id, $grid_thumb_size ); $post->thumbnail = $post->thumbnail_data && isset( $post->thumbnail_data['thumbnail'] ) ? $post->thumbnail_data['thumbnail'] : ''; $video = get_post_meta( $post->id, '_p_video', true ); $post->image_link = empty( $video ) && $post->thumbnail && isset( $post->thumbnail_data['p_img_large'][0] ) ? $post->thumbnail_data['p_img_large'][0] : $video; } $post->categories_css = $this->getCategoriesCss( $post->id ); $posts[] = $post; } wp_reset_query(); /** * Css classes for grid and teasers. * {{ */ $post_types_teasers = ''; if ( ! empty( $args['post_type'] ) && is_array( $args['post_type'] ) ) { foreach ( $args['post_type'] as $post_type ) { $post_types_teasers .= 'wpb_teaser_grid_' . $post_type . ' '; } } $li_span_class = $this->spanClass( $grid_columns_count ); $css_class = 'wpb_row wpb_teaser_grid wpb_content_element ' . $this->getMainCssClass( $filter ) . // Css class as selector for isotope plugin ' columns_count_' . $grid_columns_count . // Custom margin/padding for different count of columns in grid ' columns_count_' . $grid_columns_count . // Combination of layout and column count ' ' . $post_types_teasers; // Css classes by selected post types $class_to_filter = $css_class; $class_to_filter .= $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts ); $this->setLinkTarget( $grid_link_target ); ?>
      $title, 'extraclass' => 'wpb_teaser_grid_heading' ) ) ?>
      filter_categories ) ) : $categories_array = $this->getFilterCategories(); echo ''; ?>
        0 ) : ?> custom_user_teaser ? $post->custom_teaser_blocks : $teaser_blocks; $block_style = isset( $post->bgcolor ) ? ' style="background-color: ' . $post->bgcolor . '"' : ''; echo ''; echo '
        '; foreach ( $blocks_to_build as $block_data ) : include $this->getBlockTemplate(); endforeach; echo '
        '; ?>
      PK2\|OZZ'templates/shortcodes/vc_tta_section.phpnuW+AgetShortcode(), $atts ); $this->resetVariables( $atts, $content ); WPBakeryShortCode_VC_Tta_Section::$self_count ++; WPBakeryShortCode_VC_Tta_Section::$section_info[] = $atts; $isPageEditable = vc_is_page_editable(); $output = ''; $output .= '
      getTemplateVariable( 'tab_id' ) ) . '"'; $output .= ' data-vc-content=".vc_tta-panel-body">'; $output .= '
      '; $output .= $this->getTemplateVariable( 'heading' ); $output .= '
      '; $output .= '
      '; if ( $isPageEditable ) { $output .= '
      '; // fix for fe - shortcodes container, not required in b.e. } $output .= $this->getTemplateVariable( 'content' ); if ( $isPageEditable ) { $output .= '
      '; } $output .= '
      '; $output .= '
      '; echo $output; PK2\7GS S 'templates/shortcodes/vc_cta_button2.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $class = 'vc_call_to_action wpb_content_element'; $link = ( '||' === $link ) ? '' : $link; $class .= ( '' !== $position ) ? ' vc_cta_btn_pos_' . $position : ''; $class .= ( '' !== $el_width ) ? ' vc_el_width_' . $el_width : ''; $class .= ( '' !== $color ) ? ' vc_cta_' . $color : ''; $class .= ( '' !== $style ) ? ' vc_cta_' . $style : ''; $class .= ( '' !== $txt_align ) ? ' vc_txt_align_' . $txt_align : ''; $inline_css = ( '' !== $accent_color ) ? ' style="' . vc_get_css_color( 'background-color', $accent_color ) . vc_get_css_color( 'border-color', $accent_color ) . '"' : ''; $class .= $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts ); $css_class .= $this->getCSSAnimation( $css_animation ); ?> class="">

      PK2\zGG+templates/shortcodes/vc_gitem_post_data.phpnuW+AgetAttributes( $atts ) ); extract( $this->getStyles( $el_class, $css, $google_fonts_data, $font_container_data, $atts ) ); $data_source = $this->getDataSource( $atts ); if ( isset( $atts['link'] ) && '' !== $atts['link'] && 'none' !== $atts['link'] ) { $link_html = vc_gitem_create_link( $atts ); } $use_custom_fonts = isset( $atts['use_custom_fonts'] ) && 'yes' === $atts['use_custom_fonts']; $settings = get_option( 'wpb_js_google_fonts_subsets' ); $subsets = ''; if ( is_array( $settings ) && ! empty( $settings ) ) { $subsets = '&subset=' . implode( ',', $settings ); } $content = '{{ post_data:' . esc_attr( $data_source ) . ' }}'; if ( ! empty( $link_html ) ) { $content = '<' . $link_html . '>' . $content . ''; } $css_class .= ' vc_gitem-post-data'; if ( $data_source ) { $css_class .= ' vc_gitem-post-data-source-' . $data_source; } if ( $use_custom_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'] ), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets ); } $output .= '
      '; $style = ''; if ( ! empty( $styles ) ) { $style = 'style="' . esc_attr( implode( ';', $styles ) ) . '"'; } $output .= '<' . $font_container_data['values']['tag'] . ' ' . $style . ' >'; $output .= $content; $output .= ''; $output .= '
      '; echo $output; PK2\lӤ%templates/shortcodes/vc_row_inner.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $css_classes = array( 'vc_row', 'wpb_row', //deprecated 'vc_inner', 'vc_row-fluid', $el_class, vc_shortcode_custom_css_class( $css ), ); if ( 'yes' === $disable_element ) { if ( vc_is_page_editable() ) { $css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md'; } else { return ''; } } if ( vc_shortcode_custom_css_has_property( $css, array( 'border', 'background', ) ) ) { $css_classes[] = 'vc_row-has-fill'; } if ( ! empty( $atts['gap'] ) ) { $css_classes[] = 'vc_column-gap-' . $atts['gap']; } if ( ! empty( $equal_height ) ) { $flex_row = true; $css_classes[] = 'vc_row-o-equal-height'; } if ( ! empty( $content_placement ) ) { $flex_row = true; $css_classes[] = 'vc_row-o-content-' . $content_placement; } if ( ! empty( $flex_row ) ) { $css_classes[] = 'vc_row-flex'; } $wrapper_attributes = array(); // build attributes for wrapper if ( ! empty( $el_id ) ) { $wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"'; } $css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( array_unique( $css_classes ) ) ), $this->settings['base'], $atts ) ); $wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"'; $output .= '
      '; $output .= wpb_js_remove_wpautop( $content ); $output .= '
      '; $output .= $after_output; echo $output; PK2\]=KK&templates/shortcodes/rev_slider_vc.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $el_class = $this->getExtraClass( $el_class ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_revslider_element wpb_content_element' . $el_class, $this->settings['base'], $atts ); $output .= '
      '; $output .= wpb_widget_title( array( 'title' => $title, 'extraclass' => 'wpb_revslider_heading' ) ); $output .= apply_filters( 'vc_revslider_shortcode', do_shortcode( '[rev_slider ' . $alias . ']' ) ); $output .= '
      '; echo $output; PK2\euu'templates/shortcodes/vc_gitem_image.phpnuW+A{{ featured_image: }} PK2\L)templates/shortcodes/vc_accordion_tab.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion_section group', $this->settings['base'], $atts ); $output = '

      ' . $title . '

      ' . ( ( '' === trim( $content ) ) ? __( 'Empty section. Edit page to add content here.', 'js_composer' ) : wpb_js_remove_wpautop( $content ) ) . '
      '; echo $output; PK2\^^(templates/shortcodes/vc_column_inner.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $width = wpb_translateColumnWidthToSpan( $width ); $width = vc_column_offset_class_merge( $offset, $width ); $css_classes = array( $this->getExtraClass( $el_class ), 'wpb_column', 'vc_column_container', $width, ); if ( vc_shortcode_custom_css_has_property( $css, array( 'border', 'background', ) ) ) { $css_classes[] = 'vc_col-has-fill'; } $wrapper_attributes = array(); $css_class = preg_replace( '/\s+/', ' ', apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode( ' ', array_filter( $css_classes ) ), $this->settings['base'], $atts ) ); $wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class ) ) . '"'; $output .= '
      '; $output .= '
      '; $output .= '
      '; $output .= wpb_js_remove_wpautop( $content ); $output .= '
      '; $output .= '
      '; $output .= '
      '; echo $output; PK2\Gg)H  *templates/shortcodes/vc_text_separator.phpnuW+AgetShortcode(), $atts ); extract( $atts ); $class = 'vc_separator wpb_content_element'; $class .= ( '' !== $title_align ) ? ' vc_' . $title_align : ''; $class .= ( '' !== $el_width ) ? ' vc_sep_width_' . $el_width : ' vc_sep_width_100'; $class .= ( '' !== $style ) ? ' vc_sep_' . $style : ''; $class .= ( '' !== $border_width ) ? ' vc_sep_border_width_' . $border_width : ''; $class .= ( '' !== $align ) ? ' vc_sep_pos_' . $align : ''; $class .= ( 'separator_no_text' === $layout ) ? ' vc_separator_no_text' : ''; if ( '' !== $color && 'custom' !== $color ) { $class .= ' vc_sep_color_' . $color; } $inline_css = ( 'custom' === $color && '' !== $accent_color ) ? ' style="' . vc_get_css_color( 'border-color', $accent_color ) . '"' : ''; $class_to_filter = $class; $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 ); $css_class = esc_attr( trim( $css_class ) ); $icon = ''; if ( 'true' === $add_icon ) { vc_icon_element_fonts_enqueue( $i_type ); $icon = $this->getVcIcon( $atts ); } $content = ''; if ( $icon ) { $content = $icon; } if ( '' !== $title && 'separator_no_text' !== $layout ) { $css_class .= ' vc_separator-has-text'; $content .= '

      ' . $title . '

      '; } $separatorHtml = <<