Skip to content

Commit

Permalink
= 4.2.7.4 =
Browse files Browse the repository at this point in the history
  • Loading branch information
tungnxt89 committed Dec 2, 2024
1 parent 4099f36 commit a2f3f9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 73 deletions.
72 changes: 0 additions & 72 deletions inc/TemplateHooks/UserTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,78 +26,6 @@ class UserTemplate {
public function init() {
}

/**
* Get display name html of instructor.
*
* @param LP_User|UserModel $instructor
* @param string $class
*
* @return string
* @since 4.2.7.2
* @version 1.0.0
*/
public function html_display_name( $instructor, string $class = 'user' ): string {
$section = [
'wrapper' => sprintf( '<div class="%s-display-name">', $class ),
'display_name' => $instructor->get_display_name(),
'wrapper_end' => '</div>',
];

return Template::combine_components( $section );
}

/**
* Get html social of instructor.
*
* @param LP_User|UserModel $instructor
*
* @return string
*/
public function html_social( $instructor, string $class = 'user' ): string {
$content = '';

try {
$html_wrapper = [
'<div class="instructor-social">' => '</div>',
];
$socials = $instructor->get_profile_social( $instructor->get_id() );
ob_start();
foreach ( $socials as $k => $social ) {
echo $social;
}
$content = ob_get_clean();
$content = Template::instance()->nest_elements( $html_wrapper, $content );
} catch ( Throwable $e ) {
ob_end_clean();
error_log( __METHOD__ . ': ' . $e->getMessage() );
}

return $content;
}

/**
* Get html description of instructor.
*
* @param LP_User|UserModel $instructor
*
* @return string
*/
public function html_description( $instructor ): string {
$content = '';

try {
$html_wrapper = [
'<div class="instructor-description">' => '</div>',
];

$content = Template::instance()->nest_elements( $html_wrapper, $instructor->get_description() );
} catch ( Throwable $e ) {
error_log( __METHOD__ . ': ' . $e->getMessage() );
}

return $content;
}

/**
* Get html avatar of instructor.
*
Expand Down
4 changes: 3 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<exclude name="Universal.Arrays.DisallowShortArraySyntax" />
<exclude name="Universal.Operators.StrictComparisons.LooseNotEqual" />
<exclude name="Universal.Operators.StrictComparisons.LooseEqual" />
<exclude name="Generic.WhiteSpace.IncrementDecrementSpacing.SpaceAfterIncrement" />
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
Expand All @@ -32,8 +33,9 @@
<!-- When need check security query mysql use default of WordPress, need open -->
<exclude name="WordPress.DB.PreparedSQL.NotPrepared" />
<exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared" />
<exclude name="Generic.WhiteSpace.IncrementDecrementSpacing.SpaceAfterIncrement" />
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" />
<exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
</rule>
</ruleset>

0 comments on commit a2f3f9c

Please sign in to comment.