doc_role && ( !defined( 'RA_DOCUMENT_REPO_BLOG_ID' ) || !current_user_can_for_blog( 'manage_options', RA_DOCUMENT_REPO_BLOG_ID ) ) && !current_user_can( 'manage_options' ) ) return; $wp_admin_bar->add_menu( array( 'id' => 'umw', 'title' => __( 'Document Admin' ), 'href' => RA_DOCUMENT_REPO_URL . '/wp-admin/edit.php?post_type=umw_document' ) ); } /* load the front end of the document repository in the edit post media popup to allow inserting links to documents into posts */ function media_upload_document() { wp_iframe( 'ra_media_document_callback' ); exit; } /* add the document media button to the media button row in the post editor */ function media_buttons_context( $context ) { global $post_type; if( $post_type == 'umw_document' ) return $context; $media_button = preg_replace( '|^(.*src=[\'"])' . admin_url( '/') . '(.*)$|', ' $1$2', _media_button( __( 'Insert Document' ), plugin_dir_url( __FILE__ ) . 'images/doc.jpg', 'document' ) ); return $context . $media_button; } function admin_head_document() { ?>