How to save post with different languages and linked them with WPML?

Thank @Sally CJ I made the solution : main code global $sitepress_settings; //Insert post with main lang $post = $binding_main_cpt[‘post’]; $default_language = $sitepress_settings[‘default_language’]; $main_post = $post[$default_language]; $postInformation = [ ‘post_title’ => wp_strip_all_tags(trim($main_post[‘post_title’] ) ), ‘post_content’ => $main_post[‘post_content’], ‘post_type’ => $main_post_type, ‘post_status’ => ‘publish’ ]; $master_post_id = wp_insert_post($postInformation); echo sprintf( “insert post %d”, $master_post_id ); foreach($sitepress_settings[‘active_languages’] … Read more

How do I translate month names in post metadata?

One easy solution, if you want the frontend to be a different language than the backend, is to change the site language under Settings > General (Spanish for example) and then change your user account’s language by going to Users > Your Profile and changing the Language setting to English. In addition, you can add … Read more

Can’t generate pot file using wp cli

The problem here is that WordPress project folder is a shared folder on Ubuntu VirtualBox guest OS with guest additions. Searching in wp cli source code, I found that to scan the directory is used: $files = new IteratorIterator( new DirectoryIterator( $this->source ) ); and I could verify that it returns only . and .. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)