|
|
@@ -88,35 +88,35 @@ add_action( 'wp_enqueue_scripts', 'vue_theme_scripts' );
|
|
88
|
88
|
* disable endpoints in rest api
|
|
89
|
89
|
**/
|
|
90
|
90
|
add_filter( 'rest_endpoints', function ( $endpoints ) {
|
|
91
|
|
- if ( isset( $endpoints['/wp/v2/users'] ) ) {
|
|
92
|
|
- unset( $endpoints['/wp/v2/users'] );
|
|
93
|
|
- }
|
|
94
|
|
- if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
|
|
95
|
|
- unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
|
|
96
|
|
- }
|
|
|
91
|
+ if ( isset( $endpoints['/wp/v2/users'] ) ) {
|
|
|
92
|
+ unset( $endpoints['/wp/v2/users'] );
|
|
|
93
|
+ }
|
|
|
94
|
+ if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
|
|
|
95
|
+ unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
|
|
|
96
|
+ }
|
|
97
|
97
|
|
|
98
|
98
|
if ( isset( $endpoints['/wp/v2/comments'] ) ) {
|
|
99
|
|
- unset( $endpoints['/wp/v2/comments'] );
|
|
100
|
|
- }
|
|
101
|
|
- if ( isset( $endpoints['/wp/v2/comments/(?P<id>[\d]+)'] ) ) {
|
|
102
|
|
- unset( $endpoints['/wp/v2/comments/(?P<id>[\d]+)'] );
|
|
|
99
|
+ unset( $endpoints['/wp/v2/comments'] );
|
|
103
|
100
|
}
|
|
104
|
|
-
|
|
|
101
|
+ if ( isset( $endpoints['/wp/v2/comments/(?P<id>[\d]+)'] ) ) {
|
|
|
102
|
+ unset( $endpoints['/wp/v2/comments/(?P<id>[\d]+)'] );
|
|
|
103
|
+ }
|
|
|
104
|
+
|
|
105
|
105
|
if ( isset( $endpoints['/wp/v2/settings'] ) ) {
|
|
106
|
|
- unset( $endpoints['/wp/v2/settings'] );
|
|
107
|
|
- }
|
|
108
|
|
- return $endpoints;
|
|
109
|
|
-} );
|
|
|
106
|
+ unset( $endpoints['/wp/v2/settings'] );
|
|
|
107
|
+ }
|
|
|
108
|
+ return $endpoints;
|
|
|
109
|
+ } );
|
|
110
|
110
|
|
|
111
|
|
-/**
|
|
112
|
|
- * remove wordpress version number from files
|
|
113
|
|
- **/
|
|
|
111
|
+// Remove wordpress version number from files
|
|
114
|
112
|
remove_action( 'wp_head', 'wp_generator' );
|
|
115
|
113
|
|
|
116
|
114
|
// Disable XML-RPC
|
|
117
|
115
|
add_filter('xmlrpc_enabled', '__return_false');
|
|
|
116
|
+
|
|
118
|
117
|
// Disable WLManifest
|
|
119
|
118
|
remove_action( 'wp_head', 'wlwmanifest_link' ) ;
|
|
|
119
|
+
|
|
120
|
120
|
// Disable self ping
|
|
121
|
121
|
function disable_pingback( &$links ) {
|
|
122
|
122
|
foreach ( $links as $l => $link )
|
|
|
@@ -124,11 +124,14 @@ function disable_pingback( &$links ) {
|
|
124
|
124
|
unset($links[$l]);
|
|
125
|
125
|
}
|
|
126
|
126
|
add_action( 'pre_ping', 'disable_pingback' );
|
|
|
127
|
+
|
|
127
|
128
|
// Disable RSD (used with self ping and XML-RPC)
|
|
128
|
129
|
remove_action( 'wp_head', 'rsd_link' ) ;
|
|
|
130
|
+
|
|
129
|
131
|
// Disable post embed
|
|
130
|
132
|
function disable_embed() { wp_dequeue_script( 'wp-embed' ); }
|
|
131
|
133
|
add_action( 'wp_footer', 'disable_embed' );
|
|
|
134
|
+
|
|
132
|
135
|
// Disable Shortlinking
|
|
133
|
136
|
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
|
|
134
|
137
|
|
|
|
@@ -138,6 +141,7 @@ function remove_cssjs_ver( $src ) {
|
|
138
|
141
|
$src = remove_query_arg( 'ver', $src );
|
|
139
|
142
|
return $src;
|
|
140
|
143
|
}
|
|
|
144
|
+// !:Possible Bug HERE
|
|
141
|
145
|
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
|
|
142
|
146
|
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
|
|
143
|
147
|
|
|
|
@@ -162,3 +166,12 @@ add_action( 'wp_enqueue_scripts', 'webapptiv_remove_block_library_css' );
|
|
162
|
166
|
|
|
163
|
167
|
// header( 'Access-Control-Allow-Origin: http://localhost:8080' );
|
|
164
|
168
|
header( 'Content-Type: application/json' );
|
|
|
169
|
+
|
|
|
170
|
+// function artists_types() {
|
|
|
171
|
+// p2p_register_connection_type( array(
|
|
|
172
|
+// 'name' => 'artists_to_episodes',
|
|
|
173
|
+// 'from' => 'artist',
|
|
|
174
|
+// 'to' => 'episode'
|
|
|
175
|
+// ) );
|
|
|
176
|
+// }
|
|
|
177
|
+// add_action( 'p2p_init', 'artists_types' );
|