Changeset 4280 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-site-cloner/includes/site-control.php
- Timestamp:
- 10/21/2016 04:10:02 PM (9 years ago)
- 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 1 1 <?php 2 2 3 /** 4 * Custom Customizer Control for Search WordCamp sites to clone 5 */ 6 3 7 namespace WordCamp\Site_Cloner; 4 5 8 defined( 'WPINC' ) or die(); 6 9 7 /**8 * Custom Customizer Control for a WordCamp site9 */10 10 class 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 } 14 17 15 18 /** … … 17 20 */ 18 21 public function enqueue() { 22 add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_view_templates' ) ); 23 19 24 wp_enqueue_style( 'wordcamp-site-cloner' ); 20 25 wp_enqueue_script( 'wordcamp-site-cloner' ); … … 25 30 */ 26 31 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 } 34 34 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' ); 36 41 } 37 42 }
Note: See TracChangeset
for help on using the changeset viewer.