Changeset 515453
- Timestamp:
- 03/06/2012 05:00:35 PM (14 years ago)
- Location:
- database-peek/trunk
- Files:
-
- 3 edited
-
database-peek.php (modified) (2 diffs)
-
integrate.php (modified) (2 diffs)
-
settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
database-peek/trunk/database-peek.php
r515448 r515453 100 100 101 101 if (is_multisite()) { 102 if ( !$this->is_wp_ms_table($table)) {102 if ($this->is_wp_ms_table($table)) { 103 103 if (preg_match('#' . $wpdb->base_prefix . '(\d*)_.*#', $table, $matches)) 104 104 return intval($matches[1]); … … 118 118 119 119 $blogid = $this->get_table_blog_id($table); 120 121 if ($blogid == -1) return '';122 123 120 if (is_multisite()) { 124 121 return get_blog_option($blogid, 'blogname'); -
database-peek/trunk/integrate.php
r513959 r515453 5 5 6 6 function integrate() { 7 add_action( 'add_meta_boxes', array($this,'create_metaboxes') ); 7 if (!ABDatabasePeekSettings::option_integrate()) return; 8 8 9 add_action( 'post_row_actions', array($this,'add_post_row_action'), 10, 2); 9 10 add_filter( 'page_row_actions', array($this,'add_post_row_action'), 10, 2); … … 12 13 add_filter( 'tag_row_actions', array($this,'add_tag_row_action'), 10, 2); 13 14 add_filter( 'user_row_actions', array($this,'add_user_row_action'), 10, 2); 15 add_filter( 'get_sample_permalink_html', array($this, 'link_to_examine')); 14 16 } 15 16 function create_metaboxes() { 17 18 if (!ABDatabasePeekSettings::option_integrate()) return; 19 20 add_meta_box( 21 'ab_database_peek_post_meta_box', 22 __( 'Database'), 23 array($this,'post_custom_box'), 24 'post', 25 'side', 26 'low' 27 ); 28 29 add_meta_box( 30 'ab_database_peek_page_meta_box', 31 __( 'Database'), 32 array($this,'post_custom_box'), 33 'page', 34 'side', 35 'low' 36 ); 37 } 38 39 40 function post_custom_box($post) { 17 18 function link_to_examine( $content ) { 19 global $post; 41 20 global $wpdb; 42 21 22 $link = ""; 23 43 24 $examine = _('Examine'); 44 25 $url = ABDatabasePeek::show_table_link($wpdb->posts, $post->ID); 45 echo "<a href=\"$url\">$examine</a>"; 46 } 26 $link = "<span id=\"examine-post-btn\"><a href=\"$url\" class=\"button\">$examine</a></span>"; 47 27 48 28 return $content . $link; 29 } 30 49 31 function add_post_row_action($actions, $post){ 50 32 global $wpdb; -
database-peek/trunk/settings.php
r514852 r515453 75 75 <td> 76 76 <input type="checkbox" id="ABDatabasePeek-integrate" name="ABDatabasePeek-integrate" value="1" <?php if ($this->option_integrate()) echo 'checked'; ?> /> 77 <span class="description">Display a link on edit page for pages and posts.</span>77 <span class="description">Display "Examine" links in admin UI.</span> 78 78 </td> 79 79 </tr>
Note: See TracChangeset
for help on using the changeset viewer.