Changeset 2553568
- Timestamp:
- 06/24/2021 09:03:59 PM (5 years ago)
- Location:
- hatch
- Files:
-
- 1 edited
- 6 copied
-
tags/0.5.5 (copied) (copied from hatch/trunk)
-
tags/0.5.5/LICENSE.md (copied) (copied from hatch/trunk/LICENSE.md)
-
tags/0.5.5/abe-hatch.php (copied) (copied from hatch/trunk/abe-hatch.php)
-
tags/0.5.5/inc (copied) (copied from hatch/trunk/inc)
-
tags/0.5.5/readme.md (copied) (copied from hatch/trunk/readme.md)
-
tags/0.5.5/readme.txt (copied) (copied from hatch/trunk/readme.txt)
-
trunk/abe-hatch.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hatch/trunk/abe-hatch.php
r2551418 r2553568 3 3 * Plugin name: Hatch 4 4 * Author: A Big Egg 5 * Version: 0. 5.55 * Version: 0.6.0 6 6 * Description: Provides helper functions for working with Timber and ACF. Requires Timber (timber-library) and works well with Advanced Custom Fields Pro and Gravity Forms. 7 7 */ … … 104 104 } 105 105 106 self::$context[$key] = self::get_value_from_thing( $value ); 106 $current_post = self::get_post(); 107 108 self::$context[$key] = self::get_value_from_thing( $value, [ $current_post ] ); 107 109 } 108 110 … … 130 132 * 131 133 * @param mixed $thing 132 * @return void 133 */ 134 static private function get_value_from_thing( $thing ) { 134 * @param mixed Post for context (passed into the callback ) 135 * @return void 136 */ 137 static private function get_value_from_thing( $thing, $context = [] ) { 135 138 if ( is_callable( $thing ) || function_exists( $thing ) ) { 136 return call_user_func( $thing ); 139 // we can optionally pass in context to the function 140 return call_user_func_array( $thing, $context ); 137 141 } 138 142
Note: See TracChangeset
for help on using the changeset viewer.