Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions brand-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
* @return void
*/
function brand_assets_autoloader( $class_name ) {
// Only handle Brand_Assets classes.
// Only handle Brand_Assets classes.
if ( strpos( $class_name, 'Brand_Assets' ) !== 0 ) {
return;
}

// Convert class name to file name.
$file_name = 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
$file_path = BRAND_ASSETS_PLUGIN_DIR . 'includes/' . $file_name;
// Convert class name to file name.
$file_name = 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
$file_path = BRAND_ASSETS_PLUGIN_DIR . 'includes/' . $file_name;

// Load the file if it exists.
// Load the file if it exists.
if ( file_exists( $file_path ) ) {
require_once $file_path;
}
Expand Down
4 changes: 2 additions & 2 deletions includes/class-brand-assets-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function add_popover_html() {
return;
}

// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in the printf.
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in the printf.
printf(
'<dialog popover="manual" id="brand_assets_logo_popover">
<h1>%s</h1>
Expand Down Expand Up @@ -226,7 +226,7 @@ private function get_default_css() {
$css_file = apply_filters( 'brand_assets_frontend_css_path', BRAND_ASSETS_PLUGIN_DIR . 'assets/frontend.css' );

if ( file_exists( $css_file ) ) {
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- This is a valid use of file_get_contents.
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- This is a valid use of file_get_contents.
$css_content = file_get_contents( $css_file );
return $css_content ? $css_content : '';
}
Expand Down
16 changes: 16 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Uninstall Brand Assets.
*
* Fired when the plugin is uninstalled.
*
* @package Brand_Assets
* @since 1.0.1
*/

// If uninstall not called from WordPress, then exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}

delete_option( 'brand_assets_options' );