-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
114 lines (89 loc) · 3.69 KB
/
Copy pathfunctions.php
File metadata and controls
114 lines (89 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* WPCustomify functions and definitions.
*
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Disable unuseful metadata
// Disable emoji.
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
// Cleanup RPC.
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
// Cleanup oembed.
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
// Remove WP generator meta.
remove_action( 'wp_head', 'wp_generator' );
// Disable XML RPC
add_filter( 'xmlrpc_methods', function ( $methods ) {
unset( $methods['pingback.ping'] );
return $methods;
} );
// Enqueue child theme style
add_action( 'wp_enqueue_scripts', 'wpcustomify_enqueue_styles' );
function wpcustomify_enqueue_styles() {
wp_enqueue_style('wpcustomify-typekit', 'https://use.typekit.net/xlx8wfz.css');
wp_enqueue_style('wpcustomify-style', get_stylesheet_directory_uri() .'/style.css', array('customify-style'));
}
/* Support 3-rd plugins. */
// Wedocs (Inspiration from freemius guide: https://freemius.com/blog/build-knowledge-base-documentation )
$wedocs_file = trailingslashit( get_stylesheet_directory() ) . 'compatibility/wedocs/wedocs.php';
if ( is_readable( $wedocs_file ) && class_exists('WeDocs') ) {
require_once $wedocs_file;
}
// Gravity Forms
$gforms_file = trailingslashit( get_stylesheet_directory() ) . 'compatibility/gravity_forms.php';
if ( is_readable( $gforms_file ) && class_exists('GFForms') ) {
require_once $gforms_file;
}
function customify_wedocs_layout( $layout ){
if ( is_singular( 'docs' ) ) {
return 'content';
}
return $layout;
}
add_filter( 'customify_get_layout', 'customify_wedocs_layout' ) ;
function customify_edd_dashboad_url( $url ){
if ( isset( $GLOBALS['_customify_tab'] ) ) {
$url = remove_query_arg( ( array( 'tab') ), $url );
return add_query_arg( array( 'tab' => $GLOBALS['_customify_tab'] ), $url );
}
return $url;
}
add_filter( 'edd_get_current_page_url', 'customify_edd_dashboad_url', 35 );
add_filter( 'edd_subscription_update_url', 'customify_edd_dashboad_url', 35 );
add_filter( 'edd_subscription_cancel_url', 'customify_edd_dashboad_url', 35 );
add_filter( 'edd_subscription_reactivation_url', 'customify_edd_dashboad_url', 35 );
/**
* Displays a Manage Licenses link in purchase history
*
* @since 2.7
*/
function customify_edd_sl_site_management_links( $payment_id, $purchase_data ) {
$licensing = edd_software_licensing();
$downloads = edd_get_payment_meta_downloads( $payment_id );
if( $downloads) :
$manage_licenses_url = add_query_arg( array( 'action' => 'manage_licenses', 'payment_id' => $payment_id ) );
if ( isset( $GLOBALS['_customify_tab'] ) ) {
$manage_licenses_url = remove_query_arg( ( array( 'tab') ), $manage_licenses_url );
$manage_licenses_url = add_query_arg( array( 'tab' => 'license-keys' ), $manage_licenses_url );
}
$manage_licenses_url = esc_url( $manage_licenses_url );
echo '<td class="edd_license_key">';
if( edd_is_payment_complete( $payment_id ) && $licensing->get_licenses_of_purchase( $payment_id ) ) {
echo '<a href="' . esc_url( $manage_licenses_url ) . '">' . __( 'View Licenses', 'edd_sl' ) . '</a>';
} else {
echo '-';
}
echo '</td>';
else:
echo '<td>—</td>';
endif;
}
remove_action( 'edd_purchase_history_row_end', 'edd_sl_site_management_links', 10, 2 );
add_action( 'edd_purchase_history_row_end', 'customify_edd_sl_site_management_links', 15, 2 );
//remove_action( 'edd_product_notes', 'edd_all_access_add_receipt_link', 10, 2 );