Adding admin menus to wordpress

add_action(‘add_meta_boxes’, ‘add_testbox’); function add_testbox() { add_meta_box( ‘testmetabox’, ‘Test Meta Box’, ‘testmetabox_content’, ‘post’, ‘side’, ‘low’); } function testmetabox_content() { echo “hi”; } You can drag and drop the box into the spot you want it to display. Make sure you always wrap the add_meta_box() function in another function, then hook that in like I showed. If … Read more

Add Link Category on Activation?

Link category is a simple taxonomy just like categories , named: link_category so to add one you can use wp_insert_term() eg: wp_insert_term( ‘My link category’, // the term ‘link_category’, // the taxonomy array( ‘description’=> ‘this is a description.’, ‘slug’ => ‘my-link-category’ ) ); and to make all this happen on plugin activation take a look … Read more

WordPress Specified file failed upload test

You need to add the mime type to the whitelist of allowed file types. Assuming this one still works, you can go the plugin route using. http://wordpress.org/extend/plugins/pjw-mime-config/ Alternatively if you want to add your own mimes in code form, here’s an example. add_filter( ‘upload_mimes’, ‘your_custom_mimes’ ); function your_custom_mimes( $mimes ) { $mimes[‘extensionhere’] = ‘mimetype/goes-here’; return … Read more