How to pass contextual filters programmatically through views_get_view_result()?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by drupal7er on October 28, 2011 at 7:26pm

In the live preview I can successfully pass the uid (the filter is set to uid) but doing that programmatically returns an empty array.

$results = views_get_view_result( 'my_view', 'default', array( 1 ) );

How should I pass the arguments here? Thanks.

Comments

Not passing args as array

Posted by drupal7er on October 29, 2011 at 9:48am

Not passing args as array seems to have worked.

$results = views_get_view_result( 'my_view', 'default', 1 );

Not passings args as an array worked 4 me 2

Posted by knowpixels on July 4, 2012 at 2:58pm

This worked for me too on Drupal 6.22 and Views 2 :)

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /