Skip to content

Commit

Permalink
capability for post, capabilty for manage and vertical and text-align…
Browse files Browse the repository at this point in the history
… added for css
  • Loading branch information
codersaiful committed Sep 27, 2020
1 parent 146d0fc commit cf923e4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 2 additions & 0 deletions admin/post_metabox_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
'color' => 'Text Color',
'background-color'=>'Background Color',
'border'=>'Border',
'text-align'=>'Text Align',
'vertical-align'=>'Vertical Align',
);
$supported_css_property = apply_filters( 'wpto_supported_css_property', $supported_css_property, $tab_array, $post );

Expand Down
12 changes: 11 additions & 1 deletion admin/wpt_product_table_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ function wpt_product_table_post() {
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'post',
'capability_type' => 'post',
'capabilities' => array(
'edit_post' => 'edit_wpt_product_table',
'edit_posts' => 'edit_wpt_product_tables',
'edit_others_posts' => 'edit_others_wpt_product_tables',
'publish_posts' => 'publish_wpt_product_tables',
'read_post' => 'read_wpt_product_table',
'read_private_posts' => 'read_private_wpt_product_tables',
'delete_post' => 'delete_wpt_product_table',
),
'map_meta_cap' => true,
'register_meta_box_cb' => 'wpt_shortcode_metabox',
);
register_post_type( 'wpt_product_table', $args );
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ You can easily show specific category products. While creating new table click o
* Export Import Issue Fix
* Added lots of Filter Hooks
* Added lots of Action Hooks
* Added User Role Administrator
* add User cap for edit,delete,private etc for Product Table
* Lots of new Features Added
* Plugin Recommendation on/off features Added
* Device Wise Different Column Feature Added
Expand Down
13 changes: 12 additions & 1 deletion woo-product-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

if( !defined( 'WPT_CAPABILITY' ) ){
$wpt_capability = apply_filters( 'wpt_menu_capability', 'manage_woocommerce' );
$wpt_capability = apply_filters( 'wpt_menu_capability', 'manage_wpt_product_table' );
define( 'WPT_CAPABILITY', $wpt_capability );
}

Expand Down Expand Up @@ -661,6 +661,17 @@ public static function install() {
update_option( 'wpt_configure_options', $default_value );
}

$role = get_role( 'administrator' );

$role->add_cap( 'edit_wpt_product_table' );
$role->add_cap( 'edit_wpt_product_tables' );
$role->add_cap( 'edit_others_wpt_product_tables' );
$role->add_cap( 'publish_wpt_product_tables' );
$role->add_cap( 'read_wpt_product_table' );
$role->add_cap( 'read_private_wpt_product_tables' );
$role->add_cap( 'delete_wpt_product_table' );
$role->add_cap( 'manage_wpt_product_table' );

}

/**
Expand Down

0 comments on commit cf923e4

Please sign in to comment.