Support » Plugin: Forminator Payment, Quiz and Contact Form Plugin » User permission to use forminator

  • Resolved edemir206

    (@edemir206)


    Hi,

    What is the user permission that is allowed to use forminator ? I use user role editor plugin but I can’t seem to find a role name that gives users forminator powers, or is it hardcoded for administrator only ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Nastia – WPMU DEV Support

    (@wpmudev-support9)

    Hello @edemir206

    Hope you’re doing well!

    Only administrators can have access to the plugins’settings. By default, Editors doesn’t have access to plugins options. Unfortunately, there are no capabilities defined by the Forminator plugin.

    It will require some custom coding to allow editors to access the plugin. There is filter forminator_admin_cap to filter capability that you can use. Unfortunately, we don’t offer custom development services, what you can do is check WP Jobs section for additional help from developers:
    http://jobs.wordpress.net/

    Hope this helps!

    Cheers,
    Nastia

    Hi,

    just droping here to tell i coded myself a plugin for interacting with forminator and enabling some user cap to only see the submissions. In case someone needs the plugin code is below:

    BTW: You should replace “ufsm – admin” with the permission you want to be able to see the submissions, in case you want this custom cap to be able to create forms all you have to do is remove the remove_submenu_page parts or give the cap the manage_options permission

    <?php
    
    /**
     * Plugin Name: UFSM - Forminator Configurações Personalizadas
     * Version: 1
     * Description: Addon para extender as funcionalidades do Plugin Forminator da WPMUDEV
     * Author: UFSM
     * Author URI: https://www.ufsm.br
     * Text Domain: ufsmforminator
     */
     
    //Essa classe permite modificar o comportamento padrão do plugin Forminator da empresa WPMUDEV para às necessidades da UFSM.
    
    class Forminator_Admin_Custom {
    
        // Inicia os filtros
        public function __construct() {
            add_action( 'admin_menu', array($this,'run_filters'),1);
        }
    
        public function run_filters()
        {
            //Tradução para os menus básicos
            add_filter( 'gettext', array($this,'translate_forminator_menus'), 20, 3 );
            //Remover as permissões para usuários sem permissão de manage_options
            add_action( 'admin_menu', array($this,'forminator_menu_permissions'), 999 );
            //Aqui hookamos na permissão que possibilita o usuário de criar 
            add_filter( 'forminator_admin_cap', array($this,'my_cap_forms') );
        }
    
        public function my_cap_forms()
        {
            //Aqui é a nova permissão mínima de acesso ao forminator, esse usuário poderá ver as submissões, porém apenas
            //usuários com permissão de "manage_options" poderão criar forms, polls e quizes.
            return 'ufsm - admin';    
        }
    
        public function forminator_menu_permissions() {
            //Se o usuário não tiver a permissão de gerenciar opções removemos o acesso aos menus.
            if ( ! current_user_can( 'manage_options' ) ) {
                remove_submenu_page( 'forminator','forminator' );
                remove_submenu_page( 'forminator','forminator-cform' );
                remove_submenu_page( 'forminator','forminator-quiz' );
                remove_submenu_page( 'forminator','forminator-poll' );
                remove_submenu_page( 'forminator','forminator-settings' );
                remove_submenu_page( 'forminator','forminator-integrations' );
                remove_submenu_page( 'forminator','forminator-cform-wizard' );
                remove_submenu_page( 'forminator','forminator-poll-wizard' );
                remove_submenu_page( 'forminator','forminator-nowrong-wizard' );
                remove_submenu_page( 'forminator','forminator-knowledge-wizard' );
                remove_submenu_page( 'forminator', 'forminator-settings' );
            } 
        }
    
        //Tradução dos menus básicos do forminator para pt-br enquanto não sai a tradução.
        public function translate_forminator_menus( $translated_text, $text, $domain ) {
            switch ( $translated_text ) {
                case 'Forminator' :
                    $translated_text = __( 'Forms', 'forminator' );
                    break;
                case 'Submissions' :
                    $translated_text = __( 'Envios', 'submissions' );
                    break;
            }
            return $translated_text;
        }
        
    }
    
    //Instanciamos o objeto
    $ufsm_forms = new Forminator_Admin_Custom();
    Plugin Support Nastia – WPMU DEV Support

    (@wpmudev-support9)

    Hello @edemir206

    Hope all is well!

    Thank you for sharing this in here and sharing your feedback! Hope other users will find it useful!

    Have a good day and take care!

    Cheers,
    Nastia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User permission to use forminator’ is closed to new replies.