Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2.  
  3. # Instantiate your custom class (I use the class to ensure we don't overwrite existing functions)
  4. new My_Functions;
  5.  
  6. class My_Functions {
  7.    
  8.     /**
  9.      * Add your hooks to the __construct() which will run when we call the class
  10.      */
  11.     function __construct()
  12.     {
  13.         add_action('init',array(&$this,'init'));
  14.     } // function
  15.    
  16.     /**
  17.      * Add your members, you can safely use existing WordPress function names
  18.      * @example function [init|wp|wp_head|wp_footer]()
  19.      */
  20.     function init()
  21.     {
  22.    
  23.         $sidebar_settings = array(
  24.             'name'          => sprintf(__('Sidebar %d'), $i ),
  25.             'id'            => 'sidebar-$i',
  26.             'description'   => ''
  27.             'before_widget' => '<li id="%1$s" class="widget %2$s">',
  28.             'after_widget'  => '</li>',
  29.             'before_title'  => '<h2 class="widgettitle">',
  30.             'after_title'   => '</h2>' );
  31.            
  32.         register_sidebar($sidebar_settings);
  33.     } // function
  34.    
  35. } // class
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement