Making WordPress.org


Ignore:
Timestamp:
10/21/2016 04:10:02 PM (8 years ago)
Author:
iandunn
Message:

WordCamp Site Cloner: Convert to REST/Backbone to improve scalability

See #1112
Props prettyboymp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/includes/site-control.php

    r1715 r4280  
    11<?php
    22
     3/**
     4 * Custom Customizer Control for Search WordCamp sites to clone
     5 */
     6
    37namespace WordCamp\Site_Cloner;
    4 
    58defined( 'WPINC' ) or die();
    69
    7 /**
    8  * Custom Customizer Control for a WordCamp site
    9  */
    1010class Site_Control extends \WP_Customize_Control {
    11     public $site_id, $site_name, $screenshot_url, $theme_slug;
    12     public $settings = 'wcsc_source_site_id';
    13     public $section  = 'wcsc_sites';
     11    public function __construct( $manager, $id, $args = array() ) {
     12        parent::__construct( $manager, $id, $args );
     13
     14        $this->capability = 'edit_theme_options';
     15        $this->section    = 'wcsc_sites';
     16    }
    1417
    1518    /**
     
    1720     */
    1821    public function enqueue() {
     22        add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_view_templates' ) );
     23
    1924        wp_enqueue_style(  'wordcamp-site-cloner' );
    2025        wp_enqueue_script( 'wordcamp-site-cloner' );
     
    2530     */
    2631    public function render_content() {
    27         $preview_url = add_query_arg(
    28             array(
    29                 'theme'               => rawurlencode( $this->theme_slug ),
    30                 'wcsc_source_site_id' => rawurlencode( $this->site_id ),
    31             ),
    32             admin_url( 'customize.php' )
    33         );
     32        require_once( dirname( __DIR__ ) . '/templates/site-control.php' );
     33    }
    3434
    35         require( dirname( __DIR__ ) . '/templates/site-control.php' );
     35    /**
     36     * Render the control's Underscores templates
     37     */
     38    public function print_view_templates() {
     39        require_once( dirname( __DIR__ ) . '/templates/site-option.php'  );
     40        require_once( dirname( __DIR__ ) . '/templates/site-filters.php' );
    3641    }
    3742}
Note: See TracChangeset for help on using the changeset viewer.