Timber: Apply `maybe_convert_array` to all class functions in Timber\Twig

Created on 18 Oct 2018  路  5Comments  路  Source: timber/timber

As created in #1788, implement the maybe_convert_array method throughout Timber\Twig

https://github.com/timber/timber/blob/2.x/lib/Twig.php#L91-L93

$twig->addFunction( new Twig_Function( 'Attachment', function( $post_id, $attachment_class = 'Timber\Attachment' ) {
    return self::maybe_convert_array( $post_id, $attachment_class );
} ) );
2.0 help wanted

Most helpful comment

def. post_id please! clarity > brevity

All 5 comments

@jarednova Think this might be a decent first contribution? If so, want to keep running with pid as opposed to post_id for argument naming convention?

def. post_id please! clarity > brevity

I鈥檓 going to work this out tonight! Assuming the PR should be against the 2.x branch too 馃槈

@seancrater Great! I think this issues makes a for a good first contribution! Yep, all issues that are marked with the 2.0 label should get a PR against the 2.x branch 馃憤. I鈥檓 looking forward to that pull request. Thanks in advance!

Created that PR whenever you have a chance @gchtr and @jarednova, thanks!

Was this page helpful?
0 / 5 - 0 ratings