If you have customized wordpress plugin for a client, be sure to disable plugin updates. Use the following filter for that:

add_filter( 'http_request_args', function ( $response, $url ) {

if ( 0 === strpos( $url, 'https://api.wordpress.org/plugins/update-check' ) ) {

$basename = plugin_basename( __FILE__ );

$plugins = json_decode( $response['body']['plugins'] );

unset( $plugins->plugins->$basename );

unset( $plugins->active[ array_search( $basename, $plugins->active ) ] );

$response['body']['plugins'] = json_encode( $plugins );

}

return $response;

}, 10, 2 );

If you have customized wordpress theme for a client, be sure to disable plugin updates. Use the following filter for that:

add_filter( 'http_request_args', function ( $response, $url ) {


if ( 0 === strpos( $url, 'https://api.wordpress.org/themes/update-check' ) ) {

$themes = json_decode( $response['body']['themes'] );

unset( $themes->themes->{get_option( 'template' )} );

unset( $themes->themes->{get_option( 'stylesheet' )} );

$response['body']['themes'] = json_encode( $themes );

}



return $response;



}, 10, 2 );

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.