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() {
global $pagenow, $typenow;
if ( 'edit.php' == $pagenow && in_array( $typenow, sp_primary_post_types() ) ) {
?>
<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
if ( 'sp_event' === $typenow ) {
?>
<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' => 'sp_fixture_csv' ), 'admin.php' ) ) ); ?>\"><?php _e( 'Import Fixtures', 'sportspress' ); ?></a>")
).after(
$("<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>")
);
})(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
}
}
}
}