Created
January 25, 2017 10:25
-
-
Save martsie/7163da0a8e0e2cd84235971ed27ada53 to your computer and use it in GitHub Desktop.
Bad implementation of custom views fields in Drupal 7
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 | |
/** | |
* DO NOT USE THIS CODE | |
* | |
* Substituting custom field content in views hooks is a great way | |
* to make enemies with future developers. | |
*/ | |
function my_confusing_module_views_pre_render(&$view) { | |
// This is messy and hard to understand for site builders and future developers. | |
$view->result[0]->custom_field_999 = t('Foo'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment