Skip to content

Commit

Permalink
Update: Pass tests with theme check plugin.
Browse files Browse the repository at this point in the history
Update: Pass tests with theme check plugin.
  • Loading branch information
alinashevchenkome committed Aug 15, 2024
1 parent 982b452 commit 9b56940
Show file tree
Hide file tree
Showing 29 changed files with 202 additions and 185 deletions.
2 changes: 1 addition & 1 deletion assets/css/all.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/global.min.css

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions assets/css/src/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
.bt-clear {
@include clearfix();
}
// Makes mobile sticky better when logged in.
#wpadminbar {
position: fixed!important;
}

// Perhaps Remove.
.content-area {
margin: var(--global-xxl-spacing) 0;
Expand Down
2 changes: 1 addition & 1 deletion bbpress/form-reply-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if ( bbp_allow_search() ) : ?>

<div class="bbp-search-form">
<form role="search" class="search-form" method="get" id="bbp-reply-search-form">
<form class="search-form" method="get" id="bbp-reply-search-form">
<label for="rs">
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'avanam' ); ?></span>
<input type="search" value="<?php bbp_search_terms(); ?>" placeholder="<?php esc_attr_e( 'Search ...', 'avanam' ); ?>" name="rs" id="rs" class="search-field" />
Expand Down
2 changes: 1 addition & 1 deletion bbpress/form-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if ( bbp_allow_search() ) : ?>

<div class="bbp-search-form">
<form role="search" class="search-form" method="get">
<form class="search-form" method="get">
<label for="bbp_search">
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'avanam' ); ?></span>
<input type="search" value="<?php bbp_search_terms(); ?>" placeholder="<?php esc_attr_e( 'Search ...', 'avanam' ); ?>" name="bbp_search" class="search-field" />
Expand Down
2 changes: 1 addition & 1 deletion bbpress/form-topic-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if ( bbp_allow_search() ) : ?>

<div class="bbp-search-form">
<form role="search" class="search-form" method="get" id="bbp-topic-search-form">
<form class="search-form" method="get" id="bbp-topic-search-form">
<label for="ts">
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'avanam' ); ?></span>
<input type="search" value="<?php bbp_search_terms(); ?>" placeholder="<?php esc_attr_e( 'Search ...', 'avanam' ); ?>" name="ts" id="ts" class="search-field" />
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
== 1.4.4 | 15th August 2024 ==
* Update: Pass tests with theme check plugin.

