Advertisement
fauzanjeg

Add some String for Media

Sep 9th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. /* Add some String for Media */
  2. function add_capbility_media( $string, $post ) {
  3.     if ( $post ) {
  4.         $post_type_object = get_post_type_object( $post->post_type );
  5.     } else {
  6.         $post_type_object = get_post_type_object( 'post' );
  7.     }
  8.  
  9.     $new_string = array(
  10.         // From URL.
  11.         'insertFromUrlTitle' => __( 'Insert from URL' ),
  12.         // Featured Images.
  13.         'setFeaturedImageTitle'       => $post_type_object->labels->featured_image,
  14.         'setFeaturedImage'            => $post_type_object->labels->set_featured_image,
  15.         // Playlist.
  16.         'createPlaylistTitle'         => __( 'Create audio playlist' ),
  17.         // Video Playlist.
  18.         'createVideoPlaylistTitle'    => __( 'Create video playlist' ),
  19.     );
  20.  
  21.  
  22.     return array_replace( $string, $new_string );
  23. }
  24. add_filter( 'media_view_strings', 'add_capbility_media', 99, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement