Changeset 756540
- Timestamp:
- 08/15/2013 07:01:39 AM (12 years ago)
- Location:
- page-management/trunk
- Files:
-
- 1 added
- 4 edited
-
page-management.css (added)
-
page-management.js (modified) (2 diffs)
-
page-management.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
page-management/trunk/page-management.js
r755795 r756540 2 2 * Plugin Name: Page Management 3 3 * Plugin URI: http://www.wpshowcase.net/plugins/page-management-plugin/ 4 * Description: Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page that enables you to view the main pages of your site without the child pages.4 * Description: Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view. 5 5 * Version: 0.0 6 6 * Author: WPShowCase 7 7 * Author URI: http://www.wpshowcase.net 8 8 * 9 * Page Management is a very useful for large sites simple by allowing you to skip viewing the child pages by checking10 * checkbox.9 * Page Management is a useful tool for large sites which adds a button to pages which allows their subpages 10 * to be hidden in the All Pages view - so the author can see the pages more easily. 11 11 * 12 12 * @package PageManagement … … 19 19 20 20 jQuery(document).ready(function ($) { 21 $('.edit-php #posts-filter #post-query-submit').before('<label>Hide child pages <input type="checkbox" id="hidechildpages" name="hidechildpages" /></label> '); 22 if(window.location.href.indexOf('hidechildpages')>0) 23 $('#hidechildpages').attr('checked','checked'); 21 $('.edit-php #the-list .column-title').prepend('<div class="showhidetreecontainer"> </div>'); 22 $('.edit-php #the-list tr.parent .showhidetreecontainer').html('<button class="showhidetree">-</button>'); 23 24 $('.showhidetree').click(function() { 25 var id = $(this).parent().parent().parent().attr('id'); 26 id = id.slice(id.indexOf('-') + 1); 27 if($(this).html()=='-') { 28 $(this).html('+'); 29 $('.descendent-'+id ).toggle( 1000 ); 30 } 31 else { 32 $(this).html('-'); 33 $('.descendent-'+id ).toggle( 1000 ); 34 } 35 return false; 24 36 }); 37 }); -
page-management/trunk/page-management.php
r755795 r756540 3 3 * Plugin Name: Page Management 4 4 * Plugin URI: http://www.wpshowcase.net/plugins/page-management-plugin/ 5 * Description: Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page that enables you to view the main pages of your site without the child pages.5 * Description: Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view. 6 6 * Version: 0.0 7 7 * Author: WPShowCase 8 8 * Author URI: http://www.wpshowcase.net 9 9 * 10 * Page Management is a very useful for large sites simple by allowing you to skip viewing the child pages by checking11 * checkbox.10 * Page Management is a useful tool for large sites which adds a button to pages which allows their subpages 11 * to be hidden in the All Pages view - so the author can see the pages more easily. 12 12 * 13 13 * @package PageManagement … … 18 18 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 19 */ 20 21 /*Adds the checkbox*/ 22 add_action('admin_init', 'page_management_js'); 20 if ( !defined('ABSPATH')) exit; 23 21 24 if (!function_exists('page_management_js')) { 25 function page_management_js() { 26 wp_enqueue_script('pagemanagementscript', plugins_url( '/page-management.js' , __FILE__ ), array('jquery')); 22 /*Add CSS and Javascript*/ 23 add_action('admin_init', 'page_management_scripts'); 24 25 function page_management_scripts() { 26 wp_enqueue_script('jquery'); 27 wp_enqueue_script('jquery-ui-core'); 28 wp_enqueue_script('pagemanagementscript', plugins_url( '/page-management.js' , __FILE__ ), array('jquery','jquery-ui-core')); 29 wp_register_style( 'pagemanagementcss', WP_PLUGIN_URL . '/page-management/page-management.css' ); 30 wp_enqueue_style( 'pagemanagementcss'); 31 } 32 33 /** 34 * Adds relationships in css between the posts. 35 */ 36 function page_management_post_classes($classes) { 37 global $post; 38 $ancestor = $post->post_parent; 39 while($ancestor>0) { 40 $classes[] = 'descendent-'.$ancestor; 41 $ancestor = get_post($ancestor)->post_parent; 42 } 43 $a_wp_query = new WP_Query(); 44 $all_wp_pages = $a_wp_query->query(array('post_type' => 'page')); 45 if(count(get_page_children( $post->ID, $all_wp_pages ))>0) 46 $classes[]='parent'; 47 return $classes; 48 } 49 add_filter('post_class', 'page_management_post_classes'); 50 51 class options_page { 52 function __construct() { 53 add_action('Pages', array(&$this, 'admin_menu')); 54 } 55 function admin_menu () { 56 add_options_page('Page Title','Circle Tree Login','manage_options','options_page_slug',array($this, 'settings_page')); 57 } 58 function settings_page () { 59 echo 'This is the page content'; 27 60 } 28 61 } 29 62 new options_page; 30 63 31 64 /*Filters the pages*/ -
page-management/trunk/readme.txt
r755795 r756540 2 2 Contributors: WPShowCase 3 3 Donate link: http://www.wpshowcase.net/ 4 Tags: page management, page filter 4 Tags: page management, page filter, all pages, page tree, admin pages, page manager, hierarchy 5 5 Requires at least: 2.7 6 6 Tested up to: 3.6 7 Stable tag: t runk7 Stable tag: tags/1.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Page Management adds a checkbox on the wp-admin "All Pages" page so that you can view the main pages of your site without the child pages.11 Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view. 12 12 13 13 == Description == 14 14 15 Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page 16 that enables you to view the main pages of your site without the child pages. So you can keep the main 17 pages up-to-date easily. 15 Page Management is a useful tool for large sites which adds a button to pages which allows their subpages 16 to be hidden in the All Pages view - so the author can see the pages more easily. 18 17 19 18 == Installation == … … 27 26 == Changelog == 28 27 28 = 1.0 = 29 * Checkbox removed and buttons to expand pages added. 30 29 31 = 0.0 = 30 32 * Created
Note: See TracChangeset
for help on using the changeset viewer.