Reservations as Post
Read about roles and capabilities on codex: http://codex.wordpress.org/Roles_and_Capabilities
Read about roles and capabilities on codex: http://codex.wordpress.org/Roles_and_Capabilities
It’s working now. I’m not sure why or how. I tried applying the workaround to bug 19378 that’s posted in comment 6 of this page ( http://core.trac.wordpress.org/ticket/19378 ) since it looked related. It didn’t seem to have an effect immediately, but I am guessing that’s what did it?
Actually I got it, just needed some simple logic. If the post has an “owner” (the only person that can edit the post) I manually set the custom field “owned” to 1 and the author as the one that can edit. On the edit post page (I’m doing it front-end) I check if “owned” custom … Read more
The capabilities are stored as user meta data in a serialized array for each site. The key as a regular expression would look like that: ‘~’ . $GLOBALS[‘wpdb’]->base_prefix . ‘(\d+)_capabilities~’ So … get the user meta data, find the capability strings (they hold the roles), and compare the unserialized result with the role you want … Read more
Capability to read user’s own draft post of CPT
I was able to solve my problem with this query, although I bet it can be more efficient (I just couldn’t figure out how to do it.) SELECT DISTINCT p.* FROM wp_posts p LEFT JOIN wp_usermeta um ON p.post_author = um.user_id LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id INNER JOIN ( SELECT txrm.object_id FROM … Read more
Sounds like your authors need to be ‘Editors’.
You can detect where the user comes from (like Google) using HTTP_REFERER. <?php if (strpos($_SERVER[‘HTTP_REFERER’], “google”) == true) { echo “Hello Google User!”; } ?> So for your logged-in user: <?php if ( current_user_can( ‘subscriber’ ) && strpos( $_SERVER[‘HTTP_REFERER’], ‘google’ ) ) { ?> [content here] <?php } ?> Important Links wp_get_referer()
I managed to figure it out myself (numbers of hours spent: way too high). Initially I thought using the unfiltered_html capability for administrators would solve the issue. Even if it would (which it didn’t), it would be somewhat of a shotgun approach to a revolver issue. Upon further searching, I learned that wordpress has a … Read more
Customer portal (posts as checklist)