PluginProbe
Table Sorter / 1.0
Table Sorter v1.0
trunk 1.0 2.0 2.1 2.2 2.3
table-sorter / table-sorter.php

table-sorter.php in Table Sorter 1.0, at table-sorter.php

38 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Table Sorter
4 * Plugin URI: http://tablesorter.oregasoft.com
5 * Description: This plugin makes your standard HTML tables sortable. For more details, visit plugin's setting page
6 * Version: 1.0
7 * Author: Farhan Noor
8 * Author URI: http://linkedin.com/in/thenoors
9 * License: GPLv2 or later
10 */
11
12 wp_register_script('table-sorter',plugins_url('table-sorter/jquery.tablesorter.min.js','table-sorter'),array('jquery'));
13 wp_enqueue_script('table-sorter-metadata',plugins_url('table-sorter/jquery.metadata.js','table-sorter'),array('table-sorter'));
14 wp_enqueue_script('table-sorter-custom-js',plugins_url('table-sorter/wp-script.js','table-sorter'));
15 wp_enqueue_style('table-sorter-custom-css',plugins_url('table-sorter/wp-style.css'));
16
17 function my_plugin_menu(){
18 add_options_page( 'Table Sorter', 'Table Sorter', 'manage_options', 'table-sorter', 'tablesorter_callback');
19 }
20 add_action('admin_menu', 'my_plugin_menu');
21 function tablesorter_callback(){
22 require_once('wp-admin-page.php');
23 }
24
25 function my_plugin_row_meta( $links, $file ) {
26 if ( strpos( $file, 'table-sorter.php' ) !== false ) {
27 $new_links = array('<a href="' . admin_url( 'options-general.php?page=table-sorter' ) . '">Settings</a>');
28 $links = array_merge( $links, $new_links );
29 }
30 return $links;
31 }
32 add_filter( 'plugin_row_meta', 'my_plugin_row_meta', 10, 2 );
33
34 function add_action_links ( $links ) {
35 $mylinks = array('<a href="' . admin_url( 'options-general.php?page=table-sorter' ) . '">Settings</a>');
36 return array_merge( $links, $mylinks );
37 }
38 add_filter( 'plugin_action_links_table-sorter/table-sorter.php', 'add_action_links' );