Add fixtures importer button events screen

This commit is contained in:
Brian Miyaji
2016-09-01 16:25:25 +10:00
parent 1b31adf97e
commit ea58756be6

View File

@@ -94,15 +94,29 @@ class SP_Admin {
public function action_links() { public function action_links() {
global $pagenow, $typenow; global $pagenow, $typenow;
if ( 'edit.php' == $pagenow && in_array( $typenow, sp_primary_post_types() ) ) { if ( 'edit.php' == $pagenow && in_array( $typenow, sp_primary_post_types() ) ) {
?> if ( 'sp_event' === $typenow ) {
<script type="text/javascript"> ?>
(function($) { <script type="text/javascript">
$(".wrap .page-title-action:first-child").after( (function($) {
$("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => $typenow . '_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import', 'sportspress' ); ?></a>") $(".wrap .page-title-action:first-child").after(
); $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_fixture_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Fixtures', 'sportspress' ); ?></a>")
})(jQuery); ).after(
</script> $("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => 'sp_event_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Events', 'sportspress' ); ?></a>")
<?php );
})(jQuery);
</script>
<?php
} else {
?>
<script type="text/javascript">
(function($) {
$(".wrap .page-title-action:first-child").after(
$("<a class=\"add-new-h2\" href=\"<?php echo esc_url( admin_url( add_query_arg( array( 'import' => $typenow . '_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import', 'sportspress' ); ?></a>")
);
})(jQuery);
</script>
<?php
}
} }
} }
} }