/** Including footer styling class */ require_once 'includes/class-footer-styles.php'; /** Including Content styling class */ require_once 'includes/class-content-styles.php'; /** * Returns the main instance of Eighteen_Tags to prevent the need to use globals. * * @since 1.0.0 * @return Eighteen_Tags Instance */ function Pro_18Tags() { return Eighteen_Tags::instance(); } // End Pro_18Tags() Pro_18Tags(); /** * Main Eighteen_Tags Class * * @class Eighteen_Tags * @version 1.0.0 * @since 1.0.0 * @package Eighteen_Tags * @author Shramee Srivastav <*****@*****.**> */ final class Eighteen_Tags { /** * Eighteen_Tags The single instance of Eighteen_Tags. * @var object * @access private
public function customize_register(WP_Customize_Manager $wp_customize) { $this->customizer->etp_customize_register($wp_customize); // Call customize fields registering method // Abort if selective refresh is not available. if (!isset($wp_customize->selective_refresh)) { return; } add_action('wp_footer', function () { echo '<style id="eighteen-tags-selective-refresh-css"></style>'; }, 999); $fields = eighteen_tags_pro_fields(); $sel_ref_options = array(); foreach ($fields as $id => $f) { $f['id'] = $id; if ($this->is_selective_refresh_field($f)) { $id = "{$this->token}-{$id}"; $sel_ref_options[] = $id; $wp_customize->get_setting($id)->transport = 'postMessage'; } } $wp_customize->selective_refresh->add_partial($this->token . '-style-partial', array('selector' => '#eighteen-tags-selective-refresh-css', 'settings' => $sel_ref_options, 'render_callback' => function () { echo Pro_18Tags()->public->generate_css(); }, 'container_inclusive' => false)); $wp_customize->get_setting('eighteen-tags-pro-footer-custom-text')->transport = 'postMessage'; $wp_customize->selective_refresh->add_partial('eighteen-tags-pro-footer-custom-text', array('selector' => '#colophon > .col-full', 'settings' => array('eighteen-tags-pro-footer-custom-text'), 'render_callback' => array(Pro_18Tags()->public->footer_styles, 'credit'), 'container_inclusive' => false)); }