Remove append and prepend
This commit is contained in:
@@ -42,8 +42,6 @@ class SP_Admin_CPT_Metric extends SP_Admin_CPT {
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Label', 'sportspress' ),
|
||||
'sp_key' => __( 'Variable', 'sportspress' ),
|
||||
'sp_prepend' => __( 'Prepend', 'sportspress' ),
|
||||
'sp_append' => __( 'Append', 'sportspress' ),
|
||||
'sp_description' => __( 'Description', 'sportspress' ),
|
||||
);
|
||||
return apply_filters( 'sportspress_metric_admin_columns', $columns );
|
||||
@@ -59,12 +57,6 @@ class SP_Admin_CPT_Metric extends SP_Admin_CPT {
|
||||
global $post;
|
||||
echo $post->post_name;
|
||||
break;
|
||||
case 'sp_prepend':
|
||||
echo sp_get_post_prepend( $post_id );
|
||||
break;
|
||||
case 'sp_append':
|
||||
echo sp_get_post_append( $post_id );
|
||||
break;
|
||||
case 'sp_description':
|
||||
global $post;
|
||||
echo '<span class="description">' . $post->post_excerpt . '</span>';
|
||||
|
||||
@@ -23,30 +23,12 @@ class SP_Meta_Box_Metric_Details extends SP_Meta_Box_Config {
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
wp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );
|
||||
$prepend = get_post_meta( $post->ID, 'sp_prepend', true );
|
||||
$append = get_post_meta( $post->ID, 'sp_append', true );
|
||||
?>
|
||||
<p><strong><?php _e( 'Variable', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_default_key" type="hidden" id="sp_default_key" value="<?php echo $post->post_name; ?>">
|
||||
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>">
|
||||
</p>
|
||||
<p><strong><?php _e( 'Prepend', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_prepend" type="text" id="sp_prepend" value="<?php echo $prepend; ?>">
|
||||
</p>
|
||||
<p><strong><?php _e( 'Append', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_append" type="text" id="sp_append" value="<?php echo $append; ?>">
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_prepend', sp_array_value( $_POST, 'sp_prepend', array() ) );
|
||||
update_post_meta( $post_id, 'sp_append', sp_array_value( $_POST, 'sp_append', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -34,15 +34,9 @@ class SP_Meta_Box_Player_Metrics {
|
||||
|
||||
if ( $vars ):
|
||||
foreach ( $vars as $var ):
|
||||
$prepend = get_post_meta( $var->ID, 'sp_prepend', true );
|
||||
$append = get_post_meta( $var->ID, 'sp_append', true );
|
||||
?>
|
||||
<p><strong><?php echo $var->post_title; ?></strong></p>
|
||||
<p>
|
||||
<?php echo ( $prepend ? '<span class="description">' . $prepend . '</span>' : '' ); ?>
|
||||
<input type="text" name="sp_metrics[<?php echo $var->post_name; ?>]" value="<?php echo esc_attr( sp_array_value( $metrics, $var->post_name, '' ) ); ?>" />
|
||||
<?php echo ( $append ? '<span class="description">' . $append . '</span>' : '' ); ?>
|
||||
</p>
|
||||
<p><input type="text" name="sp_metrics[<?php echo $var->post_name; ?>]" value="<?php echo esc_attr( sp_array_value( $metrics, $var->post_name, '' ) ); ?>" /></p>
|
||||
<?php
|
||||
endforeach;
|
||||
else:
|
||||
|
||||
@@ -295,8 +295,6 @@
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Label', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Variable', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Prepend', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Append', 'sportspress' ); ?></th>
|
||||
<th scope="col"><?php _e( 'Description', 'sportspress' ); ?></th>
|
||||
<th scope="col" class="edit"></th>
|
||||
</tr>
|
||||
@@ -305,14 +303,12 @@
|
||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||
<td><code><?php echo $row->post_name; ?></code></td>
|
||||
<td><?php echo sp_get_post_prepend( $row->ID ); ?></td>
|
||||
<td><?php echo sp_get_post_append( $row->ID ); ?></td>
|
||||
<td><p class="description"><?php echo $row->post_excerpt; ?></p></td>
|
||||
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; else: ?>
|
||||
<tr class="alternate">
|
||||
<td colspan="6"><?php _e( 'No results found.', 'sportspress' ); ?></td>
|
||||
<td colspan="4"><?php _e( 'No results found.', 'sportspress' ); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user