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 | |
| add_filter('acf/location/rule_types', function ( $choices ) { | |
| $choices['Gutenburg']['block_type'] = 'Block Type'; | |
| return $choices; | |
| }, 10, 1); | |
| add_filter('acf/location/rule_values/block_type', function ( $choices, $data ) { | |
| return | |
| '<input type="text" data-ui="0" data-ajax="0" data-multiple="0" data-allow_null="0" ' . | |
| 'id="acf_field_group-location-' . $data['group'] . '-' . $data['id'] . '-value" ' . |
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
| [values.pop(), values.join(', ')].filter(v => v).reverse().join(' and ') | |
| // ['this'] => 'this' | |
| // ['this', 'that'] => 'this and that' | |
| // ['this', 'that', 'the other'] => 'this, that and the other' |
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
| @function pow($number, $exponent) { | |
| $value: 1; | |
| @if $exponent > 0 { | |
| @for $i from 1 through $exponent { | |
| $value: $value * $number; | |
| } | |
| } | |
| @return $value; |