| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | if ( ! defined( 'ABSPATH' ) ) { |
| 14: | exit; |
| 15: | } |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | function epl_property_new_excerpt_more( $more ) { |
| 28: | global $post; |
| 29: | if ( is_null( $post ) ) { |
| 30: | return $more; |
| 31: | } |
| 32: | return '...<a href="' . get_permalink( $post->ID ) . '" class="epl-more-link">' . __( 'Read More', 'easy-property-listings' ) . '→</a>'; |
| 33: | } |
| 34: | add_filter( 'excerpt_more', 'epl_property_new_excerpt_more' ); |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | function epl_get_youtube_id_from_url( $text ) { |
| 46: | $text = preg_replace( "/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user|shorts)\/))([^\?&\"'>]+)/", '$1', $text ); |
| 47: | $text = explode( '?', $text ); |
| 48: | return $text[0]; |
| 49: | } |
| 50: | |