Skip to content

Commit

Permalink
fixed guideline violations
Browse files Browse the repository at this point in the history
Fixed guideline violations to bring the plugin back to the WordPress directory
  • Loading branch information
codestylist authored Dec 7, 2023
1 parent bb773c8 commit 511a380
Show file tree
Hide file tree
Showing 9 changed files with 637 additions and 556 deletions.
32 changes: 32 additions & 0 deletions assets/js/admin/wpsight-pricing-tables-admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
jQuery(document).ready(function($){
var fieldGroupId = 'pricing_plans';
var $fieldGroupTable = $( document.getElementById( fieldGroupId + '_repeat' ) );

var countRows = function() {
return $fieldGroupTable.find( '> .cmb-row.cmb-repeatable-grouping' ).length;
};

var disableAdder = function() {
$fieldGroupTable.find('.cmb-add-group-row.button-secondary').prop( 'disabled', true );
};

var enableAdder = function() {
$fieldGroupTable.find('.cmb-add-group-row.button-secondary').prop( 'disabled', false );
};

if ( countRows() >= limit ) {
disableAdder();
}

$fieldGroupTable
.on( 'cmb2_add_row', function() {
if ( countRows() >= limit ) {
disableAdder();
}
})
.on( 'cmb2_remove_row', function() {
if ( countRows() < limit ) {
enableAdder();
}
});
});
1 change: 1 addition & 0 deletions assets/js/admin/wpsight-pricing-tables-admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/admin/class-wpsight-pricing-tables-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function admin_enqueue_scripts() {
$post_type = 'pricing_table';

if ( in_array( $screen->id, array( 'edit-' . $post_type, $post_type ) ) )
wp_enqueue_style( 'wpsight-pricing-tables-meta-boxes', WPSIGHT_PRICING_TABLES_PLUGIN_URL . '/assets/css/wpsight-pricing-tables-meta-boxes' . $suffix . '.css' );
wp_enqueue_style( 'wpsight-pricing-tables-meta-boxes', WPSIGHT_PRICING_TABLES_PLUGIN_URL . '/assets/css/wpsight-pricing-tables-meta-boxes' . $suffix . '.css', NULL, WPSIGHT_PRICING_TABLES_VERSION );

}

Expand Down
4 changes: 2 additions & 2 deletions includes/class-wpsight-pricing-tables-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public static function get_pricing_tables( $args = array() ) {
* format_price()
*
* Get a specific (active) pricing_table by ID.
*
*
* @access public
* @param interger $pricing_table_id
* @param integer $price
* @uses get_post()
* @return object
*
Expand Down
Loading

0 comments on commit 511a380

Please sign in to comment.