| @@ -1,60 +1,60 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Notice Out of date template. | |
| 4 | - * | |
| 5 | - * @author ThimPress (nhamdv) | |
| 6 | - * @version 4.0.1 | |
| 7 | - */ | |
| 8 | - | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | - exit; | |
| 11 | -} | |
| 12 | - | |
| 13 | -$template_dir = get_template_directory(); | |
| 14 | -$stylesheet_dir = get_stylesheet_directory(); | |
| 15 | -$cradle = LP_Outdated_Template_Helper::detect_outdated_template(); | |
| 16 | -$theme = wp_get_theme(); | |
| 17 | -$theme_name = array(); | |
| 18 | - | |
| 19 | -if ( $template_dir === $stylesheet_dir ) { | |
| 20 | - $theme_name[] = $theme['Name']; | |
| 21 | -} else { | |
| 22 | - if ( $cradle['parent_item'] ) { | |
| 23 | - $theme_name[] = $parent = $theme->__get( 'parent_theme' ); | |
| 24 | - } | |
| 25 | - if ( $cradle['child_item'] ) { | |
| 26 | - $theme_name[] = $theme['Name']; | |
| 27 | - } | |
| 28 | -} | |
| 29 | -$theme_name = implode( ' & ', $theme_name ); | |
| 30 | - | |
| 31 | -$readmore = 'https://thimpress.com/knowledge-base/outdated-template-fix/'; | |
| 32 | -?> | |
| 33 | - | |
| 34 | -<div id="message" class="learn-press-notice notice-warning notice"> | |
| 35 | - <p><?php printf( wp_kses( __( 'There is a new update on LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files.', 'learnpress' ), array( 'strong' => array() ) ), $theme_name ); ?></p> | |
| 36 | - <p class="outdated-readmore-link"> | |
| 37 | - <?php | |
| 38 | - echo sprintf( | |
| 39 | - wp_kses( | |
| 40 | - __( 'This is not a bug, don\'t worry. Read more about the outdated template files notice <a href=\"%s\" target=\"_blank\">here</a>.', 'learnpress' ), | |
| 41 | - array( | |
| 42 | - 'a' => array( | |
| 43 | - 'href' => array(), | |
| 44 | - 'target' => array(), | |
| 45 | - ), | |
| 46 | - ) | |
| 47 | - ), | |
| 48 | - esc_url_raw( $readmore ) | |
| 49 | - ); | |
| 50 | - ?> | |
| 51 | - </p> | |
| 52 | - <p> | |
| 53 | - <a class="button" href="<?php echo admin_url( 'admin.php?page=learn-press-tools&tab=template' ); ?>"> | |
| 54 | - <?php esc_html_e( 'View the list of outdated templates', 'learnpress' ); ?> | |
| 55 | - </a> | |
| 56 | - <a href="" onclick="LP.dismissMessage(this, {expired: 3600}); return false;" data-name="outdated-template" data-value="yes" data-el="#message" data-instant="yes"> | |
| 57 | - <?php esc_html_e( 'Dismiss', 'learnpress' ); ?> | |
| 58 | - </a> | |
| 59 | - </p> | |
| 60 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Notice Out of date template. | |
| 4 | + * | |
| 5 | + * @author ThimPress (nhamdv) | |
| 6 | + * @version 4.0.1 | |
| 7 | + */ | |
| 8 | + | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit; | |
| 11 | +} | |
| 12 | + | |
| 13 | +$template_dir = get_template_directory(); | |
| 14 | +$stylesheet_dir = get_stylesheet_directory(); | |
| 15 | +$cradle = LP_Outdated_Template_Helper::detect_outdated_template(); | |
| 16 | +$theme = wp_get_theme(); | |
| 17 | +$theme_name = array(); | |
| 18 | + | |
| 19 | +if ( $template_dir === $stylesheet_dir ) { | |
| 20 | + $theme_name[] = $theme['Name']; | |
| 21 | +} else { | |
| 22 | + if ( $cradle['parent_item'] ) { | |
| 23 | + $theme_name[] = $parent = $theme->__get( 'parent_theme' ); | |
| 24 | + } | |
| 25 | + if ( $cradle['child_item'] ) { | |
| 26 | + $theme_name[] = $theme['Name']; | |
| 27 | + } | |
| 28 | +} | |
| 29 | +$theme_name = implode( ' & ', $theme_name ); | |
| 30 | + | |
| 31 | +$readmore = 'https://thimpress.com/knowledge-base/outdated-template-fix/'; | |
| 32 | +?> | |
| 33 | + | |
| 34 | +<div id="message" class="learn-press-notice notice-warning notice"> | |
| 35 | + <p><?php printf( wp_kses( __( 'There is a new update on LearnPress. You may need to update your theme <strong>(%s)</strong> to avoid outdated template files.', 'learnpress' ), array( 'strong' => array() ) ), $theme_name ); ?></p> | |
| 36 | + <p class="outdated-readmore-link"> | |
| 37 | + <?php | |
| 38 | + echo sprintf( | |
| 39 | + wp_kses( | |
| 40 | + __( 'This is not a bug, don\'t worry. Read more about the outdated template files notice <a href=\"%s\" target=\"_blank\">here</a>.', 'learnpress' ), | |
| 41 | + array( | |
| 42 | + 'a' => array( | |
| 43 | + 'href' => array(), | |
| 44 | + 'target' => array(), | |
| 45 | + ), | |
| 46 | + ) | |
| 47 | + ), | |
| 48 | + esc_url_raw( $readmore ) | |
| 49 | + ); | |
| 50 | + ?> | |
| 51 | + </p> | |
| 52 | + <p> | |
| 53 | + <a class="button" href="<?php echo admin_url( 'admin.php?page=learn-press-tools&tab=template' ); ?>"> | |
| 54 | + <?php esc_html_e( 'View the list of outdated templates', 'learnpress' ); ?> | |
| 55 | + </a> | |
| 56 | + <a href="" onclick="LP.dismissMessage(this, {expired: 3600}); return false;" data-name="outdated-template" data-value="yes" data-el="#message" data-instant="yes"> | |
| 57 | + <?php esc_html_e( 'Dismiss', 'learnpress' ); ?> | |
| 58 | + </a> | |
| 59 | + </p> | |
| 60 | +</div> | |