Advertisement
Guest User

Untitled

a guest
Sep 11th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1.     function section_opts(){
  2.  
  3.         /* Builds array to use in opts */
  4.         $templates = wp_get_theme()->get_page_templates();
  5.        
  6.         $buildArray = array();
  7.  
  8.         $i = 1;
  9.        
  10.         foreach ($templates as $key => $value) {
  11.    
  12.             $buildArray['optvalue'.$i] = array(trim($key, '[]') => $value);
  13.             $i++;
  14.  
  15.         }  
  16.  
  17.         $opts = array(
  18.  
  19.             array(
  20.                 'key'       => 'post_content',
  21.                 'type'      => 'edit_post',
  22.                 'title'     => __( 'Edit Post/Page Content', 'pagelines' ),
  23.                 'label'     =>  __( '<i class="icon-edit"></i> Edit Post/Page', 'pagelines' ),
  24.                 'help'      => __( 'This section uses WordPress posts. Edit post information using WordPress admin.', 'pagelines' ),
  25.                 'classes'   => 'btn-primary'
  26.             ),
  27.            
  28.             array(
  29.                 'key'       => 'custom_page_template',
  30.                 'type'      => 'select',
  31.                 'title'     => 'Select your custom page template',
  32.                 'label'     => 'Template',
  33.                 'opts'      => $buildArray
  34.                                
  35.             )          
  36.            
  37.         );
  38.  
  39.         return $opts;
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement