Skip to content

Commit

Permalink
Merge branch 'trunk' into rtiodev/tweaks-custom-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
rtio committed Nov 19, 2024
2 parents 23632d0 + a27b3d7 commit 2fd20b7
Show file tree
Hide file tree
Showing 26 changed files with 272 additions and 94 deletions.
69 changes: 58 additions & 11 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,72 @@
<?xml version="1.0"?>
<ruleset name="t3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<config name="minimum_supported_wp_version" value="6.3" />
<config name="testVersion" value="7.0-"/>

<rule ref="WordPress-Extra" />

<rule ref="Jetpack">
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="MediaWiki.Usage.ForbiddenFunctions.isset" />
<exclude name="Squiz.Commenting.FileComment.WrongStyle" />
</rule>

<rule ref="Jetpack-Compat-81" />

<!-- What NOT to scan. -->
<exclude-pattern>*/bin/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/*.asset.php</exclude-pattern> <!-- This file is generated by the Gutenberg build process. -->
<exclude-pattern>*/dependencies/*</exclude-pattern> <!-- This folder is generated by the PHP scoping process. -->

<!-- How to scan. -->
<arg value="sp"/> <!-- Show sniff and progress. -->
<arg name="colors"/> <!-- Show results with colors. Disable if working on Windows. -->
<arg name="parallel" value="8"/> <!-- Enables parallel processing when available for faster results. -->
<arg name="extensions" value="php"/> <!-- Only scan PHP files. -->

<!-- Run against the PHPCompatibilityWP ruleset and check for cross-version support for PHP 8.1 and higher. -->
<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="8.1-"/>

<!-- Run against the WordPress-Extra ruleset and check for the minimum supported WP version. -->
<rule ref="WordPress-Extra">
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound" />
</rule>
<config name="minimum_wp_version" value="6.1"/>

<rule ref="Jetpack-Compat-82" />
<!-- Disallow blank lines at start/end of for/foreach/if blocks. -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>

<!-- Ensure documentation blocks follow basic formatting like containing a short description and not mixing tag groups. -->
<rule ref="Generic.Commenting.DocComment">
<!-- Ignore indentation as it conflicts with our attempts to align across multiple tag blocks. -->
<exclude name="Generic.Commenting.DocComment.TagValueIndent" />
<!-- Ignore @param tags not being first since normally start with @since and @version tags. -->
<exclude name="Generic.Commenting.DocComment.ParamNotFirst" />
</rule>

<!-- Remove isset with multiple values rule -->
<rule ref="MediaWiki.Usage.ForbiddenFunctions.isset">
<exclude />
<!-- Check that function comments exist and that they contain @param, @return and @throws tags. -->
<rule ref="Squiz.Commenting.FunctionComment">
<properties>
<!-- Ignore missing tags if @inheritDoc is present. -->
<property name="skipIfInheritdoc" value="true" />
</properties>
<!-- Ignore missing type hints since we sometimes want to ignore them on hooks. -->
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/>
</rule>

<!-- Exclude node modules and vendor folders -->
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<!-- Check that class comments exists. -->
<rule ref="Squiz.Commenting.ClassComment">
<!-- Ignore the presence of tags such as @version and @since. -->
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed" />
</rule>

<!-- Check that the proper text domain(s) is used everywhere. -->
<rule ref="WordPress.WP.I18n">
Expand Down
2 changes: 1 addition & 1 deletion assets/js/build/editor.js

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

2 changes: 1 addition & 1 deletion assets/js/build/theme-install.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '3145422ea2aa5e4a5ad2');
<?php return array('dependencies' => array(), 'version' => 'ef159c714f95891e50d5');
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.

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

const handleClick = function () {
window.location = T3_Install.browseUrl;
window.location = t3Install.browseUrl;
};

if ( filterLinks[ 0 ] && filterLinks[ 0 ].tagName.toLowerCase() === 'ul' ) {
const list = filterLinks[ 0 ];
const listItem = document.createElement( 'li' );
const link = document.createElement( 'button' );
const img = document.createElement( 'img' );
listItem.setAttribute( 'class', 'tumblr-theme-garden-list-item' );
link.setAttribute( 'title', T3_Install.buttonText );
link.setAttribute( 'title', t3Install.buttonText );
link.addEventListener( 'click', handleClick );
link.setAttribute( 'class', 'tumblr-theme-garden-link' );
listItem.appendChild( link );
Expand Down
Loading

0 comments on commit 2fd20b7

Please sign in to comment.