PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.8.0
GiveWP – Donation Plugin and Fundraising Platform v2.8.0
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / post-types.php
give / includes Last commit date
admin 5 years ago api 5 years ago database 6 years ago deprecated 6 years ago donors 5 years ago emails 6 years ago forms 5 years ago frontend 6 years ago gateways 5 years ago libraries 6 years ago payments 5 years ago actions.php 6 years ago ajax-functions.php 5 years ago class-give-async-process.php 6 years ago class-give-background-updater.php 6 years ago class-give-cache-setting.php 6 years ago class-give-cache.php 6 years ago class-give-cli-commands.php 6 years ago class-give-comment.php 6 years ago class-give-cron.php 6 years ago class-give-donate-form.php 6 years ago class-give-donor.php 6 years ago class-give-email-access.php 6 years ago class-give-license-handler.php 5 years ago class-give-logging.php 6 years ago class-give-readme-parser.php 6 years ago class-give-roles.php 6 years ago class-give-scripts.php 6 years ago class-give-session.php 5 years ago class-give-stats.php 6 years ago class-give-template-loader.php 6 years ago class-give-tooltips.php 6 years ago class-give-translation.php 6 years ago class-notices.php 5 years ago country-functions.php 5 years ago currencies-list.php 6 years ago currency-functions.php 6 years ago error-tracking.php 6 years ago filters.php 6 years ago formatting.php 6 years ago install.php 5 years ago login-register.php 6 years ago misc-functions.php 5 years ago plugin-compatibility.php 6 years ago post-types.php 5 years ago price-functions.php 6 years ago process-donation.php 5 years ago setting-functions.php 6 years ago shortcodes.php 6 years ago template-functions.php 6 years ago user-functions.php 6 years ago
post-types.php
584 lines
1 <?php
2 /**
3 * Post Type Functions
4 *
5 * @package Give
6 * @subpackage Functions
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 * @since 1.0
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Registers and sets up the Donation Forms (give_forms) custom post type
19 *
20 * @return void
21 * @since 1.0
22 */
23 function give_setup_post_types() {
24
25 // Give Forms single post and archive options.
26 $give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular', 'enabled' ) );
27 $give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives', 'enabled' ) );
28
29 // Enable/Disable give_forms links if form is saving.
30 if ( Give_Admin_Settings::is_saving_settings() ) {
31 if ( isset( $_POST['forms_singular'] ) ) {
32 $give_forms_singular = give_is_setting_enabled( give_clean( $_POST['forms_singular'] ) );
33 flush_rewrite_rules();
34 }
35
36 if ( isset( $_POST['forms_archives'] ) ) {
37 $give_forms_archives = give_is_setting_enabled( give_clean( $_POST['forms_archives'] ) );
38 flush_rewrite_rules();
39 }
40 }
41
42 $give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations';
43 // Support for old 'GIVE_FORMS_SLUG' constant
44 if ( defined( 'GIVE_FORMS_SLUG' ) ) {
45 $give_forms_slug = GIVE_FORMS_SLUG;
46 }
47
48 $give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : [
49 'slug' => $give_forms_slug,
50 'with_front' => false,
51 ];
52
53 $give_forms_labels = apply_filters(
54 'give_forms_labels',
55 [
56 'name' => __( 'Donation Forms', 'give' ),
57 'singular_name' => __( 'Form', 'give' ),
58 'add_new' => __( 'Add Form', 'give' ),
59 'add_new_item' => __( 'Add New Donation Form', 'give' ),
60 'edit_item' => __( 'Edit Donation Form', 'give' ),
61 'new_item' => __( 'New Form', 'give' ),
62 'all_items' => __( 'All Forms', 'give' ),
63 'view_item' => __( 'View Form', 'give' ),
64 'search_items' => __( 'Search Forms', 'give' ),
65 'not_found' => __( 'No forms found.', 'give' ),
66 'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ),
67 'parent_item_colon' => '',
68 'menu_name' => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ),
69 'name_admin_bar' => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ),
70 ]
71 );
72
73 // Default give_forms supports.
74 $give_form_supports = [
75 'title',
76 'thumbnail',
77 'excerpt',
78 'revisions',
79 'author',
80 ];
81
82 // Has the user disabled the excerpt?
83 if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) {
84 unset( $give_form_supports[2] );
85 }
86
87 // Has user disabled the featured image?
88 if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
89 unset( $give_form_supports[1] );
90 remove_action( 'give_before_single_form_summary', 'give_show_form_images' );
91 }
92
93 $give_forms_args = [
94 'labels' => $give_forms_labels,
95 'public' => $give_forms_singular,
96 'show_ui' => true,
97 'show_in_menu' => true,
98 'show_in_rest' => true,
99 'query_var' => true,
100 'rewrite' => $give_forms_rewrite,
101 'map_meta_cap' => true,
102 'capability_type' => 'give_form',
103 'has_archive' => $give_forms_archives,
104 'menu_icon' => 'dashicons-give',
105 'hierarchical' => false,
106 'supports' => apply_filters( 'give_forms_supports', $give_form_supports ),
107 ];
108 register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) );
109
110 /** Donation Post Type */
111 $payment_labels = [
112 'name' => _x( 'Donations', 'post type general name', 'give' ),
113 'singular_name' => _x( 'Donation', 'post type singular name', 'give' ),
114 'add_new' => __( 'Add New', 'give' ),
115 'add_new_item' => __( 'Add New Donation', 'give' ),
116 'edit_item' => __( 'Edit Donation', 'give' ),
117 'new_item' => __( 'New Donation', 'give' ),
118 'all_items' => __( 'All Donations', 'give' ),
119 'view_item' => __( 'View Donation', 'give' ),
120 'search_items' => __( 'Search Donations', 'give' ),
121 'not_found' => __( 'No donations found.', 'give' ),
122 'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ),
123 'parent_item_colon' => '',
124 'menu_name' => __( 'Donations', 'give' ),
125 ];
126
127 $payment_args = [
128 'labels' => apply_filters( 'give_payment_labels', $payment_labels ),
129 'public' => false,
130 'query_var' => false,
131 'rewrite' => false,
132 'map_meta_cap' => true,
133 'capability_type' => 'give_payment',
134 'supports' => [ 'title' ],
135 'can_export' => true,
136 ];
137 register_post_type( 'give_payment', $payment_args );
138
139 }
140
141 add_action( 'init', 'give_setup_post_types', 1 );
142
143
144 /**
145 * Give Setup Taxonomies
146 *
147 * Registers the custom taxonomies for the give_forms custom post type
148 *
149 * @return void
150 * @since 1.0
151 */
152 function give_setup_taxonomies() {
153
154 $slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations';
155
156 /** Categories */
157 $category_labels = [
158 'name' => _x( 'Form Categories', 'taxonomy general name', 'give' ),
159 'singular_name' => _x( 'Category', 'taxonomy singular name', 'give' ),
160 'search_items' => __( 'Search Categories', 'give' ),
161 'all_items' => __( 'All Categories', 'give' ),
162 'parent_item' => __( 'Parent Category', 'give' ),
163 'parent_item_colon' => __( 'Parent Category:', 'give' ),
164 'edit_item' => __( 'Edit Category', 'give' ),
165 'update_item' => __( 'Update Category', 'give' ),
166 'add_new_item' => __( 'Add New Category', 'give' ),
167 'new_item_name' => __( 'New Category Name', 'give' ),
168 'menu_name' => __( 'Categories', 'give' ),
169 ];
170
171 $category_args = apply_filters(
172 'give_forms_category_args',
173 [
174 'hierarchical' => true,
175 'labels' => apply_filters( 'give_forms_category_labels', $category_labels ),
176 'show_ui' => true,
177 'query_var' => 'give_forms_category',
178 'rewrite' => [
179 'slug' => $slug . '/category',
180 'with_front' => false,
181 'hierarchical' => true,
182 ],
183 'capabilities' => [
184 'manage_terms' => 'manage_give_form_terms',
185 'edit_terms' => 'edit_give_form_terms',
186 'assign_terms' => 'assign_give_form_terms',
187 'delete_terms' => 'delete_give_form_terms',
188 ],
189 ]
190 );
191
192 /** Tags */
193 $tag_labels = [
194 'name' => _x( 'Form Tags', 'taxonomy general name', 'give' ),
195 'singular_name' => _x( 'Tag', 'taxonomy singular name', 'give' ),
196 'search_items' => __( 'Search Tags', 'give' ),
197 'all_items' => __( 'All Tags', 'give' ),
198 'parent_item' => __( 'Parent Tag', 'give' ),
199 'parent_item_colon' => __( 'Parent Tag:', 'give' ),
200 'edit_item' => __( 'Edit Tag', 'give' ),
201 'update_item' => __( 'Update Tag', 'give' ),
202 'add_new_item' => __( 'Add New Tag', 'give' ),
203 'new_item_name' => __( 'New Tag Name', 'give' ),
204 'menu_name' => __( 'Tags', 'give' ),
205 'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ),
206 ];
207
208 $tag_args = apply_filters(
209 'give_forms_tag_args',
210 [
211 'hierarchical' => false,
212 'labels' => apply_filters( 'give_forms_tag_labels', $tag_labels ),
213 'show_ui' => true,
214 'query_var' => 'give_forms_tag',
215 'rewrite' => [
216 'slug' => $slug . '/tag',
217 'with_front' => false,
218 'hierarchical' => true,
219 ],
220 'capabilities' => [
221 'manage_terms' => 'manage_give_form_terms',
222 'edit_terms' => 'edit_give_form_terms',
223 'assign_terms' => 'assign_give_form_terms',
224 'delete_terms' => 'delete_give_form_terms',
225 ],
226 ]
227 );
228
229 // Does the user want category?
230 $enable_category = give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) );
231
232 // Does the user want tag?
233 $enable_tag = give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) );
234
235 // Enable/Disable category and tag if form is saving.
236 if ( Give_Admin_Settings::is_saving_settings() ) {
237 if ( isset( $_POST['categories'] ) ) {
238 $enable_category = give_is_setting_enabled( give_clean( $_POST['categories'] ) );
239 flush_rewrite_rules();
240 }
241
242 if ( isset( $_POST['tags'] ) ) {
243 $enable_tag = give_is_setting_enabled( give_clean( $_POST['tags'] ) );
244 flush_rewrite_rules();
245 }
246 }
247
248 if ( $enable_category ) {
249 register_taxonomy( 'give_forms_category', [ 'give_forms' ], $category_args );
250 register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' );
251 }
252
253 if ( $enable_tag ) {
254 register_taxonomy( 'give_forms_tag', [ 'give_forms' ], $tag_args );
255 register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' );
256 }
257 }
258
259 add_action( 'init', 'give_setup_taxonomies', 0 );
260
261
262 /**
263 * Get Default Form Labels
264 *
265 * @return array $defaults Default labels
266 * @since 1.0
267 */
268 function give_get_default_form_labels() {
269 $defaults = [
270 'singular' => __( 'Form', 'give' ),
271 'plural' => __( 'Forms', 'give' ),
272 ];
273
274 return apply_filters( 'give_default_form_name', $defaults );
275 }
276
277 /**
278 * Get Singular Forms Label
279 *
280 * @param bool $lowercase
281 *
282 * @return string $defaults['singular'] Singular label
283 * @since 1.0
284 */
285 function give_get_forms_label_singular( $lowercase = false ) {
286 $defaults = give_get_default_form_labels();
287
288 return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
289 }
290
291 /**
292 * Get Plural Forms Label
293 *
294 * @return string $defaults['plural'] Plural label
295 * @since 1.0
296 */
297 function give_get_forms_label_plural( $lowercase = false ) {
298 $defaults = give_get_default_form_labels();
299
300 return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
301 }
302
303 /**
304 * Change default "Enter title here" input
305 *
306 * @param string $title Default title placeholder text
307 *
308 * @return string $title New placeholder text
309 * @since 1.0
310 */
311 function give_change_default_title( $title ) {
312 // If a frontend plugin uses this filter (check extensions before changing this function)
313 if ( ! is_admin() ) {
314 $title = __( 'Enter form title here', 'give' );
315
316 return $title;
317 }
318
319 $screen = get_current_screen();
320
321 if ( 'give_forms' == $screen->post_type ) {
322 $title = __( 'Enter form title here', 'give' );
323 }
324
325 return $title;
326 }
327
328 add_filter( 'enter_title_here', 'give_change_default_title' );
329
330 /**
331 * Registers Custom Post Statuses which are used by the Payments
332 *
333 * @return void
334 * @since 1.0
335 */
336 function give_register_post_type_statuses() {
337 // Payment Statuses
338 register_post_status(
339 'refunded',
340 [
341 'label' => __( 'Refunded', 'give' ),
342 'public' => true,
343 'exclude_from_search' => false,
344 'show_in_admin_all_list' => true,
345 'show_in_admin_status_list' => true,
346 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ),
347 ]
348 );
349 register_post_status(
350 'failed',
351 [
352 'label' => __( 'Failed', 'give' ),
353 'public' => true,
354 'exclude_from_search' => false,
355 'show_in_admin_all_list' => true,
356 'show_in_admin_status_list' => true,
357 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ),
358 ]
359 );
360 register_post_status(
361 'revoked',
362 [
363 'label' => __( 'Revoked', 'give' ),
364 'public' => true,
365 'exclude_from_search' => false,
366 'show_in_admin_all_list' => true,
367 'show_in_admin_status_list' => true,
368 'label_count' => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ),
369 ]
370 );
371 register_post_status(
372 'cancelled',
373 [
374 'label' => __( 'Cancelled', 'give' ),
375 'public' => true,
376 'exclude_from_search' => false,
377 'show_in_admin_all_list' => true,
378 'show_in_admin_status_list' => true,
379 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ),
380 ]
381 );
382 register_post_status(
383 'abandoned',
384 [
385 'label' => __( 'Abandoned', 'give' ),
386 'public' => true,
387 'exclude_from_search' => false,
388 'show_in_admin_all_list' => true,
389 'show_in_admin_status_list' => true,
390 'label_count' => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ),
391 ]
392 );
393 register_post_status(
394 'processing',
395 [
396 'label' => _x( 'Processing', 'Processing payment status', 'give' ),
397 'public' => true,
398 'exclude_from_search' => false,
399 'show_in_admin_all_list' => true,
400 'show_in_admin_status_list' => true,
401 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' ),
402 ]
403 );
404
405 register_post_status(
406 'preapproval',
407 [
408 'label' => _x( 'Preapproval', 'Preapproval payment status', 'give' ),
409 'public' => true,
410 'exclude_from_search' => false,
411 'show_in_admin_all_list' => true,
412 'show_in_admin_status_list' => true,
413 'label_count' => _n_noop( 'Preapproval <span class="count">(%s)</span>', 'Preapproval <span class="count">(%s)</span>', 'give' ),
414 ]
415 );
416
417 }
418
419 add_action( 'init', 'give_register_post_type_statuses' );
420
421 /**
422 * Updated Messages
423 *
424 * Returns an array of with all updated messages.
425 *
426 * @param array $messages Post updated message
427 *
428 * @return array $messages New post updated messages
429 * @since 1.0
430 */
431 function give_updated_messages( $messages ) {
432 global $post, $post_ID;
433
434 if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) {
435
436 $messages['give_forms'] = [
437 1 => __( 'Form updated.', 'give' ),
438 4 => __( 'Form updated.', 'give' ),
439 6 => __( 'Form published.', 'give' ),
440 7 => __( 'Form saved.', 'give' ),
441 8 => __( 'Form submitted.', 'give' ),
442 ];
443
444 } else {
445
446 $messages['give_forms'] = [
447 1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
448 4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
449 6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
450 7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
451 8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
452 ];
453
454 }
455
456 return $messages;
457 }
458
459 add_filter( 'post_updated_messages', 'give_updated_messages' );
460
461 /**
462 * Ensure post thumbnail support is turned on
463 */
464 function give_add_thumbnail_support() {
465 if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
466 return;
467 }
468
469 if ( ! current_theme_supports( 'post-thumbnails' ) ) {
470 add_theme_support( 'post-thumbnails' );
471 }
472
473 add_post_type_support( 'give_forms', 'thumbnail' );
474 }
475
476 add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 );
477
478 /**
479 * Give Sidebars
480 *
481 * This option adds Give sidebars; registered late so it display last in list
482 */
483 function give_widgets_init() {
484
485 // Single Give Forms (disabled if single turned off in settings)
486 if (
487 give_is_setting_enabled( give_get_option( 'forms_singular' ) )
488 && give_is_setting_enabled( give_get_option( 'form_sidebar' ) )
489 ) {
490
491 register_sidebar(
492 apply_filters(
493 'give_forms_single_sidebar',
494 [
495 'name' => __( 'GiveWP Single Form Sidebar', 'give' ),
496 'id' => 'give-forms-sidebar',
497 'description' => __( 'Widgets in this area will be shown on the single GiveWP forms aside area. This sidebar will not display for embedded forms.', 'give' ),
498 'before_widget' => '<div id="%1$s" class="widget %2$s">',
499 'after_widget' => '</div>',
500 'before_title' => '<h3 class="widgettitle widget-title">',
501 'after_title' => '</h3>',
502 ]
503 )
504 );
505
506 }
507 }
508
509 add_action( 'widgets_init', 'give_widgets_init', 999 );
510
511
512 /**
513 * Remove "Quick Edit" for the give_forms CPT.
514 *
515 * @param array $actions
516 * @param null $post
517 *
518 * @return array
519 * @since 2.3.0
520 */
521 function give_forms_disable_quick_edit( $actions = [], $post = null ) {
522
523 // Abort if the post type is not "give_forms".
524 if ( ! is_post_type_archive( 'give_forms' ) ) {
525 return $actions;
526 }
527
528 // Remove the Quick Edit link.
529 if ( isset( $actions['inline hide-if-no-js'] ) ) {
530 unset( $actions['inline hide-if-no-js'] );
531 }
532
533 // Return the set of links without Quick Edit.
534 return $actions;
535
536 }
537
538 add_filter( 'post_row_actions', 'give_forms_disable_quick_edit', 10, 2 );
539
540 /**
541 * Removes the screen options pull down. It is reset later in a different position.
542 *
543 * @param bool $display_boolean Whether to display screen options.
544 * @param WP_Screen $wp_screen_object The screen object.
545 *
546 * @return bool Whether to display screen options.
547 * @since 2.5.0
548 */
549 function give_remove_screen_options( $display_boolean, $wp_screen_object ) {
550
551 if ( false !== strpos( $wp_screen_object->id, 'give' ) ) {
552 return false;
553 }
554
555 // Don't mess with other screens.
556 return $display_boolean;
557 }
558
559 // add_filter( 'screen_options_show_screen', 'give_remove_screen_options', 10, 2 );
560
561 /**
562 * Renders the screen options back after admin bar to ensure it pushes down the banner rather than overlaps them as is default in WordPress.
563 *
564 * @since 2.5.0
565 */
566 function give_render_screen_options() {
567 if ( ! is_admin() ) {
568 return;
569 }
570
571 $current_screen = get_current_screen();
572
573 if ( empty( $current_screen ) ) {
574 return;
575 }
576
577 if ( false !== strpos( $current_screen->id, 'give' ) ) {
578 // Render Screen Options above the banner.
579 $current_screen->render_screen_meta();
580 }
581 }
582
583 add_action( 'wp_after_admin_bar_render', 'give_render_screen_options' );
584