Gilvanilson
Forum Replies Created
Viewing 1 replies (of 1 total)
-
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(); }
Viewing 1 replies (of 1 total)