Add sponsor post type
This commit is contained in:
@@ -7,6 +7,7 @@ function sportspress_admin_init() {
|
||||
'sp_player',
|
||||
'sp_list',
|
||||
'sp_staff',
|
||||
'sp_sponsor',
|
||||
'sp_config',
|
||||
);
|
||||
|
||||
|
||||
@@ -75,6 +75,17 @@ function sportspress_activation_hook() {
|
||||
'delete_private_sp_tables' => true,
|
||||
'delete_published_sp_tables' => true,
|
||||
|
||||
'edit_sp_sponsor' => true,
|
||||
'edit_sp_sponsors' => true,
|
||||
'edit_private_sp_sponsors' => true,
|
||||
'edit_published_sp_sponsors' => true,
|
||||
'read_sp_sponsors' => true,
|
||||
'read_private_sp_sponsors' => true,
|
||||
'publish_sp_sponsors' => true,
|
||||
'delete_sp_sponsors' => true,
|
||||
'delete_private_sp_sponsors' => true,
|
||||
'delete_published_sp_sponsors' => true,
|
||||
|
||||
'view_sportspress_reports' => true,
|
||||
)
|
||||
);
|
||||
|
||||
61
admin/post-types/sponsor.php
Normal file
61
admin/post-types/sponsor.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
function sportspress_sponsor_post_init() {
|
||||
$labels = array(
|
||||
'name' => __( 'Sponsors', 'sportspress' ),
|
||||
'singular_name' => __( 'Sponsor', 'sportspress' ),
|
||||
'add_new_item' => __( 'Add New', 'sportspress' ),
|
||||
'edit_item' => __( 'Edit', 'sportspress' ),
|
||||
'new_item' => __( 'New', 'sportspress' ),
|
||||
'view_item' => __( 'View', 'sportspress' ),
|
||||
'search_items' => __( 'Search', 'sportspress' ),
|
||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||
);
|
||||
$args = array(
|
||||
'label' => __( 'Sponsors', 'sportspress' ),
|
||||
'labels' => $labels,
|
||||
'public' => true,
|
||||
'has_archive' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||
'register_meta_box_cb' => 'sportspress_sponsor_meta_init',
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_sponsor_slug', 'sponsor' ) ),
|
||||
'menu_icon' => 'dashicons-star-filled',
|
||||
'capability_type' => 'sp_sponsor'
|
||||
);
|
||||
register_post_type( 'sp_sponsor', $args );
|
||||
}
|
||||
add_action( 'init', 'sportspress_sponsor_post_init' );
|
||||
|
||||
function sportspress_sponsor_meta_init() {
|
||||
remove_meta_box( 'submitdiv', 'sp_sponsor', 'side' );
|
||||
add_meta_box( 'submitdiv', __( 'Publish', 'sportspress' ), 'post_submit_meta_box', 'sp_sponsor', 'side', 'high' );
|
||||
remove_meta_box( 'postimagediv', 'sp_sponsor', 'side' );
|
||||
add_meta_box( 'postimagediv', __( 'Photo', 'sportspress' ), 'post_thumbnail_meta_box', 'sp_sponsor', 'side', 'low' );
|
||||
add_meta_box( 'sp_teamdiv', __( 'Teams', 'sportspress' ), 'sportspress_sponsor_team_meta', 'sp_sponsor', 'side', 'high' );
|
||||
add_meta_box( 'sp_profilediv', __( 'Profile', 'sportspress' ), 'sportspress_sponsor_profile_meta', 'sp_sponsor', 'normal', 'high' );
|
||||
}
|
||||
function sportspress_sponsor_team_meta( $post ) {
|
||||
sportspress_post_checklist( $post->ID, 'sp_team' );
|
||||
sportspress_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
sportspress_nonce();
|
||||
}
|
||||
|
||||
function sportspress_sponsor_profile_meta( $post ) {
|
||||
wp_editor( $post->post_content, 'content' );
|
||||
}
|
||||
|
||||
function sportspress_sponsor_edit_columns() {
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'sp_icon' => ' ',
|
||||
'title' => __( 'Name', 'sportspress' ),
|
||||
'sp_position' => __( 'Positions', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
'sp_views' => __( 'Views', 'sportspress' ),
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
add_filter( 'manage_edit-sp_sponsor_columns', 'sportspress_sponsor_edit_columns' );
|
||||
@@ -25,9 +25,6 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-megaphone:before {
|
||||
content: "\f155";
|
||||
}
|
||||
.icon-calendar:before {
|
||||
content: "\f145";
|
||||
}
|
||||
@@ -37,11 +34,17 @@
|
||||
.icon-calendar:before {
|
||||
content: "\f469";
|
||||
}
|
||||
|
||||
.icon-tshirt:before {
|
||||
content: "\f307";
|
||||
}
|
||||
.icon-megaphone:before {
|
||||
content: "\f155";
|
||||
}
|
||||
|
||||
#adminmenu #toplevel_page_sportspress .menu-icon-generic div.wp-menu-image:before,
|
||||
#adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before,
|
||||
#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,
|
||||
#adminmenu #menu-posts-sp_player .menu-icon-sp_player div.wp-menu-image:before,
|
||||
#adminmenu #menu-posts-sp_sponsor .menu-icon-sp_sponsor div.wp-menu-image:before {
|
||||
font-family: sportspress, dashicons !important;
|
||||
}
|
||||
@@ -266,6 +269,11 @@ table.widefat.sp-data-table tr:hover a.sp-edit-name {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||
}
|
||||
|
||||
table.widefat.sp-league-table th input[type=checkbox] {
|
||||
margin: -4px 1px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.sp-admin-config-table th,
|
||||
.sp-admin-config-table td {
|
||||
width: 20%;
|
||||
|
||||
Binary file not shown.
@@ -8,7 +8,8 @@
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="256" />
|
||||
<glyph unicode="" d="M384 435.2h-51.2v-51.2h51.2v51.2zM435.2 435.2h-25.6v-76.8h-102.4v76.8h-102.4v-76.8h-102.4v76.8h-25.6c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v230.4h307.2v-230.4zM179.2 435.2h-51.2v-51.2h51.2v51.2zM281.6 256h-51.2v-51.2h51.2v51.2zM358.4 256h-51.2v-51.2h51.2v51.2zM204.8 179.2h-51.2v-51.2h51.2v51.2zM204.8 256h-51.2v-51.2h51.2v51.2zM281.6 179.2h-51.2v-51.2h51.2v51.2zM358.4 179.2h-51.2v-51.2h51.2v51.2z" />
|
||||
<glyph unicode="" d="M440.909 303.257c-40.525 94.336-105.779 166.17-138.778 152.73-56.038-22.784 33.408-132.199-241.817-244.071-23.782-9.651-29.799-48.333-19.84-71.45 9.933-23.117 42.445-46.131 66.227-36.48 4.096 1.664 19.225 6.528 19.225 6.528 16.973-22.784 34.739-9.267 41.063-23.757 7.577-17.408 24.038-55.219 29.619-68.070 5.632-12.851 18.329-24.781 27.546-21.274 9.165 3.507 40.473 15.437 52.455 19.968s14.848 15.232 11.187 23.654c-3.942 9.063-20.122 11.725-24.729 22.323-4.634 10.599-19.712 44.519-24.038 55.219-5.888 14.541 6.631 26.368 24.832 28.262 125.286 13.056 148.711-64.333 191.36-46.976 32.921 13.466 26.214 109.056-14.31 203.392zM426.803 150.246c-7.322-2.969-56.627 35.891-88.141 109.235-31.488 73.318-27.52 140.339-20.224 143.309 7.322 2.995 55.424-43.93 86.938-117.248 31.462-73.293 28.749-132.327 21.427-135.296z" />
|
||||
<glyph unicode="" d="M425.76 154.48c-6.16-15.76-14-29.84-23.2-42s-20.24-24.080-33.040-35.68c-12.8-11.52-24.56-21.2-35.36-28.88-10.88-7.6-22.080-14.88-33.84-21.68-11.84-6.8-20.16-11.44-25.12-13.92-4.96-2.4-8.96-4.24-11.92-5.52-2.24-1.2-4.64-1.68-7.28-1.68s-5.040 0.64-7.28 1.68c-3.040 1.28-6.88 3.12-11.92 5.52-5.040 2.4-13.36 7.040-25.12 13.92-11.76 6.8-23.040 14-33.84 21.68-10.88 7.68-22.56 17.28-35.36 28.88-12.8 11.52-23.84 23.36-33.040 35.68s-16.96 26.24-23.2 42c-6.32 15.76-9.44 31.76-9.44 47.76v215.040c0 4.8 1.68 9.12 5.28 12.64s7.76 5.28 12.64 5.28h322.56c4.8 0 9.12-1.68 12.64-5.28s5.28-7.76 5.28-12.64v-215.040c0-16-3.2-32-9.44-47.76zM384 384h-256v-181.92c0-33.36 22.4-67.52 67.12-102.32 17.92-14 38.24-27.040 60.88-38.96v0 0 0 0c22.64 11.92 42.96 24.96 60.88 38.96 44.72 34.88 67.12 68.96 67.12 102.32v181.92zM304.72 122.8c-14.32-11.6-30.56-22.4-48.72-32.24v0 0 267.68h102.4v-150.72c0-27.6-17.92-55.84-53.68-84.72z" />
|
||||
<glyph unicode="" d="M430.8 56.56l-116.8 97.2h-160.4v-76.8c0-7.2-2.56-13.28-7.6-18.24s-11.040-7.36-18-7.36h-25.6c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v76.8c-7.2 0-13.28 2.48-18.24 7.36s-7.36 11.040-7.36 18.24v128c0 7.2 2.48 13.28 7.36 18.24s11.040 7.36 18.24 7.36h237.2l116.8 97.2c2.96 3.2 6.88 4.88 11.84 4.96s9.2-0.88 12.8-3.040 5.44-4.8 5.44-8v-362c0-3.2-1.76-5.84-5.44-8s-7.84-3.040-12.8-2.8c-4.96 0.4-8.88 2.080-11.84 5.28zM243.2 332.96h-51.2c3.44 0 6.48-1.28 8.96-3.84s3.84-5.52 3.84-8.96v-153.6c0-3.44-1.28-6.48-3.84-8.96s-5.52-3.84-8.96-3.84h51.2c-3.76 0-6.8 1.28-9.2 3.84s-3.6 5.52-3.6 8.96v153.6c0 3.44 1.2 6.48 3.6 8.96s5.44 3.84 9.2 3.84z" />
|
||||
<glyph unicode="" d="M384 102.4h-256v179.2h-76.8v102.4l130.4 25.6c8.56-33.12 38.56-57.6 74.4-57.6s65.84 24.48 74.4 57.6l130.4-25.6v-102.4h-76.8v-179.2zM384 76.8v-51.2h-256v51.2h256z" />
|
||||
<glyph unicode="" d="M425.76 151.28c-6.16-15.76-14-29.84-23.2-42s-20.24-24.080-33.040-35.68c-12.8-11.52-24.56-21.2-35.36-28.88-10.88-7.6-22.080-14.88-33.84-21.68-11.84-6.8-20.16-11.44-25.12-13.92-4.96-2.4-8.96-4.24-11.92-5.52-2.24-1.2-4.64-1.68-7.28-1.68s-5.040 0.64-7.28 1.68c-3.040 1.28-6.88 3.12-11.92 5.52-5.040 2.4-13.36 7.040-25.12 13.92-11.76 6.8-23.040 14-33.84 21.68-10.88 7.68-22.56 17.28-35.36 28.88-12.8 11.52-23.84 23.36-33.040 35.68s-16.96 26.24-23.2 42c-6.32 15.76-9.44 31.76-9.44 47.76v215.040c0 4.8 1.68 9.12 5.28 12.64 3.6 3.52 7.76 5.28 12.64 5.28h322.56c4.8 0 9.12-1.68 12.64-5.28s5.28-7.76 5.28-12.64v-215.040c0-16-3.2-32-9.44-47.76zM384 380.8h-256v-181.92c0-33.36 22.4-67.52 67.12-102.32 17.92-14 38.24-27.040 60.88-38.96v0 0 0 0c22.64 11.92 42.96 24.96 60.88 38.96 44.72 34.88 67.12 68.96 67.12 102.32v181.92zM304.72 119.6c-14.32-11.6-30.56-22.4-48.72-32.24v0 0 267.68h102.4v-150.72c0-27.6-17.92-55.84-53.68-84.72z" />
|
||||
<glyph unicode="" d="M256 465.92c-130.073 0-235.52-105.472-235.52-235.52 0-130.073 105.447-235.52 235.52-235.52s235.52 105.447 235.52 235.52c0 130.074-105.447 235.52-235.52 235.52zM256 46.080c-101.811 0-184.32 82.534-184.32 184.32s82.509 184.32 184.32 184.32 184.32-82.534 184.32-184.32-82.509-184.32-184.32-184.32zM273.92 363.52h-35.84v-140.544l87.168-87.168 25.344 25.344-76.672 76.672z" />
|
||||
</font></defs></svg>
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
Binary file not shown.
@@ -66,6 +66,7 @@ require_once dirname( __FILE__ ) . '/admin/post-types/table.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/post-types/player.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/post-types/list.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/post-types/staff.php';
|
||||
require_once dirname( __FILE__ ) . '/admin/post-types/sponsor.php';
|
||||
|
||||
// Terms
|
||||
require_once dirname( __FILE__ ) . '/admin/terms/league.php';
|
||||
|
||||
Reference in New Issue
Block a user