• Good morning!

    I’m working on a project that requires an event calendar and I’m testing your plugin for the development of this project and I came across the following problem. The plugin adds two speaker categories automatically in English and when translating to Portuguese and loading the page the plugin generates the speaker and organizer categories again. I understand that I can translate into a certain chosen language with the Polylang and Polylang Theme plugins, but there is no need to install two plugins just to translate four strings since the project will not have other languages so I would like to know how can I remove this action to have the name and slug in our language? I’ve tried to remove it in several ways and I couldn’t, the only way I managed so far was commenting line 39 of the file wp-event-solution/core/speaker/hooks.php //add_action( ‘init’, [$this, ‘ add_default_speaker_categories’], 99999 ); but this is not a good practice as it will be undone when the plugin is updated. So how can I do this via the theme function?

    Sincerely,
    Gilvanilson Santos

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Gilvanilson

    (@gilvanilson)

    I found a solution in the translation to comply with the default language of the site, which would make the code snippet translatable, which is also not a good practice, because when updating the plugin it will be lost, unless it is done by the plugin developer . And then you think this might be a good solution to my problem, I usually translate into Portuguese all plugins that don’t have translation, used in our projects.

    public function add_default_speaker_categories() {
    
            $org_term = term_exists( 'Organizer', 'etn_speaker_category' );
    
            if ( $org_term === null ) {
                wp_insert_term(
                    __( 'Organizer', 'eventin' ),
                    'etn_speaker_category',
                    [
                        'description' => __( 'Organizer of event', 'eventin' ),
                        'slug'        => __( 'organizer', 'eventin' ),
                        'parent'      => 0,
                    ]
                );
            }
    
            $speaker_term = term_exists( 'Speaker', 'etn_speaker_category' );
    
            if ( $speaker_term === null ) {
                wp_insert_term(
                    __( 'Speaker', 'eventin' ),
                    'etn_speaker_category',
                    [
                        'description' => __( 'Speaker of schedule', 'eventin' ),
                        'slug'        => __( 'speaker', 'eventin' ),
                        'parent'      => 0,
                    ]
                );
            }
    
            // create a new page
            $this->category->create_page();
    
        }
    Plugin Support A Zaman Sagor

    (@azamansagor)

    Hi @gilvanilson ,

    Greetings! Thank you for reaching out to us regarding your issue. 

    We appreciate your feedback. Our team has forwarded your query to our development department.

    From our plugin there are some dependencies with those archive and pre used speakers and organizers category. We are discussing it with our team. 

    We appreciate your patience and understanding in this matter.

    If you have any further questions or concerns, please don’t hesitate to reach out to us.

    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove action that adds speaker categories automatically’ is closed to new replies.