Getting incoming posts by user

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
February 28, 2014 at 4:35 am #3438
dovetail
Post count: 18

Created a custom role called “volunteer.”
Created a custom post type “timecard” with a custom “Related User” field called “volunteer”. Added some timecards in the WP back end, and associated them to a volunteer user. They’re showing up fine in the back end.

Logged in as that user, and browsed to front-end page with this code:

(1) $this_user_id = get_current_user_id();
(2) $this_user = $wf->user_by_id($this_user_id);
(3) foreach ($this_user->incoming(“post_type=timecard”) as $timecard) { … }

Line (3) causes the following PHP errors:

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1179

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1178

Notice: Undefined variable: iid in /var/www/vhosts/oldstlouis.com/cmavolunteers.com/wp-content/plugins/masterpress/core/api/meow/meow-data-provider.php on line 1182

I var_dumped “$this_user” and it was correct, so it’s definitely the iterator that is breaking the code.

A clue: there were 6 timecards in the system, although only two of them were associated to this user. There were 13 errors, but 6 each attributed to lines 1178 & 1182. I added a 7th timecard, and now there are 15 errors (7 each attributed to lines 1178 & 1182) So it seems like it’s pulling ALL timecards (not just ones associated to this user), and triggering two errors for each, plus an extra error on line 1179.

  • This topic was modified 10 years, 9 months ago by dovetail.
February 28, 2014 at 4:14 pm #3440
traversal
Post count: 207

Hmm, not ideal, clearly. I’ll setup the same scenario myself and work out what’s going on there.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Latest From the Blog

Ability to deactivate licence domains within MasterPress account management

25th October 2024

We have just rolled out an account management feature which allows licence holders to have better control over the domains that use their licence key. From the MasterPress Account Management page, the list of Active Sites that use your licence now includes a function that allows you to remove a domain from your licence. Simply… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM