diff --git a/admin/post-types/metric.php b/admin/post-types/metric.php
index 17baf1ec..a42a5729 100644
--- a/admin/post-types/metric.php
+++ b/admin/post-types/metric.php
@@ -13,7 +13,7 @@ function sp_metric_cpt_init() {
'hierarchical' => false,
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sp_metric_meta_init',
- 'show_in_menu' => 'edit.php?post_type=sp_player'
+ 'show_in_menu' => 'edit.php?post_type=sp_event'
);
register_post_type( 'sp_metric', $args );
}
diff --git a/admin/post-types/outcome.php b/admin/post-types/outcome.php
index 39f808e9..2e844b31 100644
--- a/admin/post-types/outcome.php
+++ b/admin/post-types/outcome.php
@@ -12,7 +12,6 @@ function sp_outcome_cpt_init() {
'show_in_nav_menus' => false,
'hierarchical' => false,
'supports' => array( 'title', 'page-attributes' ),
- 'register_meta_box_cb' => 'sp_outcome_meta_init',
'show_in_menu' => 'edit.php?post_type=sp_event'
);
register_post_type( 'sp_outcome', $args );
@@ -22,30 +21,9 @@ add_action( 'init', 'sp_outcome_cpt_init' );
function sp_outcome_edit_columns() {
$columns = array(
'cb' => '',
- 'title' => __( 'Label', 'sportspress' ),
- 'sp_equation' => __( 'Equation', 'sportspress' ),
+ 'title' => __( 'Label', 'sportspress' )
);
return $columns;
}
add_filter( 'manage_edit-sp_outcome_columns', 'sp_outcome_edit_columns' );
-
-function sp_outcome_meta_init() {
- add_meta_box( 'sp_equationdiv', __( 'Equation', 'sportspress' ), 'sp_outcome_equation_meta', 'sp_outcome', 'normal', 'high' );
-}
-
-function sp_outcome_equation_meta( $post ) {
- $equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
- ?>
-
-
- ID, $piece, array( 'result' ) );
- endforeach;
- ?>
-
-
-
\ No newline at end of file
diff --git a/admin/post-types/result.php b/admin/post-types/result.php
index 7ea1b422..a8593ba5 100644
--- a/admin/post-types/result.php
+++ b/admin/post-types/result.php
@@ -7,7 +7,7 @@ function sp_result_cpt_init() {
$args = array(
'label' => $name,
'labels' => $labels,
- 'public' => true,
+ 'public' => false,
'show_ui' => true,
'show_in_nav_menus' => false,
'hierarchical' => false,
diff --git a/admin/post-types/stat.php b/admin/post-types/stat.php
index 08db5a91..6f4740df 100644
--- a/admin/post-types/stat.php
+++ b/admin/post-types/stat.php
@@ -14,7 +14,7 @@ function sp_stat_cpt_init() {
'supports' => array( 'title', 'page-attributes' ),
'register_meta_box_cb' => 'sp_stat_meta_init',
'rewrite' => array( 'slug' => 'stat' ),
- 'show_in_menu' => 'edit.php?post_type=sp_team'
+ 'show_in_menu' => 'edit.php?post_type=sp_event'
);
register_post_type( 'sp_stat', $args );
}
diff --git a/sportspress-filters.php b/sportspress-filters.php
index 3394f7da..1da65364 100644
--- a/sportspress-filters.php
+++ b/sportspress-filters.php
@@ -45,7 +45,7 @@ add_filter('the_content', 'sportspress_the_content');
function sp_sanitize_title( $title ) {
- if ( in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_stat', 'sp_metric' ) ) ):
+ if ( isset( $_POST ) && in_array( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_stat', 'sp_metric' ) ) ):
// Get post title
$title = $_POST['post_title'];
diff --git a/sportspress-helpers.php b/sportspress-helpers.php
index f08853b2..817ca9a9 100644
--- a/sportspress-helpers.php
+++ b/sportspress-helpers.php
@@ -63,7 +63,7 @@ if ( !function_exists( 'sp_numbers_to_words' ) ) {
}
if ( !function_exists( 'sp_cpt_labels' ) ) {
- function sp_cpt_labels( $name, $singular_name, $lowercase_name = null, $is_submenu = false ) {
+ function sp_cpt_labels( $name, $singular_name, $lowercase_name = null ) {
if ( !$lowercase_name ) $lowercase_name = $name;
$labels = array(
'name' => $name,
@@ -147,6 +147,57 @@ if ( !function_exists( 'sp_dropdown_taxonomies' ) ) {
}
}
+if ( !function_exists( 'sp_dropdown_pages' ) ) {
+
+
+/*
+
+*/
+ function sp_dropdown_pages( $args = array() ) {
+ $defaults = array(
+ 'show_option_all' => false,
+ 'show_option_none' => false,
+ 'name' => 'page_id',
+ 'selected' => null,
+ 'numberposts' => -1,
+ 'posts_per_page' => -1,
+ 'child_of' => 0,
+ 'sort_order' => 'ASC',
+ 'sort_column' => 'post_title',
+ 'hierarchical' => 1,
+ 'exclude' => null,
+ 'include' => null,
+ 'meta_key' => null,
+ 'meta_value' => null,
+ 'authors' => null,
+ 'exclude_tree' => null,
+ 'post_type' => 'page'
+ );
+ $args = array_merge( $defaults, $args );
+ $name = $args['name'];
+ unset( $args['name'] );
+ $posts = get_posts( $args );
+ if ( $posts ) {
+ printf( '' );
+ }
+ }
+}
+
if ( !function_exists( 'sp_the_posts' ) ) {
function sp_the_posts( $post_id = null, $meta = 'post', $before = '', $sep = ', ', $after = '', $delimiter = ' - ' ) {
if ( ! isset( $post_id ) )
@@ -678,6 +729,7 @@ if ( !function_exists( 'sp_event_results_table' ) ) {
|
+ |
@@ -695,6 +747,21 @@ if ( !function_exists( 'sp_event_results_table' ) ) {
?>
|
+
+ 'sp_outcome',
+ 'name' => 'sp_results[' . $team_id . '][outcome]',
+ 'show_option_none' => __( '-- Not set --', 'sportspress' ),
+ 'option_none_value' => 0,
+ 'sort_order' => 'ASC',
+ 'sort_column' => 'menu_order',
+ 'selected' => $value
+ );
+ sp_dropdown_pages( $args );
+ ?>
+ |
-
-