diff --git wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/wordcamp-budgets.php
index b6a9f8d..5379f96 100644
|
|
class WordCamp_Budgets { |
11 | 11 | * Constructor |
12 | 12 | */ |
13 | 13 | public function __construct() { |
14 | | add_action( 'init', array( __CLASS__, 'register_post_statuses' ) ); |
15 | | add_action( 'admin_menu', array( $this, 'register_budgets_menu' ) ); |
16 | | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_common_assets' ), 11 ); |
| 14 | add_action( 'init', array( __CLASS__, 'register_post_statuses' ) ); |
| 15 | add_action( 'admin_menu', array( $this, 'register_budgets_menu' ) ); |
| 16 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_common_assets' ), 11 ); |
17 | 17 | add_filter( 'user_has_cap', array( __CLASS__, 'user_can_view_payment_details' ), 10, 4 ); |
| 18 | add_filter( 'default_title', array( $this, 'set_default_payments_title'), 10, 2 ); |
18 | 19 | } |
19 | 20 | |
20 | 21 | /** |
… |
… |
class WordCamp_Budgets { |
121 | 122 | } |
122 | 123 | |
123 | 124 | /** |
| 125 | * Set default post title for reimbursments, vendor payment and sponsor invoices |
| 126 | * |
| 127 | * @param string $post_title Default post title |
| 128 | * @param objext $post Current post object |
| 129 | * |
| 130 | * @return string $post_title Post title |
| 131 | */ |
| 132 | public function set_default_payments_title ( $post_title, $post ) { |
| 133 | |
| 134 | if( ! empty( $post->post_type ) ) { |
| 135 | |
| 136 | // Generate default title for payment CPTs |
| 137 | $new_title = ''; |
| 138 | switch( $post->post_type ) { |
| 139 | case 'wcb_reimbursement': $new_title = __( 'Reimbursement Request', 'wordcamporg' ); break; |
| 140 | case 'wcp_payment_request': $new_title = __( 'Vendor Payment', 'wordcamporg' ); break; |
| 141 | case 'wcb_sponsor_invoice': $new_title = __( 'Sponsor Invoice', 'wordcamporg' ); break; |
| 142 | } |
| 143 | |
| 144 | // Prepend title with post ID to make it unique |
| 145 | if( $new_title ) { |
| 146 | $post_title = sprintf( '[%s] %s', $post->ID, $new_title ); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return $post_title; |
| 151 | } |
| 152 | |
| 153 | /** |
124 | 154 | * Enqueue scripts and stylesheets common to all modules |
125 | 155 | */ |
126 | 156 | public function enqueue_common_assets() { |