const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
This file contains hidden or 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 name="phpmd.xml" | |
| xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
| xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
| <description>PHPMD Ruleset for a WordPress Theme</description> | |
| <rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | |
| <rule ref="rulesets/cleancode.xml/ElseExpression" /> | |
| <rule ref="rulesets/cleancode.xml/StaticAccess" /> |
This file contains hidden or 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
| <ul class="products"> | |
| <?php | |
| $args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'camisa' ); | |
| $loop = new WP_Query( $args ); | |
| while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?> | |
| <h2>Shoes</h2> | |
| <li class="product"> | |
| <a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>"> | |
| <?php | |
| woocommerce_show_product_sale_flash( $post, $product ); |
This file contains hidden or 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 | |
| if(!function_exists('wc_get_products')) { | |
| return; | |
| } | |
| $paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
| $ordering = WC()->query->get_catalog_ordering_args(); | |
| $ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
| $ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; |
OlderNewer