PluginProbe
Translate and Go multilingual – Automatic AI translation – wpLingua / 1.1.0
Translate and Go multilingual – Automatic AI translation – wpLingua v1.1.0
2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 1.1.0 All 112 releases
wplingua / inc / admin / translation-cpt.php

translation-cpt.php in Translate and Go multilingual – Automatic AI translation – wpLingua 1.1.0, at inc/admin/translation-cpt.php

80 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // If this file is called directly, abort.
4 if ( ! defined( 'WPINC' ) ) {
5 die;
6 }
7
8
9 /**
10 * Register wpLingua Translation CPT
11 *
12 * @return void
13 */
14 function wplng_register_post_type_translation() {
15 register_post_type(
16 'wplng_translation',
17 array(
18 'labels' => array(
19 'name' => __( 'Translations', 'wplingua' ),
20 'singular_name' => __( 'Translation', 'wplingua' ),
21 'all_items' => __( 'All translations', 'wplingua' ),
22 'edit_item' => __( 'Edit translation', 'wplingua' ),
23 'menu_name' => __( 'Translations', 'wplingua' ),
24 ),
25 'public' => false,
26 'publicly_queryable' => false,
27 'show_ui' => true,
28 'exclude_from_search' => true,
29 'show_in_nav_menus' => false,
30 'show_in_menu' => false,
31 'has_archive' => false,
32 'rewrite' => false,
33 'menu_icon' => 'dashicons-translation',
34 'supports' => array(
35 'title',
36 ),
37 'capability_type' => 'post',
38 'capabilities' => array(
39 'create_posts' => false,
40 ),
41 'map_meta_cap' => true,
42 )
43 );
44 }
45
46
47 /**
48 * Remove quick edit on wpLingua translations list
49 *
50 * @param array $actions
51 * @param object $post
52 * @return array
53 */
54 function wplng_translation_remove_quick_edit( $actions, $post ) {
55
56 if ( $post->post_type != 'wplng_translation' ) {
57 return $actions;
58 }
59
60 unset( $actions['view'] );
61 unset( $actions['inline hide-if-no-js'] );
62
63 return $actions;
64 }
65
66
67 /**
68 * Display 100 translations by default in admin area
69 *
70 * @param mixed $result
71 * @return mixed
72 */
73 function wplng_translation_per_page( $result ) {
74 if ( false === $result ) {
75 $result = '100';
76 }
77
78 return $result;
79 }
80