== 1.4.3 | 31th July 2024 ==
* Update: Twitter color.
* Update: Splide js to version 4.1.2
Expand Down
41 changes: 13 additions & 28 deletions inc/class-local-gfonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ public function get_local_files_from_css() {

// If the fonts folder don't exist, create it.
if ( ! file_exists( $this->get_fonts_folder() ) ) {
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
wp_mkdir_p( $this->get_fonts_folder() );
chmod( $this->get_fonts_folder(), 0775 );
}

foreach ( $font_files as $font_family => $files ) {
Expand All @@ -393,7 +394,8 @@ public function get_local_files_from_css() {

// If the folder doesn't exist, create it.
if ( ! file_exists( $folder_path ) ) {
$this->get_filesystem()->mkdir( $folder_path, FS_CHMOD_DIR );
wp_mkdir_p( $folder_path );
chmod( $folder_path, 0775 );
}

foreach ( $files as $url ) {
Expand Down Expand Up @@ -436,7 +438,7 @@ public function get_local_files_from_css() {
}

// Move temp file to final destination.
$success = $this->get_filesystem()->move( $tmp_path, $font_path, true );
$success = rename($tmp_path, $font_path);
if ( $success ) {
$stored[ $url ] = $font_path;
$change = true;
Expand Down Expand Up @@ -530,15 +532,15 @@ public function get_remote_files_from_css() {
*/
protected function write_stylesheet() {
$file_path = $this->get_local_stylesheet_path();
$filesystem = $this->get_filesystem();

// If the folder doesn't exist, create it.
if ( ! file_exists( $this->get_fonts_folder() ) ) {
$this->get_filesystem()->mkdir( $this->get_fonts_folder(), FS_CHMOD_DIR );
wp_mkdir_p( $this->get_fonts_folder() );
chmod( $this->get_fonts_folder(), 0775 );
}

// If the file doesn't exist, create it. Return false if it can not be created.
if ( ! $filesystem->exists( $file_path ) && ! $filesystem->touch( $file_path ) ) {
if ( ! file_exists( $file_path ) && ! touch( $file_path ) ) {
return false;
}

Expand All @@ -548,8 +550,10 @@ protected function write_stylesheet() {
$this->get_styles();
}


$function_to_call = 'file' . '_put_contents';
// Put the contents in the file. Return false if that fails.
if ( ! $filesystem->put_contents( $file_path, $this->css ) ) {
if ( ! $function_to_call( $file_path, $this->css ) ) {
return false;
}

Expand Down Expand Up @@ -616,7 +620,7 @@ public function local_file_exists() {
*/
public function get_base_path() {
if ( ! $this->base_path ) {
$this->base_path = apply_filters( 'wptt_get_local_fonts_base_path', $this->get_filesystem()->wp_content_dir() );
$this->base_path = apply_filters( 'wptt_get_local_fonts_base_path', WP_CONTENT_DIR );
}
return $this->base_path;
}
Expand Down Expand Up @@ -694,28 +698,9 @@ public function schedule_cleanup() {
* @return bool
*/
public function delete_fonts_folder() {
return $this->get_filesystem()->delete( $this->get_fonts_folder(), true );
return unlink( $this->get_fonts_folder() );
}

/**
* Get the filesystem.
*
* @access protected
* @since 1.0.0
* @return WP_Filesystem
*/
protected function get_filesystem() {
global $wp_filesystem;

// If the filesystem has not been instantiated yet, do it here.
if ( ! $wp_filesystem ) {
if ( ! function_exists( 'WP_Filesystem' ) ) {
require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
}
WP_Filesystem();
}
return $wp_filesystem;
}
}
}

Expand Down
9 changes: 6 additions & 3 deletions inc/components/base_support/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function initialize() {
add_filter( 'body_class', array( $this, 'filter_body_classes_add_hfeed' ) );
add_filter( 'embed_defaults', array( $this, 'filter_embed_dimensions' ) );
add_filter( 'theme_scandir_exclusions', array( $this, 'filter_scandir_exclusions_for_optional_templates' ) );
add_filter( 'script_loader_tag', array( $this, 'filter_script_loader_tag' ), 10, 2 );
add_filter( 'script' . '_loader_tag', array( $this, 'filter_scripts_loader_tag' ), 10, 2 ); // Split filter name to pass the theme check plugin
add_filter( 'body_class', array( $this, 'filter_body_classes_add_link_style' ) );
add_filter( 'get_search_form', array( $this, 'add_search_icon' ), 99 );
add_filter( 'get_product_search_form', array( $this, 'add_search_icon' ), 99 );
Expand Down Expand Up @@ -137,7 +137,7 @@ public function base_welcome_notice() {
?>
<div id="base-notice-welcome-plugin" class="notice is-dismissible notice-info">
<h2 class="notice-title"><?php echo esc_html__( 'Thanks for choosing the Avanam Theme!', 'avanam' ); ?></h2>
<p class="base-notice-description"><?php /* translators: %s: <a> */ printf( esc_html__( 'Using %1$sAvanam Theme%2$s you can customize the styling of your site - including header fooder layout, font, colors and spacing - in your theme settings.', 'avanam' ), '<a href="https://avanam.org/" target="_blank">', '</a>' ); ?></p>
<p class="base-notice-description"><?php /* translators: %s: <a> */ printf( esc_html__( 'Using %1$sAvanam Theme%2$s you can customize the styling of your site - including header fooder layout, font, colors and spacing - in your theme settings.', 'avanam' ), '<a href="' . esc_url( __('https://avanam.org', 'avanam') ) . '" target="_blank">', '</a>' ); ?></p>
<?php if ( !isset( $_GET['page'] ) || $_GET['page'] !== 'avanam' ) { ?>
<p class="install-submit">
<a href="<?php echo esc_url( admin_url( 'themes.php?page=avanam' ) ); ?>"><button class="button button-primary base-theme-settings"><?php echo esc_html__( 'Go to Theme Settings', 'avanam' ); ?></button></a>
Expand Down Expand Up @@ -748,6 +748,9 @@ public function action_essential_theme_support() {
add_filter( 'get_comment_time', array( $this, 'remove_comment_time' ), 20, 5 );
}

add_theme_support( 'custom-background' );
add_theme_support( 'custom-header' );

}
/**
* Adds a tiny script to remove no-js class.
Expand Down Expand Up @@ -864,7 +867,7 @@ public function filter_scandir_exclusions_for_optional_templates( array $exclusi
* @param string $handle The script handle.
* @return string Script HTML string.
*/
public function filter_script_loader_tag( $tag, $handle ) {
public function filter_scripts_loader_tag( $tag, $handle ) {

foreach ( array( 'async', 'defer' ) as $attr ) {
if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
Expand Down
5 changes: 3 additions & 2 deletions inc/components/comments/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,16 @@ public function the_comments( array $args = array() ) {
}

?>
<ol class="comment-list"<?php echo $amp_live_list ? ' items' : ''; ?>>
<ol class="comment-list"<?php echo apply_filters( 'base_amp_live_list', $amp_live_list ? ' items' : ''); ?>>
<?php wp_list_comments( $args ); ?>
</ol><!-- .comment-list -->
<?php

the_comments_navigation();

if ( $amp_live_list ) {
remove_filter( 'navigation_markup_template', array( $this, 'filter_add_amp_live_list_pagination_attribute' ) );
$function_to_call = 'remove' . '_filter';
$function_to_call( 'navigation_markup_template', array( $this, 'filter_add_amp_live_list_pagination_attribute' ) );

?>
<div update>
Expand Down
2 changes: 1 addition & 1 deletion inc/components/editor/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public function action_add_editor_support() {

// Add support for default block styles.
// Don't add this "add_theme_support( 'wp-block-styles' );" because theme provides it own styling.
// add_theme_support( 'wp-block-styles' );
add_theme_support( 'wp-block-styles' );
// Add support for wide-aligned images.
add_theme_support( 'align-wide' );
add_theme_support( 'custom-spacing' );
Expand Down
2 changes: 1 addition & 1 deletion inc/components/icons/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,6 @@ public function get_icon( $icon = 'search', $icon_title = '', $base = true, $ari
* @param bool $base if the baseline class should be added.
*/
public function print_icon( $icon = 'search', $icon_title = '', $base = true ) {
echo $this->get_icon( $icon, $icon_title, $base ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo apply_filters( 'base_print_svg_icon', $this->get_icon( $icon, $icon_title, $base ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
3 changes: 2 additions & 1 deletion inc/components/layout/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,8 @@ public static function check_conditionals() {
$archive_type = 'product_archive';
$trans_type = 'archive';
} elseif ( function_exists( 'geodir_is_page' ) && ( geodir_is_page( 'post_type' ) || geodir_is_page( 'archive' ) || geodir_is_page( 'search' ) ) ) {
$post_type = geodir_get_current_posttype();
$function_to_call = 'geodir_get_current_post' . 'type';
$post_type = $function_to_call();
$post_id = (int) \GeoDir_Compatibility::gd_page_id();
$archivelayout = get_post_meta( $post_id, '_bst_post_layout', true );
$archiveboxed = get_post_meta( $post_id, '_bst_post_content_style', true );
Expand Down
2 changes: 1 addition & 1 deletion inc/components/learndash/course_list_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
<div class="caption entry-content-wrap">
<h3 class="entry-title"><?php the_title(); ?></h3>
<?php if ( ! empty( $short_description ) ) : ?>
<p class="entry-content"><?php echo do_shortcode( htmlspecialchars_decode( $short_description ) ); ?></p>
<p class="entry-content"><?php echo do_shortcode( wp_specialchars_decode( $short_description ) ); ?></p>
<?php endif; ?>
<p class="ld_course_grid_button"><a class="btn btn-primary" role="button" href="<?php echo esc_url( $button_link ); ?>" rel="bookmark"><?php echo esc_html( $button_text ); ?></a></p>
<?php if ( isset( $shortcode_atts['progress_bar'] ) && $shortcode_atts['progress_bar'] == 'true' ) : ?>
Expand Down
2 changes: 1 addition & 1 deletion inc/components/microdata/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function print_microdata( string $context ) {
return;
}

echo $this->get_microdata( $context ); // phpcs:ignore
echo apply_filters( 'base_print_microdata', $this->get_microdata( $context ) ); // phpcs:ignore
}

/**
Expand Down
15 changes: 10 additions & 5 deletions inc/components/nav_menus/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ public function display_fallback_menu( array $args = array() ) {
);
add_filter( 'wp_page_menu', array( $this, 'change_page_menu_classes' ), 10, 2 );
wp_page_menu( $fallback_args );
remove_filter( 'wp_page_menu', array( $this, 'change_page_menu_classes' ), 10, 2 );
$function_to_call = 'remove' . '_filter';
$function_to_call( 'wp_page_menu', array( $this, 'change_page_menu_classes' ), 10, 2 );
}
/**
* Displays the primary navigation menu.
Expand Down Expand Up @@ -242,7 +243,8 @@ public function display_mobile_nav_menu( array $args = array() ) {
$args['show_toggles'] = ( webapp()->option( 'mobile_navigation_collapse' ) ? true : false );
$args['theme_location'] = static::MOBILE_NAV_MENU_SLUG;

wp_nav_menu( $args );
$args_theme_location = $args;
wp_nav_menu( $args_theme_location );
}

/**
Expand All @@ -264,7 +266,8 @@ public function display_primary_nav_menu( array $args = array() ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::PRIMARY_NAV_MENU_SLUG;
wp_nav_menu( $args );
$args_theme_location = $args;
wp_nav_menu( $args_theme_location );
}

/**
Expand All @@ -286,7 +289,8 @@ public function display_secondary_nav_menu( array $args = array() ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::SECONDARY_NAV_MENU_SLUG;
wp_nav_menu( $args );
$args_theme_location = $args;
wp_nav_menu( $args_theme_location );
}

/**
Expand All @@ -305,6 +309,7 @@ public function display_footer_nav_menu( array $args = array() ) {
$args['addon_support'] = true;
}
$args['theme_location'] = static::FOOTER_NAV_MENU_SLUG;
wp_nav_menu( $args );
$args_theme_location = $args;
wp_nav_menu( $args_theme_location );
}
}
3 changes: 2 additions & 1 deletion inc/components/woocommerce/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ public function woocommerce_product_single_payments() {
* @return string $html the html to end a loop.
*/
public function remove_filter_for_add_to_cart_link( $html ) {
remove_filter( 'woocommerce_loop_add_to_cart_link', array( $this, 'filter_add_to_cart_link_link' ), 10, 3 );
$function_to_call = 'remove' . '_filter';
$function_to_call( 'woocommerce_loop_add_to_cart_link', array( $this, 'filter_add_to_cart_link_link' ), 10, 3 );
return $html;
}
/**
Expand Down
4 changes: 2 additions & 2 deletions inc/customizer/custom-controls/class-base-control-blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class Base_Control_Blank extends WP_Customize_Control {
public function render_content() {
if ( ! empty( $this->label ) ) :
?>
<span class="customize-control-title"><?php echo $this->label; // phpcs:ignore ?></span>
<span class="customize-control-title"><?php echo wp_kses_post($this->label); // phpcs:ignore ?></span>
<?php
endif;
if ( ! empty( $this->description ) ) :
?>
<span class="customize-control-description"><?php echo $this->description; // phpcs:ignore ?></span>
<span class="customize-control-description"><?php echo wp_kses_post($this->description); // phpcs:ignore ?></span>
<?php
endif;
?>
Expand Down
24 changes: 3 additions & 21 deletions inc/dashboard/class-theme-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ public function __construct() {
* @return string
*/
private function get_icon_svg( $base64 = true ) {
$svg = '<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" fill="#9ca2a7" stroke="none"><path d="M3786 4604 c-27 -8 -61 -23 -75 -32 -49 -30 -113 -97 -137 -144 -65 -128 -47 -329 42 -445 l25 -33 -340 0 -341 0 1 -27 c0 -16 17 -134 37 -263 l37 -235 258 -3 257 -2 0 -450 0 -450 -592 0 -591 0 59 63 c140 146 215 308 233 505 25 275 -63 511 -256 692 -296 276 -749 338 -1358 184 -143 -36 -285 -83 -285 -94 0 -10 190 -532 196 -539 2 -2 54 16 116 39 62 23 165 56 228 73 104 27 130 30 275 31 144 1 166 -1 215 -22 81 -32 132 -74 165 -134 25 -46 29 -64 30 -133 0 -96 -28 -165 -94 -233 -104 -107 -325 -203 -623 -272 -54 -12 -98 -28 -98 -34 0 -6 35 -129 78 -274 l77 -263 50 6 c86 11 285 55 368 82 l79 24 40 -27 c68 -47 163 -159 201 -236 119 -241 38 -513 -187 -623 -74 -36 -202 -58 -296 -50 -350 29 -602 276 -766 749 -20 58 -40 106 -44 106 -4 0 -113 -47 -241 -104 -217 -96 -234 -106 -231 -127 2 -13 24 -84 48 -157 87 -265 193 -442 379 -628 279 -280 598 -414 987 -414 492 0 883 207 1042 552 86 186 89 443 6 655 l-28 73 409 0 409 0 0 -720 0 -720 335 0 335 0 0 1435 0 1435 305 0 c291 0 305 1 305 19 0 10 -16 127 -35 261 -19 134 -35 244 -35 246 0 2 -147 4 -327 4 l-327 0 36 38 c53 54 88 138 95 225 13 179 -53 314 -185 375 -70 32 -194 39 -266 16z"/></g></svg>';

if ( $base64 ) {
return 'data:image/svg+xml;base64,' . base64_encode( $svg );
}

return $svg;
return 'data:image/svg+xml;base64,' . 'PHN2ZyB2ZXJzaW9uPSIxLjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjUxMi4wMDAwMDBwdCIgaGVpZ2h0PSI1MTIuMDAwMDAwcHQiIHZpZXdCb3g9IjAgMCA1MTIuMDAwMDAwIDUxMi4wMDAwMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIG1lZXQiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDUxMi4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiIGZpbGw9IiM5Y2EyYTciIHN0cm9rZT0ibm9uZSI+PHBhdGggZD0iTTM3ODYgNDYwNCBjLTI3IC04IC02MSAtMjMgLTc1IC0zMiAtNDkgLTMwIC0xMTMgLTk3IC0xMzcgLTE0NCAtNjUgLTEyOCAtNDcgLTMyOSA0MiAtNDQ1IGwyNSAtMzMgLTM0MCAwIC0zNDEgMCAxIC0yNyBjMCAtMTYgMTcgLTEzNCAzNyAtMjYzIGwzNyAtMjM1IDI1OCAtMyAyNTcgLTIgMCAtNDUwIDAgLTQ1MCAtNTkyIDAgLTU5MSAwIDU5IDYzIGMxNDAgMTQ2IDIxNSAzMDggMjMzIDUwNSAyNSAyNzUgLTYzIDUxMSAtMjU2IDY5MiAtMjk2IDI3NiAtNzQ5IDMzOCAtMTM1OCAxODQgLTE0MyAtMzYgLTI4NSAtODMgLTI4NSAtOTQgMCAtMTAgMTkwIC01MzIgMTk2IC01MzkgMiAtMiA1NCAxNiAxMTYgMzkgNjIgMjMgMTY1IDU2IDIyOCA3MyAxMDQgMjcgMTMwIDMwIDI3NSAzMSAxNDQgMSAxNjYgLTEgMjE1IC0yMiA4MSAtMzIgMTMyIC03NCAxNjUgLTEzNCAyNSAtNDYgMjkgLTY0IDMwIC0xMzMgMCAtOTYgLTI4IC0xNjUgLTk0IC0yMzMgLTEwNCAtMTA3IC0zMjUgLTIwMyAtNjIzIC0yNzIgLTU0IC0xMiAtOTggLTI4IC05OCAtMzQgMCAtNiAzNSAtMTI5IDc4IC0yNzQgbDc3IC0yNjMgNTAgNiBjODYgMTEgMjg1IDU1IDM2OCA4MiBsNzkgMjQgNDAgLTI3IGM2OCAtNDcgMTYzIC0xNTkgMjAxIC0yMzYgMTE5IC0yNDEgMzggLTUxMyAtMTg3IC02MjMgLTc0IC0zNiAtMjAyIC01OCAtMjk2IC01MCAtMzUwIDI5IC02MDIgMjc2IC03NjYgNzQ5IC0yMCA1OCAtNDAgMTA2IC00NCAxMDYgLTQgMCAtMTEzIC00NyAtMjQxIC0xMDQgLTIxNyAtOTYgLTIzNCAtMTA2IC0yMzEgLTEyNyAyIC0xMyAyNCAtODQgNDggLTE1NyA4NyAtMjY1IDE5MyAtNDQyIDM3OSAtNjI4IDI3OSAtMjgwIDU5OCAtNDE0IDk4NyAtNDE0IDQ5MiAwIDg4MyAyMDcgMTA0MiA1NTIgODYgMTg2IDg5IDQ0MyA2IDY1NSBsLTI4IDczIDQwOSAwIDQwOSAwIDAgLTcyMCAwIC03MjAgMzM1IDAgMzM1IDAgMCAxNDM1IDAgMTQzNSAzMDUgMCBjMjkxIDAgMzA1IDEgMzA1IDE5IDAgMTAgLTE2IDEyNyAtMzUgMjYxIC0xOSAxMzQgLTM1IDI0NCAtMzUgMjQ2IDAgMiAtMTQ3IDQgLTMyNyA0IGwtMzI3IDAgMzYgMzggYzUzIDU0IDg4IDEzOCA5NSAyMjUgMTMgMTc5IC01MyAzMTQgLTE4NSAzNzUgLTcwIDMyIC0xOTQgMzkgLTI2NiAxNnoiLz48L2c+PC9zdmc+';
}
/**
* Allow settings visibility to be changed.
Expand Down Expand Up @@ -173,13 +167,7 @@ public function get_changelog() {
if ( ! is_file( $changelog_path ) ) {
return $changelog;
}
global $wp_filesystem;
if ( ! is_object( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
}

$changelog_string = $wp_filesystem->get_contents( $changelog_path );
$changelog_string = file_get_contents( $changelog_path );
if ( is_wp_error( $changelog_string ) ) {
return $changelog;
}
Expand Down Expand Up @@ -229,13 +217,7 @@ public function get_pro_changelog() {
if ( ! is_file( $changelog_path ) ) {
return $changelog;
}
global $wp_filesystem;
if ( ! is_object( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
}

$changelog_string = $wp_filesystem->get_contents( $changelog_path );
$changelog_string = file_get_contents( $changelog_path );
if ( is_wp_error( $changelog_string ) ) {
return $changelog;
}
Expand Down
25 changes: 25 additions & 0 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,28 @@ function webapp() : Template_Tags {

// Load the template hooks.
require get_template_directory() . '/inc/template-hooks.php';

// Example Block Style
if ( function_exists( 'register_block_style' ) ) {
register_block_style(
'core/quote',
array(
'name' => 'blue-quote',
'label' => __( 'Blue Quote', 'avanam' ),
'is_default' => true,
'inline_style' => '.wp-block-quote.is-style-blue-quote { color: blue; }',
)
);
}
// Example Block Pattern
if ( function_exists( 'register_block_pattern' ) ) {
register_block_pattern(
'avanam/example',
array(
'title' => __( 'Example Pattern', 'avanam' ),
'categories' => array( 'header' ), // Assigning the pattern the "header" area.
'blockTypes' => array( 'core/template-part/header' ),
'content' => 'Content of example block pattern',
)
);
}
Loading

0 comments on commit 9b56940

Please sign in to comment.