mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Remove notices
This commit is contained in:
+21
-17
@@ -416,33 +416,37 @@ class UM_Shortcodes {
|
||||
$paths[] = glob(get_stylesheet_directory() . '/ultimate-member/templates/' . '*.php');
|
||||
}
|
||||
|
||||
foreach ($paths as $k => $files) {
|
||||
if( isset( $paths ) && ! empty( $paths ) ){
|
||||
|
||||
foreach ($paths as $k => $files) {
|
||||
|
||||
foreach ($files as $file) {
|
||||
foreach ($files as $file) {
|
||||
|
||||
$clean_filename = $this->get_template_name($file);
|
||||
$clean_filename = $this->get_template_name($file);
|
||||
|
||||
if (0 === strpos($clean_filename, $excluded)) {
|
||||
if (0 === strpos($clean_filename, $excluded)) {
|
||||
|
||||
$source = file_get_contents($file);
|
||||
$tokens = token_get_all($source);
|
||||
$comment = array(
|
||||
T_COMMENT, // All comments since PHP5
|
||||
T_DOC_COMMENT, // PHPDoc comments
|
||||
);
|
||||
foreach ($tokens as $token) {
|
||||
if (in_array($token[0], $comment) && strstr($token[1], '/* Template:') && $clean_filename != $excluded) {
|
||||
$txt = $token[1];
|
||||
$txt = str_replace('/* Template: ', '', $txt);
|
||||
$txt = str_replace(' */', '', $txt);
|
||||
$array[$clean_filename] = $txt;
|
||||
$source = file_get_contents($file);
|
||||
$tokens = token_get_all($source);
|
||||
$comment = array(
|
||||
T_COMMENT, // All comments since PHP5
|
||||
T_DOC_COMMENT, // PHPDoc comments
|
||||
);
|
||||
foreach ($tokens as $token) {
|
||||
if (in_array($token[0], $comment) && strstr($token[1], '/* Template:') && $clean_filename != $excluded) {
|
||||
$txt = $token[1];
|
||||
$txt = str_replace('/* Template: ', '', $txt);
|
||||
$txt = str_replace(' */', '', $txt);
|
||||
$array[$clean_filename] = $txt;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $array;
|
||||
|
||||
Reference in New Issue
Block a user