PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
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.3.0, at includes/admin/post-types/class-ph-admin-cpt.php

60 lines 1.4 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 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Legacy public global class PH_Admin_CPT; preserving the existing PH_* class name is required for plugin and extension compatibility.
19 class PH_Admin_CPT {
20
21 protected $type = '';
22
23 /**
24 * Constructor
25 */
26 public function __construct() {
27 // Insert into X media browser
28 add_filter( 'media_view_strings', array( $this, 'change_insert_into_post' ) );
29 }
30
31 /**
32 * Change label for insert buttons.
33 * @access public
34 * @param array $strings
35 * @return array
36 */
37 function change_insert_into_post( $strings ) {
38 global $post_type;
39
40 if ( $post_type == $this->type ) {
41 $obj = get_post_type_object( $this->type );
42
43 $strings['insertIntoPost'] = sprintf(
44 /* translators: %s: singular post type label */
45 __( 'Insert into %s', 'propertyhive' ),
46 $obj->labels->singular_name
47 );
48
49 $strings['uploadedToThisPost'] = sprintf(
50 /* translators: %s: singular post type label */
51 __( 'Uploaded to this %s', 'propertyhive' ),
52 $obj->labels->singular_name
53 );
54 }
55
56 return $strings;
57 }
58 }
59
60 endif;