2:42 am
That gives me:
Modifying existing posts. Please wait... Fatal error: Cannot use object of type stdClass as array in /home/domains/xxx/httpdocs/wp-content/plugins/CyberSEO/cyberseo-tools.php(0) : runtime-created function on line 1
I have 3 posts with no custom fields. And one post with that custom field.
I am trying to get the plugin to only affect posts with that custom field.
I also tried accessing it as an object, but it doesn't return true for that one post and run.
3:05 am
if(!isset($post->custom_fields->switched )) {
$post->custom_fields->switched = 2;
}
The switched = 2 gives an error...
So I used it to check the comparison. With the code above it should spit out 3 errors because one post has its custom_fields: switched set to 1. So that one should return as set and the other not set and the code should only be run 3 times.
It is being run 4 times which means $post->custom_fields->switched is not being set by CyberSEO. It isn't grabbing that from the DB to make this check it seems.
3:24 am
Well, I specified in the title and the first like that this was for the Tools, Global post mod.
But anyway...
Modifying existing posts. Please wait... Warning: addslashes() expects parameter 1 to be string, object given in /home/domains/xxx/httpdocs/wp-includes/formatting.php on line 3392 Warning: addslashes() expects parameter 1 to be string, object given in /home/domains/xxx/httpdocs/wp-includes/formatting.php on line 3392 Warning: addslashes() expects parameter 1 to be string, object given in /home/domains/xxx/httpdocs/wp-includes/formatting.php on line 3392 Warning: addslashes() expects parameter 1 to be string, object given in /home/domains/xxx/httpdocs/wp-includes/formatting.php on line 3392 Done!
And if I modify the code:
$post['custom_fields']['switched'] = 2;
I get error:
Modifying existing posts. Please wait... Fatal error: Cannot use object of type stdClass as array in /home/domains/xxx/httpdocs/wp-content/plugins/CyberSEO/cyberseo-tools.php(0) : runtime-created function on line 3
5:01 am
That worked. Thanks!
Might want to update pages like this one: Login to see this link
To also talk about the wordpress API being needed to get the ID on the global changer. Had it been there or that other page (6?) of some documentation that came up in Google I would have figured it out without needing to bother you.
Most Users Ever Online: 541
Currently Online:
13 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
ninja321: 84
s.baryshev.aoasp: 68
Freedom: 61
Pandermos: 54
MediFormatica: 49
B8europe: 48
Member Stats:
Guest Posters: 337
Members: 2855
Moderators: 0
Admins: 1
Forum Stats:
Groups: 1
Forums: 5
Topics: 1642
Posts: 8358
Newest Members:
samuel2288, comercios.cercademi, wanmarkets, torontomark48, info.ckmedianetwork, contact.mybeautystarAdministrators: CyberSEO: 3950