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
// The type of entity being edited. | |
$entity_type = 'node'; | |
// The ID of the entity being changed. | |
$entity_id = 42; | |
// The revision ID for this entity, leave as NULL to ignore revisioning. | |
$revision_id = NULL; | |
// The language code for this entity. | |
$langcode = LANGUAGE_NONE; | |
// Load the existing values, will return an empty array if anything found. | |
$metatags = metatag_metatags_load($entity_type, $entity_id, $revision_id); |
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
document.fonts.ready.then(function() { | |
canvas.renderAll(); | |
}); |
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
$status_ids = array_keys(commerce_order_statuses(array('cart' => TRUE))); | |
$cart_order_ids = db_query('SELECT order_id FROM {commerce_order} WHERE uid = 0 AND status IN (:status_ids)', array( | |
':status_ids' => $status_ids, | |
))->fetchCol(); |
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
// Backup databases. | |
drush @sites sql-dump --result-file --gzip | |
// Run update. | |
drush @sites updb | |
// Clear cache. | |
drush @sites cc all |
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
$perms = array( | |
// Node. | |
"create $bundle_name content", | |
"edit own $bundle_name content", | |
"edit any $bundle_name content", | |
"delete own $bundle_name content", | |
"delete any $bundle_name content", | |
// Commerce. | |
"create commerce_product entities of bundle $bundle_name", |
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
$views_name = 'newest_products'; | |
$display_name = 'page'; | |
$filter_name = 'type'; | |
// Add content type to allowed list in filter settings. | |
$view = views_get_view($views_name, TRUE); | |
$views_filters = $view->display[$display_name]->display_options['filters']; | |
$views_filters[$filter_name]['value'][$bundle_name] = $bundle_name; | |
$view->save(); |
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
/** | |
* Set product output across panel. | |
* | |
* @param string $bundle_name | |
* Product bundle name. | |
*/ | |
function sgpt_add_new_type_to_panel_settings($bundle_name) { | |
$task_name = 'node_view'; | |
$variant_name = 'node_view__product'; | |
$node_view_tasks = page_manager_get_task($task_name); |
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
$entity_type = 'entity_type_name'; | |
$field_name = 'field_name'; | |
$bundle = 'bundle_name'; | |
// Delete field instance. | |
if ($instance = field_info_instance($entity_type, $field_name, $bundle)) { | |
field_delete_instance($instance, TRUE); | |
field_purge_batch(1); | |
} |
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
fin bash | |
sudo apt-get install install libpcre3-dev | |
sudo pecl install oauth | |
sudo docker-php-ext-enable oauth | |
exit | |
fin restart |
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
if ($entity->get('FIELD_COLLECTION_FIELD')->count() > 0) { | |
$settings = $entity->get('FIELD_COLLECTION_FIELD')->first()->getFieldCollectionItem(); | |
} |