Skip to content

Commit

Permalink
refactor: clean-up Custom Layout upsell page
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Jan 20, 2025
1 parent 6677d46 commit 74e7e0f
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions inc/admin/hooks_upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,7 @@ public function init() {
/**
* Add the Custom Layout page with upsell elements.
*/
add_action( 'neve_render_after_header_custom_layouts', array( $this, 'render_custom_layouts_upsell_modal' ) );
add_action( 'neve_register_submenu_page', array( $this, 'register_custom_layout_upsell_page' ), 10, 2 );

add_filter(
'manage_neve_custom_layouts_posts_columns',
function( $columns ) {
unset( $columns['comments'] );
unset( $columns['author'] );

$date = $columns['date'];
unset( $columns['date'] );

$columns['type'] = __( 'Type', 'neve' );
$columns['location'] = __( 'Location', 'neve' );
$columns['shortcode'] = __( 'Shortcode', 'neve' );
$columns['enabled'] = __( 'Status', 'neve' );
$columns['date'] = $date;

return $columns;
}
);
}

/**
Expand Down Expand Up @@ -477,7 +457,7 @@ public function render_custom_layouts_upsell_modal() {
}

/**
* Renders the the upsell page for Custom Layouts.
* Renders the the upsell page for Custom Layouts which contains a modal and small table behind overlay to match the real dashboard.
*
* @return void
*/
Expand All @@ -488,6 +468,9 @@ public function render_custom_layout_page() {
<table class="widefat posts">
<thead>
<tr>
<td class="manage-column check-column">
<input type="checkbox" disabled />
</td>
<th scope="col" class="manage-column column-title column-primary"><?php echo esc_html__( 'Title', 'neve' ); ?></th>
<th scope="col" class="manage-column"><?php echo esc_html__( 'Type', 'neve' ); ?></th>
<th scope="col" class="manage-column"><?php echo esc_html__( 'Location', 'neve' ); ?></th>
Expand All @@ -497,15 +480,18 @@ public function render_custom_layout_page() {
</thead>
<tbody id="the-list">
<tr>
<td colspan="5" class="column-primary">
<td colspan="6" class="column-primary">
<p class="description" style="text-align: center; padding: 20px;">
<?php echo esc_html__( 'Upgrade to Neve Pro to a Custom Layout.', 'neve' ); ?>
<?php echo esc_html__( 'Upgrade to Neve Pro to create a Custom Layout.', 'neve' ); ?>
</p>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="manage-column check-column">
<input type="checkbox" disabled />
</td>
<th scope="col" class="manage-column column-title column-primary"><?php echo esc_html__( 'Title', 'neve' ); ?></th>
<th scope="col" class="manage-column"><?php echo esc_html__( 'Type', 'neve' ); ?></th>
<th scope="col" class="manage-column"><?php echo esc_html__( 'Location', 'neve' ); ?></th>
Expand Down

0 comments on commit 74e7e0f

Please sign in to comment.