This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress" namespace="WordPressCS\WordPress" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | |
<description>Default WordPress Coding Standards</description> | |
<!-- Lint all PHP files in the project directory by default. --> | |
<file>.</file> | |
<rule ref="WordPress-Core"> | |
<exclude name="Generic.Arrays.DisallowShortArraySyntax" /> | |
<exclude name="Generic.Commenting.DocComment.MissingShort" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a checkbox to toggle the "Unfiltered html" capability for Administrators in a multisite. | |
*/ | |
/** | |
* Re-enable unfiltered_html for Administrators only on a Multisite. | |
* | |
* @see https://core.trac.wordpress.org/browser/tags/5.8/src/wp-includes/capabilities.php#L421 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes single product link in archive page and enable template redirect | |
* | |
* A snippet that removes the <a href="(single product permalink)"> in the archive page | |
* and redirects user back to the shop page when they try to access the single page directly | |
* | |
* WC tested up to: 3.4.3 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Reduce length of Woocommerce product title | |
* | |
* @param string $title product title | |
* @param int $id product id | |
* @return string modified product title | |
* | |
* Hook ref: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Enable order item thumbnail display in emails | |
* Change order item thumbnail size | |
* @see woocommerce/includes/wc-template-functions.php for hook | |
*/ | |
function edm_display_product_thumbnail_in_emails( $args ) { | |
/* Display image thumbnail in emails */ | |
$args['show_image'] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display custom labels for products in selected categories | |
* | |
* @param array $labels Array labels | |
* | |
* - Instructions - | |
* 1) Create a product category 'Flash Sale' | |
* 2) Assign products to that category | |
* |