if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } if ( 'vc_edit_form' === vc_post_param( 'action' ) ) { VcShortcodeAutoloader::getInstance() ->includeClass( 'WPBakeryShortCode_VC_Wp_Text' ); add_filter( 'vc_edit_form_fields_attributes_vc_wp_text', array( 'WPBakeryShortCode_VC_Wp_Text', 'convertTextAttributeToContent', ) ); } if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * Add WP ui pointers to backend editor. */ function vc_add_admin_pointer() { if ( is_admin() ) { foreach ( vc_editor_post_types() as $post_type ) { add_filter( 'vc_ui-pointers-' . $post_type, 'vc_backend_editor_register_pointer' ); } } } add_action( 'admin_init', 'vc_add_admin_pointer' ); function vc_backend_editor_register_pointer( $pointers ) { $screen = get_current_screen(); if ( 'add' === $screen->action ) { $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; } if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * Add WP ui pointers to backend editor. */ function vc_frontend_editor_pointer() { vc_is_frontend_editor() && add_filter( 'vc-ui-pointers', 'vc_frontend_editor_register_pointer' ); } add_action( 'admin_init', 'vc_frontend_editor_pointer' ); function vc_frontend_editor_register_pointer( $pointers ) { global $post; if ( is_object( $post ) && ! strlen( $post->post_content ) ) { $pointers['vc_pointers_frontend_editor'] = array( 'name' => 'vcPointerController', 'messages' => array( array( 'target' => '#vc_add-new-element', 'options' => array( 'content' => sprintf( '

%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' ); if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } function vc_add_ie9_degradation() { echo ''; } add_action( 'vc_backend_editor_footer_render', 'vc_add_ie9_degradation' );