Created
January 18, 2020 05:13
-
-
Save radheymkumar/56a771f9fc2937bf137d5b1c8c9b64fb to your computer and use it in GitHub Desktop.
How to alter single custom field value in views?
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 hook_views_pre_render(&$view) { | |
switch ($view->name) { | |
case 'YOUR_VIEW_NAME': | |
// override the global custom text field value | |
$view->field['nothing']->options['alter']['text'] = 'My custom text'; | |
$view->field['nothing']->options['alter']['alter_text'] = TRUE; | |
break; | |
} | |
} | |
************************************************************************************** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment