/** * Utility function to load our custom version of FEE. * * We extend the regular {@link FEE} class to fix a few issues. */ function cacsp_wp_fee_load() { require Social_Paper::$PATH . '/includes/class-cacsp-fee.php'; Social_Paper::$FEE = new CACSP_FEE(); // re-run init routine. // we need to manually call FEE's init() method since we're calling this after // the 'init' hook Social_Paper::$FEE->init(); }
/** * Properties. */ protected function properties() { self::$PATH = dirname(__FILE__); self::$URL = plugins_url(basename(self::$PATH)); self::$TEMPLATEPATH = self::$PATH . '/templates'; }
/** * Start the buffer for content replacement on the Social Paper archive page. * * @access private * * @param WP_Query $q */ function _cacsp_archive_ob_start($q) { if (false === cacsp_is_archive()) { return; } // be careful with other WP_Query loops on the page if (empty($q->query['post_type']) || 'cacsp_paper' !== $q->query['post_type']) { return; } if (true === Social_Paper::$is_buffer) { return; } Social_Paper::$is_buffer = true; remove_action('loop_start', '_cacsp_archive_ob_start', -999); ob_start(); }