'; } /** * 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; } /** * @deprecated 4.9 * * @param $settings * @param $value * * @since 4.4 * @return string */ function vc_taxomonies_form_field( $settings, $value ) { _deprecated_function( 'vc_taxomonies_form_field', '4.9 (will be removed in 4.11)' ); return vc_taxonomies_form_field( $settings, $value ); } /** * 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; }