Created
December 1, 2020 06:03
-
-
Save yousufansa/b6a8da37ad076a2ccd90ea71a5b6cb02 to your computer and use it in GitHub Desktop.
Vodi - Display IMDB ID on Single Movie Meta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists( 'vodi_template_single_movie_imdb_id' ) ) { | |
| /** | |
| * Movie imdb id in the movie single. | |
| */ | |
| function vodi_template_single_movie_imdb_id() { | |
| global $movie; | |
| if( is_movie() ) { | |
| $imdb_id = get_post_meta( $movie->get_ID(), '_imdb_id', true ); | |
| if( ! empty ( $imdb_id ) ) { | |
| ?> | |
| <span class="movie__meta--imdb-id"> | |
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="30px" height="15px" viewBox="0 0 300 150" xml:space="preserve"> | |
| <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="123.7358" y1="-22.5557" x2="176.3433" y2="173.7773"> | |
| <stop offset="0" style="stop-color:#F8E643"/> | |
| <stop offset="1" style="stop-color:#BFA233"/> | |
| </linearGradient> | |
| <path style="fill:url(#SVGID_1_);" d="M28.418,8.068C25.597,22.923,21.08,24.859,9.446,27.035v97.141 c11.638,1.525,18.743,7.344,18.978,18.977h243.229c0.879-10.988,8.635-17.451,18.978-18.977V27.035 c-11.628-0.885-18.088-6.693-18.978-18.967H28.418z"/> | |
| <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="126.8423" y1="162.1738" x2="173.2373" y2="-10.973"> | |
| <stop offset="0" style="stop-color:#F8E643"/> | |
| <stop offset="1" style="stop-color:#BFA233"/> | |
| </linearGradient> | |
| <path style="fill:url(#SVGID_2_);" d="M39.781,16.963c-2.55,12.908-6.652,14.589-17.202,16.468v84.33 c10.55,1.322,16.994,6.377,17.202,16.475h220.514c0.802-9.551,7.828-15.152,17.208-16.475v-84.33 c-10.556-0.755-16.406-5.804-17.208-16.468H39.781z"/> | |
| <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="127.9512" y1="-6.8291" x2="172.1249" y2="158.0325"> | |
| <stop offset="0" style="stop-color:#F8E643"/> | |
| <stop offset="1" style="stop-color:#BFA233"/> | |
| </linearGradient> | |
| <path style="fill:url(#SVGID_3_);" d="M42.545,20.549c-2.488,12.117-6.491,13.694-16.766,15.469v79.167 c10.275,1.24,16.563,5.98,16.766,15.471h214.991c0.775-8.963,7.62-14.23,16.76-15.471V36.019 c-10.274-0.713-15.984-5.465-16.76-15.469H42.545z"/> | |
| <path style="fill:#FFFFFF;" d="M235.598,115.99c-2.463,0-4.795-0.548-6.933-1.628c-1.522-0.771-2.952-1.815-4.274-3.119l-0.702,2.72 l-0.23,0.899h-0.931h-18.099h-1.199v-1.199V35.93v-1.199h1.199h19.39h1.199v1.199v15.604c1.146-0.983,2.369-1.782,3.653-2.382 c2.148-0.991,4.482-1.493,6.947-1.493c2.803,0,5.29,0.45,7.396,1.338c2.169,0.927,3.849,2.249,5,3.929 c1.125,1.655,1.815,3.308,2.053,4.917c0.217,1.537,0.325,4.688,0.325,9.377v28.674c0,4.836-0.322,8.353-0.991,10.753 c-0.683,2.534-2.319,4.758-4.857,6.6C242.026,115.07,239.018,115.99,235.598,115.99L235.598,115.99z M226.691,61.369 c-0.995,0-1.149,0.383-1.225,0.566c-0.136,0.329-0.449,1.589-0.449,6.177v27.377c0,4.239,0.322,5.632,0.516,6.086 c0.152,0.366,0.412,0.699,1.3,0.699c0.938,0,1.153-0.364,1.282-0.703c0.181-0.479,0.485-1.988,0.485-6.711V68.112 c0-4.068-0.34-5.486-0.544-5.969C227.863,61.679,227.555,61.369,226.691,61.369L226.691,61.369z M176.198,114.862h-25.431h-1.199 v-1.199V35.93v-1.199h1.199h15.083c9.938,0,16.5,0.452,20.062,1.38c3.658,0.959,6.494,2.569,8.435,4.784 c1.928,2.226,3.147,4.724,3.631,7.43c0.466,2.604,0.693,7.516,0.693,15.013v27.227c0,7.133-0.336,11.815-1.029,14.313 c-0.72,2.588-2.007,4.653-3.824,6.136c-1.77,1.438-3.966,2.459-6.531,3.033C184.78,114.596,181.153,114.862,176.198,114.862 L176.198,114.862z M172.161,50.408v48.76c1.641-0.125,2.736-0.512,3.071-1.107c0.25-0.449,0.839-2.229,0.839-8.952V58.848 c0-4.255-0.169-5.89-0.311-6.51c-0.151-0.681-0.454-1.132-0.951-1.424C174.53,50.747,173.842,50.491,172.161,50.408L172.161,50.408z M143.914,114.862h-1.199h-17.62h-1.199v-1.197l-0.05-34.689l-4.667,34.848l-0.14,1.039h-1.049h-12.606h-1.041l-0.148-1.029 l-4.988-34.855l-0.056,34.688l-0.002,1.197h-1.197H80.338h-1.199v-1.199V35.93v-1.199h1.199h26.134h1.037l0.15,1.026l0.82,5.615 c0.485,3.335,1.016,6.983,1.599,10.945l1.609,11.061l3.535-27.6l0.135-1.047h1.055h26.301h1.199v1.199v77.733V114.862 L143.914,114.862z M73.428,114.862h-1.199H52.028h-1.199v-1.199V35.93v-1.199h1.199h20.201h1.199v1.199v77.733V114.862 L73.428,114.862z"/> | |
| <rect x="52.028" y="35.93" width="20.2" height="77.732"/> | |
| <path d="M142.714,35.93v77.732h-17.619l-0.078-52.483l-7.027,52.483h-12.606l-7.349-51.353l-0.083,51.353H80.338V35.93h26.134 c0.692,4.721,1.489,10.243,2.42,16.562l2.873,19.737l4.648-36.299H142.714z"/> | |
| <path d="M170.962,49.182v51.228c2.878,0,4.653-0.584,5.314-1.76c0.655-1.172,0.994-4.352,0.994-9.541V58.848 c0-3.529-0.114-5.788-0.339-6.777c-0.224-1-0.724-1.728-1.515-2.191C174.632,49.411,173.148,49.182,170.962,49.182 M150.767,35.93 h15.084c9.738,0,16.328,0.448,19.758,1.343c3.436,0.9,6.049,2.374,7.834,4.414c1.785,2.056,2.904,4.33,3.352,6.85 c0.453,2.514,0.677,7.443,0.677,14.803v27.227c0,6.98-0.333,11.639-0.983,13.992c-0.656,2.352-1.796,4.193-3.431,5.527 c-1.629,1.326-3.638,2.254-6.032,2.789c-2.395,0.525-6.001,0.787-10.826,0.787h-25.432V35.93z"/> | |
| <path d="M229.799,68.112c0-3.284-0.213-5.423-0.635-6.433c-0.422-1.005-1.239-1.51-2.473-1.51c-1.202,0-1.983,0.443-2.337,1.312 c-0.359,0.879-0.536,3.092-0.536,6.631V95.49c0,3.414,0.203,5.596,0.609,6.553c0.4,0.963,1.207,1.432,2.404,1.432 c1.229,0,2.03-0.488,2.404-1.479c0.375-0.994,0.563-3.367,0.563-7.135V68.112z M223.818,35.93v18.503 c1.608-1.874,3.394-3.274,5.361-4.195c1.982-0.917,4.127-1.379,6.438-1.379c2.659,0,4.966,0.417,6.928,1.244 c1.957,0.838,3.451,2.004,4.477,3.503c1.025,1.504,1.645,2.978,1.857,4.414c0.203,1.437,0.313,4.502,0.313,9.202v28.674 c0,4.67-0.313,8.146-0.947,10.432c-0.619,2.289-2.098,4.273-4.408,5.949c-2.316,1.676-5.06,2.514-8.239,2.514 c-2.285,0-4.414-0.5-6.393-1.5c-1.982-1.004-3.794-2.504-5.423-4.496l-1.255,4.867H204.43V35.93H223.818z"/> | |
| <path d="M256.651,44.831h0.76c0.869,0,1.604-0.313,1.604-1.119c0-0.583-0.422-1.161-1.604-1.161c-0.344,0-0.572,0.026-0.76,0.057 V44.831z M256.651,48.479h-1.046V41.9c0.552-0.083,1.072-0.162,1.863-0.162c0.994,0,1.649,0.208,2.04,0.5 c0.396,0.287,0.604,0.734,0.604,1.364c0,0.87-0.572,1.39-1.28,1.598v0.052c0.572,0.109,0.969,0.629,1.099,1.603 c0.156,1.02,0.313,1.416,0.422,1.624h-1.099c-0.167-0.208-0.317-0.812-0.453-1.676c-0.156-0.843-0.572-1.155-1.416-1.155h-0.733 V48.479z M257.75,40.063c-2.593,0-4.716,2.228-4.716,4.981c0,2.811,2.123,5.012,4.747,5.012c2.623,0.026,4.721-2.202,4.721-4.986 c0-2.779-2.098-5.007-4.721-5.007H257.75z M257.781,39.142c3.227,0,5.798,2.623,5.798,5.902c0,3.331-2.571,5.929-5.829,5.929 c-3.223,0-5.846-2.598-5.846-5.929c0-3.279,2.623-5.902,5.846-5.902H257.781z"/> | |
| </svg> | |
| <span class="movie__meta--imdb-id__text"><?php echo esc_html( $imdb_id ); ?></span> | |
| </span> | |
| <?php | |
| } | |
| } | |
| } | |
| } | |
| add_action( 'masvideos_single_movie_meta', 'vodi_template_single_movie_imdb_id', 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment