Add and update hooks

This commit is contained in:
Brian Miyaji
2015-09-22 21:40:44 +10:00
parent d8417c31d6
commit c3e0a68055
4 changed files with 11 additions and 8 deletions

View File

@@ -320,7 +320,7 @@ class SP_Admin_Meta_Boxes {
if ( is_int( wp_is_post_revision( $post ) ) ) return; if ( is_int( wp_is_post_revision( $post ) ) ) return;
if ( is_int( wp_is_post_autosave( $post ) ) ) return; if ( is_int( wp_is_post_autosave( $post ) ) ) return;
if ( empty( $_POST['sportspress_meta_nonce'] ) || ! wp_verify_nonce( $_POST['sportspress_meta_nonce'], 'sportspress_save_data' ) ) return; if ( empty( $_POST['sportspress_meta_nonce'] ) || ! wp_verify_nonce( $_POST['sportspress_meta_nonce'], 'sportspress_save_data' ) ) return;
if ( ! current_user_can( 'edit_post', $post_id ) ) return; if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) return;
if ( ! is_sp_post_type( $post->post_type ) && ! is_sp_config_type( $post->post_type ) ) return; if ( ! is_sp_post_type( $post->post_type ) && ! is_sp_config_type( $post->post_type ) ) return;
do_action( 'sportspress_process_' . $post->post_type . '_meta', $post_id, $post ); do_action( 'sportspress_process_' . $post->post_type . '_meta', $post_id, $post );

View File

@@ -39,6 +39,9 @@ if ( ! isset( $class ) ) $class = null;
<tbody> <tbody>
<?php <?php
if ( $show_players ) { if ( $show_players ) {
$data = apply_filters( 'sportspress_event_performance_players', $data, $data, array(), $mode );
$i = 0; $i = 0;
foreach ( $data as $player_id => $row ): foreach ( $data as $player_id => $row ):

View File

@@ -58,7 +58,7 @@ if ( ! isset( $class ) ) $class = null;
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id; $lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
endforeach; endforeach;
$data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs ); $data = apply_filters( 'sportspress_event_performance_players', $data, $lineups, $subs, $mode );
$i = 0; $i = 0;
foreach ( $data as $player_id => $row ): foreach ( $data as $player_id => $row ):

View File

@@ -34,8 +34,13 @@ if ( is_array( $teams ) ):
$event = new SP_Event( $id ); $event = new SP_Event( $id );
$performance = $event->performance(); $performance = $event->performance();
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
$mode = get_option( 'sportspress_event_performance_mode', 'values' );
// The first row should be column labels // The first row should be column labels
$labels = $performance[0]; $labels = apply_filters( 'sportspress_event_box_score_labels', $performance[0], $event, $mode );
// Remove the first row to leave us with the actual data // Remove the first row to leave us with the actual data
unset( $performance[0] ); unset( $performance[0] );
@@ -44,11 +49,6 @@ if ( is_array( $teams ) ):
$status = $event->status(); $status = $event->status();
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
$sortable = get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false;
$mode = get_option( 'sportspress_event_performance_mode', 'values' );
// Get performance ids for icons // Get performance ids for icons
if ( $mode == 'icons' ): if ( $mode == 'icons' ):
$performance_ids = array(); $performance_ids = array();