public function setUpPlugin()
 {
     parent::setUpPlugin();
     $this->composer->addAction('edit_post', 'saveMetaBoxes');
     $this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
     $this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
     $this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
     $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
     $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
     $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
     // Add specific CSS class by filter
     $this->addFilter('body_class', 'jsComposerBodyClass');
     $this->addFilter('get_media_item_args', 'jsForceSend');
     //$this->addAction( 'admin_menu','composerSettings' );
     //$this->addAction( 'admin_init', 'composerRedirect' );
     $this->addAction('admin_init', 'jsComposerEditPage', 5);
     $this->addAction('admin_init', 'registerCss');
     $this->addAction('admin_init', 'registerJavascript');
     $this->addAction('admin_print_scripts-post.php', 'editScreen_js');
     $this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
     /* Create Media tab for images */
     $this->composer->createImagesMediaTab();
 }
Esempio n. 2
0
 public function setUpPlugin()
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     parent::setUpPlugin();
     $show = true;
     foreach ($current_user->roles as $role) {
         if (isset($settings[$role]['show']) && $settings[$role]['show'] === 'no') {
             $show = false;
             break;
         }
     }
     if ($show) {
         $this->composer->addAction('edit_post', 'saveMetaBoxes');
         $this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_convert_elements_backend_html', 'Convert2NewVersionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_row_element_backend_html', 'elementRowBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_single_image_src', 'singleImageSrcJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_gallery_html', 'galleryHTMLJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_loop_suggestion', 'getLoopSuggestionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_remove_settings_notification_element_css_class', 'removeSettingsNotificationJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_image_url', 'getImageUrlByIdJavascript_callback');
         /*
          * Create edit form html
          * @deprecated
          */
         $this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_edit_form', 'getEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template_shortcodes', 'loadTemplateShortcodesJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_loop_settings', 'getLoopSettingsJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_activate_license', 'activateLicense');
         $this->composer->addAction('wp_ajax_wpb_deactivate_license', 'deactivateLicense');
         $this->addAction('admin_init', 'jsComposerEditPage', 5);
     }
     // Add specific CSS class by filter
     $this->addFilter('body_class', 'jsComposerBodyClass');
     $this->addFilter('get_media_item_args', 'jsForceSend');
     $this->addAction('admin_init', 'composerRedirect');
     $this->addAction('admin_init', 'registerCss');
     $this->addAction('admin_init', 'registerJavascript');
     if ($this->composer->isNetworkPlugin() && is_network_admin()) {
         $this->addAction('network_admin_menu', 'composerSettings');
     }
     $this->addAction('admin_menu', 'composerSettings');
     $this->addAction('admin_print_scripts-post.php', 'editScreen_js');
     $this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
     // Upgrade message in plugins list.
     if ($this->composer->updaterDisabled()) {
         return $this;
     }
     $plugin_file_name = 'js_composer/js_composer.php';
     new WpbAutoUpdate(WPB_VC_VERSION, 'http://wpbakery.com/version/?' . time(), $plugin_file_name);
     $this->addAction('in_plugin_update_message-' . $plugin_file_name, 'addUpgradeMessageLink');
 }
Esempio n. 3
0
 public function setUpPlugin()
 {
     global $current_user;
     get_currentuserinfo();
     /** @var $settings - get use group access rules */
     $settings = WPBakeryVisualComposerSettings::get('groups_access_rules');
     parent::setUpPlugin();
     $show = true;
     foreach ($current_user->roles as $role) {
         if (isset($settings[$role]['show']) && $settings[$role]['show'] === 'no') {
             $show = false;
             break;
         }
     }
     if ($show) {
         $this->composer->addAction('edit_post', 'saveMetaBoxes');
         $this->composer->addAction('wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_convert_elements_backend_html', 'Convert2NewVersionJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_get_row_element_backend_html', 'elementRowBackendHtmlJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');
         $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');
         $this->addAction('admin_init', 'jsComposerEditPage', 5);
     }
     // Add specific CSS class by filter
     $this->addFilter('body_class', 'jsComposerBodyClass');
     $this->addFilter('get_media_item_args', 'jsForceSend');
     $this->addAction('admin_init', 'composerRedirect');
     $this->addAction('admin_init', 'registerCss');
     $this->addAction('admin_init', 'registerJavascript');
     $this->addAction('admin_menu', 'composerSettings');
     $this->addAction('admin_print_scripts-post.php', 'editScreen_js');
     $this->addAction('admin_print_scripts-post-new.php', 'editScreen_js');
     /* Create Media tab for images */
     $this->composer->createImagesMediaTab();
 }