Changeset 1864542
- Timestamp:
- 04/26/2018 05:18:50 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c9-variables/trunk/includes/code/basic/public/core/class-c9-variables-public-delegate.php
r1863910 r1864542 27 27 $name = C9_Text_Utils::html_entity_decode($attribs[C9_Variables_Constants::$NAME_ATTRIB], C9_Variables_Constants::$VARIABLE_NAME_SANITIZE_PATTERN); 28 28 $results = new WP_Query([C9_Variables_Constants::$POST_TYPE_FIELD => C9_Variables_Constants::$VARIABLES_POST_TYPE, 'name' => $name, 'posts_per_page' => 1]); 29 while($results->have_posts()) {29 if($results->have_posts()) { 30 30 $results->the_post(); 31 31 $var = get_the_content(); 32 32 $var = do_shortcode($var); 33 33 } 34 35 // Clean up 36 wp_reset_postdata(); 34 37 } 35 38 if (C9_Logger::is_debug_enabled()) { 36 39 C9_Logger::debug(sprintf("C9_Variables_Public_Delegate::get_variable(): name: '%s', content: %s", $name, $var)); 37 40 } 41 38 42 return $var; 39 43 }
Note: See TracChangeset
for help on using the changeset viewer.