Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change class name #95

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="ttgarden_"/>
<element value="clttg_"/>
<element value="CupcakeLabs\TumblrThemeGarden"/>
</property>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/build/theme-install.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions assets/js/src/theme-install.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* global ttgardenInstall */
/* global clttgInstall */
window.addEventListener(
'DOMContentLoaded',
function () {
const body = document.getElementById( 'wpbody-content' );
const filterLinks = body.getElementsByClassName( 'filter-links' );

const handleClick = function () {
window.location = ttgardenInstall.browseUrl;
window.location = clttgInstall.browseUrl;
};

if ( filterLinks[ 0 ] && filterLinks[ 0 ].tagName.toLowerCase() === 'ul' ) {
const list = filterLinks[ 0 ];
const listItem = document.createElement( 'li' );
const link = document.createElement( 'button' );
listItem.setAttribute( 'class', 'tumblr-theme-garden-list-item' );
link.setAttribute( 'title', ttgardenInstall.buttonText );
link.setAttribute( 'title', clttgInstall.buttonText );
link.addEventListener( 'click', handleClick );
link.setAttribute( 'class', 'tumblr-theme-garden-link' );
listItem.appendChild( link );
Expand Down
47 changes: 24 additions & 23 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@

defined( 'ABSPATH' ) || exit;

use CupcakeLabs\TumblrThemeGarden\Plugin;
use CupcakeLabs\TumblrThemeGarden\CLTTG_Plugin;

/**
* Returns the plugin's main class instance.
*
* @since 1.0.0
* @version 1.0.0
* @return CLTTG_Plugin
*@version 1.0.0
*
* @return Plugin
* @since 1.0.0
*/
function ttgarden_get_plugin_instance(): Plugin {
return Plugin::get_instance();
function clttg_get_plugin_instance(): CLTTG_Plugin
{
return CLTTG_Plugin::get_instance();
}

/**
Expand All @@ -29,8 +30,8 @@ function ttgarden_get_plugin_instance(): Plugin {
*
* @return string
*/
function ttgarden_get_plugin_slug(): string {
return sanitize_key( TTGARDEN_METADATA['TextDomain'] );
function clttg_get_plugin_slug(): string {
return sanitize_key( CLTTG_METADATA['TextDomain'] );
}

/**
Expand All @@ -46,8 +47,8 @@ function ttgarden_get_plugin_slug(): string {
*
* @return array|null
*/
function ttgarden_get_asset_meta( string $asset_path, ?array $extra_dependencies = null ): ?array {
if ( ! file_exists( $asset_path ) || ! str_starts_with( $asset_path, TTGARDEN_PATH ) ) {
function clttg_get_asset_meta( string $asset_path, ?array $extra_dependencies = null ): ?array {
if ( ! file_exists( $asset_path ) || ! str_starts_with( $asset_path, CLTTG_PATH ) ) {
return null;
}

Expand All @@ -61,7 +62,7 @@ function ttgarden_get_asset_meta( string $asset_path, ?array $extra_dependencies
'version' => filemtime( $asset_path ),
);
if ( false === $asset_meta['version'] ) { // Safeguard against filemtime() returning false.
$asset_meta['version'] = TTGARDEN_METADATA['Version'];
$asset_meta['version'] = CLTTG_METADATA['Version'];
}
}

Expand All @@ -82,7 +83,7 @@ function ttgarden_get_asset_meta( string $asset_path, ?array $extra_dependencies
*
* @return string The parsed content.
*/
function ttgarden_do_shortcode( $content ): string {
function clttg_do_shortcode( $content ): string {
global $shortcode_tags;
static $pattern = null;

Expand All @@ -106,9 +107,9 @@ function ttgarden_do_shortcode( $content ): string {
*
* @return array|null|string The current parse context.
*/
function ttgarden_get_parse_context() {
global $ttgarden_parse_context;
return $ttgarden_parse_context;
function clttg_get_parse_context() {
global $clttg_parse_context;
return $clttg_parse_context;
}

/**
Expand All @@ -119,9 +120,9 @@ function ttgarden_get_parse_context() {
*
* @return void
*/
function ttgarden_set_parse_context( $key, $value ): void {
global $ttgarden_parse_context;
$ttgarden_parse_context = array( $key => $value );
function clttg_set_parse_context( $key, $value ): void {
global $clttg_parse_context;
$clttg_parse_context = array( $key => $value );
}

/**
Expand All @@ -131,12 +132,12 @@ function ttgarden_set_parse_context( $key, $value ): void {
*
* @return string The normalized name.
*/
function ttgarden_normalize_option_name( $name ): string {
function clttg_normalize_option_name( $name ): string {
return strtolower(
str_replace(
array_merge(
array( ' ' ),
TTGARDEN_OPTIONS
CLTTG_OPTIONS
),
'',
$name
Expand All @@ -149,10 +150,10 @@ function ttgarden_normalize_option_name( $name ): string {
*
* @return string The Tumblr Theme Garden regex.
*/
function ttgarden_get_tumblr_regex(): string {
function clttg_get_tumblr_regex(): string {
return '/\{([a-zA-Z0-9][a-zA-Z0-9\\-\/=" ]*|font\:[a-zA-Z0-9 ]+|text\:[a-zA-Z0-9 ]+|select\:[a-zA-Z0-9 ]+|image\:[a-zA-Z0-9 ]+|color\:[a-zA-Z0-9 ]+|RGBcolor\:[a-zA-Z0-9 ]+|lang\:[a-zA-Z0-9- ]+|[\/]?block\:[a-zA-Z0-9]+( [a-zA-Z0-9=" ]+)*)\}/i';
}

// Include tag and block hydration functions for each Tumblr Theme tag|block.
require TTGARDEN_PATH . 'includes/block-functions.php';
require TTGARDEN_PATH . 'includes/tag-functions.php';
require CLTTG_PATH . 'includes/block-functions.php';
require CLTTG_PATH . 'includes/tag-functions.php';
Loading
Loading