1 <?php
2 3 4 5 6 7 8 9
10
11 if ( ! defined( 'ABSPATH' ) ) exit;
12
13 if ( ! class_exists( 'WC_Admin_CPT' ) ) :
14
15 16 17
18 class WC_Admin_CPT {
19
20 protected $type = '';
21
22 23 24
25 public function __construct() {
26
27 add_filter( 'media_view_strings', array( $this, 'change_insert_into_post' ) );
28 }
29
30 31 32 33 34 35
36 function change_insert_into_post( $strings ) {
37 global $post_type;
38
39 if ( $post_type == $this->type ) {
40 $obj = get_post_type_object( $this->type );
41
42 $strings['insertIntoPost'] = sprintf( __( 'Insert into %s', 'woocommerce' ), $obj->labels->singular_name );
43 $strings['uploadedToThisPost'] = sprintf( __( 'Uploaded to this %s', 'woocommerce' ), $obj->labels->singular_name );
44 }
45
46 return $strings;
47 }
48 }
49
50 endif;