PluginProbe
Property Hive / 2.2.4
Property Hive v2.2.4
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / includes / admin / post-types / class-ph-admin-cpt.php

class-ph-admin-cpt.php in Property Hive 2.2.4, at includes/admin/post-types/class-ph-admin-cpt.php

59 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin functions for post types
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin/Post Types
8 * @version 1.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
13 if ( ! class_exists( 'PH_Admin_CPT' ) ) :
14
15 /**
16 * PH_Admin_CPT Class
17 */
18 class PH_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(
43 /* translators: %s: singular post type label */
44 __( 'Insert into %s', 'propertyhive' ),
45 $obj->labels->singular_name
46 );
47
48 $strings['uploadedToThisPost'] = sprintf(
49 /* translators: %s: singular post type label */
50 __( 'Uploaded to this %s', 'propertyhive' ),
51 $obj->labels->singular_name
52 );
53 }
54
55 return $strings;
56 }
57 }
58
59 endif;