1 <?php
2 3 4 5 6 7 8 9 10 11 12
13
14
15 if ( ! defined( 'ABSPATH' ) ) exit;
16
17 18 19 20 21 22 23
24 function edd_remove_restrict_meta_box( $post_types ) {
25 $post_types[] = 'download';
26
27 return $post_types;
28 }
29 add_filter( 'rcp_metabox_excluded_post_types', 'edd_remove_restrict_meta_box', 999 );
30
31 32 33 34 35 36 37 38 39
40 function edd_remove_post_types_order() {
41 remove_filter( 'posts_orderby', 'CPTOrderPosts' );
42 }
43 add_action( 'load-edit.php', 'edd_remove_post_types_order' );
44
45 46 47 48 49 50 51 52 53
54 function edd_disable_jetpack_og_on_checkout() {
55 if ( edd_is_checkout() ) {
56 remove_action( 'wp_head', 'jetpack_og_tags' );
57 }
58 }
59 add_action( 'template_redirect', 'edd_disable_jetpack_og_on_checkout' );
60
61 62 63 64 65 66
67 function edd_is_caching_plugin_active() {
68 $caching = ( function_exists( 'wpsupercache_site_admin' ) || defined( 'W3TC' ) );
69 return apply_filters( 'edd_is_caching_plugin_active', $caching );
70 }
71
72 73 74 75 76 77 78 79 80
81 function edd_append_no_cache_param( $settings ) {
82 if ( ! edd_is_caching_plugin_active() )
83 return $settings;
84
85 $settings[] = array(
86 'id' => 'no_cache_checkout',
87 'name' => __('No Caching on Checkout?', 'edd'),
88 'desc' => __('Check this box in order to append a ?nocache parameter to the checkout URL to prevent caching plugins from caching the page.', 'edd'),
89 'type' => 'checkbox'
90 );
91
92 return $settings;
93 }
94 add_filter( 'edd_settings_misc', 'edd_append_no_cache_param', -1 );