creating different edit screens for different roles

Solved it for different edit pages for different roles. In my method resposible for rendering the field I have: if ( count( array_intersect( $allowed_editors, $user->roles ) ) < 1 ) $readonly = ‘readonly’; Which I later use to either set the input field as readonly or add/remove classes before rendering it. Still working for the … Read more

How to remove UI access to Custom Post Type using direct links?

Yes. Use capabilities! When registering a post type, take a look at the capability_type and capabilities. You can define a custom capability map for the standard edit_post, delete_post, etc. for your post type. The thing you remember is, if you customize the capabilities, YOU DON’T HAVE THESE CAPABILITIES EITHER! This means you’ll have to get … Read more

Modify loop to include all post statuses not just ‘published’

Okay, I think to start you need to change line 470 of the file includes/admin/class-learndash-admin-binary-selector.php from: ‘post_status’ => array(‘publish’), to ‘post_status’ => array(‘any’), If this doesn’t work on its own, there may be other places you need to change this as well – do a global file search on ‘post_status’ and look for places where … Read more

Using get_the_excerpt in edit-post

I think (and assuming) you use (without code, it’s hard to know, how you proceed) add_meta_boxes() to do your job. Then your code is logically standing in custom functions. Your function to render the metabox, don’t get the $post global, if you didn’t define it, the function need to know from which post it must … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)