Skip to content

Instantly share code, notes, and snippets.

@norcross
Created August 14, 2012 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norcross/3345771 to your computer and use it in GitHub Desktop.
Save norcross/3345771 to your computer and use it in GitHub Desktop.
Hide comments and pingbacks on Shopp
jQuery(document).ready(function($) {
//********************************************************
// expand / collapse for settings page
//********************************************************
$('div.settings_group div.dg_wrap').hide();
// show or hide new license block licenses
$('div.settings_group input.toggle_group').click(function() {
var name = $(this).attr('name');
$(this).toggleClass('toggle_active');
$('div.dg_wrap[name=' + name + ']').toggle();
return false;
});
//********************************************************
// set comments and pingbacks for Shopp
//********************************************************
// set the boxes to no
$('.shopp form#product input#allow-comments').prop('checked', false);
$('.shopp form#product input#allow-trackpings').prop('checked', false);
// hide boxes completely
$('.shopp form#product input#allow-comments').parent('p').hide();
$('.shopp form#product input#allow-trackpings').parent('p').hide();
});
<?php
function shopp_comment_hide() {
// change the URL and filename to match whatever it is you use
wp_enqueue_script( 'shopp-comments', get_bloginfo('stylesheet_directory').'/lib/js/shopp-comment-hide.js', array('jquery'), null, true );
}
add_action( 'wp_enqueue_scripts', 'shopp_comment_hide' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment