Skip to main content
added 40 characters in body
Source Link
Yuri
  • 1.1k
  • 4
  • 25
  • 46

** This question is outdated! **

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

**UPDATE**

I am not a PHP coder, so I do not know if what I did is correct, but this works - no errors, no warnings, no plugin update:

// Disable plugin update
function my_filter_plugin_updates() {
   $value = new StdClass;
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

**UPDATE**

I am not a PHP coder, so I do not know if what I did is correct, but this works - no errors, no warnings, no plugin update:

// Disable plugin update
function my_filter_plugin_updates() {
   $value = new StdClass;
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

** This question is outdated! **

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

**UPDATE**

I am not a PHP coder, so I do not know if what I did is correct, but this works - no errors, no warnings, no plugin update:

// Disable plugin update
function my_filter_plugin_updates() {
   $value = new StdClass;
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );
added 446 characters in body
Source Link
Yuri
  • 1.1k
  • 4
  • 25
  • 46

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

**UPDATE**

I am not a PHP coder, so I do not know if what I did is correct, but this works - no errors, no warnings, no plugin update:

// Disable plugin update
function my_filter_plugin_updates() {
   $value = new StdClass;
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );

**UPDATE**

I am not a PHP coder, so I do not know if what I did is correct, but this works - no errors, no warnings, no plugin update:

// Disable plugin update
function my_filter_plugin_updates() {
   $value = new StdClass;
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );
Source Link
Yuri
  • 1.1k
  • 4
  • 25
  • 46

'Attempt to modify property of non-object' warning

I use the bellow function to disable a plugin update. It works, because I use an old version of this plugin and it does not show me that a newer version exists, but, however, I get a warning on line 2: Attempt to modify property of non-object. How to fix this?

function my_filter_plugin_updates( $value ) {
   unset( $value->response['duplicator/duplicator.php'] ); //Duplicator
   return $value;
}

add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );