diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4bfe2f0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "phpcs.standard": "WordPress" +} \ No newline at end of file diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index a2c642d..93091f8 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -45,6 +45,10 @@ export default defineConfig({ text: 'Block Style Modifier', link: '/js-libraries/block-style-modifier' }, + { + text: 'Match Height Library', + link: '/js-libraries/match-height' + }, ] } ] diff --git a/docs/js-libraries/match-height.md b/docs/js-libraries/match-height.md new file mode 100644 index 0000000..dd60a64 --- /dev/null +++ b/docs/js-libraries/match-height.md @@ -0,0 +1,14 @@ +--- +outline: deep +--- + +# Match Height + +## Introduction +Match Height is a jQuery plugin that automatically matches the heights of elements. This is particularly useful for creating uniform card layouts, grid systems, or any scenario where you need multiple elements to have the same height regardless of their content. + +The library is automatically registered and available for both front-end and admin scripts, with jQuery as a dependency. + +## Usage +For complete usage documentation, options, examples, and advanced features, please refer to the official [jquery-match-height repository](https://github.com/liabru/jquery-match-height). + diff --git a/theme-template/includes/register-scripts.php b/theme-template/includes/register-scripts.php index ee5fd06..7ecf7ae 100644 --- a/theme-template/includes/register-scripts.php +++ b/theme-template/includes/register-scripts.php @@ -15,6 +15,8 @@ 'wp_enqueue_scripts', function () { $asset_enqueue = Asset_Enqueue::get_instance(); + + wp_register_script( 'match-height', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight-min.js', array( 'jquery' ), '0.7.2', true ); $asset_enqueue->register_vite_script( 'example_script', 'js/example-script.js' ); wp_enqueue_script( 'example_script' ); @@ -29,6 +31,8 @@ function () { function () { $asset_enqueue = Asset_Enqueue::get_instance(); + wp_register_script( 'match-height', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight-min.js', array( 'jquery' ), '0.7.2', true ); + $asset_enqueue->register_vite_script( 'block_styles', 'js/admin/block-styles.js', array( 'block_style_modifier' ) ); wp_enqueue_script( 'block_styles' ); }