/**
  * Renders an HTML Dropdown of all Transaction Types
  *
  * @access	public
  * @since	1.3.7
  * @param	str		$name		Name attribute of the dropdown
  * @param	int		$selected	Category to select automatically
  * @return	str		$output		Category dropdown
  */
 public function txn_type_dropdown($name = 'mdjm_txn_for', $selected = 0)
 {
     $args = array('hide_empty' => false);
     $categories = get_terms('transaction-types', apply_filters('mdjm_txn_types_dropdown', $args));
     $options = array();
     foreach ($categories as $category) {
         $options[absint($category->term_id)] = esc_html($category->name);
     }
     $category_labels = mdjm_get_taxonomy_labels('transaction-types');
     $output = $this->select(array('name' => $name, 'selected' => $selected, 'options' => $options, 'show_option_all' => false, 'show_option_none' => __(' - Select Txn Type - ')));
     return $output;
 }
Exemple #2
0
/**
 * Define the columns to be displayed for addon posts
 *
 * @since	1.4
 * @param	arr		$columns	Array of column names
 * @return	arr		$columns	Filtered array of column names
 */
function mdjm_addon_post_columns($columns)
{
    $category_labels = mdjm_get_taxonomy_labels('addon-category');
    $columns = array('cb' => '<input type="checkbox" />', 'title' => __('Addon', 'mobile-dj-manager'), 'addon_category' => $category_labels['column_name'], 'availability' => __('Availability', 'mobile-dj-manager'), 'event_types' => sprintf(__('%s Types', 'mobile-dj-manager'), mdjm_get_label_singular()), 'employees' => __('Employees', 'mobile-dj-manager'), 'price' => __('Price', 'mobile-dj-manager'), 'usage' => __('Usage', 'mobile-dj-manager'));
    if (!mdjm_employee_can('manage_packages') && isset($columns['cb'])) {
        unset($columns['cb']);
    }
    return $columns;
}