protected function row($item) { if (!APP_Item_Registry::is_registered($item['type'])) { return html('tr', array(), html('td', array('colspan' => '3', 'style' => 'font-style: italic;'), __('This item could not be recognized. It might be from another theme or an uninstalled plugin.', APP_TD))); } $ptype_obj = get_post_type_object($item['post']->post_type); $item_link = $ptype_obj->public ? html_link(get_permalink($item['post_id']), $item['post']->post_title) : ''; $cells = array(APP_Item_Registry::get_title($item['type']), appthemes_get_price($item['price'], $this->currency), $item_link); return html('tr', array(), $this->cells($cells)); }
protected function row($item) { if (!APP_Item_Registry::is_registered($item['type'])) { return ''; } $cells = array(APP_Item_Registry::get_title($item['type']), appthemes_get_price($item['price'], $this->currency)); return html($this->args['row_html'], array(), $this->cells($cells)); }
/** * Retrieves the summary for a given Order. * * @since 3.5 */ function cp_get_the_order_summary($order, $output = 'plain') { $order_items = ''; $items = $order->get_items(); foreach ($items as $item) { if (!APP_Item_Registry::is_registered($item['type'])) { $item_title = __('Unknown', APP_TD); } else { $item_title = APP_Item_Registry::get_title($item['type']); } $item_html = 'html' == $output ? html('div', $item_title) : ($order_items ? ' / ' . $item_title : $item_title); $order_items .= $item_html; } if (!$order_items) { $order_items = '-'; } return $order_items; }
public function test_is_registered_bad_id() { $this->setExpectedException('PHPUnit_Framework_Error_Warning'); APP_Item_Registry::is_registered(array('not-a-string')); }
/** * @since 3.5 */ function get_order_summary_content($order, $checkout) { $order_items = $relist = ''; $items = $order->get_items(); $order_plan = cp_get_order_plan_data($order); $plan_type = $order_plan['type']; foreach ($items as $item) { if (!APP_Item_Registry::is_registered($item['type'])) { $item_title = __('Unknown', APP_TD); } else { $item_title = APP_Item_Registry::get_title($item['type']); } if ($item['type'] == $plan_type) { $item_title .= $relist; } $item_html = $order_items ? ' / ' . $item_title : $item_title; $order_items .= $item_html; } if (!$order_items) { $order_items = '-'; } return $order_items; }