Add fixtures importer button events screen
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user