
cforms2 no buttons in admin bar. My solution to the problem.
After update WordPress seen on several sites., what buttons owned by cforms2 plugin disappeared from admin. Digging in Runet and Bynet, found the answer on the official forum of the plugin, I advise you to read. Everything turned out to be quite simple.. You need to put a fix until the plugin developers fix the code ).
To get the buttons, copy the code to a file function.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | if(substr_count($_GET['page'], 'cforms')){ add_action('admin_bar_menu', 'add_items'); function add_items($admin_bar){ $cfo = get_option('cforms_settings'); addAdminBar_root('cforms-bar', 'cforms Admin'); addAdminBar_item('cforms-addbutton', __('Add new form', 'cforms'), __('Adds a new form with default values', 'cforms'), 'jQuery("#cfbar-addbutton").trigger("click"); return false;'); addAdminBar_item('cforms-dupbutton', __('Duplicate current form', 'cforms'), __('Clones the current form', 'cforms'), 'jQuery("#cfbar-dupbutton").trigger("click"); return false;'); if ( (int)$cfo['global']['cforms_formcount'] > 1) addAdminBar_item('cforms-delbutton', __('Delete current form (!)', 'cforms'), __('Clicking this button WILL delete this form', 'cforms'), 'if ( confirm("'.__('This will delete the current form!', 'cforms').'")) jQuery("#cfbar-delbutton").trigger("click"); return false;'); addAdminBar_item('cforms-preset', __('Install a form preset', 'cforms'), __('Pick a form preset from the repository', 'cforms'), 'jQuery("#preset").trigger("click"); return false;'); addAdminBar_item('cforms-backup', __('Backup / restore this form only', 'cforms'), __('Better safe than sorry ;)', 'cforms'), 'jQuery("#backup").trigger("click"); return false;'); addAdminBar_item('cforms-SubmitOptions', __('Save & update form settings', 'cforms'), '', 'document.mainform.action="#"+getFieldset(focusedFormControl); jQuery("#cfbar-SubmitOptions").trigger("click"); return false;', 'root-default'); } } |
Just in case, I developed a small plugin that you can install and fix the problem until the developers fix it in the new version., then just deactivate the plugin.

/*

- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.
New version without this problem, but decided, what is it worth describing, since many have sites with old versions and for various reasons it is not always possible to quickly update the plugin. And with the help of my plugin, you can fix old versions through the admin panel.