WordPress.org

Plugin Directory

Changeset 571510


Ignore:
Timestamp:
07/12/12 23:44:05 (21 months ago)
Author:
alyssonweb
Message:

Version 1.0.3

Location:
dynamics-sidebars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dynamics-sidebars/tags/1.0.2/readme.txt

    r571489 r571510  
    1818An awesome plugin that let you have a custom sidebar (widget area) for every page, post and/or custom post type. 
    1919 
     20[Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 
     21 
    2022**Usage** 
    2123 
     
    2426* Post 
    2527* 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 
     37Or 
     38 
     39`<?php 
     40    $sidebar = get_the_sidebar(); 
     41    if ( is_active_sidebar( $sidebar ) ) { 
     42        dynamic_sidebar( $sidebar ); 
     43    } 
     44?>` 
    2645 
    2746**Adding support for custom post type** 
     
    4362When you register your custom post type, on 'register_post_type' call. 
    4463 
    45 @see http://codex.wordpress.org/Function_Reference/register_post_type for more information 
     64[Function Reference register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type) for more information 
    4665 
    4766`<?php 
    4867    $args = array( 'supports' => array( 'custom-sidebar' ) ); 
    49     register_post_type( 'post_type', $args ); 
     68    register_post_type( 'post_type', $args ); 
    5069?>` 
    5170 
     
    6685?>` 
    6786 
    68 **Showing the sidebar** 
    69  
    70 ***Note you can use this wherever you like to show you sidebar*** 
    71  
    72 `<?php 
    73     dynamic_sidebar( get_the_sidebar() ); 
    74 ?>` 
    75  
    76 Or 
    77  
    78 `<?php 
    79     $sidebar = get_the_sidebar(); 
    80     if ( is_active_sidebar( $sidebar ) ) { 
    81         dynamic_sidebar( $sidebar ); 
    82     } 
    83 ?>` 
    84  
    8587**Changing sidebar args** 
    8688 
     
    8890 
    8991`<?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 ) { 
    9395        $args = array( 
    94             'description'   => 'My widget area', 
     96            'description'   => "$sidebar_name widget area", 
    9597            'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 
    9698            'after_widget'  => '</li>', 'after_widget', 
     
    102104    } 
    103105?>` 
     106 
     107[Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 
    104108 
    105109**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  
    77 * Author Name: Alysson Bortoli 
    88 * Author URI: http://twitter.com/akbortoli 
    9  * Version: 1.0.2 
     9 * Version: 1.0.3 
    1010 * License: GPLv2 or later 
    1111 */ 
  • dynamics-sidebars/trunk/includes/class-dynamic-sidebars.php

    r571470 r571510  
    347347            if ( ! current_user_can( 'edit_page', $post_id ) ) { 
    348348                $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 ); 
    350350            } 
    351351        } elseif ( 'post' == $post->post_type ) { 
    352352            if ( ! current_user_can( 'edit_post', $post_id ) ) { 
    353353                $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 ); 
    355355            } 
    356356        } else { 
     
    359359            if ( ! $continue ) { 
    360360                $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 ); 
    362362            } 
    363363        } 
     
    373373        if ( $saved ) { 
    374374            $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 ); 
    376376        } else { 
    377377            $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 ); 
    379379        } 
    380380 
  • dynamics-sidebars/trunk/readme.txt

    r571488 r571510  
    55Requires at least: 3.0 
    66Tested up to: 3.4.1 
    7 Stable tag: 1.0.2 
     7Stable tag: 1.0.3 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    1818An awesome plugin that let you have a custom sidebar (widget area) for every page, post and/or custom post type. 
    1919 
     20[Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 
     21 
    2022**Usage** 
    2123 
     
    2426* Post 
    2527* 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 
     37Or 
     38 
     39`<?php 
     40    $sidebar = get_the_sidebar(); 
     41    if ( is_active_sidebar( $sidebar ) ) { 
     42        dynamic_sidebar( $sidebar ); 
     43    } 
     44?>` 
    2645 
    2746**Adding support for custom post type** 
     
    4362When you register your custom post type, on 'register_post_type' call. 
    4463 
    45 @see http://codex.wordpress.org/Function_Reference/register_post_type for more information 
     64[Function Reference register_post_type](http://codex.wordpress.org/Function_Reference/register_post_type) for more information 
    4665 
    4766`<?php 
    4867    $args = array( 'supports' => array( 'custom-sidebar' ) ); 
    49     register_post_type( 'post_type', $args ); 
     68    register_post_type( 'post_type', $args ); 
    5069?>` 
    5170 
     
    6685?>` 
    6786 
    68 **Showing the sidebar** 
    69  
    70 ***Note you can use this wherever you like to show you sidebar*** 
    71  
    72 `<?php 
    73     dynamic_sidebar( get_the_sidebar() ); 
    74 ?>` 
    75  
    76 Or 
    77  
    78 `<?php 
    79     $sidebar = get_the_sidebar(); 
    80     if ( is_active_sidebar( $sidebar ) ) { 
    81         dynamic_sidebar( $sidebar ); 
    82     } 
    83 ?>` 
    84  
    8587**Changing sidebar args** 
    8688 
     
    8890 
    8991`<?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 ) { 
    9395        $args = array( 
    94             'description'   => 'My widget area', 
     96            'description'   => "$sidebar_name widget area", 
    9597            'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 
    9698            'after_widget'  => '</li>', 'after_widget', 
     
    102104    } 
    103105?>` 
     106 
     107[Documentation](https://github.com/scribu/wp-posts-to-posts/wiki) | [Support Forum](https://github.com/alyssonweb/wp-dynamics-sidebars/issues) 
    104108 
    105109**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.