Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function section_opts(){
- /* Builds array to use in opts */
- $templates = wp_get_theme()->get_page_templates();
- $buildArray = array();
- $i = 1;
- foreach ($templates as $key => $value) {
- $buildArray['optvalue'.$i] = array(trim($key, '[]') => $value);
- $i++;
- }
- $opts = array(
- array(
- 'key' => 'post_content',
- 'type' => 'edit_post',
- 'title' => __( 'Edit Post/Page Content', 'pagelines' ),
- 'label' => __( '<i class="icon-edit"></i> Edit Post/Page', 'pagelines' ),
- 'help' => __( 'This section uses WordPress posts. Edit post information using WordPress admin.', 'pagelines' ),
- 'classes' => 'btn-primary'
- ),
- array(
- 'key' => 'custom_page_template',
- 'type' => 'select',
- 'title' => 'Select your custom page template',
- 'label' => 'Template',
- 'opts' => $buildArray
- )
- );
- return $opts;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement