Register our sections to the WordPress Customizer.

@var object The WordPress Customizer object
547992
public function add_sections() {
		if ( ! empty( Kirki::$sections ) ) {
			foreach ( Kirki::$sections as $section_args ) {
				// Extra checks for nested sections.
				if ( isset( $section_args['section'] ) ) {
					if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) {
						// Set the type to nested.
						$section_args['type'] = 'kirki-nested';
						// We need to check if the parent section is nested inside a panel.
						$parent_section = Kirki::$sections[ $section_args['section'] ];
						if ( isset( $parent_section['panel'] ) ) {
							$section_args['panel'] = $parent_section['panel'];
						}
					}
				}
				new Section( $section_args );
			}
		}
	}
647203
public function register()
    {
        // Store details
        $args = $this->getModel()->getArgs();
        $metaboxes = $this->getModel()->getMetaboxes();
        $slug = $this->getModel()->getSlug();

        // Register post type if not post or page
        if (!in_array($slug, $this->reserved_slugs)) {
            global $wp_rewrite;

            // Action to register
            register_post_type($slug, $args);

            // Option
            $opt = 'permalink_structure_'.$slug;

            // Get value
            $structure = Option::get($opt, '/%'.$slug.'%-%post_id%');

            // Change structure
            $wp_rewrite->add_rewrite_tag('%'.$slug.'%', '([^/]+)', $slug.'=');
            $wp_rewrite->add_permastruct($slug, $structure, false);
        }

        // Check name
        $name = isset($args['labels']['name']) ? $args['labels']['name'] : '';

        // Works on hook
        $hook = new PosttypeHook($slug, $name, $metaboxes, $this->reserved_slugs);
        $this->getModel()->setHook($hook);
    }
349836
protected function _registerPlugin()
    {
        $view = $this->getView();
        $id = $this->options['id'];

        $options = $this->clientOptions !== false && !empty($this->clientOptions)
            ? Json::encode($this->clientOptions)
            : '{}';

        $js[] = "CKEDITOR.replace('$id', $options);";
        $js[] = "skeeks.ckEditorWidget.registerOnChangeHandler('$id');";

        if (isset($this->clientOptions['filebrowserUploadUrl'])) {
            $js[] = "skeeks.ckEditorWidget.registerCsrfImageUploadHandler();";
        }

        $view->registerJs(implode("\n", $js));
    }
715600
protected function registerClient()
    {
        $view = $this->getView();
        TreeViewAsset::register($view);

        $selector = ArrayHelper::remove($this->clientOptions, 'selector', 'ol.sortable');
        $view->registerJs("ns = $('{$selector}').nestedSortable(" . Json::htmlEncode($this->clientOptions) . ");");

        $treeView = $this->options['id'];
        $loading = $this->loadingOptions['id'];
        $view->registerJs(<<<JS
treeView = $('#{$treeView}');
loading = $('#{$loading}');
JS
        );
    }
1014369
public function customize_register( WP_Customize_Manager $wp_customize ) {

		$wp_customize->add_section(
			'layout',
			array(
				'title'      => esc_html__( 'Layout', 'rock' ),
				'priority'   => 30,
				'capability' => 'edit_theme_options',
			)
		);

		if ( ! $this->page_widths ) {

			return;

		}

		reset( $this->page_widths );

		$wp_customize->add_setting(
			'page_width',
			array(
				'default'           => key( $this->page_widths ),
				'sanitize_callback' => 'sanitize_key',
				'transport'         => 'postMessage',
			)
		);

		$wp_customize->add_control(
			'page_width',
			array(
				'label'       => esc_html__( 'Page Width', 'rock' ),
				'description' => esc_html__( 'Display your site differently on larger screens.', 'rock' ),
				'section'     => 'layout',
				'settings'    => 'page_width',
				'type'        => 'radio',
				'choices'     => $this->page_widths,
			)
		);

	}
445260
protected function registerAssets()
    {
        $view = $this->getView();
        SelectizeAsset::register($view);
        $js = '$("#' . $this->getInputId() . '").selectize(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);
    }
1270867
public function register()
    {
        wp_register_script(
            $this->handle,
            $this->url,
            $this->dependencies,
            $this->version,
            $this->footer
        );

        // Localize the script as needed
        if( !empty( $this->localize['data'] ) && !empty( $this->localize['data'] ) ) {
            wp_localize_script(
                $this->handle,
                $this->localize['name'],
                $this->localize['data']
            );
        }
        $this->is_registered = true;
    }
1312061
protected function register_assets() {
		$icon_picker = Icon_Picker::instance();

		if ( defined( 'ICON_PICKER_SCRIPT_DEBUG' ) && ICON_PICKER_SCRIPT_DEBUG ) {
			$assets_url = '//localhost:8080';
			$suffix     = '';
		} else {
			$assets_url = $icon_picker->url;
			$suffix     = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
		}

		wp_register_script(
			'icon-picker',
			"{$assets_url}/js/icon-picker{$suffix}.js",
			array( 'media-views' ),
			Icon_Picker::VERSION,
			true
		);
		$this->add_script( 'icon-picker' );

		wp_register_style(
			'icon-picker',
			"{$icon_picker->url}/css/icon-picker{$suffix}.css",
			false,
			Icon_Picker::VERSION
		);
		$this->add_style( 'icon-picker' );
	}
1078987
protected function registerClientScripts()
    {
        $view = $this->getView();
        NoUiSliderAsset::register($view);

        $id = $this->sliderOptions['id'];
        $varName = $this->getUniqueId('slider_');

        if ($this->clientOptions !== false) {
            $options = empty($this->clientOptions) ? '{}' : Json::htmlEncode($this->clientOptions);
            $view->registerJs(<<<JS
var $varName = document.getElementById('$id');
noUiSlider.create($varName, {$options});
JS
            );
        }

        $this->registerClientEvents($varName);
    }
313217
public function registerAssets()
    {
        $view = $this->getView();
        JsTreeAsset::register($view);

        $config = [
            'core' => array_merge(['data' => $this->data], $this->core),
            'checkbox' => $this->checkbox,
            'contextmenu' => $this->contextmenu,
            'dnd' => $this->dnd,
            'search' => $this->search,
            'sort' => $this->sort,
            'state' => $this->state,
            'plugins' => $this->plugins,
            'types' => $this->types
        ];
        $defaults = Json::encode($config);

        $inputId = (!$this->hasModel()) ? $this->options['id'] : Html::getInputId($this->model, $this->attribute);

        $js = <<<SCRIPT
;(function($, window, document, undefined) {
    $('#jsTree_{$this->options['id']}')
        .bind("loaded.jstree", function (event, data) {
                $("#{$inputId}").val(JSON.stringify(data.selected));
            })
        .bind("changed.jstree", function(e, data, x){
                $("#{$inputId}").val(JSON.stringify(data.selected));
        })
        .jstree({$defaults});
})(window.jQuery, window, document);
SCRIPT;
        $view->registerJs($js);
    }
948562
public function add_fields() {
		global $wp_customize;
		foreach ( Kirki::$fields as $args ) {

			// Create the settings.
			new Settings( $args );

			// Check if we're on the customizer.
			// If we are, then we will create the controls, add the scripts needed for the customizer
			// and any other tweaks that this field may require.
			if ( $wp_customize ) {

				// Create the control.
				new Control( $args );

			}
		}
	}
228746
protected function registerPlugin()
    {
        $view = $this->getView();

        $this->ckeditor = new \skeeks\cms\widgets\formInputs\ckeditor\Ckeditor(ArrayHelper::merge([
            'model' => $this->model,
            'attribute' => $this->attribute,
            'relatedModel' => $this->model,
        ], $this->ckeditorOptions));

        $this->codemirror = new CodemirrorWidget(ArrayHelper::merge([
            'model' => $this->model,
            'attribute' => $this->attribute,

            'preset' => 'htmlmixed',
            'assets' =>
                [
                    \skeeks\widget\codemirror\CodemirrorAsset::THEME_NIGHT
                ],
            'clientOptions' =>
                [
                    'theme' => 'night'
                ],

        ], $this->codemirrorOptions));

        $this->ckeditor->registerAssets();
        $this->codemirror->registerAssets();

        $this->clientOptions['ckeditor'] = $this->ckeditor->clientOptions;
        $this->clientOptions['codemirror'] = $this->codemirror->clientOptions;

        ComboTextInputWidgetAsset::register($this->view);

    }
948957
public function register()
    {
        /*
        $this->app['filters']->listen(
            'site_url',
            function ($url)
            {
                if (strpos($url, 'wp-') === false)
                {
                    return str_replace(WP_SITEURL, WP_HOME, $url);
                }

                return $url;
            }
        );
        */

        foreach (config('supports') as $feature => $value)
        {
            if ($value === 'automatic-feed-links')
            {
                $feature = $value;
                add_theme_support($feature);
            }
            else
            {
                add_theme_support($feature, $value);
            }
        }
    }
786946
protected function registerClientScript()
	{
		$view = $this->getView();
		UMeditorAsset::register($view);
		$id = $this->options['id'];
		$options = Json::encode($this->clientOptions);
		$js = "window.um = UM.getEditor('$id', $options);";
		$view->registerJs($js, $view::POS_READY);
	}
1177811
public function register() 
    {
        add_action( 'admin_head', array( $this, 'add_filters' ) );
        add_action( 'wp_head', array( $this, 'add_filters' ) );
        
        if( is_array( $this->config['callback'] ) )
        {
            foreach( $this->config['callback'] as $handle => $callback )
            {
                $callback->register( $this->config['slug'].'_'.$handle );
            }
        }
        else
        {
            $this->config['callback']->register( $this->config['slug'] );
        }
    }
866676
protected function registerPlugins()
    {
        if (isset($this->clientOptions['plugins']) && count($this->clientOptions['plugins'])) {
            foreach ($this->clientOptions['plugins'] as $plugin) {
                $js = 'plugins/' . $plugin . '/' . $plugin . '.js';
                if (file_exists($this->sourcePath . DIRECTORY_SEPARATOR . $js)) {
                    $this->assetBundle->js[] = $js;
                }
                $css = 'plugins/' . $plugin . '/' . $plugin . '.css';
                if (file_exists($this->sourcePath . DIRECTORY_SEPARATOR . $css)) {
                    $this->assetBundle->css[] = $css;
                }
            }
        }
    }
882549
public function registerClientScript()
    {
        $this->options['element'] = new JsExpression("jQuery('#{$this->options['id']}')[0]");
        $mdeOptions = Json::encode($this->mdeOptions);
        $mdeName = Inflector::classify('editor' . $this->options['id']);
        $js = "var {$mdeName} = new SimpleMDE({$mdeOptions});";
        $this->getView()->registerJs($js);
    }