Skip to content

Commit

Permalink
Update: namespace used in class_exists() function
Browse files Browse the repository at this point in the history
  • Loading branch information
SH4LIN committed Dec 15, 2023
1 parent f664b1e commit 06d5ccc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions includes/classes/class-rtcamp-google-embeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
defined( 'ABSPATH' ) || exit;

/**
* Class RtCamp_Google_Embeds
* Class rtCamp_Google_Embeds
*
* @package rt-google-embeds
*/
class RtCamp_Google_Embeds {
class rtCamp_Google_Embeds {

/**
* The single instance of the class.
*
* @var RtCamp_Google_Embeds
* @var rtCamp_Google_Embeds
*/
protected static $instance = null;

/**
* RtCamp_Google_Embeds Plugin Instance.
* rtCamp_Google_Embeds Plugin Instance.
*
* @return RtCamp_Google_Embeds.
* @return rtCamp_Google_Embeds.
*/
public static function instance() {

Expand All @@ -42,7 +42,7 @@ public static function instance() {
}

/**
* RtCamp_Google_Embeds constructor.
* rtCamp_Google_Embeds constructor.
*/
public function __construct() {

Expand Down Expand Up @@ -204,8 +204,8 @@ public function render_embed( $type, $data ) {
ob_start();
$template = sprintf( 'templates/embeds/%s.php', $type );

if ( ! empty( $data ) ) {
extract( $data ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract -- Used as an exception as there is no better alternative.
if ( ! empty( $data ) && is_array( $data ) ) {
extract( $data, EXTR_OVERWRITE );
}

include RT_GOOGLE_EMBEDS_PLUGIN_DIR . $template; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable
Expand Down Expand Up @@ -388,4 +388,4 @@ public function get_thumb_preview( $request ) {
}

// Initialize the class.
RtCamp_Google_Embeds::instance();
rtCamp_Google_Embeds::instance();
2 changes: 1 addition & 1 deletion rt-google-embeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
define( 'RT_GOOGLE_EMBEDS_PLUGIN_DIR', plugin_dir_path( RT_GOOGLE_EMBEDS_PLUGIN_FILE ) );
}

if ( ! class_exists( 'RtCamp_Google_Embeds' ) ) {
if ( ! class_exists( 'RT_Google_Embeds\rtCamp_Google_Embeds' ) ) {
require_once RT_GOOGLE_EMBEDS_PLUGIN_DIR . '/includes/classes/class-rtcamp-google-embeds.php';
}

0 comments on commit 06d5ccc

Please sign in to comment.