Mark Wilkinson
Forum Replies Created
-
Forum: Hacks
In reply to: Custom Capability for Custom Post TypeFound the answer eventually thanks for looking at the way other plugins have done this, most notably the Whistles plugin by Justin Tadlock. Below is my solution.
When register the post type with
register_post_typeyou can pass capability types like this (for a custom post type named bulletin):'capability_type' => 'bulletin', 'map_meta_cap' => true, 'capabilities' => array( // meta caps (don't assign these to roles) 'edit_post' => 'edit_bulletin', 'read_post' => 'read_bulletin', 'delete_post' => 'delete_bulletin', // primitive/meta caps 'create_posts' => 'create_bulletins', // primitive caps used outside of map_meta_cap() 'edit_posts' => 'edit_bulletins', 'edit_others_posts' => 'manage_bulletins', 'publish_posts' => 'manage_bulletins', 'read_private_posts' => 'read', // primitive caps used inside of map_meta_cap() 'read' => 'read', 'delete_posts' => 'manage_bulletins', 'delete_private_posts' => 'manage_bulletins', 'delete_published_posts' => 'manage_bulletins', 'delete_others_posts' => 'manage_bulletins', 'edit_private_posts' => 'edit_bulletins', 'edit_published_posts' => 'edit_bulletins' ),Then you need to assign the these capabilities to users on plugin activation (or another appropriate hook) to allow them to use the post type:
function mdw_plugin_activation() { /* Get the administrator role. */ $mdw_role = get_role( 'administrator' ); /* If the administrator role exists, add required capabilities for the plugin. */ if ( !empty( $rhsstf_role ) ) { $mdw_role->add_cap( 'manage_bulletins' ); $mdw_role->add_cap( 'create_bulletins' ); $mdw_role->add_cap( 'edit_bulletins' ); } } register_activation_hook( __FILE__, 'mdw_plugin_activation' );Forum: Hacks
In reply to: Custom Capability for Custom Post TypeThanks for coming back to me with that and I will take another look at the resource you have outlined. That was in fact the place I started however I could not quite get my head around it. Will take another look.
Thanks for your help.
Forum: Localhost Installs
In reply to: Error establishing database connection!!!Sounds like you just need to change the database connection details in the wp-config.php file on the remote site. They are probably different from your local connection details.
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageThanks Esmi – that would be my next step!!
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageAlso check the error logs with your host – they may give you a clue as to what is causing the error
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageAre you using theme other than one of the defaults – twenty[something]?
Forum: Localhost Installs
In reply to: MAMP Pro 2.2 and live to local problemsSounds like you need to run a search and replace on the database to replace all of the old URLs with the new ones. The script below is great for doing this:
http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Forum: Fixing WordPress
In reply to: Trouble logging in to web pageFirst thing to try is deactivating all plugins and switching to the default theme (twenty[something])
Forum: Fixing WordPress
In reply to: Authorship Link not workingYou have double quotes in the link. The HTML reads as follows:
<a href="”https://plus.google.com/+LonnyHeiner?rel=author"">Google Profile</a>It should read:
<a href="https://plus.google.com/+LonnyHeiner?rel=author">Google Profile</a>Forum: Plugins
In reply to: [User Switching] User Switching from Admin BarYes that is correct it does as you have described. I have not noticed any performance loss but only really tested it with max 10 users on a site.
There is also a github repo for this now too:
Forum: Themes and Templates
In reply to: Change the title and home menu navigation linksTake a look here for creating your own menu:
http://en.support.wordpress.com/menus/
I know it is wordpress.com but it is the same in Twenty Twelve.
Forum: Fixing WordPress
In reply to: media image upload problemHave you taken a look here:
Forum: Themes and Templates
In reply to: [Stitch] Removing page title ?On line 699 of your themes style.css file you will see the following:
.entry-title, .entry-title a { color: #74452e; display: block; font-family: "Fjalla One", script; font-size: 32px; font-size: 3.2rem; margin: 0; max-width: 94%; text-transform: uppercase; }Try replacing it with this:
.entry-title, .entry-title a { color: #74452e; display: none; font-family: "Fjalla One", script; font-size: 32px; font-size: 3.2rem; margin: 0; max-width: 94%; text-transform: uppercase; }Forum: Themes and Templates
In reply to: How to change from one nav to the other after log inYou would need something along these lines in your template file where the nav is called:
<?php if( is_user_logged_in() ) { // code for navbar for logged in users } else { // code for navbar for none logged in users } ?>Forum: Plugins
In reply to: [User Switching] User Switching from Admin BarExcellent thanks for that – it works a treat. I thought there would be an easier way, it was just getting to know how the plugin did this.
Thanks again.
My amended plugin is now here: