While writing my F# posts I had many problems with WordPress’ visual editor. It was constantly mangling my code snippets – and it would be painful to go back through them and correct them by hand. I got fed up with the visual editor so I turned it off. But editing in straight HTML wasn’t as nice as I would like it either.
While I was on hiatus the Stack Overflow site launched. I’ve found it incredibly useful and I keep going back there again and again. One thing I love about their site is the simplified syntax they use: Markdown. I liked it so much that I wanted to use it under the covers for my blog here. I found the Markdown for WordPress and bbPress and WP MarkItUp! plugins and installed them. Markdown for WordPress allows writing posts in Markdown and MarkItUp replaces the editor toolbar with buttons related to Markdown instead of HTML.
Markdown for WordPress worked great. I had no problem editing my posts in Markdown. However, I had a problem configuring MarkItUp. Every time I tried to access the settings page for MarkItUp I received a blang page with the following error: “You do not have sufficient permissions to access this page.” The plugin hadn’t been updated in over a year, so I figured that it was a small incompatibility with WordPress 3. I delved into the markitup_class.php file included with the plugin and found this line:
add_options_page('WP MarkItUp!', 'WP MarkItUp!', 8, 'WP MarkItUp!', array(&$this, 'option_page'));
The WordPress [Adding Administration Menu page] describes the 3rd argument as “The capability required for this menu to be displayed to the user.” and further details that, “user levels are deprecated and should not be used here!” Well…that ‘
8‘ certianly looks like a user level to me! I replaced the ‘
8‘ with the
'manage_options' capability and deactivated then reactivated the plugin. After that…I was still unable to access the plugin settings page.
I looked in the address bar and noticed that the URL ended in “
MarkItUp!“. Special characters in URLs can be fishy, so I looked at the 4th argument, the
menu_slug, and changed it from
'WP MarkItUp!' to
'markitup'. After going through the deactivation/reactivation procedure one more time I was finally able to access the plugin settings page. The final code looks like this:
add_options_page('WP MarkItUp!', 'WP MarkItUp!', 'manage_options', 'markitup', array(&$this, 'option_page'));