Example #1
0
/**
 * bp-default theme comment overrides.
 *
 * Disables the avatar from showing atop the comment form.
 *
 * @access private
 */
function _cacsp_bp_dtheme_overrides()
{
    if (!cacsp_is_page()) {
        return;
    }
    remove_action('comment_form_top', 'bp_dtheme_before_comment_form');
    remove_action('comment_form', 'bp_dtheme_after_comment_form');
}
/**
 * Inline JS outputted in the footer.
 *
 * JS does the following:
 *
 * - Repositions inline comment timestamps underneath the author name.
 * - Displays inline comment for inline comment permalink URLs. Relies on the
 *   the "?para" URL parameter and the arrive.js library.  Arrive.js watches
 *   for DOM element injections and allows us to hook in when IC adds its
 *   comment elements.
 *
 * @see cacsp_ic_alter_comment_permalink()
 * @see https://github.com/uzairfarooq/arrive
 */
function cacsp_ic_inline_js()
{
    if (false === cacsp_is_page()) {
        return;
    }
    if (true === Social_Paper::$is_new) {
        return;
    }
    if (true === in_array(get_queried_object()->post_status, array('draft', 'auto-draft'), true)) {
        return;
    }
    ?>

	<script type="text/javascript" src="//cdn.rawgit.com/uzairfarooq/arrive/master/minified/arrive.min.js"></script>
	<script type="text/javascript">
	jQuery(function(){
		// reposition inline comment timestamps
		jQuery('.comment-time').each(function() {
			jQuery(this).closest('.comment-body').find('.comment-author cite').append(this);
		});

		var para = window.location.search.split('=')[1];

		if ( null === para ) {
			return;
		}

		jQuery(document).arrive('[data-incom-bubble=' + para + ']', function() {
			// manually trigger click so IC will display the comment tree
			jQuery(this).click();

			// unbind arrive
			jQuery(document).unbindArrive();
		});
	});
	</script>

<?php 
}
Example #3
0
/**
 * Add button to WP FEE's toolbar
 *
 * @param object $post The WordPress post object
 */
function cacsp_wp_fee_tax_buttons($post)
{
    if (!cacsp_is_page()) {
        return;
    }
    if (in_array('cacsp_paper_tag', get_object_taxonomies($post))) {
        ?>
		<button class="button button-large fee-button-cacsp_paper_tag"><div class="dashicons dashicons-tag dashicons-cacsp_paper_tag"></div></button>
	<?php 
    }
}