phpface

VideoTube - Custom Video Meta

Jun 22nd, 2020
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. if( ! function_exists( 'videotube_child_remove_video_meta' ) ){
  2.     /**
  3.      *
  4.      * Remove default meta
  5.      *
  6.      */
  7.     function videotube_child_remove_video_meta(){
  8.         remove_action( 'mars_video_meta', 'mars_video_meta', 10 );
  9.     }
  10.     add_action( 'init', 'videotube_child_remove_video_meta' ); 
  11. }
  12.  
  13. if( ! function_exists( 'videotube_child_add_custom_video_meta' ) ){
  14.     /**
  15.      *
  16.      * Add custom meta
  17.      *
  18.      */
  19.     function videotube_child_add_custom_video_meta(){
  20.         ?><div class="post-meta meta d-flex justify-content-between">
  21.             <span class="post-author">
  22.                 <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );?>">
  23.                     <?php printf(
  24.                         esc_html__( 'By %s', 'videotube-child' ),
  25.                         get_the_author_meta( 'display_name' )
  26.                     );?>
  27.                 </a>
  28.             </span>
  29.  
  30.             <span class="post-date date">
  31.                 <?php printf(
  32.                     esc_html__('%s ago','videotube-child'),
  33.                     human_time_diff( get_the_time('U'),
  34.                     current_time('timestamp') )
  35.                 );?>
  36.             </span>
  37.         </div><?php
  38.     }
  39.     add_action( 'mars_video_meta', 'videotube_child_add_custom_video_meta' );
  40. }
Add Comment
Please, Sign In to add comment