PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/traits/theme.php +4 -11 5.3.1 → 6.3.0 View file →
@@ -71,22 +71,15 @@
71 71 * @return bool Returns true if the given theme file path is the active theme, false otherwise.
72 72 */
73 73 public function is_active_theme( $file_path ): bool {
74 74 $active_theme = $this->get_theme();
75 - if ( ! is_object( $active_theme ) ) {
76 - return false;
77 - }
78 - $theme_dir = $this->get_path_of_themes_dir();
79 - $abs_path = $theme_dir;
80 - $abs_path = defender_replace_line( $abs_path );
75 + $theme_dir = $this->get_path_of_themes_dir();
76 + $abs_path = $theme_dir;
77 + $abs_path = defender_replace_line( $abs_path );
81 78 // Without the first slash.
82 79 $rev_file = str_replace( $abs_path, '', $file_path );
83 80 $theme_data = explode( '/', $rev_file );
84 - if ( ! empty( $theme_data ) ) {
85 - $theme_slug = $theme_data[0];
86 - } else {
87 - return false;
88 - }
81 + $theme_slug = $theme_data[0];
89 82 // Checking if the given theme is a child theme.
90 83 if ( false !== stripos( $theme_slug, '-child' ) ) {
91 84 $theme_slug = str_replace( '-child', '', $theme_slug );
92 85 }