Changeset 571510
- Timestamp:
- 07/12/2012 11:44:05 PM (14 years ago)
- Location:
- dynamics-sidebars
- Files:
-
- 4 edited
-
tags/1.0.2/readme.txt (modified) (6 diffs)
-
trunk/dynamics-sidebars.php (modified) (1 diff)
-
trunk/includes/class-dynamic-sidebars.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dynamics-sidebars/tags/1.0.2/readme.txt
r571489 r571510 18 18 An awesome plugin that let you have a custom sidebar (widget area) for every page, post and/or custom post type. 19 19 20 [Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 21 20 22 **Usage** 21 23 … … 24 26 * Post 25 27 * Page 28 29 **IMPORTANT: Showing the sidebar** 30 31 ***Note you can use this wherever you like to show you sidebar*** 32 33 `<?php 34 dynamic_sidebar( get_the_sidebar() ); 35 ?>` 36 37 Or 38 39 `<?php 40 $sidebar = get_the_sidebar(); 41 if ( is_active_sidebar( $sidebar ) ) { 42 dynamic_sidebar( $sidebar ); 43 } 44 ?>` 26 45 27 46 **Adding support for custom post type** … … 43 62 When you register your custom post type, on 'register_post_type' call. 44 63 45 @see http://codex.wordpress.org/Function_Reference/register_post_typefor more information64 [Function Reference register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type) for more information 46 65 47 66 `<?php 48 67 $args = array( 'supports' => array( 'custom-sidebar' ) ); 49 register_post_type( 'post_type', $args );68 register_post_type( 'post_type', $args ); 50 69 ?>` 51 70 … … 66 85 ?>` 67 86 68 **Showing the sidebar**69 70 ***Note you can use this wherever you like to show you sidebar***71 72 `<?php73 dynamic_sidebar( get_the_sidebar() );74 ?>`75 76 Or77 78 `<?php79 $sidebar = get_the_sidebar();80 if ( is_active_sidebar( $sidebar ) ) {81 dynamic_sidebar( $sidebar );82 }83 ?>`84 85 87 **Changing sidebar args** 86 88 … … 88 90 89 91 `<?php 90 add_filter( 'ds_sidebar_args', 'my_sidebar_args' );91 92 function my_sidebar_args( $defaults ) {92 add_filter( 'ds_sidebar_args', 'my_sidebar_args', 1, 3 ); 93 94 function my_sidebar_args( $defaults, $sidebar_name, $sidebar_id ) { 93 95 $args = array( 94 'description' => 'My widget area',96 'description' => "$sidebar_name widget area", 95 97 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 96 98 'after_widget' => '</li>', 'after_widget', … … 102 104 } 103 105 ?>` 106 107 [Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 104 108 105 109 **Don't forget to check the 'Other Notes' tab for a list of all function and hook you can use.** -
dynamics-sidebars/trunk/dynamics-sidebars.php
r571488 r571510 7 7 * Author Name: Alysson Bortoli 8 8 * Author URI: http://twitter.com/akbortoli 9 * Version: 1.0. 29 * Version: 1.0.3 10 10 * License: GPLv2 or later 11 11 */ -
dynamics-sidebars/trunk/includes/class-dynamic-sidebars.php
r571470 r571510 347 347 if ( ! current_user_can( 'edit_page', $post_id ) ) { 348 348 $response['error'] = true; 349 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'You do not have permission to edit this page.', DS_PLUGIN_I18N_DOMAIN ) );349 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'You do not have permission to edit this page.', DS_PLUGIN_I18N_DOMAIN ), true ); 350 350 } 351 351 } elseif ( 'post' == $post->post_type ) { 352 352 if ( ! current_user_can( 'edit_post', $post_id ) ) { 353 353 $response['error'] = true; 354 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'You do not have permission to edit this post.', DS_PLUGIN_I18N_DOMAIN ) );354 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'You do not have permission to edit this post.', DS_PLUGIN_I18N_DOMAIN ), true ); 355 355 } 356 356 } else { … … 359 359 if ( ! $continue ) { 360 360 $response['error'] = true; 361 $response['message'] = apply_filters( 'ds_save_ajax_message', sprintf( __( 'You do not have permission to edit this %s.', DS_PLUGIN_I18N_DOMAIN ), $post->post_type ) );361 $response['message'] = apply_filters( 'ds_save_ajax_message', sprintf( __( 'You do not have permission to edit this %s.', DS_PLUGIN_I18N_DOMAIN ), $post->post_type ), true ); 362 362 } 363 363 } … … 373 373 if ( $saved ) { 374 374 $response['error'] = false; 375 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'Sidebar updated.', DS_PLUGIN_I18N_DOMAIN ) );375 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'Sidebar updated.', DS_PLUGIN_I18N_DOMAIN ), false ); 376 376 } else { 377 377 $response['error'] = true; 378 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'Sorry an error occurred.', DS_PLUGIN_I18N_DOMAIN ) );378 $response['message'] = apply_filters( 'ds_save_ajax_message', __( 'Sorry an error occurred.', DS_PLUGIN_I18N_DOMAIN ), true ); 379 379 } 380 380 -
dynamics-sidebars/trunk/readme.txt
r571488 r571510 5 5 Requires at least: 3.0 6 6 Tested up to: 3.4.1 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 An awesome plugin that let you have a custom sidebar (widget area) for every page, post and/or custom post type. 19 19 20 [Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 21 20 22 **Usage** 21 23 … … 24 26 * Post 25 27 * Page 28 29 **IMPORTANT: Showing the sidebar** 30 31 ***Note you can use this wherever you like to show you sidebar*** 32 33 `<?php 34 dynamic_sidebar( get_the_sidebar() ); 35 ?>` 36 37 Or 38 39 `<?php 40 $sidebar = get_the_sidebar(); 41 if ( is_active_sidebar( $sidebar ) ) { 42 dynamic_sidebar( $sidebar ); 43 } 44 ?>` 26 45 27 46 **Adding support for custom post type** … … 43 62 When you register your custom post type, on 'register_post_type' call. 44 63 45 @see http://codex.wordpress.org/Function_Reference/register_post_typefor more information64 [Function Reference register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type) for more information 46 65 47 66 `<?php 48 67 $args = array( 'supports' => array( 'custom-sidebar' ) ); 49 register_post_type( 'post_type', $args );68 register_post_type( 'post_type', $args ); 50 69 ?>` 51 70 … … 66 85 ?>` 67 86 68 **Showing the sidebar**69 70 ***Note you can use this wherever you like to show you sidebar***71 72 `<?php73 dynamic_sidebar( get_the_sidebar() );74 ?>`75 76 Or77 78 `<?php79 $sidebar = get_the_sidebar();80 if ( is_active_sidebar( $sidebar ) ) {81 dynamic_sidebar( $sidebar );82 }83 ?>`84 85 87 **Changing sidebar args** 86 88 … … 88 90 89 91 `<?php 90 add_filter( 'ds_sidebar_args', 'my_sidebar_args' );91 92 function my_sidebar_args( $defaults ) {92 add_filter( 'ds_sidebar_args', 'my_sidebar_args', 1, 3 ); 93 94 function my_sidebar_args( $defaults, $sidebar_name, $sidebar_id ) { 93 95 $args = array( 94 'description' => 'My widget area',96 'description' => "$sidebar_name widget area", 95 97 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 96 98 'after_widget' => '</li>', 'after_widget', … … 102 104 } 103 105 ?>` 106 107 [Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 104 108 105 109 **Don't forget to check the 'Other Notes' tab for a list of all function and hook you can use.**
Note: See TracChangeset
for help on using the changeset viewer.