Skip to content
Permalink
Browse files

HTML for add new box and table for displaying saved boxes

  • Loading branch information...
MJGrant committed Jun 9, 2019
1 parent 22f6aa5 commit 6bad57817c88400d012c86aa8f8613256abf25be
Showing with 80 additions and 5 deletions.
  1. +80 −5 amazin-product-box/amazin-product-box.php
@@ -19,14 +19,89 @@ function amazin_plugin_menu() {
add_menu_page( 'Amazin\' Product Box Management', 'Amazin\' Product Box', 'manage_options', 'amazin-product-box', 'amazin_display_management_page' );
}
/** Step 3. */
function amazin_display_management_page() {
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
echo '<div class="wrap">';
echo '<h2>Amazin\' Product Box</h2>';
echo '<p>Create, edit, delete and manage your product boxes here.</p>';
echo '</div>';
amazin_render_form();
amazin_render_table();
}
function amazin_render_form() {
?>
<h2>Amazin' Product Box</h2>
<p>Create, edit, delete and manage your product boxes here.</p>
<div class="form-wrap">

<!-- product box name -->
<div class="form-field">
<label for="product-box-name">Product Box name</label>
<input type="text" id="product-box-name" placeholder="Give this product box a useful name"/>
</div>

<!-- product name -->
<div class="form-field">
<label for="product-name">Product Name</label>
<input type="text" id="product-name" placeholder="Enter the product name here"/>
</div>

<!-- product tagline -->
<div class="form-field">
<label for="product-tagline">Product Tagline</label>
<input type="text" id="product-tagline" placeholder="Write a few words summarizing this product"/>
</div>

<!-- product description -->
<div class="form-field">
<label for="product-description">Product Description</label>
<input type="text" id="product-description" placeholder="Write about 100 characters explaining why this product is great."/>
</div>

<!-- product URL -->
<div class="form-field">
<label for="product-url">Affiliate link</label>
<input type="text" id="product-url" placeholder="http://amazon.com/affiliate-link-here"/>
</div>

<!-- Button text -->
<div class="form-field">
<label for="product-button-text">Button text</label>
<input type="text" id="product-button-text" placeholder="See XYZ product on Amazon.com"/>
</div>

<button>Add Product Box</button>

</div>
<?php
return;
}
function amazin_render_table() {
?>
<table>
<thead>
<tr>
<th>Shortcode</th>
<th>Product Name</th>
<th>Author</th>
<th>Last Modified</th>
<th>Manage</th>
</tr>
</thead>
<tbody>
<tr>
<!-- for loop through saved boxes -->
<td>[shortcode here]</td>
<td>Sample Name</td>
<td>Sample Author</td>
<td>Sample Date</td>
<td><button>Edit</button> <button>Delete</button></td>
</tr>
</tbody>
</table>
<?php
return;
}
?>

0 comments on commit 6bad578

Please sign in to comment.
You can’t perform that action at this time.