Changeset 2596167
- Timestamp:
- 09/09/2021 12:02:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lisette-cost-calculator/trunk/Sum.php
r1749731 r2596167 37 37 */ 38 38 public function widget( $args, $instance ) { 39 // show widget only on page cost-calculator 40 $pagename = get_query_var('pagename'); 41 if ( is_page() && $pagename == 'cost-calculator' ) { 42 $title = apply_filters( 'widget_title', $instance['title'] ); 39 $title = apply_filters( 'widget_title', $instance['title'] ); 43 40 44 41 echo $args['before_widget']; 45 42 46 if ( ! empty( $title ) ) 47 echo $args['before_title'] . $title . $args['after_title']; 48 49 $view = dirname( __FILE__ ) . '/views/cost_calculator_sum.php'; 50 if( file_exists( $view ) ) 51 include_once( $view ); 52 else 53 echo __('No view file found!', 'lcc'); 54 55 echo $args['after_widget']; 56 } 43 if (!empty($title)) { 44 echo $args['before_title'] . $title . $args['after_title']; 45 } 46 $view = __DIR__ . '/views/cost_calculator_sum.php'; 47 if (file_exists($view)) { 48 include_once($view); 49 } else { 50 echo __('No view file found!', 'lcc'); 51 } 52 echo $args['after_widget']; 57 53 } 58 54
Note: See TracChangeset
for help on using the changeset viewer.