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
$source = drupal_get_path('module', 'MY_DEPLOY_MODULE') . '/dummy.jpg'; |
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
$file = new stdClass; | |
$file>filename = 'dummy.jpg'; | |
$file>timestamp = REQUEST_TIME; | |
$file>uri = $source; | |
$file>filemime = file_get_mimetype($source); | |
$file>uid = 1; | |
$file>status = 1; |
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
$file = file_copy($file, 'public://default.jpg', FILE_EXISTS_REPLACE); | |
$fid = $file>fid; |
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
$field = field_info_field("field_imagen"); | |
$field['settings']['default_image'] = $fid; |
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
field_update_field($field); |
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
/** | |
* Implements hook_field_create_instance(). | |
*/ | |
function MY_DEPLOY_MODULE_field_create_instance($field) { | |
if($field['field_name'] == 'field_imagen') { | |
$source = drupal_get_path('module', 'MY_DEPLOY_MODULE') . '/dummy.jpg'; | |
$file = new stdClass; | |
$file>filename = 'dummy.jpg'; | |
$file>timestamp = REQUEST_TIME; | |
$file>uri = $source; |
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
/** | |
* Minify to base64 URL and defer WooCommerce script. | |
* | |
* @param string $js The JS being rendered. | |
*/ | |
function yournamespace_woocommerce_queued_js( string $js ) : string { | |
// Cleanup and get JS inside the wrapper <script> tag. | |
$remove_comments_regex = '/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?<!\:|\\\|\')\/\/.*))/'; | |
$js = preg_replace( $remove_comments_regex, '', $js ); | |
$js = str_replace( PHP_EOL, ' ', $js ); |
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
{ | |
"id": "wordpress_visual_regression", | |
"viewports": [ | |
{ | |
"label": "mobile", | |
"width": 360, | |
"height": 480 | |
} | |
{ | |
"label": "tablet", |
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
./configure --with-python3-config-dir=/usr/lib/python3.8/config-3.8m-x86_64-linux-gnu/ --enable-python3interp --enable-fail-if-missing --without-x --with-python3-command=python3.8 | |
make | |
sudo make install |
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 | |
/** | |
* Plugin disabler for specific URLs | |
* | |
* @package Timeular | |
* @author Julià Mestieri | |
* @version 0.1.0 | |
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2) | |
*/ |