true // ,'edit_posts'=>true // ,'edit_others_posts'=>true // ,'edit_published_posts'=>true // ,'delete_posts'=>true // ,'delete_published_posts'=>true // ,'publish_posts'=>true ,'publish_pages'=>true ,'delete_pages'=>true ,'edit_pages'=>true ,'edit_others_pages'=>true ,'edit_published_pages'=>true ,'delete_published_pages'=>true ,'edit_wiki'=>true); $wp_roles->add_role('wiki_editor', 'Wiki Editor',$role_capabilities); } $role = get_role('administrator'); $role->add_cap('edit_wiki'); function wiki_post_revisions($content='') { global $post, $current_user, $role; if ( !$post = get_post( $post->ID ) ) return $content; $initial_post_id = $post->ID; if($post->post_type == 'revision' && ($post->post_parent > 0)) { if(!$post = get_post( $post->post_parent )) return $content; } $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' ); extract( wp_parse_args( $args, $defaults ), EXTR_SKIP ); $type = 'revision'; switch ( $type ) { case 'autosave' : if ( !$autosave = wp_get_post_autosave( $post->ID ) ) return $content; $revisions = array( $autosave ); break; case 'revision' : // just revisions - remove autosave later case 'all' : default : if ( !$revisions = wp_get_post_revisions( $post->ID ) ) return $content; break; } //echo("
".print_r($revisions,true).""); $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' ); if ( $parent ) array_unshift( $revisions, $post ); $rows = ''; $class = false; $can_edit_post = current_user_can( 'edit_post', $post->ID ); //Track the first iteration as this is the current version auther who is different from the original $k=0; foreach ( $revisions as $revision ) { $is_selected = ''; if ( !current_user_can( 'read_post', $revision->ID ) ) continue; if ( 'revision' === $type && wp_is_post_autosave( $revision ) ) continue; if($initial_post_id == $revision->ID ) { $is_selected = "class='selected-revision'"; } $date = wiki_post_revision_title( $revision ); $name = get_author_name( $revision->post_author ); $title = sprintf( $titlef, $date, $name ); $rows .= "\t
".print_r($query,true).""); } } function wiki_view_sql_query($query) { /** * This function makes wordpress treat a revision as a single post */ global $wp_query; if((int)$_GET['revision'] > 0 ) { $wp_query->is_single= true; // echo("
".print_r($wp_query,true).""); } return $query; } /** * wiki page metabox section starts */ function wiki_metabox_module() { /** * this function creates the HTML for the wiki page metabox module */ global $wpdb, $post_meta_cache; if(is_numeric($_GET['post'])) { $post_ID = (int)$_GET['post']; $wpsc_members_data = get_post_meta($post_ID,'wiki_page'); if(is_array($wpsc_members_data) && ($wpsc_members_data[0] == 1)) { $checked_status = "checked='checked'"; $wiki_toc_data = get_post_meta($post_ID,'wiki_page_toc'); if(is_array($wiki_toc_data) && ($wiki_toc_data[0] == 1)) { $wiki_toc_status = "checked='checked'"; } else { $wiki_toc_status = ""; } } else { $checked_status = ""; $wiki_toc_status = "disabled"; } } else { $checked_status = ""; $wiki_toc_status = "disabled"; } ?>
'.__('wiki URL: ').''.$post->post_title.'
'.__('Modifiyed By: ').''. get_author_name($post->post_author).'
'; ?>
'widget_my_contributions', 'description' => __( "My Contributions widget for WordPress Wiki Plugin") ); wp_register_sidebar_widget('my_contributions', __('My Contributions'), 'wiki_widget_myc', $widget_ops); wp_register_widget_control('my_contributions', __('My Contributions'),'wiki_widget_myc_control', 300, 100); } /** * Build links from shortcodes * @param
" . __("Sorry, the page with title ") . $not_found . __(" is not created yet. Click") . '' . __("here") . '' . __(" to create a new page with that title.") . "