1 <?php
 2 /**
 3  * Admin functions for post types
 4  *
 5  * @author      WooThemes
 6  * @category    Admin
 7  * @package     WooCommerce/Admin/Post Types
 8  * @version     2.1.0
 9  */
10 
11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12 
13 if ( ! class_exists( 'WC_Admin_CPT' ) ) :
14 
15 /**
16  * WC_Admin_CPT Class
17  */
18 class WC_Admin_CPT {
19 
20     protected $type = '';
21 
22     /**
23      * Constructor
24      */
25     public function __construct() {
26         // Insert into X media browser
27         add_filter( 'media_view_strings', array( $this, 'change_insert_into_post' ) );
28     }
29 
30     /**
31      * Change label for insert buttons.
32      * @access   public
33      * @param array $strings
34      * @return array
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;
WooCommerce API documentation generated by ApiGen 2.8.0