$callback ) { if ( is_array( $callback ) && 'entry-thumbnail' === $callback[2] ) { unset( $callbacks[ $key ] ); break; } } } if ( in_array( $format, [ 'audio', 'video' ], true ) ) { array_push( $callbacks, [ [ $this, 'media_markup' ], $format, true ] ); } return $callbacks; } /** * Display HTML markup for the found media in current post. * * @since 1.0.1 * * @param arrray $callbacks Array of callback functions (may be with args). * @return string */ public function entry_featured_media( $callbacks ) { $format = get_post_format(); if ( in_array( $format, [ 'audio', 'video', 'gallery' ], true ) ) { // Add 'media_markup()' to array of callbacks with its args. array_push( $callbacks, [ [ $this, 'media_markup' ], $format, false ] ); } return $callbacks; } /** * Display HTML markup for the found media in current Display post. * * @since 1.0.1 * * @param arrray $callbacks Array of callback functions (may be with args). * @return string */ public function dp_featured_media( $callbacks ) { $format = get_post_format(); if ( in_array( $format, [ 'audio', 'video', 'gallery' ], true ) ) { // Add 'media_markup()' to array of callbacks with its args. array_push( $callbacks, [ [ $this, 'media_markup' ], $format, false, true ] ); } return $callbacks; } /** * Get the HTML markup for the found media in current post. * * @since 1.0.1 * * @param string $media_type audio | video | gallery. * @param bool $split_media Whether to split the media from the post content. * @param bool $wrapper Whether media to be wrapped in 'entry-featured-media'. * @return void */ public function media_markup( $media_type, $split_media, $wrapper = false ) { $media_obj = new Media_Grabber( $media_type, $split_media ); $media_arr = $media_obj->get_media(); $media = $media_arr[0]; if ( ( $wrapper || ! is_single() ) && $media ) { $toggle = sprintf( '', aamla_get_icon( array( 'icon' => 'close' ) ), esc_html__( 'Close Media Window', 'aamla' ) ); $title = the_title( sprintf( '
', false ); $media_post = sprintf( '